/usr/include/Gyoto/GyotoUniformSphere.h is in libgyoto1-dev 0.1.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | /**
* \file GyotoUniformSphere.h
* \brief Optically thick or thin, spherical objects
*
* Gyoto::Astrobj::UniformSphere is an abstract type from which
* uniform, spherical objects inherit (in particular, the
* Gyoto::Astrobj::Star and Gyoto::Astrobj::FixedStar classes).
*
*/
/*
Copyright 2011 Frederic Vincent, Thibaut Paumard
This file is part of Gyoto.
Gyoto is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gyoto is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GyotoUniformSphere_H_
#define __GyotoUniformSphere_H_
namespace Gyoto{
namespace Astrobj { class UniformSphere; }
}
#include <GyotoMetric.h>
#include <GyotoStandardAstrobj.h>
#include <GyotoSpectrum.h>
#ifdef GYOTO_USE_XERCES
#include <GyotoRegister.h>
#endif
#include <string>
/**
* \class Gyoto::Astrobj::UniformSphere
* \brief Optically thick or thin, spherical objects
*
* Gyoto::Astrobj::UniformSphere is an abstract type from which
* uniform, spherical objects inherit (in particular, the
* Gyoto::Astrobj::Star and Gyoto::Astrobj::FixedStar classes).
*
* These objects are coordinate-spherical: they comprise all the
* points within a given radius from a centre. The distance is the
* usual Euclidian distance in a Cartesian coordinate system which is
* trivially determined by the coordinate system in which the Metric
* is expressed.
*
* The sphere is in solid motion: all the points have the same
* 4-velocity. The centre of the sphere may move. This motion and the
* velocity are provided by the derived classes through the
* getCartesian() and getVelocity() methods.
*
* The spheres can be optically thick or optically thin. In the
* optically thin case, the opacity law provided as a Gyoto::Spectrum
* also sets both the emissivity. Another Gyoto::Spectrum provides
* the emission law of the source, which is uniform.
*
* Gyoto::Astrobj::UniformSphere::setParameters() take care of
* interpreting the XML elements describing the parameters of the
* sphere:
* \code
* <Radius> value </Radius>
* <Spectrum kind="..."> parameters for this spectrum kind </Spectrum>
* <Opacity kind="..."> parameters for this spectrum kind </Opacity>
* \endcode
* setGenericParameters() also takes care of calling
* setParameter().
*/
class Gyoto::Astrobj::UniformSphere :
public Gyoto::Astrobj::Standard {
friend class Gyoto::SmartPointer<Gyoto::Astrobj::UniformSphere>;
// Data :
// -----
protected:
double radius_ ; ///< sphere radius [geometrical units]
SmartPointer<Spectrum::Generic> spectrum_; ///< sphere emission law
SmartPointer<Spectrum::Generic> opacity_; ///< if optically thin, opacity law
// Constructors - Destructor
// -------------------------
public:
/**
* Create UniformSphere object.
* \param kind: specifi kind (e.g. "Star" or "FixedStar")
* \param gg: Gyoto::SmartPointer to the Gyoto::Metric in this part of the Universe
* \param radius: sphere radius
*/
UniformSphere(std::string kind,
SmartPointer<Metric::Generic> gg, double radius) ;
///< Standard constructor
/**
* Create UniformSphere object. Use setMetric(), setRadius(),
* setSpectrum() and setOpacity() to set the members.
*
* \param kind: specifi kind (e.g. "Star" or "FixedStar")
*/
UniformSphere(std::string kind); ///< Default constructor
UniformSphere(const UniformSphere& orig); ///< Copy constructor
virtual ~UniformSphere() ; ///< Destructor
// Accessors
// ---------
public:
virtual std::string className() const ; ///< "UniformSphere"
virtual std::string className_l() const ; ///< "uniformsphere"
virtual void setSpectrum(SmartPointer<Spectrum::Generic>);
///< Set spectrum_
virtual SmartPointer<Spectrum::Generic> getSpectrum() const;
///< Get spectrum_
virtual void setOpacity(SmartPointer<Spectrum::Generic>);
///< Set opacity_
virtual SmartPointer<Spectrum::Generic> getOpacity() const;
///< Get opacity_
double getRadius() const ; ///< Get radius_ in geometrical units
void setRadius(double); ///< Set radius_ in geometrical units
double getRadius(std::string) const ; ///< Get radius_ in specified unit
void setRadius(double, std::string); ///< Set radius_ in specified unit
public:
virtual int setParameter(std::string name,
std::string content,
std::string unit) ;
#ifdef GYOTO_USE_XERCES
/**
* The sub-classes implementations of the
* Astrobj::Generic::fillElement() method should call
* Astrobj::UniformSphere::fillElement() to fill the common bits.
*/
virtual void fillElement(FactoryMessenger *fmp) const ;
///< Fill the generic XML bits
/**
* The sub-classes subcontractor function (see
* Astrobj::Subcontractor_t) should call this after creating the
* object to interpret the common bits (Spectrum, Opacity, Radius):
\code
SmartPointer<MyObject> object = new MyObject (.....);
fmp -> reset();
object -> setParameters(fmp);
\endcode
*/
virtual void setParameters(FactoryMessenger *fmp) ;
///< Interpret common XML sections
#endif
virtual double operator()(double const coord[4]) ;
///< Square distance to the center of the sphere
protected:
/**
* If the coordinate system of the Metric object is spherical, use a
* trivial conversion.
*/
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) =0;
///< Yield the Cartesian coordinates of the center of the sphere
virtual void getVelocity(double const pos[4], double vel[4]) = 0;
///< Yield velocity of the center of the sphere.
using Standard::emission;
virtual double emission(double nu_em, double dsem,
double cp[8], double co[8]=NULL) const;
///< Emission is determined by spectrum_ and opacity_
using Standard::integrateEmission;
virtual double integrateEmission(double nu1, double nu2, double dsem,
double c_ph[8], double c_obj[8]=NULL) const;
virtual double transmission(double nuem, double dsem, double*) const ;
///< Transmission is determined by opacity_
};
#endif
|