Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Protected Member Functions | List of all members
materials::refractive_index Class Reference

Compute the refractive index or the extinction coefficient for a given medium. More...

#include <bayeux/materials/refractive_index.h>

Inheritance diagram for materials::refractive_index:
mygsl::i_unary_function datatools::i_tree_dumpable

Public Types

enum  dispersion_formula_type {
  FORMULA_INVALID = 0, FORMULA_CONSTANT = 1, FORMULA_DISPERSION_TABULATED = 2, FORMULA_DISPERSION_RII_SELLMEIER = 11,
  FORMULA_DISPERSION_RII_SELLMEIER2 = 12, FORMULA_DISPERSION_RII_POLYNOMIAL = 13, FORMULA_DISPERSION_RII_RII4 = 14, FORMULA_DISPERSION_RII_CAUCHY = 15,
  FORMULA_DISPERSION_RII_GASES = 16, FORMULA_DISPERSION_RII_HERZBERGER = 17
}
 
enum  eval_mode_type { EVAL_N = 0, EVAL_K = 1 }
 Evaluation mode. More...
 
typedef std::map< std::size_t, double > coeff_dict_type
 Type alias for a dictionry of parameters. More...
 
- Public Types inherited from mygsl::i_unary_function
enum  write_options_type {
  wo_none = 0, wo_data_index = 0x1, wo_skip_nan = 0x2, wo_skip_inf = 0x4,
  wo_skip_onzd = 0x8, wo_skip_odod = 0x10, wo_append = 0x20, wo_default = wo_none
}
 Options for writing sampled function in an ASCII stream. More...
 
- Public Types inherited from datatools::i_tree_dumpable
enum  ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 }
 Enumeration for standard output streams. More...
 

Public Member Functions

 refractive_index ()
 Default constructor. More...
 
virtual ~refractive_index ()
 Destructor. More...
 
bool is_eval_n () const
 Check the refractive index evaluation mode. More...
 
bool is_eval_k () const
 Check the extinction coefficient evaluation mode. More...
 
void set_eval_n ()
 Set to refractive index evaluation mode. More...
 
void set_eval_k ()
 Set to extinction coefficient evaluation mode. More...
 
bool has_lambda_range () const
 Check if validity range of lambda is set. More...
 
void set_lambda_range (const double lambda_min_, const double lambda_max_)
 Set the validity range of lambda. More...
 
void set_lambda_range (const datatools::real_range &lr_)
 Set the validity range of lambda. More...
 
const datatools::real_rangeget_lambda_range () const
 Return the validity range of lambda. More...
 
void make_constant (const double n_, const double k_=std::numeric_limits< double >::quiet_NaN())
 
void make_tabulated (const std::string &n_tab_, const std::string &k_tab_="")
 Use a tabulated refractive index and extension coefficient. More...
 
void make_dispersion_rii (const dispersion_formula_type formula_, const coeff_dict_type &coeffs_, const std::string &k_tab_="")
 Use a RII dispersion formula refractive index. More...
 
bool has_rii_coeff (const std::size_t) const
 Check if a RII coeff is set. More...
 
double get_rii_coeff (const std::size_t) const
 Return the RII coeff at given rank. More...
 
double eval_refractive_index (const double lambda_) const
 Compute the refractive index from the vacuum wavelength (where E = hc/lambda) More...
 
double eval_extinction_coefficient (const double lambda_) const
 Compute the extinction coefficient from the vacuum wavelength. More...
 
double eval_attenuation_coefficient (const double lambda_) const
 Compute the attenuation coefficient from the vacuum wavelength. More...
 
double eval_penetration_depth (const double lambda_) const
 Compute the penetration depth from the vacuum wavelength. More...
 
double compute_principal_dispersion () const
 Compute the principal dispersion (from Fraunhofer F-, C-spectral lines) More...
 
double compute_abbe_number () const
 Compute the Abbe number (from Fraunhofer D-, F-, C-spectral lines) More...
 
double compute_abbe_number_e () const
 Compute the Abbe number (from Fraunhofer Cd, Hg spectral lines) More...
 
virtual bool has_explicit_domain_of_definition () const
 Check if a domain of definition is set. More...
 
virtual bool is_in_domain_of_definition (const double x_) const
 Check if a value is in the domain of definition. More...
 
bool is_initialized () const
 Check initialization status. More...
 
void initialize (const datatools::properties &config_, const mygsl::unary_function_dict_type &)
 Initialize from properties. More...
 
void reset ()
 Reset. More...
 
- Public Member Functions inherited from mygsl::i_unary_function
 i_unary_function (double epsilon_=0.0)
 Constructor. More...
 
virtual ~i_unary_function ()
 Destructor. More...
 
virtual double eval (double x_) const
 The function evaluation method. More...
 
double evaluate (double x_) const
 The function evaluation method. More...
 
virtual double eval_no_check (double x_) const
 The function evaluation method with any value check. More...
 
virtual double get_non_zero_domain_min () const
 The minimum bound of the non-zero domain (default is minus infinity) More...
 
bool has_non_zero_domain_min () const
 Check the minimum bound of the non-zero domain. More...
 
