BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorCoreShell.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Particle/FormFactorCoreShell.cpp
6 //! @brief Implements class FormFactorCoreShell.
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 
18  : m_core(core), m_shell(shell)
19 {
20  setName("FormFactorCoreShell");
21 }
22 
24 
26 {
27  return new FormFactorCoreShell(m_core->clone(), m_shell->clone());
28 }
29 
31 {
32  return m_shell->radialExtension();
33 }
34 
35 double FormFactorCoreShell::bottomZ(const IRotation& rotation) const
36 {
37  return m_shell->bottomZ(rotation);
38 }
39 
40 double FormFactorCoreShell::topZ(const IRotation& rotation) const
41 {
42  return m_shell->topZ(rotation);
43 }
44 
46 {
47  m_shell->setAmbientMaterial(material);
48 }
49 
51 {
52  return m_shell->evaluate(wavevectors) + m_core->evaluate(wavevectors);
53 }
54 
55 Eigen::Matrix2cd FormFactorCoreShell::evaluatePol(const WavevectorInfo& wavevectors) const
56 {
57  return m_shell->evaluatePol(wavevectors) + m_core->evaluatePol(wavevectors);
58 }
std::complex< double > complex_t
Definition: Complex.h:20
Defines class FormFactorCoreShell.
Form Factor for a core shell particle.
complex_t evaluate(const WavevectorInfo &wavevectors) const override
Returns scattering amplitude for complex wavevectors ki, kf.
Eigen::Matrix2cd evaluatePol(const WavevectorInfo &wavevectors) const override
Calculates and returns a polarized form factor calculation in DWBA.
std::unique_ptr< IFormFactor > m_shell
~FormFactorCoreShell() override
void setAmbientMaterial(const Material &material) override
Passes the material in which this particle is embedded.
std::unique_ptr< IFormFactor > m_core
FormFactorCoreShell * clone() const override
Returns a clone of this ISampleNode object.
FormFactorCoreShell(IFormFactor *core, IFormFactor *shell)
double topZ(const IRotation &rotation) const override
Returns the z-coordinate of the lowest point in this shape after a given rotation.
double radialExtension() const override
Returns the (approximate in some cases) radial size of the particle of this form factor's shape.
double bottomZ(const IRotation &rotation) const override
Returns the z-coordinate of the lowest point in this shape after a given rotation.
Abstract base class for all form factors.
Definition: IFormFactor.h:36
void setName(const std::string &name)
Abstract base class for rotations.
Definition: Rotations.h:28
virtual const Material * material() const
Returns nullptr, unless overwritten to return a specific material.
Definition: ISampleNode.h:37
A wrapper for underlying material implementation.
Definition: Material.h:29
Holds all wavevector information relevant for calculating form factors.