The SKIRT project
advanced radiative transfer for astrophysics
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
SpiralStructureGeometryDecorator Class Reference

#include <SpiralStructureGeometryDecorator.hpp>

Inheritance diagram for SpiralStructureGeometryDecorator:
Inheritance graph
[legend]

Public Member Functions

double density (Position bfr) const override
 
Position generatePosition () const override
 
AxGeometrygeometry () const
 
int index () const
 
int numArms () const
 
double perturbationWeight () const
 
double phaseZeroPoint () const
 
double pitchAngle () const
 
double radiusZeroPoint () const
 
void setupSelfBefore () override
 
double SigmaX () const override
 
double SigmaY () const override
 
double SigmaZ () const override
 
- Public Member Functions inherited from GenGeometry
int dimension () const override
 
virtual double density (Position bfr) const =0
 
virtual int dimension () const =0
 
virtual Position generatePosition () const =0
 
virtual double SigmaX () const =0
 
virtual double SigmaY () const =0
 
virtual double SigmaZ () const =0
 
- 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

 SpiralStructureGeometryDecorator ()
 
- Protected Member Functions inherited from GenGeometry
 GenGeometry ()
 
- 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 ()
 
virtual void setupSelfBefore ()
 
- Protected Member Functions inherited from Item
 Item ()
 

Private Types

using BaseType = GenGeometry
 
using ItemType = SpiralStructureGeometryDecorator
 

Private Member Functions

double perturbation (double R, double phi) const
 

Private Attributes

double _c
 
double _cn
 
AxGeometry_geometry
 
int _index
 
const int & _m
 
const int & _N
 
int _numArms
 
const double & _p
 
double _perturbationWeight
 
double _phaseZeroPoint
 
const double & _phi0
 
double _pitchAngle
 
const double & _R0
 
double _radiusZeroPoint
 
double _tanp
 
const double & _w
 

Friends

class ItemRegistry
 

Detailed Description

The SpiralStructureGeometryDecorator class is a geometry decorator that adds spiral structure to any axisymmetric geometry. The spiral arm perturbation (with an arbitrary weight factor) is a logarithmic spiral arm pattern, based on the formulation of Schechtman-Rook et al. (2012, ApJ, 746, 70). The decorator basically alters the uniform distribution in azimuth (by definition, the density \(\rho_{\text{ax}}\) of the original geometry is independent of \(\phi\)). In formula form, the density of the new geometry behaves as

\[ \rho(R,\phi,z) = \rho_{\text{ax}}(R,z)\, \xi(R,\phi) \]

where \(\xi(R,\phi)\) is a perturbation given by

\[ \xi(R,\phi) = (1-w) + w\, C_N \sin^{2N} \left[\frac{m}{2}\left( \frac{\ln (R/R_0)}{\tan p}-(\phi-\phi_0)\right) + \frac{\pi}{4} \right]. \]

Apart from the reference to the original geometry that is being decorated, the model contains six parameters: the number of spiral arms \(m\), the pitch angle \(p\), the spiral arm radius and phase zero-points \(R_0\) and \(\phi_0\), the spiral perturbation weight \(w\), and the integer index \(N>0\) that sets the arm-interarm size ratio (larger values of \(N\) correspond to larger arm-interarm size ratios). The factor \(C_N\) is not a free parameter, but a normalization factor that ensures that the total mass equals one,

\[ C_N = \frac{\sqrt{\pi}\, \Gamma(N+1)}{\Gamma(N+\tfrac12)}. \]

For \(N=1\) the expression for the perturbation reduces to

\[ \xi(R,\phi) = 1 + w\, \sin \left[m \left( \frac{\ln (R/R_0)}{\tan p} - (\phi-\phi_0)\right) \right], \]

as in Misiriotis et al. (2000, A&A, 353, 117). Note that the parameters \(R_0\) and \(\phi_0\) in fact have the same effect (both of them add an offset to the spiral structure). In principle one of them could be suppressed, but it is confortable to include both of them.

Constructor & Destructor Documentation

