Gyoto
GyotoPolishDoughnut.h
Go to the documentation of this file.
1 
17 /*
18  Copyright (c) 2012-2016, 2018-2019 Frederic Vincent, Odele Straub,
19  Thibaut Paumard
20 
21  This file is part of Gyoto.
22 
23  Gyoto is free software: you can redistribute it and/or modify
24  it under the terms of the GNU General Public License as published by
25  the Free Software Foundation, either version 3 of the License, or
26  (at your option) any later version.
27 
28  Gyoto is distributed in the hope that it will be useful,
29  but WITHOUT ANY WARRANTY; without even the implied warranty of
30  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31  GNU General Public License for more details.
32 
33  You should have received a copy of the GNU General Public License
34  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
35  */
36 
37 #ifndef __GyotoPolishDoughnut_H_
38 #define __GyotoPolishDoughnut_H_
39 
40 namespace Gyoto{
41  namespace Astrobj { class PolishDoughnut; }
42  class FactoryMessenger;
43 }
44 
45 #include <GyotoStandardAstrobj.h>
46 #include <GyotoFunctors.h>
47 #include <GyotoHooks.h>
51 
67 : public Astrobj::Standard,
68  protected Gyoto::Hook::Listener
69 {
71 
72  // Data :
73  // -----
74 protected:
75  SmartPointer<Spectrum::ThermalBremsstrahlung> spectrumBrems_;
76  SmartPointer<Spectrum::ThermalSynchrotron> spectrumSynch_;
77  SmartPointer<Spectrum::PowerLawSynchrotron> spectrumPLSynch_;
78  double l0_;
79  double lambda_;
80  double W_surface_;
81  double W_centre_;
82  double r_cusp_;
83  double r_centre_;
84  double r_torusouter_ ;
85  double DeltaWm1_;
88  double beta_;
90  double aa_;
91  double aa2_;
95 
97 
102  double deltaPL_;
103 
104  bool adaf_;
106  double ADAFdensity_;
107 
108  bool changecusp_;
111  double rintorus_;
112 
113  // Constructors - Destructor
114  // -------------------------
115 public:
116  GYOTO_OBJECT; // This object has Properties
118 #ifdef GYOTO_USE_XERCES
119  // We need to filter some properties when writing XML
120  void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const;
121 #endif
122  PolishDoughnut() ;
123  PolishDoughnut(const PolishDoughnut& ) ;
124  virtual PolishDoughnut* clone() const;
125  virtual ~PolishDoughnut() ;
126 
127 
128  // Mutators / assignment
129  // ---------------------
130 public:
131  // Accessors
132  // ---------
133 public:
134  double getL0() const;
135  // void setL0(double l0); set by lambda_
136 
137  double lambda() const;
138  void lambda(double lambda);
139 
140  double centralEnthalpyPerUnitVolume() const;
141  double centralEnthalpyPerUnitVolume(std::string const &unit) const;
142  void centralEnthalpyPerUnitVolume(double density);
143  void centralEnthalpyPerUnitVolume(double density, std::string const &unit);
144 
145  double centralTemp() const;
146  void centralTemp(double val);
147 
148  double beta() const;
149  void beta(double beta);
150 
151  void magnetizationParameter(double rr);
152  double magnetizationParameter()const;
153 
154  void spectralOversampling(size_t);
155  size_t spectralOversampling() const ;
156 
157  bool changeCusp() const;
158  void changeCusp(bool t);
159  bool bremsstrahlung() const;
160  void bremsstrahlung(bool brems);
161  bool angleAveraged() const;
162  void angleAveraged(bool komis);
163  void nonThermalDeltaExpo(std::vector<double> const &v);
164  std::vector<double> nonThermalDeltaExpo() const;
165  void angmomrinner(std::vector<double> const &v);
166  std::vector<double> angmomrinner() const;
167  void adafparams(std::vector<double> const &v);
168  std::vector<double> adafparams() const;
169  void adaf(bool t);
170  bool adaf() const;
171  void setParameter(Gyoto::Property const &p,
172  std::string const & name,
173  std::string const & content,
174  std::string const & unit);
175 
176  // Read only members, depend on lambda
177  double getWsurface() const;
178  double getWcentre() const;
179  double getRcusp() const;
180  double getRcentre() const;
181 
182  using Standard::metric;
183  virtual void metric(Gyoto::SmartPointer<Gyoto::Metric::Generic>);
184 
185  // ASTROBJ API
186  // -----------
187  int Impact(Photon *ph, size_t index,
188  Astrobj::Properties *data);
189 
190  virtual double operator()(double const coord[4]) ;
191 
192  // ASTROBJ processHitQuantities API
193  // --------------------------------
194 protected:
200  virtual void tell(Gyoto::Hook::Teller * msg);
201  virtual void getVelocity(double const pos[4], double vel[4]) ;
203 
213  virtual void integrateEmission(double * I, double const * boundaries,
214  size_t const * chaninds, size_t nbnu,
215  double dsem, state_t const &cph, double const *co) const;
216 
217  virtual void radiativeQ(double Inu[], double Taunu[],
218  double const nu_em[], size_t nbnu,
219  double dsem, state_t const &coord_ph,
220  double const coord_obj[8]=NULL) const ;
221 
222  // PURELY INTERNAL TO ASTROBJ
223  // --------------------------
224  private:
225  double potential(double r, double theta) const;
227 
240  public:
242  PolishDoughnut * papa;
243  virtual double operator() (double) const;
244  };
245  friend class intersection_t;
246 
248 
257  public:
258  const PolishDoughnut * papa;
259  virtual double operator() (double) const;
260  };
261 
262  // Outputs
263  // -------
264  public:
265 
267  friend std::ostream& operator<<(std::ostream& , const PolishDoughnut& ) ;
268 
269  public:
270 
271 
272 };
273 
274 #endif
double l0_
Angular momentum. Tied to PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:78
double central_enthalpy_cgs_
Central enthalpy per unit volume in erg/cm3.
Definition: GyotoPolishDoughnut.h:86
double getL0() const
Get PolishDoughnut::l0_.
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
virtual double operator()(double const coord[4])
Function defining the object interior.
A toroidal accretion structure.
Definition: GyotoPolishDoughnut.h:66
bool defangmomrinner_
true if torus defined from l0 and rin
Definition: GyotoPolishDoughnut.h:110
double DeltaWm1_
1./(W_centre_ - W_surface_);
Definition: GyotoPolishDoughnut.h:85
friend std::ostream & operator<<(std::ostream &, const PolishDoughnut &)
Display.
virtual PolishDoughnut * clone() const
Cloner.
Thermal synchrotron spectrum.
Tellers tell Listeners when they mutate.
bool bremsstrahlung_
1 if Komissarov model should compute Brems radiation
Definition: GyotoPolishDoughnut.h:94
Classes with an operator() method.
#define GYOTO_OBJECT_THREAD_SAFETY
Declare virtual bool isThreadSafe() const.
Definition: GyotoObject.h:99
virtual double integrateEmission(double nu1, double nu2, double dsem, state_t const &c_ph, double const c_obj[8]=NULL) const
∫ν1ν2 Iν dν (or jν)
double lambda_
Adimentionned angular momentum.
Definition: GyotoPolishDoughnut.h:79
size_t spectralOversampling() const
Get PolishDoughnut::spectral_oversampling_.
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 <sys/types.h>.
Definition: GyotoConfig.h:387
bool changeCusp() const
Get PolishDoughnut::komissarov_.
virtual void getVelocity(double const pos[4], double vel[4])
Fluid velocity field.
bool adaf_
true to switch to an ADAF model rather tha Polish doughnut
Definition: GyotoPolishDoughnut.h:104
Astronomical objects defined bya a potential/distance.
A functor like double (func) (double) const.
Definition: GyotoFunctors.h:57
double aa2_
aa_2
Definition: GyotoPolishDoughnut.h:91
virtual void tell(Gyoto::Hook::Teller *msg)
Update PolishDoughnut::aa_.
double beta_
Pgas/Pmagn (careful not standard)
Definition: GyotoPolishDoughnut.h:88
double magnetizationParameter_
Pmagn/(ne mp c2) (careful, very different from above)
Definition: GyotoPolishDoughnut.h:89
size_t spectral_oversampling_
Oversampling used in integrateEmission()
Definition: GyotoPolishDoughnut.h:92
bool rochelobefilling_
true if torus filling its Roche lobe
Definition: GyotoPolishDoughnut.h:109
bool angle_averaged_
1 if Komissarov model should be angle averaged
Definition: GyotoPolishDoughnut.h:93
double aa_
PolishDoughnut::gg_ spin, cached when setting PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:90
virtual void integrateEmission(double *I, double const *boundaries, size_t const *chaninds, size_t nbnu, double dsem, state_t const &cph, double const *co) const
∫ν1ν2 Iν dν (or jν)
virtual double operator()(double) const
The actual function.
double lambda() const
Get PolishDoughnut::lambda_.
double ADAFdensity_
ADAF central density.
Definition: GyotoPolishDoughnut.h:106
intersection_t intersection
double intersection(double) Functor
Definition: GyotoPolishDoughnut.h:247
double getRcusp() const
Get PolishDoughnut::r_cusp_.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
double W_centre_
Potential central value. Tied to PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:81
double central_temperature_
Tcenter in K.
Definition: GyotoPolishDoughnut.h:87
double r_cusp_
Cusp radius in geometrical units. Tied to PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:82
double W_surface_
Potential surface value. Tied to PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:80
Thermal brems spectrum.
double potential(double r, double theta) const
Potential defining shape, used by operator()()
Pointers performing reference counting.
Definition: GyotoProperty.h:45
double beta() const
Get PolishDoughnut::beta_.
double r_torusouter_
Torus outer coordinate radius. Tied to PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:84
double centralTemp() const
Get PolishDoughnut::central_temperature_.
virtual void radiativeQ(double Inu[], double Taunu[], double const nu_em[], size_t nbnu, double dsem, state_t const &coord_ph, double const coord_obj[8]=NULL) const
emission and transmission together
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)
virtual SmartPointer< Metric::Generic > metric() const
Get the Metric gg_.
double ADAFtemperature_
ADAF central temperature.
Definition: GyotoPolishDoughnut.h:105
bool changecusp_
true to apply the fishy rcusp_ change (to be changed)
Definition: GyotoPolishDoughnut.h:108
double getRcentre() const
Get PolishDoughnut::r_centre_.
Powerlaw synchrotron spectrum.
Astronomical objects defined bya a potential/distance.
Definition: GyotoStandardAstrobj.h:84
double getWcentre() const
Get PolishDoughnut::W_centre_.
double outerradius(double) Functor class
Definition: GyotoPolishDoughnut.h:256
double intersection(double) Functor class
Definition: GyotoPolishDoughnut.h:239
double centralEnthalpyPerUnitVolume() const
Get PolishDoughnut::central_enthalpy_cgs_.
bool bremsstrahlung() const
Get PolishDoughnut::bremsstrahlung_.
double getWsurface() const
Get PolishDoughnut::W_surface_.
double deltaPL_
fraction of thermal energy in non-thermal electrons
Definition: GyotoPolishDoughnut.h:102
double r_centre_
Central radius in geometrical units. Tied to PolishDoughnut::lambda_.
Definition: GyotoPolishDoughnut.h:83
double rintorus_
Inner radius of the doughnut.
Definition: GyotoPolishDoughnut.h:111
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.
bool angleAveraged() const
Get PolishDoughnut::angle_averaged_.