26 constexpr 
double magnetization_prefactor = (
gamma_n * 
r_e / 2.0 / 
mu_B) * 1e-18;
 
   32     if (base.
mag2() == 0.0)
 
   35     return vector.
complex() - projection;
 
   57 bool MagneticMaterialImpl::isMagneticMaterial()
 const 
   64     return m_magnetization;
 
   69     cvector_t mag_ortho = OrthogonalToBaseVector(wavevectors.getQ(), m_magnetization);
 
   71     return MaterialUtils::MagnetizationCorrection(unit_factor, magnetization_prefactor, mag_ortho);
 
   78     result->setMagnetization(transformed_field);
 
Defines magnetic material base implementation.
 
Declares functions in namespace MaterialUtils.
 
Defines the values of physical constants (SI)
 
constexpr double mu_B
Bohr magneton ( ), J/T.
 
constexpr double r_e
Thomson scattering length ( ), m.
 
constexpr double gamma_n
factor for neutron magnetic moment,
 
Interface for material implementation classes.
 
const std::string & getName() const
Returns name of the material.
 
virtual complex_t scalarSubtrSLD(const WavevectorInfo &wavevectors) const =0
Returns (  - sld), sld being the scattering length density.
 
double mag2() const
Returns magnitude squared of the vector.
 
auto dot(const BasicVector3D< U > &v) const
Returns dot product of vectors (antilinear in the first [=self] argument).
 
BasicVector3D< std::complex< double > > complex() const
Returns this, trivially converted to complex type.
 
Basic implementation for magnetized material.
 
MagneticMaterialImpl * clone() const override=0
Returns pointer to a copy of material.
 
MagneticMaterialImpl(const std::string &name, kvector_t magnetization)
Constructs basic material with name and magnetization.
 
MagneticMaterialImpl * inverted() const override final
Constructs a material with inverted magnetization.
 
kvector_t magnetization() const override final
Returns the magnetization (in A/m)
 
bool isScalarMaterial() const override final
Indicates whether the interaction with the material is scalar.
 
Eigen::Matrix2cd polarizedSubtrSLD(const WavevectorInfo &wavevectors) const override final
Returns (  - sld) matrix with magnetization corrections.
 
Holds all wavevector information relevant for calculating form factors.