BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ParticleCoreShell.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Particle/ParticleCoreShell.h
6 //! @brief Defines 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 
15 #ifndef BORNAGAIN_SAMPLE_PARTICLE_PARTICLECORESHELL_H
16 #define BORNAGAIN_SAMPLE_PARTICLE_PARTICLECORESHELL_H
17 
19 
20 class Particle;
21 
22 //! A particle with a core/shell geometry.
23 //! @ingroup samples
24 
25 class ParticleCoreShell : public IParticle {
26 public:
27  ParticleCoreShell(const Particle& shell, const Particle& core,
28  R3 relative_core_position = R3(0.0, 0.0, 0.0));
29  ~ParticleCoreShell() override;
30 
31  ParticleCoreShell* clone() const override;
32  std::string className() const final { return "ParticleCoreShell"; }
33  std::vector<const INode*> nodeChildren() const override;
34 
35  const Particle* shellParticle() const { return m_shell.get(); }
36  const Particle* coreParticle() const { return m_core.get(); }
37 
38 protected:
39  std::unique_ptr<Particle> m_shell;
40  std::unique_ptr<Particle> m_core;
41 };
42 
43 #endif // BORNAGAIN_SAMPLE_PARTICLE_PARTICLECORESHELL_H
Defines interface IParticle.
Abstract base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal....
Definition: IParticle.h:31
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))
const Particle * coreParticle() const
ParticleCoreShell * clone() const override
Returns a clone of this ISampleNode object.
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
const Particle * shellParticle() const
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