The SKIRT project
advanced radiative transfer for astrophysics
SpheroidalGeometryDecorator Class Reference

#include <SpheroidalGeometryDecorator.hpp>

Inheritance diagram for SpheroidalGeometryDecorator:

Public Member Functions

double density (double R, double z) const override
double flattening () const
Position generatePosition () const override
SpheGeometrygeometry () const
double SigmaR () const override
double SigmaZ () const override
Public Member Functions inherited from AxGeometry
double density (Position bfr) const override
int dimension () const override
double SigmaX () const override
double SigmaY () const override
Public Member Functions inherited from SimulationItem
template<class T>
T * find (bool setup=true) const
template<class T>
T * interface (int levels=-999999, bool setup=true) const
virtual string itemName () const
void setup ()
string typeAndName () const
Public Member Functions inherited from Item
 Item (const Item &)=delete
virtual ~Item ()
void addChild (Item *child)
const vector< Item * > & children () const
virtual void clearItemListProperty (const PropertyDef *property)
void destroyChild (Item *child)
virtual bool getBoolProperty (const PropertyDef *property) const
virtual vector< double > getDoubleListProperty (const PropertyDef *property) const
virtual double getDoubleProperty (const PropertyDef *property) const
virtual string getEnumProperty (const PropertyDef *property) const
virtual int getIntProperty (const PropertyDef *property) const
virtual vector< Item * > getItemListProperty (const PropertyDef *property) const
virtual ItemgetItemProperty (const PropertyDef *property) const
virtual string getStringProperty (const PropertyDef *property) const
int getUtilityProperty (string name) const
virtual void insertIntoItemListProperty (const PropertyDef *property, int index, Item *item)
Itemoperator= (const Item &)=delete
Itemparent () const
virtual void removeFromItemListProperty (const PropertyDef *property, int index)
virtual void setBoolProperty (const PropertyDef *property, bool value)
virtual void setDoubleListProperty (const PropertyDef *property, vector< double > value)
virtual void setDoubleProperty (const PropertyDef *property, double value)
virtual void setEnumProperty (const PropertyDef *property, string value)
virtual void setIntProperty (const PropertyDef *property, int value)
virtual void setItemProperty (const PropertyDef *property, Item *item)
virtual void setStringProperty (const PropertyDef *property, string value)
void setUtilityProperty (string name, int value)
virtual string type () const

Protected Member Functions

 SpheroidalGeometryDecorator ()
Protected Member Functions inherited from AxGeometry
 AxGeometry ()
Protected Member Functions inherited from Geometry
 Geometry ()
Randomrandom () const
void setupSelfBefore () override
Protected Member Functions inherited from SimulationItem
 SimulationItem ()
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
virtual void setupSelfAfter ()
Protected Member Functions inherited from Item
 Item ()

Private Types

using BaseType
using ItemType

Private Attributes

double _flattening
SpheGeometry_geometry
const double & _q

Friends

class ItemRegistry

Detailed Description

The SpheroidalGeometryDecorator class is a geometry decorator that constructs a spheroidal geometry based on a spherical geometry. The properties of a SpheroidalGeometryDecorator object are a reference to the SpheGeometry object being decorated and the flattening parameter \(q\). If the original spherical geometry is characterized by the density profile \(\rho_{\text{s}}(r) \), the new geometry has as density

\[ \rho(R,z) = \frac{1}{q}\, \rho_{\text{s}}\left(\sqrt{R^2 + \frac{z^2}{q^2}}\right). \]

This new geometry is also normalized to one.

Note that the flattening parameter can have any value \(q>0\). For \(0<q<1\), the geometry is wider than it is high. For \(q>1\), the geometry is higher than it is wide.

Constructor & Destructor Documentation

◆ SpheroidalGeometryDecorator()

SpheroidalGeometryDecorator::SpheroidalGeometryDecorator ( )
inlineprotected

Default constructor for concrete Item subclass SpheroidalGeometryDecorator: "a decorator that constructs a spheroidal variant of any spherical geometry".

Member Function Documentation

◆ density()

double SpheroidalGeometryDecorator::density ( double R,
double z ) const
overridevirtual

This function returns the density \(\rho(R,z)\) at the cylindrical radius \(R\) and the height \(z\). It just implements the analytical formula.

Implements AxGeometry.

◆ flattening()

double SpheroidalGeometryDecorator::flattening ( ) const
inline

This function returns the value of the discoverable double property flattening: "the flattening parameter q".

The minimum value for this property is "]0".

The default value for this property is given by the conditional value expression "1".

◆ generatePosition()

Position SpheroidalGeometryDecorator::generatePosition ( ) const
overridevirtual

This function generates a random position from the geometry, by drawing a random point from the three-dimensional probability density \(p({\bf{r}})\, {\text{d}}{\bf{r}} = \rho({\bf{r}})\, {\text{d}}{\bf{r}}\). It first generates a random position \({\bf{r}}_{\text{s}}\) by calling the generatePosition() function of the geometry being decorated and applies a simple linear transformation to the coordinates, \(x = x_{\text{s}}, y = y_{\text{s}}, z = q\,z_{\text{s}}\).

Implements Geometry.

◆ geometry()

SpheGeometry * SpheroidalGeometryDecorator::geometry ( ) const
inline

This function returns the value of the discoverable item property geometry: "the spherical geometry to be made spheroidal".

◆ SigmaR()

double SpheroidalGeometryDecorator::SigmaR ( ) const
overridevirtual

This function returns the radial surface density, i.e. the integration of the density along a line in the equatorial plane starting at the centre of the coordinate system,

\[ \Sigma_R = \int_0^\infty \rho(R,0)\,{\text{d}}R. \]

We easily obtain

\[ \Sigma_R = \frac{1}{q} \int_0^\infty \rho_{\text{orig}}(R)\,{\text{d}}R = \frac{1}{q}\,\Sigma_{r,{\text{orig}}}. \]

Implements AxGeometry.

◆ SigmaZ()

double SpheroidalGeometryDecorator::SigmaZ ( ) const
overridevirtual

This function returns the Z-axis surface density, i.e. the integration of the density along the entire Z-axis,

\[ \Sigma_Z = \int_{-\infty}^\infty \rho(0,0,z)\,{\text{d}}z. \]

We easily obtain

\[ \Sigma_Z = \frac{2}{q} \int_0^\infty \rho_{\text{orig}} \left(\frac{z}{q}\right)\,{\text{d}}z = 2 \int_0^\infty \rho_{\text{orig}}(r)\,{\text{d}}r = 2\,\Sigma_{r,{\text{orig}}}. \]

Implements Geometry.


The documentation for this class was generated from the following file: