BornAgain  1.19.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 reflection and scattering
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_SAMPLE_MATERIAL_MATERIALUTILS_H
21 #define BORNAGAIN_SAMPLE_MATERIAL_MATERIALUTILS_H
22 
24 
25 //! A number of materials-related helper functions for internal use
26 //! @ingroup materials
27 
28 namespace MaterialUtils {
29 
30 //! Function for calculating the reduced potential, used for obtaining the Fresnel coefficients
31 //! (non-polarized material case)
32 
34 
35 //! Function for calculating the reduced potential, used for obtaining the Fresnel coefficients
36 //! (polarized material case)
37 
38 Eigen::Matrix2cd PolarizedReducedPotential(complex_t n, kvector_t b_field, kvector_t k,
39  double n_ref);
40 
41 // Utility to compute magnetization correction for reduced potential and scattering length density.
42 // Used with T = double, complex_t.
43 
44 template <typename T>
45 Eigen::Matrix2cd MagnetizationCorrection(complex_t unit_factor, double magnetic_factor,
46  BasicVector3D<T> polarization);
47 
48 //! Checks if all non-default materials in _materials_ are of the same type and returns this type.
49 //! If several types of materials are involved, InvalidMaterialType identifier is returned.
50 
51 MATERIAL_TYPES checkMaterialTypes(const std::vector<const Material*>& materials);
52 
53 } // namespace MaterialUtils
54 
55 #endif // BORNAGAIN_SAMPLE_MATERIAL_MATERIALUTILS_H
56 #endif // USER_API
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:28
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)