GyotoDisk3D.h
Go to the documentation of this file.
/*
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 __GyotoDisk3D_H_
#define __GyotoDisk3D_H_
#include <iostream>
#include <fstream>
#include <iomanip>
namespace Gyoto{
namespace Astrobj { class Disk3D; }
}
class Gyoto::Astrobj::Disk3D : public Gyoto::Astrobj::Generic {
friend class Gyoto::SmartPointer<Gyoto::Astrobj::Disk3D>;
private:
std::string filename_;
double * emissquant_;
double * opacity_;
double * velocity_;
double dnu_;
double nu0_;
size_t nnu_;
double dphi_;
double phimin_;
size_t nphi_;
double phimax_;
size_t repeat_phi_;
//double phi0_==0, phi max is always 2*M_PI
double dz_;
double zmin_;
size_t nz_;
double zmax_;
double dr_;
double rin_;
size_t nr_;
double rout_;
int zsym_;
double tPattern_;
double omegaPattern_;
// Constructors - Destructor
// -------------------------
public:
GYOTO_OBJECT;
// fillProperty is overridden to remove leading "!" from FITS filename
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const;
Disk3D();
Disk3D(const Disk3D& ) ;
virtual Disk3D* clone () const;
virtual ~Disk3D() ;
// Accessors
// ---------
public:
#ifdef GYOTO_USE_CFITSIO
virtual void fitsRead(std::string filename_);
virtual void fitsWrite(std::string filename_);
#endif
void file(std::string const &f);
std::string file() const;
void zsym(bool t);
bool zsym() const;
void tPattern(double t);
double tPattern() const;
void omegaPattern(double t);
double omegaPattern() const;
void setEmissquant(double * pattern);
void opacity(double * pattern);
void setVelocity(double * pattern);
virtual void copyEmissquant(double const * const pattern = NULL,
size_t const naxes[4] = NULL);
virtual double const * getEmissquant() const;
virtual void getEmissquantNaxes( size_t naxes[4] ) const ;
virtual void copyOpacity(double const * const pattern = NULL,
size_t const naxes[4] = NULL);
virtual double const * opacity() const;
virtual void copyVelocity(double const * const pattern = NULL,
size_t const naxes[3] = NULL);
virtual double const * getVelocity() const;
virtual void repeatPhi(size_t n);
virtual size_t repeatPhi() const;
virtual void nu0(double freq);
virtual double nu0() const;
virtual void dnu(double dfreq);
virtual double dnu() const;
void rin(double rrin);
double rin() const;
void rout(double rout);
double rout() const;
void zmin(double zmin);
double zmin() const;
void zmax(double zmax);
double zmax() const;
void phimin(double phimin);
double phimin() const;
void phimax(double phimax);
double phimax() const;
protected:
void getIndices(size_t i[4], double const co[4], double nu=0.) const ;
public:
int Impact(Photon *ph, size_t index, Astrobj::Properties *data);
virtual void getVelocity(double const pos[4], double vel[4]) ;
};
#endif
size_t
#define size_t
If not defined in <sys/types.h>.
Definition GyotoConfig.h:390
GYOTO_OBJECT
#define GYOTO_OBJECT
Declare class::properties and class::getProperties().
Definition GyotoObject.h:84
Gyoto::Astrobj::Disk3D
Geometrically thick disk read from FITS file.
Definition GyotoDisk3D.h:56
Gyoto::Astrobj::Disk3D::dr_
double dr_
Radius step.
Definition GyotoDisk3D.h:98
Gyoto::Astrobj::Disk3D::copyEmissquant
virtual void copyEmissquant(double const *const pattern=NULL, size_t const naxes[4]=NULL)
Set Disk3D::emissquant_.
Gyoto::Astrobj::Disk3D::rout_
double rout_
Outer radius of the grid.
Definition GyotoDisk3D.h:101
Gyoto::Astrobj::Disk3D::fillProperty
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.
Gyoto::Astrobj::Disk3D::opacity_
double * opacity_
Opacity, same dimensions as emissquant_.
Definition GyotoDisk3D.h:68
Gyoto::Astrobj::Disk3D::phimin
void phimin(double phimin)
Set Disk3D::phimin_.
Gyoto::Astrobj::Disk3D::nphi_
size_t nphi_
Grid size in the φ direction.
Definition GyotoDisk3D.h:83
Gyoto::Astrobj::Disk3D::getEmissquant
virtual double const * getEmissquant() const
Get Disk3D::emissquant_.
Gyoto::Astrobj::Disk3D::zmax_
double zmax_
Maximum altitude.
Definition GyotoDisk3D.h:96
Gyoto::Astrobj::Disk3D::Disk3D
Disk3D()
Standard constructor.
Gyoto::Astrobj::Disk3D::nnu_
size_t nnu_
Number of frequencies provided in PatternDisk::emission_.
Definition GyotoDisk3D.h:79
Gyoto::Astrobj::Disk3D::dz_
double dz_
Altitude step.
Definition GyotoDisk3D.h:93
Gyoto::Astrobj::Disk3D::getVelocity
virtual double const * getVelocity() const
Get Disk3D::velocity_.
Gyoto::Astrobj::Disk3D::clone
virtual Disk3D * clone() const
Cloner.
Gyoto::Astrobj::Disk3D::nu0
virtual void nu0(double freq)
Set Disk3D::nu0_.
Gyoto::Astrobj::Disk3D::rin
void rin(double rrin)
Set Disk3D::rin_.
Gyoto::Astrobj::Disk3D::dphi_
double dphi_
δφ between two grid columns
Definition GyotoDisk3D.h:81
Gyoto::Astrobj::Disk3D::phimin_
double phimin_
Minimum φ in grid.
Definition GyotoDisk3D.h:82
Gyoto::Astrobj::Disk3D::zmin_
double zmin_
Minimum altitude.
Definition GyotoDisk3D.h:94
Gyoto::Astrobj::Disk3D::Impact
int Impact(Photon *ph, size_t index, Astrobj::Properties *data)
Does a photon at these coordinates impact the object?
Gyoto::Astrobj::Disk3D::dnu_
double dnu_
Frequency scale of PatternDisk::emission_ in Hz.
Definition GyotoDisk3D.h:77
Gyoto::Astrobj::Disk3D::phimax_
double phimax_
Maximum φ in grid.
Definition GyotoDisk3D.h:84
Gyoto::Astrobj::Disk3D::nu0_
double nu0_
Lowest frequency provided in PatternDisk::emission_ in Hz.
Definition GyotoDisk3D.h:78
Gyoto::Astrobj::Disk3D::zmin
void zmin(double zmin)
Set Disk3D::zmin_.
Gyoto::Astrobj::Disk3D::tPattern_
double tPattern_
If the disk is being rotated (like a pattern disk) this is the origin of time for this rotation.
Definition GyotoDisk3D.h:105
Gyoto::Astrobj::Disk3D::getIndices
void getIndices(size_t i[4], double const co[4], double nu=0.) const
Get emissquant_ cell corresponding to position co[4].
Gyoto::Astrobj::Disk3D::emissquant_
double * emissquant_
Physical quantity yielding emission.
Definition GyotoDisk3D.h:66
Gyoto::Astrobj::Disk3D::zmax
void zmax(double zmax)
Set Disk3D::zmax_.
Gyoto::Astrobj::Disk3D::repeat_phi_
size_t repeat_phi_
Number of times the pattern should be repeated to cover [0, 2Π].
Definition GyotoDisk3D.h:90
Gyoto::Astrobj::Disk3D::phimax
void phimax(double phimax)
Set Disk3D::phimax_.
Gyoto::Astrobj::Disk3D::filename_
std::string filename_
Optional FITS file name containing the arrays.
Definition GyotoDisk3D.h:59
Gyoto::Astrobj::Disk3D::rin_
double rin_
Inner radius of the grid.
Definition GyotoDisk3D.h:99
Gyoto::Astrobj::Disk3D::zsym_
int zsym_
1 to symmetrize the grid z -> -z (default case)
Definition GyotoDisk3D.h:103
Gyoto::Astrobj::Disk3D::setEmissquant
void setEmissquant(double *pattern)
Set Disk3D::emissquant_.
Gyoto::Astrobj::Disk3D::setVelocity
void setVelocity(double *pattern)
Set Disk3D::velocity__.
Gyoto::Astrobj::Disk3D::dnu
virtual void dnu(double dfreq)
Set Disk3D::dnu_.
Gyoto::Astrobj::Disk3D::copyVelocity
virtual void copyVelocity(double const *const pattern=NULL, size_t const naxes[3]=NULL)
Set Disk3D::velocity_.
Gyoto::Astrobj::Disk3D::nz_
size_t nz_
Grid size in the altitude direction.
Definition GyotoDisk3D.h:95
Gyoto::Astrobj::Disk3D::velocity_
double * velocity_
Velocity(r, z, phi).
Definition GyotoDisk3D.h:75
Gyoto::Astrobj::Disk3D::getEmissquantNaxes
virtual void getEmissquantNaxes(size_t naxes[4]) const
Get { Disk3D::nnu_, Disk3D::nphi_, Disk3D::nz_, Disk3D::nr_ }.
Gyoto::Astrobj::Disk3D::repeatPhi
virtual void repeatPhi(size_t n)
Set Disk3D::repeat_phi_.
Gyoto::Astrobj::Disk3D::nr_
size_t nr_
Number of rows in the patternGrid size in the r direction.
Definition GyotoDisk3D.h:100
Gyoto::Astrobj::Disk3D::omegaPattern_
double omegaPattern_
If the disk is being rotated (like a pattern disk) this is the rotation velocity dphi/dt.
Definition GyotoDisk3D.h:106
Gyoto::Astrobj::Disk3D::rout
void rout(double rout)
Set Disk3D::rout_.
Gyoto::Astrobj::Generic
Base class for astronomical object.
Definition GyotoAstrobj.h:200
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