BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
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 RotMatrix;
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, R3 magnetization);
37 
38  ~MagneticMaterialImpl() override = 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 override;
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 override;
49 
50  bool isMagneticMaterial() const override;
51 
52  //! Returns the magnetization (in A/m)
53  R3 magnetization() const override;
54 
55  //! Returns (\f$ \pi/\lambda^2 \f$ - sld) matrix with magnetization corrections
56  SpinMatrix polarizedSubtrSLD(const WavevectorInfo& wavevectors) const override;
57 
58  MagneticMaterialImpl* rotatedMaterial(const RotMatrix& transform) const override;
59 
60 private:
62 
63  R3 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. Inherited by MagneticMaterialImpl, which has further c...
Basic implementation for magnetized material. Inherited by RefractiveMaterialImpl and MaterialBySLDIm...
bool isScalarMaterial() const override
Indicates whether the interaction with the material is scalar. This means that different polarization...
bool isMagneticMaterial() const override
MagneticMaterialImpl * clone() const override=0
Returns pointer to a copy of material.
~MagneticMaterialImpl() override=default
R3 m_magnetization
magnetization
void setMagnetization(R3 magnetization)
MagneticMaterialImpl * rotatedMaterial(const RotMatrix &transform) const override
MagneticMaterialImpl(const std::string &name, R3 magnetization)
Constructs basic material with name and magnetization.
R3 magnetization() const override
Returns the magnetization (in A/m)
SpinMatrix polarizedSubtrSLD(const WavevectorInfo &wavevectors) const override
Returns ( - sld) matrix with magnetization corrections.
MagneticMaterialImpl * inverted() const override
Constructs a material with inverted magnetization.
Rotation matrix in three dimensions. Represents group SO(3). Internal parameterization based on quate...
Definition: RotMatrix.h:25
Holds all wavevector information relevant for calculating form factors.