Manticore  Version 1.0
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 {
12  extern void printModels(std::vector<mutils::CommandLine::Option> &opts,
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 lamb0, double kappa0, double beta)
46  { setModel(lamb0, kappa0, beta); }
47 
51  void setModel(const std::string &model, double rho = 100.0);
52 
57  void setModel(double lamb0, double kappa0, double beta);
58 
61  double kappa(double nu) const;
62 
64  const std::string &name() const noexcept { return name_; }
65 
67  double rho() const noexcept { return rho_; }
68 
69 protected:
71  struct Opacity { double inu0, kappa0, beta; };
72 
74  std::string name_;
75 
77  double rho_;
78 
80  Opacity opacity_ = {0.0, 0.0, 0.0};
81 
83  gsl_spline *spline_ = nullptr;
84 };
85 
86 } // namespace manticore
87 
88 #endif // DUST_H
Dust(const std::string &model="OH5", double rho=100.0)
Default constructor.
Definition: Dust.h:33
Dust(double lamb0, double kappa0, double beta)
Fixed power-law constructor.
Definition: Dust.h:45
const std::string & name() const noexcept
Current model name.
Definition: Dust.h:64
void setModel(const std::string &model, double rho=100.0)
Set dust properties model (table-based).
Definition: Dust.cc:164
Fixed power-law opacity parameters.
Definition: Dust.h:71
Package namespace.
Definition: Detector.cc:13
Declares the CommandLine class.
std::string name_
Current model name.
Definition: Dust.h:74
void printModels(std::vector< mu::CommandLine::Option > &opts, char name)
Add available dust model names to options summary.
Definition: Dust.cc:148
double kappa(double nu) const
Gas/dust extinction opacity (cm^2/g).
Definition: Dust.cc:222
The MathUtils miscellaneous utilities library.
~Dust()
Destructor.
Definition: Dust.h:37
double rho_
Current model gas-to-dust ratio.
Definition: Dust.h:77
gsl_spline * spline_
Table interpolator.
Definition: Dust.h:83
Opacity opacity_
Fixed power law.
Definition: Dust.h:80
double rho() const noexcept
Current model gas-to-dust ratio.
Definition: Dust.h:67
Dust model.
Definition: Dust.h:28