virtual double get_non_zero_domain_max () const
 The maximum bound of the non-zero domain (default is plus infinity) More...
 
bool has_non_zero_domain_max () const
 Check the maximum bound of the non-zero domain. More...
 
bool is_in_non_zero_domain (double x_) const
 Check if a value is in the non-zero domain. More...
 
bool is_in_zero_domain (double x_) const
 Check if a value is in the zero domain. More...
 
bool has_zero_domain () const
 Check if the functor has an explicit zero domain. More...
 
double operator() (double x_) const
 Standard C++ functor interface. More...
 
void write_ascii (std::ostream &fout_, double min_, double max_, unsigned int nsamples_, int x_precision_=16, int fx_precision_=16, uint32_t options_=wo_default) const
 Write the (x,y=f(x)) value pairs in an ASCII stream : More...
 
void write_ascii_with_units (std::ostream &fout_, double min_, double max_, unsigned int nsamples_, double x_unit_, double fx_unit_, int x_precision_=16, int fx_precision_=16, uint32_t options_=wo_default) const
 Write the (x,y=f(x)) value pairs in an ASCII stream : More...
 
void write_ascii_file (const std::string &filename_, double min_, double max_, unsigned int nsamples_, int x_precision_=16, int fx_precision_=16, uint32_t options_=wo_default) const
 Write the (x,y=f(x)) value pairs in an ASCII file (typical Gnuplot input) : More...
 
void write_ascii_file_with_units (const std::string &filename_, double min_, double max_, unsigned int nsamples_, const std::string &x_unit_label_, const std::string &fx_unit_label_, int x_precision_=16, int fx_precision_=16, uint32_t options_=wo_default) const
 Write the (x,y=f(x)) value pairs in an ASCII file (typical Gnuplot input) : More...
 
void set_epsilon (double)
 Set the precision. More...
 
double get_epsilon () const
 Return the precision. More...
 
void initialize_simple ()
 Simple initialization. More...
 
void initialize_standalone (const datatools::properties &config_)
 Initialization from a container of parameters. More...
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Smart printing. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
virtual void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const
 Main new interface method for printing. More...
 
void print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const
 Printing with jsonized options. More...
 
void print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const
 Printing with jsonized options. More...
 
void tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const
 
void tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const
 
void smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const
 

Protected Member Functions

virtual double _eval (double) const
 The function evaluation abstract method. More...
 
double _eval_n (double) const
 
double _eval_k (double) const
 
void _build_n_tabfunc ()
 
void _build_k_tabfunc ()
 
- Protected Member Functions inherited from mygsl::i_unary_function
void _base_initialize (const datatools::properties &config_, const unary_function_dict_type &functors_)
 
void _base_reset ()
 
void _compute_auto_epsilon ()
 
void _set_defaults ()
 Set defaults attributes. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from mygsl::i_unary_function
static double g_function (double x_, void *functor_)
 A generic static function to feed the GSL gsl_function interface: More...
 
- Static Public Member Functions inherited from datatools::i_tree_dumpable
static const boost::property_tree::ptree & empty_options ()
 
static boost::property_tree::ptree make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false)
 
static std::ostream & last_skip_tag (std::ostream &out_)
 
static std::ostream & skip_tag (std::ostream &out_)
 
static std::ostream & last_tag (std::ostream &out_)
 
static std::ostream & tag (std::ostream &out_)
 
- Static Public Attributes inherited from mygsl::i_unary_function
static const double DEFAULT_EPSILON
 Default error. More...
 
static const double AUTO_EPSILON
 Value for automatic computation of the error. More...
 

Detailed Description

Compute the refractive index or the extinction coefficient for a given medium.

See also
http://refractiveindex.info/
https://github.com/polyanskiy/refractiveindex.info-database/blob/master/database/doc/Dispersion%20formulas.pdf
https://github.com/polyanskiy/refractiveindex.info-database/ Typical validity wavelength range from UV to ~2.3 μm, depending of the parametrization (tabulated function or explicit formula).

Member Typedef Documentation

◆ coeff_dict_type

typedef std::map<std::size_t, double> materials::refractive_index::coeff_dict_type

Type alias for a dictionry of parameters.

Member Enumeration Documentation

◆ dispersion_formula_type

Enumerator
FORMULA_INVALID 

Invalid formula.

FORMULA_CONSTANT 

No dispersion (constant refractive index)

FORMULA_DISPERSION_TABULATED 

Tabulated dispersion.

FORMULA_DISPERSION_RII_SELLMEIER 

Sellmeier formula (preferred)

FORMULA_DISPERSION_RII_SELLMEIER2 

Sellmeier formula (alternative)

FORMULA_DISPERSION_RII_POLYNOMIAL 
FORMULA_DISPERSION_RII_RII4 
FORMULA_DISPERSION_RII_CAUCHY 
FORMULA_DISPERSION_RII_GASES 
FORMULA_DISPERSION_RII_HERZBERGER 

◆ eval_mode_type

Evaluation mode.

Enumerator
EVAL_N 
EVAL_K 

Constructor & Destructor Documentation

