Gyoto
GyotoPolishDoughnut.h
Go to the documentation of this file.
1 
12 /*
13  Copyright (c) 2012 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 <GyotoMetric.h>
40 #include <GyotoKerrBL.h>
41 #include <GyotoStandardAstrobj.h>
42 #include <GyotoFunctors.h>
43 #include <GyotoHooks.h>
44 //#include <GyotoPolishDoughnutCst.h>
45 
56 : public Astrobj::Standard,
57  protected Gyoto::Hook::Listener
58 {
59  friend class Gyoto::SmartPointer<Gyoto::Astrobj::PolishDoughnut>;
60 
61  // Data :
62  // -----
63 private:
72  SmartPointer<Gyoto::Metric::KerrBL> gg_;
73  double l0_;
74  double lambda_;
75  double W_surface_;
76  double W_centre_;
77  double r_cusp_;
78  double r_centre_;
79  double DeltaWm1_;
83  double beta_;
85  double aa_;
86  double aa2_;
88 
89  // Constructors - Destructor
90  // -------------------------
91 public:
92  PolishDoughnut() ;
93  //PolishDoughnut(SmartPointer<Metric::KerrBL> gg, double lambda) ; ///< Standard constructor
94  PolishDoughnut(const PolishDoughnut& ) ;
95  virtual PolishDoughnut* clone() const;
96  virtual ~PolishDoughnut() ;
97 
98 
99  // Mutators / assignment
100  // ---------------------
101 public:
103  void operator=(const PolishDoughnut&) ;
104 
105  // Accessors
106  // ---------
107 public:
108  double getL0() const;
109  // void setL0(double l0); set by lambda_
110 
111  double getLambda() const;
112  void setLambda(double lambda);
113 
114  double getTemperatureRatio() const;
115  void setTemperatureRatio(double temp);
116 
117  double getCentralDensity() const;
118  double getCentralDensity(std::string unit) const;
119  void setCentralDensity(double density);
120  void setCentralDensity(double density, std::string unit);
121 
122  double getCentralTempOverVirial() const;
123  void setCentralTempOverVirial(double val);
124 
125  double getBeta() const;
126  void setBeta(double beta);
127 
128  void setSpectralOversampling(size_t);
130 
131  // Read only members, depend on lambda
132  double getWsurface() const;
133  double getWcentre() const;
134  double getRcusp() const;
135  double getRcentre() const;
136 
137 
138  virtual Gyoto::SmartPointer<Gyoto::Metric::Generic> getMetric() const;
139  virtual void setMetric(Gyoto::SmartPointer<Gyoto::Metric::Generic>);
140  void useSpecificImpact(int yes=1);
141 
142  // ASTROBJ API
143  // -----------
147  int Impact(Photon *ph, size_t index,
148  Astrobj::Properties *data);
150 
156  int Impact_(Photon *ph, size_t index,
157  Astrobj::Properties *data);
159  virtual double operator()(double const coord[4]) ;
160 
161  virtual int setParameter(std::string name,
162  std::string content,
163  std::string unit) ;
164 #ifdef GYOTO_USE_XERCES
165  virtual void fillElement(FactoryMessenger *fmp) const ;
166 #endif
167 
168  // ASTROBJ processHitQuantities API
169  // --------------------------------
170 protected:
176  virtual void tell(Gyoto::Hook::Teller * msg);
177  virtual void getVelocity(double const pos[4], double vel[4]) ;
179 
189  virtual void integrateEmission(double * I, double * boundaries,
190  size_t* chaninds, size_t nbnu,
191  double dsem, double *cph, double *co) const;
192 
193  virtual double emission(double nu_em, double dsem, double coord_ph[8],
194  double coord_obj[8]) const;
195  virtual void emission(double Inu[], double nu_em[], size_t nbnu,
196  double dsem, double coord_ph[8],
197  double coord_obj[8]=NULL) const ;
198 
199  double emissionBrems(double nu_em, double nu_crit,
200  double numax, double T_electron,
201  double n_e, double n_j,
202  double amplification,
203  double Cbrems,
204  int comptonorder) const;
206  double emissionSynch(double nu_em, double nu_crit,
207  double numax, double nu_0,
208  double T_electron,
209  double amplification,
210  double Csynch,
211  double alpha1, double alpha2,
212  double alpha3, double preff,
213  int comptonorder) const;
215  double transmission(double nuem, double dsem, double coord_ph[8]) const ;
216  double BBapprox(double nuem, double Te) const;
217  static double funcxM(double alpha1, double alpha2, double alpha3, double xM);
219  // PURELY INTERNAL TO ASTROBJ
220  // --------------------------
221 private:
222  double potential(double r, double theta) const;
224 
237  public:
238  double aa_;
239  double aa2_;
240  double l0_;
241  virtual double operator() (double) const;
242  };
254  public:
268  double const * par;
269  virtual double operator() (double) const;
270  };
272 
273  public:
274  static double bessi0(double xx);
275  static double bessi1(double xx);
276  static double bessk0(double xx);
277  static double bessk1(double xx);
278  static double bessk(int nn, double xx);
279 
280  // Outputs
281  // -------
282  public:
283 
285  friend std::ostream& operator<<(std::ostream& , const PolishDoughnut& ) ;
286 
287  public:
288 
289 
290 };
291 
292 #endif