GyotoPolishDoughnut.h
Go to the documentation of this file.
/*
Copyright (c) 2012-2016, 2018-2019 Frederic Vincent, Odele Straub,
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 __GyotoPolishDoughnut_H_
#define __GyotoPolishDoughnut_H_
namespace Gyoto{
namespace Astrobj { class PolishDoughnut; }
class FactoryMessenger;
}
#include <GyotoStandardAstrobj.h>
#include <GyotoFunctors.h>
#include <GyotoHooks.h>
#include <GyotoThermalBremsstrahlungSpectrum.h>
#include <GyotoThermalSynchrotronSpectrum.h>
#include <GyotoPowerLawSynchrotronSpectrum.h>
class Gyoto::Astrobj::PolishDoughnut
: public Astrobj::Standard,
protected Gyoto::Hook::Listener
{
friend class Gyoto::SmartPointer<Gyoto::Astrobj::PolishDoughnut>;
// Data :
// -----
protected:
SmartPointer<Spectrum::ThermalBremsstrahlung> spectrumBrems_;
SmartPointer<Spectrum::ThermalSynchrotron> spectrumSynch_;
SmartPointer<Spectrum::PowerLawSynchrotron> spectrumPLSynch_;
double l0_;
double lambda_;
double W_surface_;
double W_centre_;
double r_cusp_;
double r_centre_;
double r_torusouter_ ;
double DeltaWm1_;
double central_enthalpy_cgs_;
double central_temperature_;
double beta_;
double magnetizationParameter_;
double aa_;
double aa2_;
size_t spectral_oversampling_;
bool angle_averaged_;
bool bremsstrahlung_;
double deltaPL_;
bool adaf_;
double ADAFtemperature_;
double ADAFdensity_;
bool changecusp_;
bool rochelobefilling_;
bool defangmomrinner_;
double rintorus_;
// Constructors - Destructor
// -------------------------
public:
GYOTO_OBJECT; // This object has Properties
GYOTO_OBJECT_THREAD_SAFETY;
#ifdef GYOTO_USE_XERCES
// We need to filter some properties when writing XML
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const;
#endif
PolishDoughnut() ;
PolishDoughnut(const PolishDoughnut& ) ;
virtual PolishDoughnut* clone() const;
virtual ~PolishDoughnut() ;
// Mutators / assignment
// ---------------------
public:
// Accessors
// ---------
public:
double getL0() const;
// void setL0(double l0); set by lambda_
double lambda() const;
void lambda(double lambda);
double centralEnthalpyPerUnitVolume() const;
double centralEnthalpyPerUnitVolume(std::string const &unit) const;
void centralEnthalpyPerUnitVolume(double density);
void centralEnthalpyPerUnitVolume(double density, std::string const &unit);
double centralTemp() const;
void centralTemp(double val);
double beta() const;
void beta(double beta);
void magnetizationParameter(double rr);
double magnetizationParameter()const;
void spectralOversampling(size_t);
size_t spectralOversampling() const ;
bool changeCusp() const;
void changeCusp(bool t);
bool bremsstrahlung() const;
void bremsstrahlung(bool brems);
bool angleAveraged() const;
void angleAveraged(bool komis);
void nonThermalDeltaExpo(std::vector<double> const &v);
std::vector<double> nonThermalDeltaExpo() const;
void angmomrinner(std::vector<double> const &v);
std::vector<double> angmomrinner() const;
void adafparams(std::vector<double> const &v);
std::vector<double> adafparams() const;
void adaf(bool t);
bool adaf() const;
void setParameter(Gyoto::Property const &p,
std::string const & name,
std::string const & content,
std::string const & unit);
// Read only members, depend on lambda
double getWsurface() const;
double getWcentre() const;
double getRcusp() const;
double getRcentre() const;
using Standard::metric;
virtual void metric(Gyoto::SmartPointer<Gyoto::Metric::Generic>);
// ASTROBJ API
// -----------
int Impact(Photon *ph, size_t index,
Astrobj::Properties *data);
virtual double operator()(double const coord[4]) ;
// ASTROBJ processHitQuantities API
// --------------------------------
protected:
virtual void tell(Gyoto::Hook::Teller * msg);
virtual void getVelocity(double const pos[4], double vel[4]) ;
using Standard::integrateEmission;
virtual void integrateEmission(double * I, double const * boundaries,
size_t const * chaninds, size_t nbnu,
double dsem, state_t const &cph, double const *co) const;
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 ;
// PURELY INTERNAL TO ASTROBJ
// --------------------------
private:
double potential(double r, double theta) const;
class intersection_t : public Gyoto::Functor::Double_Double_const {
public:
intersection_t(PolishDoughnut* parent);
PolishDoughnut * papa;
virtual double operator() (double) const;
};
friend class intersection_t;
intersection_t intersection;
class outerradius_t : public Gyoto::Functor::Double_Double_const {
public:
const PolishDoughnut * papa;
virtual double operator() (double) const;
};
// Outputs
// -------
public:
};
#endif
size_t
#define size_t
If not defined in <sys/types.h>.
Definition GyotoConfig.h:390
GyotoFunctors.h
Classes with an operator() method.
GyotoHooks.h
Tellers tell Listeners when they mutate.
GYOTO_OBJECT
#define GYOTO_OBJECT
Declare class::properties and class::getProperties().
Definition GyotoObject.h:84
GyotoPowerLawSynchrotronSpectrum.h
Powerlaw synchrotron spectrum.
GyotoStandardAstrobj.h
Astronomical objects defined bya a potential/distance.
GyotoThermalBremsstrahlungSpectrum.h
Thermal brems spectrum.
GyotoThermalSynchrotronSpectrum.h
Thermal synchrotron spectrum.
Gyoto::Astrobj::Generic::integrateEmission
virtual double integrateEmission(double nu1, double nu2, double dsem, state_t const &c_ph, double const c_obj[8]=NULL) const
∫ν1ν2 Iν dν (or jν)
Gyoto::Astrobj::Generic::metric
virtual SmartPointer< Metric::Generic > metric() const
Get the Metric gg_.
Gyoto::Astrobj::PolishDoughnut::intersection_t
double intersection(double) Functor class
Definition GyotoPolishDoughnut.h:239
Gyoto::Astrobj::PolishDoughnut::outerradius_t
double outerradius(double) Functor class
Definition GyotoPolishDoughnut.h:256
Gyoto::Astrobj::PolishDoughnut::outerradius_t::operator()
virtual double operator()(double) const
The actual function.
Gyoto::Astrobj::PolishDoughnut
A toroidal accretion structure.
Definition GyotoPolishDoughnut.h:69
Gyoto::Astrobj::PolishDoughnut::central_temperature_
double central_temperature_
Tcenter in K.
Definition GyotoPolishDoughnut.h:87
Gyoto::Astrobj::PolishDoughnut::getRcentre
double getRcentre() const
Get PolishDoughnut::r_centre_.
Gyoto::Astrobj::PolishDoughnut::setParameter
void setParameter(Gyoto::Property const &p, std::string const &name, std::string const &content, std::string const &unit)
Set parameter by Property (and name).
Gyoto::Astrobj::PolishDoughnut::adaf_
bool adaf_
true to switch to an ADAF model rather tha Polish doughnut
Definition GyotoPolishDoughnut.h:104
Gyoto::Astrobj::PolishDoughnut::centralTemp
double centralTemp() const
Get PolishDoughnut::central_temperature_.
Gyoto::Astrobj::PolishDoughnut::centralEnthalpyPerUnitVolume
double centralEnthalpyPerUnitVolume() const
Get PolishDoughnut::central_enthalpy_cgs_.
Gyoto::Astrobj::PolishDoughnut::ADAFdensity_
double ADAFdensity_
ADAF central density.
Definition GyotoPolishDoughnut.h:106
Gyoto::Astrobj::PolishDoughnut::r_centre_
double r_centre_
Central radius in geometrical units. Tied to PolishDoughnut::lambda_.
Definition GyotoPolishDoughnut.h:83
Gyoto::Astrobj::PolishDoughnut::integrateEmission
virtual void integrateEmission(double *I, double const *boundaries, size_t const *chaninds, size_t nbnu, double dsem, state_t const &cph, double const *co) const
∫ν1ν2 Iν dν (or jν)
Gyoto::Astrobj::PolishDoughnut::r_torusouter_
double r_torusouter_
Torus outer coordinate radius. Tied to PolishDoughnut::lambda_.
Definition GyotoPolishDoughnut.h:84
Gyoto::Astrobj::PolishDoughnut::spectralOversampling
void spectralOversampling(size_t)
Set PolishDoughnut::spectral_oversampling_.
Gyoto::Astrobj::PolishDoughnut::DeltaWm1_
double DeltaWm1_
1./(W_centre_ - W_surface_);
Definition GyotoPolishDoughnut.h:85
Gyoto::Astrobj::PolishDoughnut::deltaPL_
double deltaPL_
fraction of thermal energy in non-thermal electrons
Definition GyotoPolishDoughnut.h:102
Gyoto::Astrobj::PolishDoughnut::r_cusp_
double r_cusp_
Cusp radius in geometrical units. Tied to PolishDoughnut::lambda_.
Definition GyotoPolishDoughnut.h:82
Gyoto::Astrobj::PolishDoughnut::getWsurface
double getWsurface() const
Get PolishDoughnut::W_surface_.
Gyoto::Astrobj::PolishDoughnut::rochelobefilling_
bool rochelobefilling_
true if torus filling its Roche lobe
Definition GyotoPolishDoughnut.h:109
Gyoto::Astrobj::PolishDoughnut::Impact
int Impact(Photon *ph, size_t index, Astrobj::Properties *data)
Does a photon at these coordinates impact the object?
Gyoto::Astrobj::PolishDoughnut::bremsstrahlung
bool bremsstrahlung() const
Get PolishDoughnut::bremsstrahlung_.
Gyoto::Astrobj::PolishDoughnut::getL0
double getL0() const
Get PolishDoughnut::l0_.
Gyoto::Astrobj::PolishDoughnut::spectral_oversampling_
size_t spectral_oversampling_
Oversampling used in integrateEmission().
Definition GyotoPolishDoughnut.h:92
Gyoto::Astrobj::PolishDoughnut::aa2_
double aa2_
aa_2
Definition GyotoPolishDoughnut.h:91
Gyoto::Astrobj::PolishDoughnut::getRcusp
double getRcusp() const
Get PolishDoughnut::r_cusp_.
Gyoto::Astrobj::PolishDoughnut::getWcentre
double getWcentre() const
Get PolishDoughnut::W_centre_.
Gyoto::Astrobj::PolishDoughnut::beta_
double beta_
Pgas/Pmagn (careful not standard).
Definition GyotoPolishDoughnut.h:88
Gyoto::Astrobj::PolishDoughnut::magnetizationParameter_
double magnetizationParameter_
Pmagn/(ne mp c2) (careful, very different from above).
Definition GyotoPolishDoughnut.h:89
Gyoto::Astrobj::PolishDoughnut::W_surface_
double W_surface_
Potential surface value. Tied to PolishDoughnut::lambda_.
Definition GyotoPolishDoughnut.h:80
Gyoto::Astrobj::PolishDoughnut::changecusp_
bool changecusp_
true to apply the fishy rcusp_ change (to be changed)
Definition GyotoPolishDoughnut.h:108
Gyoto::Astrobj::PolishDoughnut::beta
double beta() const
Get PolishDoughnut::beta_.
Gyoto::Astrobj::PolishDoughnut::lambda
double lambda() const
Get PolishDoughnut::lambda_.
Gyoto::Astrobj::PolishDoughnut::tell
virtual void tell(Gyoto::Hook::Teller *msg)
Update PolishDoughnut::aa_.
Gyoto::Astrobj::PolishDoughnut::aa_
double aa_
PolishDoughnut::gg_ spin, cached when setting PolishDoughnut::lambda_.
Definition GyotoPolishDoughnut.h:90
Gyoto::Astrobj::PolishDoughnut::metric
virtual void metric(Gyoto::SmartPointer< Gyoto::Metric::Generic >)
Set the Metric gg_.
Gyoto::Astrobj::PolishDoughnut::potential
double potential(double r, double theta) const
Potential defining shape, used by operator()().
Gyoto::Astrobj::PolishDoughnut::lambda_
double lambda_
Adimentionned angular momentum.
Definition GyotoPolishDoughnut.h:79
Gyoto::Astrobj::PolishDoughnut::PolishDoughnut
PolishDoughnut()
Default constructor.
Gyoto::Astrobj::PolishDoughnut::central_enthalpy_cgs_
double central_enthalpy_cgs_
Central enthalpy per unit volume in erg/cm3.
Definition GyotoPolishDoughnut.h:86
Gyoto::Astrobj::PolishDoughnut::defangmomrinner_
bool defangmomrinner_
true if torus defined from l0 and rin
Definition GyotoPolishDoughnut.h:110
Gyoto::Astrobj::PolishDoughnut::W_centre_
double W_centre_
Potential central value. Tied to PolishDoughnut::lambda_.
Definition GyotoPolishDoughnut.h:81
Gyoto::Astrobj::PolishDoughnut::intersection
intersection_t intersection
double intersection(double) Functor
Definition GyotoPolishDoughnut.h:247
Gyoto::Astrobj::PolishDoughnut::fillProperty
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.
Gyoto::Astrobj::PolishDoughnut::ADAFtemperature_
double ADAFtemperature_
ADAF central temperature.
Definition GyotoPolishDoughnut.h:105
Gyoto::Astrobj::PolishDoughnut::changeCusp
bool changeCusp() const
Get PolishDoughnut::komissarov_.
Gyoto::Astrobj::PolishDoughnut::rintorus_
double rintorus_
Inner radius of the doughnut.
Definition GyotoPolishDoughnut.h:111
Gyoto::Astrobj::PolishDoughnut::clone
virtual PolishDoughnut * clone() const
Cloner.
Gyoto::Astrobj::PolishDoughnut::bremsstrahlung_
bool bremsstrahlung_
1 if Komissarov model should compute Brems radiation
Definition GyotoPolishDoughnut.h:94
Gyoto::Astrobj::PolishDoughnut::getVelocity
virtual void getVelocity(double const pos[4], double vel[4])
Fluid velocity field.
Gyoto::Astrobj::PolishDoughnut::angle_averaged_
bool angle_averaged_
1 if Komissarov model should be angle averaged
Definition GyotoPolishDoughnut.h:93
Gyoto::Astrobj::PolishDoughnut::angleAveraged
bool angleAveraged() const
Get PolishDoughnut::angle_averaged_.
Gyoto::Astrobj::PolishDoughnut::l0_
double l0_
Angular momentum. Tied to PolishDoughnut::lambda_.
Definition GyotoPolishDoughnut.h:78
Gyoto::Astrobj::PolishDoughnut::radiativeQ
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
Gyoto::Astrobj::Standard
Astronomical objects defined bya a potential/distance.
Definition GyotoStandardAstrobj.h:87
Gyoto::FactoryMessenger
Factory / SmartPointee::Subcontractor_t interface.
Definition GyotoFactoryMessenger.h:92
Gyoto::Functor::Double_Double_const
A functor like double (func) (double) const.
Definition GyotoFunctors.h:58
Gyoto::Hook::Listener
I might listen to a Teller.
Definition GyotoHooks.h:64
Gyoto::SmartPointer
Pointers performing reference counting.
Definition GyotoSmartPointer.h:135
Gyoto::Astrobj
Access to astronomical objects.
Definition GyotoAstrobj.h:49
Gyoto
Namespace for the Gyoto library.
Definition GyotoAstrobj.h:44