BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ParticleCoreShell.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Particle/ParticleCoreShell.cpp
6 //! @brief Implements class ParticleCoreShell.
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 
17 #include "Base/Util/Assert.h"
20 #include <memory>
21 
23  R3 relative_core_position)
24 {
25  m_core.reset(core.clone());
26  m_core->translate(relative_core_position);
27  m_shell.reset(shell.clone());
28 }
29 
31 
33 {
34  auto* p_result = new ParticleCoreShell(*m_shell, *m_core);
35  p_result->setAbundance(m_abundance);
36  if (m_rotation)
37  p_result->setRotation(*m_rotation);
38  p_result->setParticlePosition(m_position);
39  return p_result;
40 }
41 
42 std::vector<const INode*> ParticleCoreShell::nodeChildren() const
43 {
44  return std::vector<const INode*>() << IParticle::nodeChildren() << m_core << m_shell;
45 }
Defines the macro ASSERT.
Defines ParticleCoreShell.
Defines class Particle.
Defines IRotation classes.
R3 m_position
Definition: IParticle.h:79
double m_abundance
Definition: IParticle.h:78
std::vector< const INode * > nodeChildren() const override
Returns all children.
Definition: IParticle.cpp:20
std::unique_ptr< IRotation > m_rotation
Definition: IParticle.h:80
A particle with a core/shell geometry.
std::unique_ptr< Particle > m_shell
std::unique_ptr< Particle > m_core
ParticleCoreShell(const Particle &shell, const Particle &core, R3 relative_core_position=R3(0.0, 0.0, 0.0))
ParticleCoreShell * clone() const override
Returns a clone of this ISampleNode object.
std::vector< const INode * > nodeChildren() const override
Returns all children.
~ParticleCoreShell() override
A particle with a form factor and refractive index.
Definition: Particle.h:25
Particle * clone() const override
Returns a clone of this ISampleNode object.
Definition: Particle.cpp:34