Manticore  Version 1.5.3
Physics of Molecular Clouds
Dust.h
Go to the documentation of this file.
1 #ifndef DUST_H
2 #define DUST_H
3 
4 #include <gsl/gsl_spline.h>
5 
6 #include "mutils/CommandLine.h"
7 #include "mutils/util.h"
8 
9 namespace manticore {
10 
11 namespace dust {
13  char shortName);
14 }
15 
16 
28 class Dust {
29 public:
33  Dust(const std::string &model = "OH5", double rho = 100.0)
34  { setModel(model, rho); }
35 
37  ~Dust() {
38  if (spline_) { gsl_spline_free(spline_); }
39  }
40 
45  Dust(double nu0, double kappa0, double beta)
46  { setModel(nu0, kappa0, beta); }
47 
51  void setModel(const std::string &model, double rho = 100.0);
52 
57  void setModel(double nu0, double kappa0, double beta);
58 
62  double kappa(double nu, gsl_interp_accel *acc = nullptr) const;
63 
65  const std::string &name() const noexcept { return name_; }
66 
68  double rho() const noexcept { return rho_; }
69 
70 protected:
72  struct Opacity { double inu0, kappa0, beta; };
73 
76 
78  double rho_;
79 
81  Opacity opacity_ = {0.0, 0.0, 0.0};
82 
84  gsl_spline *spline_ = nullptr;
85 
87  bool ln_ = false;
88 };
89 
90 } // namespace manticore
91 
92 #endif // DUST_H
Dust(const std::string &model="OH5", double rho=100.0)
Default constructor.
Definition: Dust.h:33
Dust(double nu0, double kappa0, double beta)
Fixed power-law constructor.
Definition: Dust.h:45
const std::string & name() const noexcept
Current model name.
Definition: Dust.h:65
void setModel(const std::string &model, double rho=100.0)
Set dust properties model (table-based).
Definition: Dust.cc:670
Fixed power-law opacity parameters.
Definition: Dust.h:72
Package namespace.
Definition: Detector.cc:15
Declares the CommandLine class.
std::string name_
Current model name.
Definition: Dust.h:75
void printModels(std::vector< mu::CommandLine::Option > &opts, char name)
Add available dust model names to options summary.
Definition: Dust.cc:654
The MathUtils miscellaneous utilities library.
~Dust()
Destructor.
Definition: Dust.h:37
double kappa(double nu, gsl_interp_accel *acc=nullptr) const
Gas/dust extinction opacity (cm^2/g).
Definition: Dust.cc:745
double rho_
Current model gas-to-dust ratio.
Definition: Dust.h:78
gsl_spline * spline_
Table interpolator.
Definition: Dust.h:84
Opacity opacity_
Fixed power law.
Definition: Dust.h:81
double rho() const noexcept
Current model gas-to-dust ratio.
Definition: Dust.h:68
bool ln_
Whether to interpolate in log space.
Definition: Dust.h:87
Dust model.
Definition: Dust.h:28