BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
IReParticle.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Resample/Particle/IReParticle.cpp
6 //! @brief Implements interface class IReParticle.
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 
16 #include "Base/Spin/SpinMatrix.h"
18 #include <memory>
19 
21 {
22  // Throws to prevent unanticipated behaviour
23  throw std::runtime_error("IReParticle::evaluatePol: is not implemented by default");
24 }
25 
26 double IReParticle::volume() const
27 {
28  auto zero_wavevectors = WavevectorInfo::makeZeroQ();
29  return std::abs(theFF(zero_wavevectors));
30 }
Defines and implements interface IReParticle.
Defines class SpinMatrix.
Defines WavevectorInfo.
virtual SpinMatrix thePolFF(const WavevectorInfo &wavevectors) const
Returns scattering amplitude for matrix interactions.
Definition: IReParticle.cpp:20
virtual complex_t theFF(const WavevectorInfo &wavevectors) const =0
Returns scattering amplitude for complex wavevectors ki, kf.
virtual double volume() const
Returns the total volume of the particle of this form factor's shape.
Definition: IReParticle.cpp:26
Holds all wavevector information relevant for calculating form factors.
static WavevectorInfo makeZeroQ()