Gyoto
GyotoPolishDoughnut.h
Go to the documentation of this file.
1 
12 /*
13  Copyright (c) 2012-2015 Frederic Vincent, Odele Straub, Thibaut Paumard
14 
15  This file is part of Gyoto.
16 
17  Gyoto is free software: you can redistribute it and/or modify
18  it under the terms of the GNU General Public License as published by
19  the Free Software Foundation, either version 3 of the License, or
20  (at your option) any later version.
21 
22  Gyoto is distributed in the hope that it will be useful,
23  but WITHOUT ANY WARRANTY; without even the implied warranty of
24  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  GNU General Public License for more details.
26 
27  You should have received a copy of the GNU General Public License
28  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
29  */
30 
31 #ifndef __GyotoPolishDoughnut_H_
32 #define __GyotoPolishDoughnut_H_
33 
34 namespace Gyoto{
35  namespace Astrobj { class PolishDoughnut; }
36  class FactoryMessenger;
37 }
38 
39 #include <GyotoStandardAstrobj.h>
40 #include <GyotoFunctors.h>
41 #include <GyotoHooks.h>
42 #include <GyotoBlackBodySpectrum.h>
43 
54 : public Astrobj::Standard,
55  protected Gyoto::Hook::Listener
56 {
57  friend class Gyoto::SmartPointer<Gyoto::Astrobj::PolishDoughnut>;
58 
59  // Data :
60  // -----
61 protected:
62  SmartPointer<Spectrum::BlackBody> spectrumBB_;
63  double l0_;
64  double lambda_;
65  double W_surface_;
66  double W_centre_;
67  double r_cusp_;
68  double r_centre_;
69  double r_torusouter_ ;
70  double DeltaWm1_;
72  /*
73  WARNING! so far (jan. 2014) central_density_ is density_central
74  in standard Polish doughnut model, but it is
75  density_central*c2+pressure_central in Komissarov model
76  */
78  double beta_;
79  double aa_;
80  double aa2_;
82  bool komissarov_;
84 
86 
91  double deltaPL_;
92  double expoPL_;
93 
94  bool adaf_;
96  double ADAFdensity_;
97 
98  bool changecusp_;
101  double rintorus_;
102 
103  // Constructors - Destructor
104  // -------------------------
105 public:
106  GYOTO_OBJECT; // This object has Properties
107 #ifdef GYOTO_USE_XERCES
108  // We need to filter some properties when writing XML
109  void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const;
110 #endif
111  PolishDoughnut() ;
112  PolishDoughnut(const PolishDoughnut& ) ;
113  virtual PolishDoughnut* clone() const;
114  virtual ~PolishDoughnut() ;
115 
116 
117  // Mutators / assignment
118  // ---------------------
119 public:
121  void operator=(const PolishDoughnut&) ;
122 
123  // Accessors
124  // ---------
125 public:
126  double getL0() const;
127  // void setL0(double l0); set by lambda_
128 
129  double lambda() const;
130  void lambda(double lambda);
131 
132  double centralDensity() const;
133  double centralDensity(std::string const &unit) const;
134  void centralDensity(double density);
135  void centralDensity(double density, std::string const &unit);
136 
137  double centralTempOverVirial() const;
138  void centralTempOverVirial(double val);
139 
140  double beta() const;
141  void beta(double beta);
142 
143  void spectralOversampling(size_t);
144  size_t spectralOversampling() const ;
145 
146  bool changeCusp() const;
147  void changeCusp(bool t);
148  bool komissarov() const;
149  void komissarov(bool komis);
150  bool angleAveraged() const;
151 
155  void angleAveraged(bool komis);
156 
157  void nonThermalDeltaExpo(std::vector<double> const &v);
158  std::vector<double> nonThermalDeltaExpo() const;
159  void angmomrinner(std::vector<double> const &v);
160  std::vector<double> angmomrinner() const;
161  void adafparams(std::vector<double> const &v);
162  std::vector<double> adafparams() const;
163  void adaf(bool t);
164  bool adaf() const;
165  void setParameter(Gyoto::Property const &p,
166  std::string const & name,
167  std::string const & content,
168  std::string const & unit);
169 
170 
171  // Read only members, depend on lambda
172  double getWsurface() const;
173  double getWcentre() const;
174  double getRcusp() const;
175  double getRcentre() const;
176 
177  using Standard::metric;
178  virtual void metric(Gyoto::SmartPointer<Gyoto::Metric::Generic>);
179 
180  // ASTROBJ API
181  // -----------
182  int Impact(Photon *ph, size_t index,
183  Astrobj::Properties *data);
184 
185  virtual double operator()(double const coord[4]) ;
186 
187  // ASTROBJ processHitQuantities API
188  // --------------------------------
189 protected:
195  virtual void tell(Gyoto::Hook::Teller * msg);
196  virtual void getVelocity(double const pos[4], double vel[4]) ;
198 
208  virtual void integrateEmission(double * I, double * boundaries,
209  size_t* chaninds, size_t nbnu,
210  double dsem, double *cph, double *co) const;
211 
212  virtual double emission(double nu_em, double dsem, double coord_ph[8],
213  double coord_obj[8]) const;
214  virtual void emission(double Inu[], double nu_em[], size_t nbnu,
215  double dsem, double coord_ph[8],
216  double coord_obj[8]=NULL) const ;
217 
218  virtual void radiativeQ(double Inu[], double Taunu[],
219  double nu_em[], size_t nbnu,
220  double dsem, double coord_ph[8],
221  double coord_obj[8]=NULL) const ;
222 
223  double emissionBrems(double nu_em, double nu_crit,
224  double numax, double T_electron,
225  double n_e, double n_j,
226  double amplification,
227  double Cbrems,
228  int comptonorder) const;
230  double emissionSynch(double nu_em, double nu_crit,
231  double numax, double nu_0,
232  double T_electron,
233  double amplification,
234  double Csynch,
235  double alpha1, double alpha2,
236  double alpha3, double preff,
237  int comptonorder) const;
238  double emissionSynchro_komissarov_direction(double Theta_elec,
239  double number_density,
240  double nuem,
241  double nuc,
242  double theta
243  ) const;
244  double emissionSynchro_komissarov_averaged(double Theta_elec,
245  double number_density,
246  double nuem,
247  double nuc
248  ) const;
249  double emissionSynchro_komissarov_averaged_integ(double Theta_elec,
250  double number_density,
251  double nuem,
252  double nuc
253  ) const;
254  double emissionSynchro_komissarov_PL_direction(
255  double number_density_PL,
256  double nuem, double nuc,
257  double theta_mag) const;
258  double emissionSynchro_komissarov_PL_averaged(
259  double number_density_PL,
260  double nuem, double nuc
261  ) const;
262  double absorptionSynchro_komissarov_PL_direction(
263  double number_density_PL,
264  double nuem, double nuc,
265  double theta_mag) const ;
267  double number_density_PL,
268  double nuem, double nuc
269  ) const;
271  double transmission(double nuem, double dsem, double coord_ph[8]) const ;
272  double BBapprox(double nuem, double Te) const;
273  static double funcxM(double alpha1, double alpha2, double alpha3, double xM);
275  // PURELY INTERNAL TO ASTROBJ
276  // --------------------------
277  private:
278  double potential(double r, double theta) const;
280 
293  public:
295  PolishDoughnut * papa;
296  virtual double operator() (double) const;
297  };
298  friend class intersection_t;
299 
311  public:
325  double const * par;
326  const PolishDoughnut * papa;
327  virtual double operator() (double) const;
328  };
330 
339  public:
340  const PolishDoughnut * papa;
341  virtual double operator() (double) const;
342  };
343 
344  public:
345  static double bessi0(double xx);
346  static double bessi1(double xx);
347  static double bessk0(double xx);
348  static double bessk1(double xx);
349  static double bessk(int nn, double xx);
350 
351  // Outputs
352  // -------
353  public:
354 
356  friend std::ostream& operator<<(std::ostream& , const PolishDoughnut& ) ;
357 
358  public:
359 
360 
361 };
362 
363 #endif
double getWcentre() const
Get PolishDoughnut::W_centre_.
double l0_
Angular momentum. Tied to PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:63
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:83
virtual double operator()(double const coord[4])
Function defining the object interior.
Pointers performing reference counting.
Definition: GyotoProperty.h:41
double lambda() const
Get PolishDoughnut::lambda_.
A toroïdal accretion structure.
Definition: GyotoPolishDoughnut.h:53
virtual double operator()(double) const
The actual function.
bool defangmomrinner_
true if torus defined from l0 and rin
Definition: GyotoPolishDoughnut.h:100
static double funcxM(double alpha1, double alpha2, double alpha3, double xM)
Mahadevan 96 fit function.
double DeltaWm1_
1./(W_centre_ - W_surface_);
Definition: GyotoPolishDoughnut.h:70
double potential(double r, double theta) const
Potential defining shape, used by operator()()
static double bessi1(double xx)
Modified Bessel function I1
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.
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ν)
friend std::ostream & operator<<(std::ostream &, const PolishDoughnut &)
Display.
Tellers tell Listeners when they mutate.
bool angleAveraged() const
Get PolishDoughnut::angle_averaged_.
Classes with an operator() method.
double central_density_
Central density in kg/L (same as g cm^-3)
Definition: GyotoPolishDoughnut.h:71
double lambda_
Adimentionned angular momentum.
Definition: GyotoPolishDoughnut.h:64
int Impact(Photon *ph, size_t index, Astrobj::Properties *data)
Does a photon at these coordinates impact the object?
#define size_t
If not defined in .
Definition: GyotoConfig.h:357
virtual double operator()(double) const
The actual function.
bool komissarov_
1 if Komissarov model is integrated
Definition: GyotoPolishDoughnut.h:82
virtual void getVelocity(double const pos[4], double vel[4])
Fluid velocity field.
double emissionBrems(double nu_em, double nu_crit, double numax, double T_electron, double n_e, double n_j, double amplification, double Cbrems, int comptonorder) const
Bremsstrahlung proxy for emission()
bool adaf_
true to switch to an ADAF model rather tha Polish doughnut
Definition: GyotoPolishDoughnut.h:94
double centralTempOverVirial() const
Get PolishDoughnut::centraltemp_over_virial_.
Astronomical objects defined bya a potential/distance.
virtual void integrateEmission(double *I, double *boundaries, size_t *chaninds, size_t nbnu, double dsem, double *cph, double *co) const
∫ν1ν2 Iν dν (or jν)
A functor like double (func) (double) const.
Definition: GyotoFunctors.h:56
double aa2_
aa_2
Definition: GyotoPolishDoughnut.h:80
size_t spectralOversampling() const
Get PolishDoughnut::spectral_oversampling_.
virtual void tell(Gyoto::Hook::Teller *msg)
Update PolishDoughnut::aa_.
double beta_
Pmagn/Pgas
Definition: GyotoPolishDoughnut.h:78
virtual double emission(double nu_em, double dsem, double coord_ph[8], double coord_obj[8]) const
Specific intensity Iν
size_t spectral_oversampling_
Oversampling used in integrateEmission()
Definition: GyotoPolishDoughnut.h:81
bool rochelobefilling_
true if torus filling its Roche lobe
Definition: GyotoPolishDoughnut.h:99
bool angle_averaged_
1 if Komissarov model should be angle averaged
Definition: GyotoPolishDoughnut.h:83
double centralDensity() const
Get PolishDoughnut::central_density_.
double aa_
PolishDoughnut::gg_ spin, cached when setting PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:79
static double bessk0(double xx)
Modified Bessel function K0
double ADAFdensity_
ADAF central density.
Definition: GyotoPolishDoughnut.h:96
double transmission(double nuem, double dsem, double coord_ph[8]) const
Transmission: exp( αν * dsem )
double beta() const
Get PolishDoughnut::beta_.
bool changeCusp() const
Get PolishDoughnut::komissarov_.
intersection_t intersection
double intersection(double) Functor
Definition: GyotoPolishDoughnut.h:329
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
double W_centre_
Potential central value. Tied to PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:66
virtual PolishDoughnut * clone() const
Cloner.
double centraltemp_over_virial_
Tcenter/Tvirial
Definition: GyotoPolishDoughnut.h:77
double r_cusp_
Cusp radius in geometrical units. Tied to PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:67
double const * par
Parameter array.
Definition: GyotoPolishDoughnut.h:325
double W_surface_
Potential surface value. Tied to PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:65
double r_torusouter_
Torus outer coordinate radius. Tied to PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:69
I might listen to a Teller.
Definition: GyotoHooks.h:64
void setParameter(Gyoto::Property const &p, std::string const &name, std::string const &content, std::string const &unit)
Set parameter by Property (and name)
double getL0() const
Get PolishDoughnut::l0_.
double ADAFtemperature_
ADAF central temperature.
Definition: GyotoPolishDoughnut.h:95
bool changecusp_
true to apply the fishy rcusp_ change (to be changed)
Definition: GyotoPolishDoughnut.h:98
Astronomical objects defined bya a potential/distance.
Definition: GyotoStandardAstrobj.h:84
virtual SmartPointer< Metric::Generic > metric() const
Get the Metric gg_.
static double bessk(int nn, double xx)
Modified Bessel function.
double outerradius(double) Functor class
Definition: GyotoPolishDoughnut.h:338
I_nu(nu, T) = cst_*2*h*nu^3/c^2/(exp(h*nu/k*T)-1.);.
double transcendental(double) Functor class
Definition: GyotoPolishDoughnut.h:310
static double bessk1(double xx)
Modified Bessel function K1
double getWsurface() const
Get PolishDoughnut::W_surface_.
double absorptionSynchro_komissarov_PL_averaged(double number_density_PL, double nuem, double nuc) const
Synchrotron proxy for emission()
double intersection(double) Functor class
Definition: GyotoPolishDoughnut.h:292
static double bessi0(double xx)
Modified Bessel function I0
double expoPL_
exponent of the non-thermal powerlaw = -expoPL_
Definition: GyotoPolishDoughnut.h:92
double deltaPL_
fraction of thermal energy in non-thermal electrons
Definition: GyotoPolishDoughnut.h:91
double r_centre_
Central radius in geometrical units. Tied to PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:68
double rintorus_
Inner radius of the doughnut.
Definition: GyotoPolishDoughnut.h:101
double getRcusp() const
Get PolishDoughnut::r_cusp_.
double BBapprox(double nuem, double Te) const
Approximated Black-Body function.
bool komissarov() const
Get PolishDoughnut::komissarov_.
double getRcentre() const
Get PolishDoughnut::r_centre_.