BornAgain  1.19.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 reflection and scattering
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_SAMPLE_MATERIAL_REFRACTIVEMATERIALIMPL_H
21 #define BORNAGAIN_SAMPLE_MATERIAL_REFRACTIVEMATERIALIMPL_H
22 
25 
26 //! Material implementation based on refractive coefficiencts (valid for one wavelength value only)
27 //! @ingroup materials
28 
30 public:
31  friend Material HomogeneousMaterial(const std::string&, double, double, kvector_t);
32 
33  virtual ~RefractiveMaterialImpl() = default;
34 
35  //! Returns pointer to a copy of material
36  RefractiveMaterialImpl* clone() const override;
37 
38  //! Returns refractive index
39  //! For this particular implementation returned value does not depend
40  //! on passed wavelength
41  complex_t refractiveIndex(double wavelength) const override;
42 
43  //! Returns squared refractive index.
44  //! For this particular implementation returned value does not depend
45  //! on passed wavelength.
46  complex_t refractiveIndex2(double wavelength) const override;
47 
48  //! Returns underlying material data
49  complex_t materialData() const override;
50 
51  //! Returns type of material implementation
53 
54  //! Returns (\f$ \pi/\lambda^2 \f$ - sld), sld (in \f$nm^{-2}\f$) being the scattering length
55  //! density. If the wavelength associated with passed wavevector is different from the one
56  //! associated with refractive coefficients used during the object construction,
57  //! provided result is inconsistent.
58  complex_t scalarSubtrSLD(const WavevectorInfo& wavevectors) const override;
59 
60  //! Prints object data
61  void print(std::ostream& ostr) const override;
62 
63 private:
64  RefractiveMaterialImpl(const std::string& name, double delta, double beta,
66 
67  const double
68  m_delta; //!< \f$\delta\f$ coefficient for refractive index \f$n = 1 - \delta + i \beta\f$
69  const double
70  m_beta; //!< \f$\beta\f$ coefficient for refractive index \f$n = 1 - \delta + i \beta\f$
71 };
72 
73 #endif // BORNAGAIN_SAMPLE_MATERIAL_REFRACTIVEMATERIALIMPL_H
74 #endif // USER_API
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 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)
const double m_delta
coefficient for refractive index
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
RefractiveMaterialImpl(const std::string &name, double delta, double beta, kvector_t magnetization)
const double m_beta
coefficient for refractive index
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)
Holds all wavevector information relevant for calculating form factors.
QString const & name(EShape k)
Definition: particles.cpp:21