Gyoto
GyotoPlasmoid.h
Go to the documentation of this file.
1 
9 /*
10  Copyright 2019 Frederic Vincent, Thibaut Paumard, Nicolas Aimar
11 
12  This file is part of Gyoto.
13 
14  Gyoto is free software: you can redistribute it and/or modify
15  it under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  Gyoto is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
26  */
27 
28 
29 #ifndef __GyotoPlasmoid_H_
30 #define __GyotoPlasmoid_H_
31 
32 namespace Gyoto{
33  namespace Astrobj { class Plasmoid; }
34 }
35 
36 #include <iostream>
37 #include <fstream>
38 #include <iomanip>
39 #include <GyotoMetric.h>
40 #include <GyotoUniformSphere.h>
41 #include <GyotoFitsRW.h>
43 //#include <GyotoThermalSynchrotronSpectrum.h>
44 #ifdef GYOTO_USE_CFITSIO
45 #include <fitsio.h>
46 #endif
47 
48 #ifdef GYOTO_USE_XERCES
49 #include <GyotoRegister.h>
50 #endif
51 
52 #include <string>
53 
61  public FitsRW,
64 
65  // Data :
66  // -----
67  private:
68  double* posIni_; // 4-position of the plasmoid in spherical coordinates
69  double* fourveldt_; // 4-velocity of the plasmoid in spherical coordinates (dxi/dt, not dtau)
70  std::string flag_; // type of motion "helical" or "equatorial"
71  bool posSet_;
72  double t_inj_;
73  double radiusMax_; // Maximun radius of the Plasmoid in geometrical units
74  std::string varyRadius_;
75  //std::string magneticConfig_; // Magnetic field geometry (toroidal, vertical)
76  double beta_; //ratio between poloidal and toroidal magnetic field inside the plasmoid
77  // FITS FILE Quantities
78  std::string filename_;
79  double** emis_polar_array_;
80  double** abs_polar_array_;
81  double** rot_polar_array_;
82  double* freq_array_;
83  double* time_array_;
84  double* angle_array_;
85 
86  int nb_time_;
87  int nb_freq_;
88  int nb_angle_;
89 
90  SmartPointer<Spectrum::KappaDistributionSynchrotron> spectrumKappaSynch_;
91 
92  // Constructors - Destructor
93  // -------------------------
94  public:
95  GYOTO_OBJECT; // This object has a (non-inherited) Property list
96 
103  Plasmoid();
104 
105  Plasmoid(const Plasmoid& orig);
106  virtual Plasmoid * clone() const ;
107 
108  virtual ~Plasmoid() ;
109 
110  public:
111  virtual std::string className() const ;
112  virtual std::string className_l() const ;
113 
114  public:
115  void motionType(std::string const type);
116  SmartPointer<Metric::Generic> metric() const;
117  void metric(SmartPointer<Metric::Generic> gg);
118  void initPosition(std::vector<double> const &v);
119  std::vector<double> initPosition() const;
120  void initVelocity(std::vector<double> const &v);
121  std::vector<double> initVelocity() const;
122  void initCoord(std::vector<double> const &v);
123  std::vector<double> initCoord() const;
124  void radiusMax(double rr);
125  double radiusMax() const;
126  void Radius(std::string vary);
127  void beta(double beta);
128  double beta() const;
129 
130  virtual void radiativeQ(double Inu[], double Taunu[],
131  double const nu_em[], size_t nbnu,
132  double dsem, state_t const &coord_ph,
133  double const coord_obj[8]=NULL) const;
134 
135  virtual void radiativeQ(double Inu[], double Qnu[], double Unu[],
136  double Vnu[], Eigen::Matrix4d Onu[],
137  double const nu_ems[], size_t nbnu, double dsem,
138  state_t const &coord_ph, double const coord_obj[8]) const;
139 
140  void getCartesian(double const * const dates, size_t const n_dates,
141  double * const x, double * const y,
142  double * const z, double * const xprime=NULL,
143  double * const yprime=NULL,
144  double * const zprime=NULL);
145 
146  void getVelocity(double const pos[4], double vel[4]);
147 
148  int Impact(Gyoto::Photon* ph, size_t index,
149  Astrobj::Properties *data=NULL);
150 
151  void file(std::string const &f);
152 
153  void fitsRead(std::string filename);
154 
155 };
156 
157 
158 #endif
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
Optically thick or thin, spherical objects.
Definition: GyotoUniformSphere.h:89
Gyoto registers.
Class for reading or writing data in FITS file. The data stored should be 1D array(s).
Definition: GyotoFitsRW.h:51
virtual std::string className() const
"Plasmoid"
SmartPointer< Metric::Generic > metric() const
Get the Metric gg_.
Class to read/write jnu and anu in FITS File.
int Impact(Gyoto::Photon *ph, size_t index, Astrobj::Properties *data=NULL)
Does a photon at these coordinates impact the object?
Base class for metric description.
Optically thick or thin, spherical objects.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:46
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
Pointers performing reference counting.
Definition: GyotoProperty.h:45
Plasmoid Shere of plasma emitting synchrotron, following a trajectory specified in getVelocity (non-g...
Definition: GyotoPlasmoid.h:60
virtual std::string className_l() const
"inflate_star"
void getVelocity(double const pos[4], double vel[4])
Yield velocity of the center of the sphere.
Powerlaw synchrotron spectrum.
void getCartesian(double const *const dates, size_t const n_dates, double *const x, double *const y, double *const z, double *const xprime=NULL, double *const yprime=NULL, double *const zprime=NULL)
Yield the Cartesian coordinates of the center of the sphere.