BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
MesoCrystal.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Particle/MesoCrystal.cpp
6 //! @brief Implements class MesoCrystal.
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/Util/Assert.h"
20 
22  : m_crystal(crystal)
23  , m_meso_formfactor(formfactor)
24 {
25 }
26 
27 MesoCrystal::MesoCrystal(const Crystal& crystal, const IFormFactor& formfactor)
28  : MesoCrystal(crystal.clone(), formfactor.clone())
29 {
30 }
31 
32 MesoCrystal::~MesoCrystal() = default;
33 
35 {
36  auto* result = new MesoCrystal(m_crystal->clone(), m_meso_formfactor->clone());
37  result->setAbundance(m_abundance);
38  if (m_rotation)
39  result->setRotation(*m_rotation);
40  result->setParticlePosition(m_position);
41  return result;
42 }
43 
44 std::vector<const INode*> MesoCrystal::nodeChildren() const
45 {
46  return std::vector<const INode*>()
48 }
49 
51 {
53  return *m_crystal;
54 }
Defines the macro ASSERT.
#define ASSERT(condition)
Definition: Assert.h:45
Defines class Crystal.
Defines interface IDecoratableBorn.
Defines class MesoCrystal.
Defines IRotation classes.
A crystal structure, defined by a Bravais lattice, a basis, and a position variance.
Definition: Crystal.h:34
Abstract base class for Born form factors.
Definition: IFormFactor.h:36
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 crystalline inner structure, made of smaller particles, and an outer shape describe...
Definition: MesoCrystal.h:27
~MesoCrystal() override
const Crystal & particleStructure() const
Definition: MesoCrystal.cpp:50
const std::unique_ptr< IFormFactor > m_meso_formfactor
Outer shape of the mesocrystal.
Definition: MesoCrystal.h:44
std::vector< const INode * > nodeChildren() const override
Returns all children.
Definition: MesoCrystal.cpp:44
MesoCrystal * clone() const override
Returns a clone of this ISampleNode object.
Definition: MesoCrystal.cpp:34
const std::unique_ptr< Crystal > m_crystal
Crystalline inner structure.
Definition: MesoCrystal.h:43
MesoCrystal(const Crystal &crystal, const IFormFactor &formfactor)
Definition: MesoCrystal.cpp:27