Gyoto
GyotoSimBridge.h
Go to the documentation of this file.
1 
8 /*
9  Copyright 2024 Aimar Nicolas, Irene Urso
10 
11  Gyoto is free software: you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  Gyoto is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
23  */
24 
25 #ifndef __GyotoSimBridge_H_
26 #define __GyotoSimBridge_H_
27 
28 #include <iostream>
29 #include <fstream>
30 #include <iomanip>
31 #include <cstring>
32 #include <string>
33 
34 #include <GyotoBlackBodySpectrum.h>
38 #include <GyotoFitsRW.h>
39 #include <GyotoStandardAstrobj.h>
40 #include <GyotoMetric.h>
41 
42 namespace Gyoto{
43  namespace Astrobj { class SimBridge; }
44 }
45 
99 
100  protected:
101  SmartPointer<Spectrum::BlackBody> spectrumBB_;
102  SmartPointer<Spectrum::KappaDistributionSynchrotron> spectrumKappaSynch_; // kappa-distribution synchrotron spectrum
103  SmartPointer<Spectrum::PowerLawSynchrotron> spectrumPLSynch_; // PL-distribution synchrotron spectrum
104  SmartPointer<Spectrum::ThermalSynchrotron> spectrumThermalSynch_; // Thermal distribution synchrotron spectrum
105 
106  private:
107  std::string dirname_;
108  std::string fname_;
112  bool BinFile_;
113  std::string emission_; // Type of emission : Black Body or synchrotron from electron distribution (thermal, PL, kappa)
114  double PLindex_;
115  double gammaMin_;
116  double gammaMax_;
117 
119 
121 
122  int emisInFile_[4];
123  int absInFile_[4];
124  int rotInFile_[3];
125 
126  protected:
127  //Number of dimensions (maximum 4D : [t, r, theta, phi] or [t, x, y, z]). When the number of dimension is lower than 4, the array of the complement dimension(s) is of length 1 (in the FITS files headers).
128  double* time_array_;
129  double* x1_array_;
130  double* x2_array_;
131  double* x3_array_;
132  double* nu_array_;
133 
134  int ntime_;
135  int nx1_;
136  int nx2_;
137  int nx3_;
138  int nnu_;
139 
140  std::string* boundCond_;
141 
142  // Constructors - Destructor
143  // -------------------------
144  public:
145  GYOTO_OBJECT;
146 
147  SimBridge();
148 
149  SimBridge(const SimBridge& ) ;
150  virtual SimBridge* clone () const;
151 
152  virtual ~SimBridge();
153 
154  virtual std::string className() const ;
155  virtual std::string className_l() const ;
156 
157  // Accessors
158  // ---------
159  public:
160  void directory(std::string const &d);
161  std::string directory() const;
162  void filename(std::string const &d);
163  std::string filename() const;
164  void PLindex(double pl);
165  double PLindex()const;
166  void gammaMin(double gmin);
167  double gammaMin() const;
168  void gammaMax(double gmax);
169  double gammaMax() const;
170  void circularMotion(bool t);
171  bool circularMotion() const;
172  void cunninghamVel(bool t);
173  bool cunninghamVel() const;
174  void floorTemperature(double t);
175  double floorTemperature()const;
176  void magnetization(double ss);
177  double magnetization() const;
178  void boundaryConditions(std::string const &sbc);
179  std::string boundaryConditions() const;
180  void emissionType(std::string const &kind);
181  std::string emissionType() const;
182 
183  virtual void radiativeQ(double Inu[], double Taunu[], double const nu_em[], size_t nbnu,
184  double dsem, state_t const &coord_ph, double const coord_obj[8]=NULL) const ;
185 
186  virtual void radiativeQ(double *Inu, double *Qnu, double *Unu, double *Vnu,
187  Eigen::Matrix4d *Onu, double const *nuem , size_t nbnu, double dsem,
188  state_t const &coord_ph, double const *coord_obj) const ;
189 
190  virtual void getVelocity(double const pos[4], double vel[4]);
191 
192  virtual double operator()(double const coord[4]);
193 
194  private:
195  int getIndex(double const tcur) const;
196 
197 };
198 
199 #endif
double * x3_array_
Third spatial dimension array ( in spherical, Z in Cartesian)
Definition: GyotoSimBridge.h:131
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
double floorTemperature() const
get the minimum of temperature (GRMHD case)
Object that read physical quantities from a set of FITS files comming from numerical simulations...
Definition: GyotoSimBridge.h:97
virtual std::string className_l() const
"simbridge"
Class for reading or writing data in FITS file. The data stored should be 1D array(s).
Definition: GyotoFitsRW.h:51
double * time_array_
array containing the time evolution of each FITS files
Definition: GyotoSimBridge.h:128
bool circularMotion() const
Get the flag which select the type of velocity.
double * x1_array_
First spatial dimension array (radius in spherical, X in Cartesian)
Definition: GyotoSimBridge.h:129
double gammaMax() const
Get the maximum gamma factor of the electron distribution function.
std::string directory() const
Get the directory where the FITS files will be searched.
Thermal synchrotron spectrum.
Class to read/write jnu and anu in FITS File.
bool cunninghamvel_
1 if Cunningham prescription below risco, 0 if radial velocity below risco
Definition: GyotoSimBridge.h:111
std::string fname_
FITS files prefix (without the number neither the extension, i.e. &#39;.fits&#39;)
Definition: GyotoSimBridge.h:108
virtual void getVelocity(double const pos[4], double vel[4])
Fluid velocity field.
double gammaMin_
minimum value of gamma for power law energy density
Definition: GyotoSimBridge.h:115
std::string filename() const
Get the FITS filename prefix.
virtual SimBridge * clone() const
Cloner.
bool BinFile_
Define if the magnetic field is saved in FITS file or not.
Definition: GyotoSimBridge.h:112
Astronomical objects defined bya a potential/distance.
std::string * boundCond_
Table of string which store the boundary conditions of all dimensions.
Definition: GyotoSimBridge.h:140
double magnetization() const
Get magnetization paramater.
bool circularmotion_
1 if velocity is given in fits data file, 0 if circularmotion is directly given
Definition: GyotoSimBridge.h:110
double floortemperature_
Set minimum of temperature.
Definition: GyotoSimBridge.h:120
Base class for metric description.
virtual std::string className() const
"SimBridge"
double * nu_array_
frequency array if quantities in FITS files are radiative coefficients
Definition: GyotoSimBridge.h:132
double * x2_array_
Second spatial dimension array ( in spherical, Y in Cartesian)
Definition: GyotoSimBridge.h:130
double gammaMax_
maximum value of gamma for power law energy density
Definition: GyotoSimBridge.h:116
SmartPointer< Spectrum::BlackBody > spectrumBB_
Black Body.
Definition: GyotoSimBridge.h:101
double PLindex() const
Get the power law index of the electron distribution function.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:46
double PLindex_
power law index such that density_elec(E) ∝ E-p
Definition: GyotoSimBridge.h:114
bool temperature_
1 if temperature is given in fits data file, 0 if emission coef is directly given ...
Definition: GyotoSimBridge.h:109
double magnetizationParameter_
magnetization parameter if magnetic field not present in FITS files
Definition: GyotoSimBridge.h:118
double gammaMin() const
Get the minimum gamma factor of the electron distribution function.
Pointers performing reference counting.
Definition: GyotoProperty.h:45
int emisInFile_[4]
Flag that specify which emission coefficients are in the FITS files.
Definition: GyotoSimBridge.h:122
int ntime_
length of time_array_
Definition: GyotoSimBridge.h:134
int nx3_
length of x3_array_
Definition: GyotoSimBridge.h:137
virtual void radiativeQ(double Inu[], double Taunu[], double const nu_em[], size_t nbnu, double dsem, state_t const &coord_ph, double const coord_obj[8]=NULL) const
emission and transmission together
Powerlaw synchrotron spectrum.
Astronomical objects defined bya a potential/distance.
Definition: GyotoStandardAstrobj.h:84
std::string boundaryConditions() const
Get the boundary condition array.
std::string dirname_
FITS files directory.
Definition: GyotoSimBridge.h:107
Powerlaw synchrotron spectrum.
std::string emissionType() const
Get emission type.
int rotInFile_[3]
Flag that specify which rotation coefficients are in the FITS files.
Definition: GyotoSimBridge.h:124
I_nu(nu, T) = cst_*2*h*nu^3/c^2/(exp(h*nu/k*T)-1.);.
int nx1_
length of x1_array_
Definition: GyotoSimBridge.h:135
int absInFile_[4]
Flag that specify which absorption coefficients are in the FITS files.
Definition: GyotoSimBridge.h:123
int nnu_
///< length of nu_array_, optional
Definition: GyotoSimBridge.h:138
int nx2_
length of x2_array_
Definition: GyotoSimBridge.h:136
bool cunninghamVel() const
Get the flag which select the velocity prescription below risco.