Gyoto
GyotoStar.h
Go to the documentation of this file.
1 
10 /*
11  Copyright 2011, 2013 Frederic Vincent, Thibaut Paumard
12 
13  This file is part of Gyoto.
14 
15  Gyoto is free software: you can redistribute it and/or modify
16  it under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  Gyoto is distributed in the hope that it will be useful,
21  but WITHOUT ANY WARRANTY; without even the implied warranty of
22  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  GNU General Public License for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
27  */
28 
29 
30 #ifndef __GyotoStar_H_
31 #define __GyotoStar_H_
32 
33 namespace Gyoto{
34  namespace Astrobj { class Star; }
35 }
36 
37 #include <GyotoMetric.h>
38 #include <GyotoUniformSphere.h>
39 #include <GyotoSpectrum.h>
40 #include <GyotoWorldline.h>
41 
42 #ifdef GYOTO_USE_XERCES
43 #include <GyotoRegister.h>
44 #endif
45 
46 #include <string>
47 
95  public Gyoto::Worldline {
97 
98  // Data :
99  // -----
100 
101  // Constructors - Destructor
102  // -------------------------
103  public:
104  GYOTO_OBJECT;
105 
113  Star(SmartPointer<Metric::Generic> gg, double radius,
114  double const pos[4], double const v[3]) ;
115 
122  Star();
123 
124  Star(const Star& orig);
125  virtual Star * clone() const ;
126 
127  virtual ~Star() ;
128 
129  // Accessors
130  // ---------
131  public:
132  virtual std::string className() const ;
133  virtual std::string className_l() const ;
134 
135  virtual void metric(SmartPointer<Metric::Generic>);
136  virtual SmartPointer<Metric::Generic> metric() const;
137 
143  virtual double getMass() const ;
144 
145  public:
146  using UniformSphere::rMax;
147  virtual double rMax() ;
148  // void setCoordSys(int); ///< Get coordinate system for integration
149  // int getCoordSys(); ///< Set coordinate system for integration
150  virtual void setInitialCondition(double const coord[8]);
151 
152  public:
153  // Object / Property overloading for special needs:
154  // Overload to interpret InitialCoordinate alias, and to interpret
155  // Position/Velocity
156  virtual int setParameter(std::string name,
157  std::string content,
158  std::string unit) ;
159 #ifdef GYOTO_USE_XERCES
160  // Overload to 1- get metric first and 2- interpret Position/Velocity
161  virtual void setParameters(FactoryMessenger *fmp) ;
162  // Overload to dispatch InitCoord into Position and Velocity
163  // for massive particle
164  virtual void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const ;
165 #endif
166  // Declare the wrappers around the Worldline accessors
168  // Both base classes have deltaMax methods: we need to explicitly
169  // use both
172 
173  public:
174 
176 
182  virtual void getCartesian(double const * const dates, size_t const n_dates,
183  double * const x, double * const y,
184  double * const z, double * const xprime=NULL,
185  double * const yprime=NULL, double * const zprime=NULL) ;
186  virtual void getVelocity(double const pos[4], double vel[4]) ;
187 
188 };
189 
190 
191 #endif
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
virtual double deltaMax(double *coord)
Optically thick or thin, spherical objects.
Definition: GyotoUniformSphere.h:89
double deltaMax() const
Get delta_max_.
Timelike or null geodesics.
Definition: GyotoWorldline.h:238
Gyoto registers.
virtual double getMass() const
Return 1.
virtual std::string className_l() const
"star"
virtual double rMax()
Get maximal distance from center of coordinate system.
virtual void getVelocity(double const pos[4], double vel[4])
Yield velocity of the center of the sphere.
virtual std::string className() const
"Star"
virtual double rMax()
Get maximal distance from center of coordinate system.
virtual void setInitialCondition(double const coord[8])
Same as Worldline::setInitialCondition(gg, coord, sys,1)
virtual SmartPointer< Metric::Generic > metric() const
Get the Metric gg_.
virtual Star * clone() const
Cloner.
Timelike or null geodesics.
Base class for metric description.
Optically thick or thin, spherical objects.
virtual 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)
Get the 6 Cartesian coordinates for specific dates.
virtual int setParameter(std::string name, std::string content, std::string unit)
Set parameter by name.
#define GYOTO_WORLDLINE
Declare the Worldline interface wrappers.
Definition: GyotoWorldline.h:164
Spectrum of a simple object (e.g. Star)
virtual void setParameters(FactoryMessenger *fmp)
Main loop in Subcontractor_t function.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
Mass-less, spherical object following a timelike geodesic.
Definition: GyotoStar.h:93
Pointers performing reference counting.
Definition: GyotoProperty.h:45
virtual void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.