Gyoto
GyotoPatternDisk.h
Go to the documentation of this file.
1 
8 /*
9  Copyright 2011-2015, 2018 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 __GyotoPatternDisk_H_
28 #define __GyotoPatternDisk_H_
29 
30 #include <iostream>
31 #include <fstream>
32 #include <iomanip>
33 
34 namespace Gyoto{
35  namespace Astrobj { class PatternDisk; }
36 }
37 
38 //#include <GyotoMetric.h>
39 #include <GyotoThinDisk.h>
40 
53  private:
54  std::string filename_;
55 
60  double * emission_;
61 
62  double * opacity_;
63 
69  double * velocity_;
70 
74  double * radius_;
75 
80  double Omega_;
81 
86  double t0_;
87 
88  double dnu_;
89  double nu0_;
91 
92  double dphi_;
93  double phimin_;
95  double phimax_;
96 
102 
103  double dr_;
105 
106 
107  // Constructors - Destructor
108  // -------------------------
109  public:
110  GYOTO_OBJECT;
111  // fillProperty is overridden to remove leading "!" from FITS filename
112  void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const;
113 
114  PatternDisk();
115 
116  PatternDisk(const PatternDisk& ) ;
117  virtual PatternDisk* clone () const;
118 
119  virtual ~PatternDisk() ;
120 
121  // Accessors
122  // ---------
123  public:
124  using ThinDisk::innerRadius;
125  virtual void innerRadius(double);
126  using ThinDisk::outerRadius;
127  virtual void outerRadius(double);
128 
132  virtual void patternVelocity(double);
133  virtual double patternVelocity() const;
134 
135  virtual void file(std::string const &f);
136  virtual std::string file() const ;
137 
138 #ifdef GYOTO_USE_CFITSIO
139  virtual void fitsRead(std::string filename_);
141 
143  virtual void fitsWrite(std::string filename_);
144 #endif
145 
147 
154  void setEmission(double * pattern);
155 
157 
164  void setVelocity(double * pattern);
165 
167 
174  void radius(double * pattern);
175 
177 
193  virtual void copyIntensity(double const * const pattern = NULL,
194  size_t const naxes[3] = NULL);
195 
196  virtual double const * getIntensity() const;
197  virtual void getIntensityNaxes( size_t naxes[3] ) const ;
198 
213  virtual void copyOpacity(double const * const pattern = NULL,
214  size_t const naxes[3] = NULL);
215  virtual double const * opacity() const;
216 
218 
230  virtual void copyVelocity(double const * const pattern = NULL,
231  size_t const naxes[2] = NULL);
232  virtual double const * getVelocity() const;
233 
235 
247  virtual void copyGridRadius(double const * const pattern = NULL,
248  size_t nr = 0 );
249  virtual double const * getGridRadius() const;
250 
251  virtual void repeatPhi(size_t n);
252  virtual size_t repeatPhi() const;
253 
254  virtual void nu0(double freq);
255  virtual double nu0() const;
256 
257  virtual void dnu(double dfreq);
258  virtual double dnu() const;
259 
260  void phimin(double phimin);
261  double phimin() const;
262 
263  void phimax(double phimax);
264  double phimax() const;
265 
266  protected:
267  void getIndices(size_t i[3], double const co[4], double nu=0.) const ;
269 
270  public:
271  using ThinDisk::emission;
272  virtual double emission(double nu_em, double dsem,
273  state_t const &c_ph, double const c_obj[8]=NULL) const;
274  virtual double transmission(double nu_em, double dsem, state_t const &, double const coord[8]) const;
275 
276  virtual void getVelocity(double const pos[4], double vel[4]) ;
277 
278 };
279 
280 #endif
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
double nu0_
Lowest frequency provided in PatternDisk::emission_ in Hz.
Definition: GyotoPatternDisk.h:89
virtual void copyOpacity(double const *const pattern=NULL, size_t const naxes[3]=NULL)
Set PatternDisk::opacity_.
virtual double const * opacity() const
Get PatternDisk::opacity_.
virtual double nu0() const
Get PatternDisk::nu0_.
virtual double const * getIntensity() const
Get PatternDisk::emission_.
double * velocity_
velocity(r, φ)
Definition: GyotoPatternDisk.h:69
double Omega_
Pattern angular velocity.
Definition: GyotoPatternDisk.h:80
void getIndices(size_t i[3], double const co[4], double nu=0.) const
Get emission_ cell corresponding to position co[4].
void setVelocity(double *pattern)
Set PatternDisk::velocity__.
size_t nnu_
Number of frequencies provided in PatternDisk::emission_.
Definition: GyotoPatternDisk.h:90
#define size_t
If not defined in <sys/types.h>.
Definition: GyotoConfig.h:387
virtual void copyGridRadius(double const *const pattern=NULL, size_t nr=0)
Set PatternDisk::radius_.
virtual double innerRadius() const
Get rin_.
double phimin_
Minimum φ in grid.
Definition: GyotoPatternDisk.h:93
virtual double const * getGridRadius() const
Get PatternDisk::radius_.
size_t nr_
Number of rows in the patternGrid size in the r direction.
Definition: GyotoPatternDisk.h:104
virtual double patternVelocity() const
Get PatternDisk::Omega_.
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.
virtual void copyIntensity(double const *const pattern=NULL, size_t const naxes[3]=NULL)
Set PatternDisk::emission_.
double phimin() const
Get PatternDisk::phimin_.
double * radius_
Radius vector.
Definition: GyotoPatternDisk.h:74
double dnu_
Frequency scale of PatternDisk::emission_ in Hz.
Definition: GyotoPatternDisk.h:88
std::string filename_
Optional FITS file name containing the arrays.
Definition: GyotoPatternDisk.h:54
void radius(double *pattern)
Set PatternDisk::radius_.
virtual double emission(double nu_em, double dsem, state_t const &c_ph, double const c_obj[8]=NULL) const
Specific intensity Iν
Geometrically thin disks and rings.
Definition: GyotoThinDisk.h:68
virtual double const * getVelocity() const
Get PatternDisk::velocity_.
Geometrically thin disk read from FITS file.
Definition: GyotoPatternDisk.h:51
virtual void getIntensityNaxes(size_t naxes[3]) const
Get PatternDisk::nnu_, PatternDisk::nphi_, and PatternDisk::nr_.
double * opacity_
Same dimenstions as emission, or NULL.
Definition: GyotoPatternDisk.h:62
Geometrically thin disks and rings.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
virtual double outerRadius() const
Get rout_.
double phimax() const
Get PatternDisk::phimax_.
Pointers performing reference counting.
Definition: GyotoProperty.h:45
virtual double dnu() const
Get PatternDisk::dnu_.
size_t repeat_phi_
Number of times the pattern should be repeated to cover [0, 2Π].
Definition: GyotoPatternDisk.h:101
virtual void copyVelocity(double const *const pattern=NULL, size_t const naxes[2]=NULL)
Set PatternDisk::velocity_.
double dr_
Radius step.
Definition: GyotoPatternDisk.h:103
double t0_
Date for which i=0 corresponds to phi=0.
Definition: GyotoPatternDisk.h:86
double * emission_
Iν(ν, r, φ)
Definition: GyotoPatternDisk.h:60
size_t nphi_
Grid size in the φ direction.
Definition: GyotoPatternDisk.h:94
double phimax_
Maximum φ in grid.
Definition: GyotoPatternDisk.h:95
double dphi_
δφ between two grid columns
Definition: GyotoPatternDisk.h:92
virtual double transmission(double nu_em, double dsem, state_t const &, double const coord[8]) const
Transmission: exp( αν * dsem )
virtual double emission(double nu_em, double dsem, state_t const &coord_ph, double const coord_obj[8]=NULL) const
Specific intensity Iν
virtual PatternDisk * clone() const
Cloner.
void setEmission(double *pattern)
Set PatternDisk::emission_.
virtual size_t repeatPhi() const
Get PatternDisk::repeat_phi_.