Gyoto
GyotoUniformSphere.h
Go to the documentation of this file.
1 
11 /*
12  Copyright 2011 Frederic Vincent, Thibaut Paumard
13 
14  This file is part of Gyoto.
15 
16  Gyoto is free software: you can redistribute it and/or modify
17  it under the terms of the GNU General Public License as published by
18  the Free Software Foundation, either version 3 of the License, or
19  (at your option) any later version.
20 
21  Gyoto is distributed in the hope that it will be useful,
22  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  GNU General Public License for more details.
25 
26  You should have received a copy of the GNU General Public License
27  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
28  */
29 
30 
31 #ifndef __GyotoUniformSphere_H_
32 #define __GyotoUniformSphere_H_
33 
34 namespace Gyoto{
35  namespace Astrobj { class UniformSphere; }
36 }
37 
38 #include <GyotoMetric.h>
39 #include <GyotoStandardAstrobj.h>
40 #include <GyotoSpectrum.h>
41 
42 #ifdef GYOTO_USE_XERCES
43 #include <GyotoRegister.h>
44 #endif
45 
46 #include <string>
47 
91  friend class Gyoto::SmartPointer<Gyoto::Astrobj::UniformSphere>;
92 
93  // Data :
94  // -----
95  protected:
96  double radius_ ;
97  bool isotropic_;
98  double alpha_;
99  SmartPointer<Spectrum::Generic> spectrum_;
101  SmartPointer<Spectrum::Generic> opacity_;
102  double dltmor_;
103  double dltmod_;
104 
105  // Constructors - Destructor
106  // -------------------------
107  public:
108  GYOTO_OBJECT;
109 
116  UniformSphere(std::string kind,
117  SmartPointer<Metric::Generic> gg, double radius) ;
119 
126  UniformSphere(std::string kind);
127 
128  UniformSphere(const UniformSphere& orig);
129 
130  virtual ~UniformSphere() ;
131 
132  // Accessors
133  // ---------
134  public:
135  virtual std::string className() const ;
136  virtual std::string className_l() const ;
137 
138  virtual void spectrum(SmartPointer<Spectrum::Generic>);
140  virtual SmartPointer<Spectrum::Generic> spectrum() const;
142  virtual void opacity(SmartPointer<Spectrum::Generic>);
144  virtual SmartPointer<Spectrum::Generic> opacity() const;
146  double radius() const ;
147  virtual void radius(double);
148  double radius(std::string const &) const ;
149  virtual void radius(double, std::string const &);
150 
151  double deltaMaxOverRadius() const ;
152  virtual void deltaMaxOverRadius(double f);
153 
154  double deltaMaxOverDistance() const ;
155  virtual void deltaMaxOverDistance(double f);
156 
157  bool isotropic() const;
158  void isotropic(bool);
159  double alpha() const ;
160  void alpha(double);
161 
162  public:
163 
164  virtual double operator()(double const coord[4]) ;
166 
168 
172  virtual double deltaMax(double*coord);
173 
174  protected:
179  virtual void getCartesian(double const * const dates, size_t const n_dates,
180  double * const x, double * const y,
181  double * const z, double * const xprime=NULL,
182  double * const yprime=NULL, double * const zprime=NULL) =0;
184 
185  virtual void getVelocity(double const pos[4], double vel[4]) = 0;
187 
188  using Standard::emission;
189  virtual double emission(double nu_em, double dsem,
190  double cp[8], double co[8]=NULL) const;
193  virtual double integrateEmission(double nu1, double nu2, double dsem,
194  double c_ph[8], double c_obj[8]=NULL) const;
195  virtual double transmission(double nuem, double dsem, double*) const ;
197  void processHitQuantities(Photon* ph, double* coord_ph_hit,
198  double* coord_obj_hit, double dt,
199  Properties* data) const;
200 
201 };
202 
203 
204 #endif
double deltaMaxOverRadius() const
Get dltmor_.
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:83
virtual double deltaMax(double *coord)
bool isotropic_
if 1, then emission just returns 1
Definition: GyotoUniformSphere.h:97
Pointers performing reference counting.
Definition: GyotoProperty.h:41
Optically thick or thin, spherical objects.
Definition: GyotoUniformSphere.h:89
double radius() const
Get radius_ in geometrical units.
virtual SmartPointer< Spectrum::Generic > spectrum() const
Get spectrum_.
Gyoto registers.
virtual double integrateEmission(double nu1, double nu2, double dsem, double c_ph[8], double c_obj[8]=NULL) const
∫ν1ν2 Iν dν (or jν)
void processHitQuantities(Photon *ph, double *coord_ph_hit, double *coord_obj_hit, double dt, Properties *data) const
Fills Astrobj::Properties.
virtual std::string className_l() const
"uniformsphere"
virtual void getVelocity(double const pos[4], double vel[4])=0
Yield velocity of the center of the sphere.
virtual double emission(double nu_em, double dsem, double coord_ph[8], double coord_obj[8]=NULL) const
Specific intensity Iν
double dltmod_
see deltaMax(double*)
Definition: GyotoUniformSphere.h:103
virtual std::string className() const
"UniformSphere"
virtual double integrateEmission(double nu1, double nu2, double dsem, double c_ph[8], double c_obj[8]=NULL) const
∫ν1ν2 Iν dν (or jν)
Astronomical objects defined bya a potential/distance.
double alpha_
index Gamma is: alpha_ = 2-Gamma
Definition: GyotoUniformSphere.h:98
Base class for metric description.
SmartPointer< Spectrum::Generic > opacity_
if optically thin, opacity law
Definition: GyotoUniformSphere.h:101
virtual void getCartesian(double const *const dates, size_t const n_dates, double *const x, double *const y, double *const z, double *const xprime=NULL, double *const yprime=NULL, double *const zprime=NULL)=0
Yield the Cartesian coordinates of the center of the sphere.
virtual SmartPointer< Spectrum::Generic > opacity() const
Get opacity_.
Spectrum of a simple object (e.g. Star)
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
double radius_
sphere radius [geometrical units]
Definition: GyotoUniformSphere.h:96
double deltaMaxOverDistance() const
Get dltmod_.
double dltmor_
see deltaMax(double*)
Definition: GyotoUniformSphere.h:102
Astronomical objects defined bya a potential/distance.
Definition: GyotoStandardAstrobj.h:84
SmartPointer< Spectrum::Generic > spectrum_
sphere emission law
Definition: GyotoUniformSphere.h:100
virtual double transmission(double nuem, double dsem, double *) const
Transmission is determined by opacity_.
virtual double emission(double nu_em, double dsem, double cp[8], double co[8]=NULL) const
Emission is determined by spectrum_ and opacity_.