Gyoto
GyotoFreeStar.h
1 
6 /*
7  Copyright 2019 Frederic Vincent, Thibaut Paumard, Nicolas Aimar
8 
9  This file is part of Gyoto.
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 
26 #ifndef __GyotoFreeStar_H_
27 #define __GyotoFreeStar_H_
28 
29 namespace Gyoto{
30  namespace Astrobj { class FreeStar; }
31 }
32 
33 #include <iostream>
34 #include <fstream>
35 #include <iomanip>
36 #include <GyotoMetric.h>
37 #include <GyotoUniformSphere.h>
38 
39 #ifdef GYOTO_USE_XERCES
40 #include <GyotoRegister.h>
41 #endif
42 
43 #include <string>
44 
54 
55  // Data :
56  // -----
57  private:
58  double posIni_[4]; // 4-position of the star in spherical coordinates
59  double fourveldt_[4]; // 4-velocity of the star in spherical coordinates (dxi/dt, not dtau)
60  bool posSet_;
61  bool velSet_;
62 
63  // Constructors - Destructor
64  // -------------------------
65  public:
66  GYOTO_OBJECT; // Property list management
67 
74  FreeStar();
75 
76  FreeStar(const FreeStar& orig);
77  virtual FreeStar * clone() const ;
78 
79  virtual ~FreeStar() ;
80 
81  public:
82  virtual std::string className() const ;
83  virtual std::string className_l() const ;
84 
85  public:
87  void metric(SmartPointer<Metric::Generic>);
88  void initPosition(std::vector<double> const &v);
89  std::vector<double> initPosition() const;
90  void initVelocity(std::vector<double> const &v);
91  std::vector<double> initVelocity() const;
92  void initCoord(std::vector<double> const &v);
93  std::vector<double> initCoord() const;
94 
95  void getCartesian(double const * const dates, size_t const n_dates,
96  double * const x, double * const y,
97  double * const z, double * const xprime=NULL,
98  double * const yprime=NULL,
99  double * const zprime=NULL);
100 
101  void getVelocity(double const pos[4], double vel[4]);
102 
103  void normalizeVelocity();
104 
105 };
106 
107 
108 #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.
UniformShere following a trajectory specified in getVelocity (non-geodesic) with a constant velocity...
Definition: GyotoFreeStar.h:51
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.
void getVelocity(double const pos[4], double vel[4])
Yield velocity of the center of the sphere.
Base class for metric description.
Optically thick or thin, spherical objects.
virtual FreeStar * clone() const
Cloner.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:46
virtual std::string className() const
"FreeStar"
Pointers performing reference counting.
Definition: GyotoProperty.h:45
virtual SmartPointer< Metric::Generic > metric() const
Get the Metric gg_.
virtual std::string className_l() const
"free_star"