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
34namespace Gyoto{
35 namespace Astrobj { class PatternDisk; }
36}
37
38//#include <GyotoMetric.h>
39#include <GyotoThinDisk.h>
40
53 private:
54 std::string filename_;
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:
111 // fillProperty is overridden to remove leading "!" from FITS filename
112 void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const;
113
115
116 PatternDisk(const PatternDisk& ) ;
117 virtual PatternDisk* clone () const;
118
119 virtual ~PatternDisk() ;
120
121 // Accessors
122 // ---------
123 public:
125 virtual void innerRadius(double);
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
140 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 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 thin disks and rings.
virtual double emission(double nu_em, double dsem, state_t const &coord_ph, double const coord_obj[8]=NULL) const
Specific intensity Iν
Geometrically thin disk read from FITS file.
Definition: GyotoPatternDisk.h:51
virtual void copyVelocity(double const *const pattern=NULL, size_t const naxes[2]=NULL)
Set PatternDisk::velocity_.
double phimin_
Minimum φ in grid.
Definition: GyotoPatternDisk.h:93
double phimax_
Maximum φ in grid.
Definition: GyotoPatternDisk.h:95
virtual double dnu() const
Get PatternDisk::dnu_.
virtual void copyOpacity(double const *const pattern=NULL, size_t const naxes[3]=NULL)
Set PatternDisk::opacity_.
void setEmission(double *pattern)
Set PatternDisk::emission_.
virtual double innerRadius() const
Get rin_.
virtual double const * opacity() const
Get PatternDisk::opacity_.
size_t nr_
Number of rows in the patternGrid size in the r direction.
Definition: GyotoPatternDisk.h:104
double * emission_
Iν(ν, r, φ)
Definition: GyotoPatternDisk.h:60
void getIndices(size_t i[3], double const co[4], double nu=0.) const
Get emission_ cell corresponding to position co[4].
double phimin() const
Get PatternDisk::phimin_.
double t0_
Date for which i=0 corresponds to phi=0.
Definition: GyotoPatternDisk.h:86
double dr_
Radius step.
Definition: GyotoPatternDisk.h:103
virtual double const * getGridRadius() const
Get PatternDisk::radius_.
virtual size_t repeatPhi() const
Get PatternDisk::repeat_phi_.
double * radius_
Radius vector.
Definition: GyotoPatternDisk.h:74
double phimax() const
Get PatternDisk::phimax_.
virtual void getIntensityNaxes(size_t naxes[3]) const
Get PatternDisk::nnu_, PatternDisk::nphi_, and PatternDisk::nr_.
virtual double outerRadius() const
Get rout_.
double dphi_
δφ between two grid columns
Definition: GyotoPatternDisk.h:92
size_t nphi_
Grid size in the φ direction.
Definition: GyotoPatternDisk.h:94
double Omega_
Pattern angular velocity.
Definition: GyotoPatternDisk.h:80
virtual void copyGridRadius(double const *const pattern=NULL, size_t nr=0)
Set PatternDisk::radius_.
double dnu_
Frequency scale of PatternDisk::emission_ in Hz.
Definition: GyotoPatternDisk.h:88
virtual double nu0() const
Get PatternDisk::nu0_.
void setVelocity(double *pattern)
Set PatternDisk::velocity__.
double * velocity_
velocity(r, φ)
Definition: GyotoPatternDisk.h:69
double nu0_
Lowest frequency provided in PatternDisk::emission_ in Hz.
Definition: GyotoPatternDisk.h:89
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.
size_t nnu_
Number of frequencies provided in PatternDisk::emission_.
Definition: GyotoPatternDisk.h:90
virtual double patternVelocity() const
Get PatternDisk::Omega_.
virtual double transmission(double nu_em, double dsem, state_t const &, double const coord[8]) const
Transmission: exp( αν * dsem )
double * opacity_
Same dimenstions as emission, or NULL.
Definition: GyotoPatternDisk.h:62
virtual double const * getVelocity() const
Get PatternDisk::velocity_.
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ν
virtual double const * getIntensity() const
Get PatternDisk::emission_.
virtual void copyIntensity(double const *const pattern=NULL, size_t const naxes[3]=NULL)
Set PatternDisk::emission_.
virtual PatternDisk * clone() const
Cloner.
size_t repeat_phi_
Number of times the pattern should be repeated to cover [0, 2Π].
Definition: GyotoPatternDisk.h:101
std::string filename_
Optional FITS file name containing the arrays.
Definition: GyotoPatternDisk.h:54
Geometrically thin disks and rings.
Definition: GyotoThinDisk.h:71
virtual double innerRadius() const
Get rin_.
virtual double outerRadius() const
Get rout_.
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:135
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43