Manticore  Version 1.5.3
Physics of Molecular Clouds
Classes | Public Member Functions | Protected Attributes | List of all members
manticore::Dust Class Reference

Dust model. More...

#include <Dust.h>

Collaboration diagram for manticore::Dust:
Collaboration graph
[legend]

Classes

struct  Opacity
 Fixed power-law opacity parameters. More...
 

Public Member Functions

 Dust (const std::string &model="OH5", double rho=100.0)
 Default constructor. More...
 
 Dust (double nu0, double kappa0, double beta)
 Fixed power-law constructor. More...
 
 ~Dust ()
 Destructor. More...
 
double kappa (double nu, gsl_interp_accel *acc=nullptr) const
 Gas/dust extinction opacity (cm^2/g). More...
 
const std::stringname () const noexcept
 Current model name. More...
 
double rho () const noexcept
 Current model gas-to-dust ratio. More...
 
void setModel (const std::string &model, double rho=100.0)
 Set dust properties model (table-based). More...
 
void setModel (double nu0, double kappa0, double beta)
 Set dust properties model (fixed power law). More...
 

Protected Attributes

bool ln_ = false
 Whether to interpolate in log space. More...
 
std::string name_
 Current model name. More...
 
Opacity opacity_ = {0.0, 0.0, 0.0}
 Fixed power law. More...
 
double rho_
 Current model gas-to-dust ratio. More...
 
gsl_spline * spline_ = nullptr
 Table interpolator. More...
 

Detailed Description

Dust model.

This class supports both arbitrary, table-based opacity models as well as fixed power laws. The underlying model is set at construction but can be changed during use; cf. setModel(). Table-based models are evaluated via cubic spline interpolation of the logarithm of the opacity.

Note
Once initialized, a model may be safely shared among multiple threads.

Definition at line 28 of file Dust.h.

Constructor & Destructor Documentation

◆ Dust() [1/2]

manticore::Dust::Dust ( const std::string model = "OH5",
double  rho = 100.0 
)
inline

Default constructor.

Parameters
[in]modelDust model name.
[in]rhoGas-to-dust ratio.

Definition at line 33 of file Dust.h.

References rho(), and setModel().

◆ ~Dust()

manticore::Dust::~Dust ( )
inline

Destructor.

Definition at line 37 of file Dust.h.

References spline_.

◆ Dust() [2/2]

manticore::Dust::Dust ( double  nu0,
double  kappa0,
double  beta 
)
inline

Fixed power-law constructor.

Parameters
[in]nu0Fiducial frequency (Hz).
[in]kappa0Fiducial opacity (cm^2/g @ g/d = 100).
[in]betaOpacity scaling.

Definition at line 45 of file Dust.h.

References setModel().

Member Function Documentation

◆ kappa()

double manticore::Dust::kappa ( double  nu,
gsl_interp_accel *  acc = nullptr 
) const

Gas/dust extinction opacity (cm^2/g).

Parameters
[in]nuObservation frequency (Hz).
[in]accInterpolation lookup accelerator.

The opacity value is interpolated from tabulated values assuming a fixed power law dependence between adjacent points. If nu lies woutside the range of the table, the corresponding end value is extrapolated.

Returns
Dust+gas extinction opacity at the given wavelength.

Definition at line 745 of file Dust.cc.

References manticore::Dust::Opacity::beta, manticore::Dust::Opacity::inu0, manticore::Dust::Opacity::kappa0, ln_, opacity_, and spline_.

◆ name()

const std::string& manticore::Dust::name ( ) const
inlinenoexcept

Current model name.

Definition at line 65 of file Dust.h.

References name_.

Referenced by setModel(), and manticore::solve().

◆ rho()

double manticore::Dust::rho ( ) const
inlinenoexcept

Current model gas-to-dust ratio.

Definition at line 68 of file Dust.h.

References rho_.

Referenced by Dust(), setModel(), and manticore::solve().

◆ setModel() [1/2]

void manticore::Dust::setModel ( const std::string model,
double  rho = 100.0 
)

Set dust properties model (table-based).

Parameters
[in]modelDust model name.
[in]rhoGas-to-dust ratio.

Definition at line 670 of file Dust.cc.

References std::string::c_str(), std::string::find(), manticore::initSpline(), ln_, std::max(), std::min(), manticore::dust::modelMap, MU_ERROR, name_, opacity_, rho(), rho_, and spline_.

Referenced by manticore::ccfCheck(), and Dust().

◆ setModel() [2/2]

void manticore::Dust::setModel ( double  nu0,
double  kappa0,
double  beta 
)

Set dust properties model (fixed power law).

Parameters
[in]nu0Fiducial frequency (Hz).
[in]kappa0Fiducial opacity (cm^2/g @ g/d = 100).
[in]betaOpacity scaling.

Definition at line 718 of file Dust.cc.

References ln_, name(), name_, opacity_, rho_, and spline_.

Member Data Documentation

◆ ln_

bool manticore::Dust::ln_ = false
protected

Whether to interpolate in log space.

Definition at line 87 of file Dust.h.

Referenced by kappa(), and setModel().

◆ name_

std::string manticore::Dust::name_
protected

Current model name.

Definition at line 75 of file Dust.h.

Referenced by name(), and setModel().

◆ opacity_

Opacity manticore::Dust::opacity_ = {0.0, 0.0, 0.0}
protected

Fixed power law.

Definition at line 81 of file Dust.h.

Referenced by kappa(), and setModel().

◆ rho_

double manticore::Dust::rho_
protected

Current model gas-to-dust ratio.

Definition at line 78 of file Dust.h.

Referenced by rho(), and setModel().

◆ spline_

gsl_spline* manticore::Dust::spline_ = nullptr
protected

Table interpolator.

Definition at line 84 of file Dust.h.

Referenced by kappa(), setModel(), and ~Dust().


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