◆ refractive_index()

materials::refractive_index::refractive_index ( )

Default constructor.

◆ ~refractive_index()

virtual materials::refractive_index::~refractive_index ( )
virtual

Destructor.

Member Function Documentation

◆ _build_k_tabfunc()

void materials::refractive_index::_build_k_tabfunc ( )
protected

◆ _build_n_tabfunc()

void materials::refractive_index::_build_n_tabfunc ( )
protected

◆ _eval()

virtual double materials::refractive_index::_eval ( double  x_) const
protectedvirtual

The function evaluation abstract method.

Implements mygsl::i_unary_function.

◆ _eval_k()

double materials::refractive_index::_eval_k ( double  ) const
protected

◆ _eval_n()

double materials::refractive_index::_eval_n ( double  ) const
protected

◆ compute_abbe_number()

double materials::refractive_index::compute_abbe_number ( ) const

Compute the Abbe number (from Fraunhofer D-, F-, C-spectral lines)

◆ compute_abbe_number_e()

double materials::refractive_index::compute_abbe_number_e ( ) const

Compute the Abbe number (from Fraunhofer Cd, Hg spectral lines)

◆ compute_principal_dispersion()

double materials::refractive_index::compute_principal_dispersion ( ) const

Compute the principal dispersion (from Fraunhofer F-, C-spectral lines)

◆ eval_attenuation_coefficient()

double materials::refractive_index::eval_attenuation_coefficient ( const double  lambda_) const

Compute the attenuation coefficient from the vacuum wavelength.

◆ eval_extinction_coefficient()

double materials::refractive_index::eval_extinction_coefficient ( const double  lambda_) const

Compute the extinction coefficient from the vacuum wavelength.

◆ eval_penetration_depth()

double materials::refractive_index::eval_penetration_depth ( const double  lambda_) const

Compute the penetration depth from the vacuum wavelength.

◆ eval_refractive_index()

double materials::refractive_index::eval_refractive_index ( const double  lambda_) const

Compute the refractive index from the vacuum wavelength (where E = hc/lambda)

◆ get_lambda_range()

const datatools::real_range& materials::refractive_index::get_lambda_range ( ) const

Return the validity range of lambda.

◆ get_rii_coeff()

double materials::refractive_index::get_rii_coeff ( const std::size_t  ) const

Return the RII coeff at given rank.

◆ has_explicit_domain_of_definition()

virtual bool materials::refractive_index::has_explicit_domain_of_definition ( ) const
virtual

Check if a domain of definition is set.

Reimplemented from mygsl::i_unary_function.

◆ has_lambda_range()

bool materials::refractive_index::has_lambda_range ( ) const

Check if validity range of lambda is set.

◆ has_rii_coeff()

bool materials::refractive_index::has_rii_coeff ( const std::size_t  ) const

Check if a RII coeff is set.

◆ initialize()

void materials::refractive_index::initialize ( const datatools::properties config_,
const mygsl::unary_function_dict_type  
)
virtual

Initialize from properties.

Reimplemented from mygsl::i_unary_function.

◆ is_eval_k()

bool materials::refractive_index::is_eval_k ( ) const

Check the extinction coefficient evaluation mode.

◆ is_eval_n()

bool materials::refractive_index::is_eval_n ( ) const

Check the refractive index evaluation mode.

◆ is_in_domain_of_definition()

virtual bool materials::refractive_index::is_in_domain_of_definition ( const double  x_) const
virtual

Check if a value is in the domain of definition.

Reimplemented from mygsl::i_unary_function.

◆ is_initialized()

bool materials::refractive_index::is_initialized ( ) const
virtual

Check initialization status.

Reimplemented from mygsl::i_unary_function.

◆ make_constant()

void materials::refractive_index::make_constant ( const double  n_,
const double  k_ = std::numeric_limits< double >::quiet_NaN() 
)

Use a constant refractive index (independant of lambda) and a constant extinction coefficient (optional)

◆ make_dispersion_rii()

void materials::refractive_index::make_dispersion_rii ( const dispersion_formula_type  formula_,
const coeff_dict_type coeffs_,
const std::string &  k_tab_ = "" 
)

Use a RII dispersion formula refractive index.

◆ make_tabulated()

void materials::refractive_index::make_tabulated ( const std::string &  n_tab_,
const std::string &  k_tab_ = "" 
)

Use a tabulated refractive index and extension coefficient.

◆ reset()

void materials::refractive_index::reset ( )
virtual

Reset.

Reimplemented from mygsl::i_unary_function.

◆ set_eval_k()

void materials::refractive_index::set_eval_k ( )

Set to extinction coefficient evaluation mode.

◆ set_eval_n()

void materials::refractive_index::set_eval_n ( )

Set to refractive index evaluation mode.

◆ set_lambda_range() [1/2]

void materials::refractive_index::set_lambda_range ( const double  lambda_min_,
const double  lambda_max_ 
)

Set the validity range of lambda.

◆ set_lambda_range() [2/2]

void materials::refractive_index::set_lambda_range ( const datatools::real_range lr_)

Set the validity range of lambda.


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