BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MagneticMaterialImpl.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Material/MagneticMaterialImpl.h
6 //! @brief Defines magnetic material base implementation.
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_MAGNETICMATERIALIMPL_H
21 #define BORNAGAIN_SAMPLE_MATERIAL_MAGNETICMATERIALIMPL_H
22 
24 
25 class Transform3D;
26 class WavevectorInfo;
27 
28 //! Basic implementation for magnetized material.
29 //! Inherited by RefractiveMaterialImpl and MaterialBySLDImpl.
30 //! Incorporates data and methods required to handle material magnetization.
31 //! @ingroup materials
32 
34 public:
35  //! Constructs basic material with name and magnetization
36  MagneticMaterialImpl(const std::string& name, kvector_t magnetization);
37 
38  virtual ~MagneticMaterialImpl() = default;
39 
40  //! Returns pointer to a copy of material
41  MagneticMaterialImpl* clone() const override = 0;
42 
43  //! Constructs a material with inverted magnetization
44  MagneticMaterialImpl* inverted() const final;
45 
46  //! Indicates whether the interaction with the material is scalar.
47  //! This means that different polarization states will be diffracted equally
48  bool isScalarMaterial() const final;
49 
50  bool isMagneticMaterial() const final;
51 
52  //! Returns the magnetization (in A/m)
53  kvector_t magnetization() const final;
54 
55  //! Returns (\f$ \pi/\lambda^2 \f$ - sld) matrix with magnetization corrections
56  Eigen::Matrix2cd polarizedSubtrSLD(const WavevectorInfo& wavevectors) const final;
57 
58  MagneticMaterialImpl* rotatedMaterial(const Transform3D& transform) const final;
59 
60 private:
62 
63  kvector_t m_magnetization; //!< magnetization
64 };
65 
66 #endif // BORNAGAIN_SAMPLE_MATERIAL_MAGNETICMATERIALIMPL_H
67 #endif // USER_API
Defines basic material implementation interface.
Interface for material implementation classes.
Basic implementation for magnetized material.
void setMagnetization(kvector_t magnetization)
virtual ~MagneticMaterialImpl()=default
MagneticMaterialImpl * clone() const override=0
Returns pointer to a copy of material.
kvector_t magnetization() const final
Returns the magnetization (in A/m)
MagneticMaterialImpl(const std::string &name, kvector_t magnetization)
Constructs basic material with name and magnetization.
bool isScalarMaterial() const final
Indicates whether the interaction with the material is scalar.
bool isMagneticMaterial() const final
Eigen::Matrix2cd polarizedSubtrSLD(const WavevectorInfo &wavevectors) const final
Returns ( - sld) matrix with magnetization corrections.
MagneticMaterialImpl * inverted() const final
Constructs a material with inverted magnetization.
MagneticMaterialImpl * rotatedMaterial(const Transform3D &transform) const final
kvector_t m_magnetization
magnetization
Vector transformations in three dimensions.
Definition: Transform3D.h:26
Holds all wavevector information relevant for calculating form factors.
QString const & name(EShape k)
Definition: particles.cpp:21