Gyoto
GyotoDisk3D.h
Go to the documentation of this file.
1 
8 /*
9  Copyright 2011 Frederic Vincent, Thibaut Paumard
10 
11  This file is part of Gyoto.
12 
13  Gyoto is free software: you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  Gyoto is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
25  */
26 
27 #ifndef __GyotoDisk3D_H_
28 #define __GyotoDisk3D_H_
29 
30 #include <iostream>
31 #include <fstream>
32 #include <iomanip>
33 
34 namespace Gyoto{
35  namespace Astrobj { class Disk3D; }
36 }
37 
57  friend class Gyoto::SmartPointer<Gyoto::Astrobj::Disk3D>;
58  private:
59  std::string filename_;
60 
66  double * emissquant_;
67 
73  double * velocity_;
74 
75  double dnu_;
76  double nu0_;
78 
79  double dphi_;
80  double phimin_;
82  double phimax_;
83 
89  //double phi0_==0, phi max is always 2*M_PI
90 
91  double dz_;
92  double zmin_;
94  double zmax_;
95 
96  double dr_;
97  double rin_;
99  double rout_;
100 
101 
102 
103  // Constructors - Destructor
104  // -------------------------
105  public:
106  Disk3D();
107 
108  Disk3D(const Disk3D& ) ;
109  virtual Disk3D* clone () const;
110 
111  virtual ~Disk3D() ;
112 
113  // Accessors
114  // ---------
115  public:
116 
118  virtual void fitsRead(std::string filename_);
119 
121  virtual void fitsWrite(std::string filename_);
122 
124 
131  void setEmissquant(double * pattern);
132 
134 
141  void setVelocity(double * pattern);
142 
144 
159  virtual void copyEmissquant(double const * const pattern = NULL,
160  size_t const naxes[4] = NULL);
161 
163  virtual double const * getEmissquant() const;
164 
166  virtual void getEmissquantNaxes( size_t naxes[4] ) const ;
167 
169 
181  virtual void copyVelocity(double const * const pattern = NULL,
182  size_t const naxes[3] = NULL);
184  virtual double const * getVelocity() const;
185 
187  virtual void repeatPhi(size_t n);
189  virtual size_t repeatPhi() const;
190 
192  virtual void nu0(double freq);
194  virtual double nu0() const;
195 
197  virtual void dnu(double dfreq);
199  virtual double dnu() const;
200 
202  void rin(double rrin);
204  double rin() const;
205 
207  void rout(double rout);
209  double rout() const;
210 
212  void zmin(double zmin);
214  double zmin() const;
215 
217  void zmax(double zmax);
219  double zmax() const;
220 
222  void phimin(double phimin);
224  double phimin() const;
225 
227  void phimax(double phimax);
229  double phimax() const;
230 
231  virtual int setParameter(std::string name,
232  std::string content,
233  std::string unit);
234 
235  protected:
236  void getIndices(size_t i[4], double const co[4], double nu=0.) const ;
238 
239  public:
240  int Impact(Photon *ph, size_t index, Astrobj::Properties *data);
241 
243 
250  virtual void getVelocity(double const pos[4], double vel[4]) ;
251 
252  public:
253 #ifdef GYOTO_USE_XERCES
254  virtual void fillElement(FactoryMessenger *fmp) const ;
255  virtual void setParameters(FactoryMessenger *fmp);
256 #endif
257 
258 };
259 
260 #endif
double phimin() const
Get Disk3D::phimin_.
virtual void copyEmissquant(double const *const pattern=NULL, size_t const naxes[4]=NULL)
Set Disk3D::emissquant_.
Geometrically thick disk read from FITS file.
Definition: GyotoDisk3D.h:56
virtual Disk3D * clone() const
Cloner.
void getIndices(size_t i[4], double const co[4], double nu=0.) const
Get emissquant_ cell corresponding to position co[4].
virtual size_t repeatPhi() const
Get Disk3D::repeat_phi_.
double dr_
Radius step.
Definition: GyotoDisk3D.h:96
void setVelocity(double *pattern)
Set Disk3D::velocity__.
double phimin_
Minimum φ in grid.
Definition: GyotoDisk3D.h:80
virtual void setParameters(FactoryMessenger *fmp)
Main loop in Subcontractor_t function.
double dphi_
δφ between two grid columns
Definition: GyotoDisk3D.h:79
#define size_t
If not defined in &lt;sys/types.h&gt;.
Definition: GyotoConfig.h:293
int Impact(Photon *ph, size_t index, Astrobj::Properties *data)
Does a photon at these coordinates impact the object?
size_t repeat_phi_
Number of times the pattern should be repeated to cover [0, 2Π].
Definition: GyotoDisk3D.h:88
std::string filename_
Optional FITS file name containing the arrays.
Definition: GyotoDisk3D.h:59
double zmin() const
Get Disk3D::zmin_.
double nu0_
Lowest frequency provided in PatternDisk::emission_ in Hz.
Definition: GyotoDisk3D.h:76
size_t nnu_
Number of frequencies provided in PatternDisk::emission_.
Definition: GyotoDisk3D.h:77
size_t nphi_
Grid size in the φ direction.
Definition: GyotoDisk3D.h:81
double * velocity_
Velocity(r, z, phi)
Definition: GyotoDisk3D.h:73
virtual void copyVelocity(double const *const pattern=NULL, size_t const naxes[3]=NULL)
Set Disk3D::velocity_.
virtual double nu0() const
Get Disk3D::nu0_.
double phimax_
Maximum φ in grid.
Definition: GyotoDisk3D.h:82
virtual void fitsRead(std::string filename_)
Read parameters and arrays from FITS file.
double rin_
Inner radius of the grid.
Definition: GyotoDisk3D.h:97
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:51
double dnu_
Frequency scale of PatternDisk::emission_ in Hz.
Definition: GyotoDisk3D.h:75
double dz_
Altitude step.
Definition: GyotoDisk3D.h:91
double zmin_
Minimum altitude.
Definition: GyotoDisk3D.h:92
virtual void fillElement(FactoryMessenger *fmp) const
Fill XML section.
double rout() const
Get Disk3D::rout_.
double rout_
Outer radius of the grid.
Definition: GyotoDisk3D.h:99
void setEmissquant(double *pattern)
Set Disk3D::emissquant_.
double zmax() const
Get Disk3D::zmax_.
double rin() const
Get Disk3D::rin_.
Base class for astronomical object.
Definition: GyotoAstrobj.h:187
virtual int setParameter(std::string name, std::string content, std::string unit)
Set parameter by name.
double * emissquant_
Physical quantity yielding emission.
Definition: GyotoDisk3D.h:66
size_t nz_
Grid size in the altitude direction.
Definition: GyotoDisk3D.h:93
double phimax() const
Get Disk3D::phimax_.
double zmax_
Maximum altitude.
Definition: GyotoDisk3D.h:94
virtual void fitsWrite(std::string filename_)
Write parameters and arrays to FITS file.
virtual double const * getEmissquant() const
Get Disk3D::emissquant_.
size_t nr_
Number of rows in the patternGrid size in the r direction.
Definition: GyotoDisk3D.h:98
virtual double const * getVelocity() const
Get Disk3D::velocity_.
virtual void getEmissquantNaxes(size_t naxes[4]) const
Get { Disk3D::nnu_, Disk3D::nphi_, Disk3D::nz_, Disk3D::nr_ }.
virtual double dnu() const
Get Disk3D::dnu_.