BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
RefractiveMaterialImpl.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Material/RefractiveMaterialImpl.h
6 //! @brief Defines class RefractiveMaterialImpl.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
15 #ifndef BORNAGAIN_CORE_MATERIAL_REFRACTIVEMATERIALIMPL_H
16 #define BORNAGAIN_CORE_MATERIAL_REFRACTIVEMATERIALIMPL_H
17 
20 
21 //! Material implementation based on refractive coefficiencts (valid for one wavelength value only)
22 //! @ingroup materials
23 
25 {
26 public:
27  friend Material HomogeneousMaterial(const std::string&, double, double, kvector_t);
28 
29  virtual ~RefractiveMaterialImpl() = default;
30 
31  //! Returns pointer to a copy of material
32  RefractiveMaterialImpl* clone() const override;
33 
34  //! Returns refractive index
35  //! For this particular implementation returned value does not depend
36  //! on passed wavelength
37  complex_t refractiveIndex(double wavelength) const override;
38 
39  //! Returns squared refractive index.
40  //! For this particular implementation returned value does not depend
41  //! on passed wavelength.
42  complex_t refractiveIndex2(double wavelength) const override;
43 
44  //! Returns underlying material data
45  complex_t materialData() const override;
46 
47  //! Returns type of material implementation
49 
50  //! Returns (\f$ \pi/\lambda^2 \f$ - sld), sld (in \f$nm^{-2}\f$) being the scattering length
51  //! density. If the wavelength associated with passed wavevector is different from the one
52  //! associated with refractive coefficients used during the object construction,
53  //! provided result is inconsistent.
54  complex_t scalarSubtrSLD(const WavevectorInfo& wavevectors) const override;
55 
56  //! Prints object data
57  void print(std::ostream& ostr) const override;
58 
59 private:
60  RefractiveMaterialImpl(const std::string& name, double delta, double beta,
62 
63  double
64  m_delta; //!< \f$\delta\f$ coefficient for refractive index \f$n = 1 - \delta + i \beta\f$
65  double m_beta; //!< \f$\beta\f$ coefficient for refractive index \f$n = 1 - \delta + i \beta\f$
66 };
67 
68 #endif // BORNAGAIN_CORE_MATERIAL_REFRACTIVEMATERIALIMPL_H
MATERIAL_TYPES
std::complex< double > complex_t
Definition: Complex.h:20
Defines magnetic material base implementation.
Defines and implements class Material.
Basic implementation for magnetized material.
kvector_t magnetization() const override final
Returns the magnetization (in A/m)
A wrapper for underlying material implementation.
Definition: Material.h:29
Material implementation based on refractive coefficiencts (valid for one wavelength value only)
complex_t refractiveIndex2(double wavelength) const override
Returns squared refractive index.
complex_t materialData() const override
Returns underlying material data.
complex_t refractiveIndex(double wavelength) const override
Returns refractive index For this particular implementation returned value does not depend on passed ...
void print(std::ostream &ostr) const override
Prints object data.
RefractiveMaterialImpl * clone() const override
Returns pointer to a copy of material.
virtual ~RefractiveMaterialImpl()=default
double m_delta
coefficient for refractive index
RefractiveMaterialImpl(const std::string &name, double delta, double beta, kvector_t magnetization)
complex_t scalarSubtrSLD(const WavevectorInfo &wavevectors) const override
Returns ( - sld), sld (in ) being the scattering length density.
MATERIAL_TYPES typeID() const override
Returns type of material implementation.
friend Material HomogeneousMaterial(const std::string &, double, double, kvector_t)
double m_beta
coefficient for refractive index
Holds all wavevector information relevant for calculating form factors.