◆ SpiralStructureGeometryDecorator()

SpiralStructureGeometryDecorator::SpiralStructureGeometryDecorator ( )
inlineprotected

Default constructor for concrete Item subclass SpiralStructureGeometryDecorator : "a decorator that adds spiral structure to any axisymmetric geometry" .

Member Function Documentation

◆ density()

double SpiralStructureGeometryDecorator::density ( Position  bfr) const
overridevirtual

This function returns the density \(\rho({\bf{r}})\) at the position \({\bf{r}}\). It just implements the analytical formula.

Implements Geometry.

◆ generatePosition()

Position SpiralStructureGeometryDecorator::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}}\). We use a combination of the conditional distribution technique and the rejection technique.

Implements Geometry.

◆ geometry()

AxGeometry * SpiralStructureGeometryDecorator::geometry ( ) const
inline

This function returns the value of the discoverable item property geometry : "the axisymmetric geometry to be decorated with spiral structure" .

◆ index()

SpiralStructureGeometryDecorator::index ( ) const
inline

This function returns the value of the discoverable integer property index : "the arm-interarm size ratio index" .

The minimum value for this property is "0" .

The maximum value for this property is "10" .

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

This property is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.

◆ numArms()

SpiralStructureGeometryDecorator::numArms ( ) const
inline

This function returns the value of the discoverable integer property numArms : "the number of spiral arms" .

The minimum value for this property is "1" .

The maximum value for this property is "100" .

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

◆ perturbation()

double SpiralStructureGeometryDecorator::perturbation ( double  R,
double  phi 
) const
private

This private function implements the analytical formula for the perturbation \(\xi(R,\phi)\).

◆ perturbationWeight()

SpiralStructureGeometryDecorator::perturbationWeight ( ) const
inline

This function returns the value of the discoverable double property perturbationWeight : "the weight of the spiral perturbation" .

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

The maximum value for this property is "1]" .

◆ phaseZeroPoint()

SpiralStructureGeometryDecorator::phaseZeroPoint ( ) const
inline

This function returns the value of the discoverable double property phaseZeroPoint : "the phase zero-point" .

This property represents a physical quantity of type "posangle" .

The minimum value for this property is "[0 deg" .

The maximum value for this property is "360 deg]" .

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

This property is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.

◆ pitchAngle()

SpiralStructureGeometryDecorator::pitchAngle ( ) const
inline

This function returns the value of the discoverable double property pitchAngle : "the pitch angle" .

This property represents a physical quantity of type "posangle" .

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

The maximum value for this property is "90 deg[" .

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

◆ radiusZeroPoint()

SpiralStructureGeometryDecorator::radiusZeroPoint ( ) const
inline

This function returns the value of the discoverable double property radiusZeroPoint : "the radius zero-point" .

This property represents a physical quantity of type "length" .

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

◆ setupSelfBefore()

void SpiralStructureGeometryDecorator::setupSelfBefore ( )
overridevirtual

This function calculates some frequently used values.

Reimplemented from Geometry.

◆ SigmaX()

double SpiralStructureGeometryDecorator::SigmaX ( ) const
overridevirtual

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

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

This integral cannot be calculated analytically, but when averaged over all lines-of-sight in the equatorial plane, the contribution of the spiral arm perturbation cancels out, and we recover the X-axis surface density of the corresponding unperturbed model.

Implements Geometry.

◆ SigmaY()

double SpiralStructureGeometryDecorator::SigmaY ( ) const
overridevirtual

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

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

This integral cannot be calculated analytically, but when averaged over all lines-of-sight in the equatorial plane, the contribution of the spiral arm perturbation cancels out, and we recover the Y-axis surface density of the corresponding unperturbed model.

Implements Geometry.

◆ SigmaZ()

double SpiralStructureGeometryDecorator::SigmaZ ( ) const
overridevirtual

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

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

For the present decorator, this integral is not really well defined, as the logarithmic spiral perturbation winds ever stronger when we get closer to the Z-axis. We use the Z-axis surface density of the corresponding unperturbed model.

Implements Geometry.


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