BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MaterialUtils.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Material/MaterialUtils.h
6 //! @brief Declares functions in namespace MaterialUtils
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_MATERIALUTILS_H
16 #define BORNAGAIN_CORE_MATERIAL_MATERIALUTILS_H
17 
19 
20 //! A number of materials-related helper functions for internal use
21 //! @ingroup materials
22 
23 namespace MaterialUtils
24 {
25 
26 //! Function for calculating the reduced potential, used for obtaining the Fresnel coefficients
27 //! (non-polarized material case)
28 
30 
31 //! Function for calculating the reduced potential, used for obtaining the Fresnel coefficients
32 //! (polarized material case)
33 
34 Eigen::Matrix2cd PolarizedReducedPotential(complex_t n, kvector_t b_field, kvector_t k,
35  double n_ref);
36 
37 // Utility to compute magnetization correction for reduced potential and scattering length density.
38 // Used with T = double, complex_t.
39 
40 template <typename T>
41 Eigen::Matrix2cd MagnetizationCorrection(complex_t unit_factor, double magnetic_factor,
42  BasicVector3D<T> polarization);
43 
44 //! Checks if all non-default materials in _materials_ are of the same type and returns this type.
45 //! If several types of materials are involved, InvalidMaterialType identifier is returned.
46 
47 MATERIAL_TYPES checkMaterialTypes(const std::vector<const Material*>& materials);
48 
49 } // namespace MaterialUtils
50 
51 #endif // BORNAGAIN_CORE_MATERIAL_MATERIALUTILS_H
MATERIAL_TYPES
std::complex< double > complex_t
Definition: Complex.h:20
Defines and implements class Material.
A number of materials-related helper functions for internal use.
Definition: MaterialUtils.h:24
MATERIAL_TYPES checkMaterialTypes(const std::vector< const Material * > &materials)
Checks if all non-default materials in materials are of the same type and returns this type.
complex_t ScalarReducedPotential(complex_t n, kvector_t k, double n_ref)
Function for calculating the reduced potential, used for obtaining the Fresnel coefficients (non-pola...
Eigen::Matrix2cd PolarizedReducedPotential(complex_t n, kvector_t b_field, kvector_t k, double n_ref)
Function for calculating the reduced potential, used for obtaining the Fresnel coefficients (polarize...
Eigen::Matrix2cd MagnetizationCorrection(complex_t unit_factor, double magnetic_factor, BasicVector3D< T > polarization)