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
34namespace Gyoto{
35 namespace Astrobj { class Disk3D; }
36}
37
58 private:
59 std::string filename_;
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_;
107
108 // Constructors - Destructor
109 // -------------------------
110 public:
112 // fillProperty is overridden to remove leading "!" from FITS filename
113 void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const;
114
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
128 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
#define size_t
If not defined in <sys/types.h>.
Definition: GyotoConfig.h:390
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
Geometrically thick disk read from FITS file.
Definition: GyotoDisk3D.h:56
double dr_
Radius step.
Definition: GyotoDisk3D.h:98
virtual void copyEmissquant(double const *const pattern=NULL, size_t const naxes[4]=NULL)
Set Disk3D::emissquant_.
double rout_
Outer radius of the grid.
Definition: GyotoDisk3D.h:101
double zmin() const
Get Disk3D::zmin_.
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.
double * opacity_
Opacity, same dimensions as emissquant_.
Definition: GyotoDisk3D.h:68
size_t nphi_
Grid size in the φ direction.
Definition: GyotoDisk3D.h:83
virtual double const * getEmissquant() const
Get Disk3D::emissquant_.
virtual double dnu() const
Get Disk3D::dnu_.
double zmax_
Maximum altitude.
Definition: GyotoDisk3D.h:96
size_t nnu_
Number of frequencies provided in PatternDisk::emission_.
Definition: GyotoDisk3D.h:79
double dz_
Altitude step.
Definition: GyotoDisk3D.h:93
virtual double const * getVelocity() const
Get Disk3D::velocity_.
virtual Disk3D * clone() const
Cloner.
virtual double const * opacity() const
Get Disk3D::opacity_.
double dphi_
δφ between two grid columns
Definition: GyotoDisk3D.h:81
double phimin_
Minimum φ in grid.
Definition: GyotoDisk3D.h:82
double zmin_
Minimum altitude.
Definition: GyotoDisk3D.h:94
double phimin() const
Get Disk3D::phimin_.
int Impact(Photon *ph, size_t index, Astrobj::Properties *data)
Does a photon at these coordinates impact the object?
double dnu_
Frequency scale of PatternDisk::emission_ in Hz.
Definition: GyotoDisk3D.h:77
double phimax_
Maximum φ in grid.
Definition: GyotoDisk3D.h:84
double nu0_
Lowest frequency provided in PatternDisk::emission_ in Hz.
Definition: GyotoDisk3D.h:78
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 rin() const
Get Disk3D::rin_.
void getIndices(size_t i[4], double const co[4], double nu=0.) const
Get emissquant_ cell corresponding to position co[4].
double zmax() const
Get Disk3D::zmax_.
double * emissquant_
Physical quantity yielding emission.
Definition: GyotoDisk3D.h:66
virtual double nu0() const
Get Disk3D::nu0_.
double phimax() const
Get Disk3D::phimax_.
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 rin_
Inner radius of the grid.
Definition: GyotoDisk3D.h:99
int zsym_
1 to symmetrize the grid z -> -z (default case)
Definition: GyotoDisk3D.h:103
virtual size_t repeatPhi() const
Get Disk3D::repeat_phi_.
void setEmissquant(double *pattern)
Set Disk3D::emissquant_.
void setVelocity(double *pattern)
Set Disk3D::velocity__.
virtual void copyVelocity(double const *const pattern=NULL, size_t const naxes[3]=NULL)
Set Disk3D::velocity_.
size_t nz_
Grid size in the altitude direction.
Definition: GyotoDisk3D.h:95
double * velocity_
Velocity(r, z, phi)
Definition: GyotoDisk3D.h:75
virtual void getEmissquantNaxes(size_t naxes[4]) const
Get { Disk3D::nnu_, Disk3D::nphi_, Disk3D::nz_, Disk3D::nr_ }.
size_t nr_
Number of rows in the patternGrid size in the r direction.
Definition: GyotoDisk3D.h:100
double omegaPattern_
If the disk is being rotated (like a pattern disk) this is the rotation velocity dphi/dt.
Definition: GyotoDisk3D.h:106
double rout() const
Get Disk3D::rout_.
Base class for astronomical object.
Definition: GyotoAstrobj.h:199
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:135
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43