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 
58  private:
59  std::string filename_;
60 
66  double * emissquant_;
67 
68  double * opacity_;
69 
75  double * velocity_;
76 
77  double dnu_;
78  double nu0_;
80 
81  double dphi_;
82  double phimin_;
84  double phimax_;
85 
91  //double phi0_==0, phi max is always 2*M_PI
92 
93  double dz_;
94  double zmin_;
96  double zmax_;
97 
98  double dr_;
99  double rin_;
101  double rout_;
102 
103  int zsym_;
104 
105  double tPattern_;
106  double omegaPattern_;
107 
108  // Constructors - Destructor
109  // -------------------------
110  public:
111  GYOTO_OBJECT;
112  // fillProperty is overridden to remove leading "!" from FITS filename
113  void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const;
114 
115  Disk3D();
116 
117  Disk3D(const Disk3D& ) ;
118  virtual Disk3D* clone () const;
119 
120  virtual ~Disk3D() ;
121 
122  // Accessors
123  // ---------
124  public:
125 
126 #ifdef GYOTO_USE_CFITSIO
127  virtual void fitsRead(std::string filename_);
129 
131  virtual void fitsWrite(std::string filename_);
132 #endif
133 
134  void file(std::string const &f);
135  std::string file() const;
136  void zsym(bool t);
137  bool zsym() const;
138  void tPattern(double t);
139  double tPattern() const;
140  void omegaPattern(double t);
141  double omegaPattern() const;
142 
143 
145 
152  void setEmissquant(double * pattern);
153 
154  void opacity(double * pattern);
155 
157 
164  void setVelocity(double * pattern);
165 
167 
182  virtual void copyEmissquant(double const * const pattern = NULL,
183  size_t const naxes[4] = NULL);
184 
186  virtual double const * getEmissquant() const;
187 
189  virtual void getEmissquantNaxes( size_t naxes[4] ) const ;
190 
191  virtual void copyOpacity(double const * const pattern = NULL,
192  size_t const naxes[4] = NULL);
193 
195  virtual double const * opacity() const;
196 
198 
210  virtual void copyVelocity(double const * const pattern = NULL,
211  size_t const naxes[3] = NULL);
213  virtual double const * getVelocity() const;
214 
216  virtual void repeatPhi(size_t n);
218  virtual size_t repeatPhi() const;
219 
221  virtual void nu0(double freq);
223  virtual double nu0() const;
224 
226  virtual void dnu(double dfreq);
228  virtual double dnu() const;
229 
231  void rin(double rrin);
233  double rin() const;
234 
236  void rout(double rout);
238  double rout() const;
239 
241  void zmin(double zmin);
243  double zmin() const;
244 
246  void zmax(double zmax);
248  double zmax() const;
249 
251  void phimin(double phimin);
253  double phimin() const;
254 
256  void phimax(double phimax);
258  double phimax() const;
259 
260  protected:
261  void getIndices(size_t i[4], double const co[4], double nu=0.) const ;
263 
264  public:
265  int Impact(Photon *ph, size_t index, Astrobj::Properties *data);
266 
268 
275  virtual void getVelocity(double const pos[4], double vel[4]) ;
276 
277 };
278 
279 #endif
double omegaPattern_
If the disk is being rotated (like a pattern disk) this is the rotation velocity dphi/dt.
Definition: GyotoDisk3D.h:106
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
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
virtual void getEmissquantNaxes(size_t naxes[4]) const
Get { Disk3D::nnu_, Disk3D::nphi_, Disk3D::nz_, Disk3D::nr_ }.
double dr_
Radius step.
Definition: GyotoDisk3D.h:98
void setVelocity(double *pattern)
Set Disk3D::velocity__.
virtual double const * getEmissquant() const
Get Disk3D::emissquant_.
double phimin_
Minimum φ in grid.
Definition: GyotoDisk3D.h:82
double dphi_
δφ between two grid columns
Definition: GyotoDisk3D.h:81
double rin() const
Get Disk3D::rin_.
virtual double dnu() const
Get Disk3D::dnu_.
#define size_t
If not defined in <sys/types.h>.
Definition: GyotoConfig.h:387
int Impact(Photon *ph, size_t index, Astrobj::Properties *data)
Does a photon at these coordinates impact the object?
double zmax() const
Get Disk3D::zmax_.
size_t repeat_phi_
Number of times the pattern should be repeated to cover [0, 2Π].
Definition: GyotoDisk3D.h:90
std::string filename_
Optional FITS file name containing the arrays.
Definition: GyotoDisk3D.h:59
double phimin() const
Get Disk3D::phimin_.
double nu0_
Lowest frequency provided in PatternDisk::emission_ in Hz.
Definition: GyotoDisk3D.h:78
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.
void getIndices(size_t i[4], double const co[4], double nu=0.) const
Get emissquant_ cell corresponding to position co[4].
double rout() const
Get Disk3D::rout_.
virtual double nu0() const
Get Disk3D::nu0_.
int zsym_
1 to symmetrize the grid z -> -z (default case)
Definition: GyotoDisk3D.h:103
size_t nnu_
Number of frequencies provided in PatternDisk::emission_.
Definition: GyotoDisk3D.h:79
size_t nphi_
Grid size in the φ direction.
Definition: GyotoDisk3D.h:83
double * velocity_
Velocity(r, z, phi)
Definition: GyotoDisk3D.h:75
virtual void copyVelocity(double const *const pattern=NULL, size_t const naxes[3]=NULL)
Set Disk3D::velocity_.
double phimax_
Maximum φ in grid.
Definition: GyotoDisk3D.h:84
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
double rin_
Inner radius of the grid.
Definition: GyotoDisk3D.h:99
virtual Disk3D * clone() const
Cloner.
double * opacity_
Opacity, same dimensions as emissquant_.
Definition: GyotoDisk3D.h:68
double zmin() const
Get Disk3D::zmin_.
Pointers performing reference counting.
Definition: GyotoProperty.h:45
double dnu_
Frequency scale of PatternDisk::emission_ in Hz.
Definition: GyotoDisk3D.h:77
double dz_
Altitude step.
Definition: GyotoDisk3D.h:93
double zmin_
Minimum altitude.
Definition: GyotoDisk3D.h:94
double tPattern_
If the disk is being rotated (like a pattern disk) this is the origin of time for this rotation...
Definition: GyotoDisk3D.h:105
double rout_
Outer radius of the grid.
Definition: GyotoDisk3D.h:101
void setEmissquant(double *pattern)
Set Disk3D::emissquant_.
virtual size_t repeatPhi() const
Get Disk3D::repeat_phi_.
virtual double const * opacity() const
Get Disk3D::opacity_.
Base class for astronomical object.
Definition: GyotoAstrobj.h:196
double * emissquant_
Physical quantity yielding emission.
Definition: GyotoDisk3D.h:66
size_t nz_
Grid size in the altitude direction.
Definition: GyotoDisk3D.h:95
double zmax_
Maximum altitude.
Definition: GyotoDisk3D.h:96
virtual double const * getVelocity() const
Get Disk3D::velocity_.
size_t nr_
Number of rows in the patternGrid size in the r direction.
Definition: GyotoDisk3D.h:100
double phimax() const
Get Disk3D::phimax_.