BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Decorator class that adds particles to ISampleNode objects.
Definition at line 28 of file ParticleLayout.h.
Public Member Functions | |
ParticleLayout () | |
ParticleLayout (const IParticle &particle, double abundance=-1.0) | |
~ParticleLayout () override | |
void | addParticle (const IParticle &particle, double abundance=-1.0) |
Adds particle to the layout with abundance, position and the rotation defined. More... | |
void | checkNodeArgs () const |
Raises exception if a parameter value is invalid. More... | |
std::string | className () const final |
Returns the class name, to be hard-coded in each leaf class that inherits from INode. More... | |
ParticleLayout * | clone () const override |
Returns a clone of this ISampleNode object. More... | |
std::vector< const Material * > | containedMaterials () const |
Returns set of unique materials contained in this ISampleNode. More... | |
const IInterference * | interferenceFunction () const |
bool | isMagnetic () const |
Returns true if there is any magnetic material in this ISampleNode. More... | |
virtual const Material * | material () const |
Returns nullptr, unless overwritten to return a specific material. More... | |
std::vector< const INode * > | nodeChildren () const override |
Returns all children. More... | |
std::vector< const INode * > | nodeOffspring () const |
Returns all descendants. More... | |
std::vector< ParaMeta > | parDefs () const final |
Returns the parameter definitions, to be hard-coded in each leaf class. More... | |
std::vector< const IParticle * > | particles () const |
void | setInterference (const IInterference &interparticle) |
Adds interference functions. More... | |
void | setTotalParticleSurfaceDensity (double particle_density) |
Sets total particle surface density. More... | |
void | setWeight (double weight) |
Sets the relative weight of this layout. More... | |
double | totalAbundance () const |
double | totalParticleSurfaceDensity () const |
virtual void | transferToCPP () |
Used for Python overriding of clone (see swig/tweaks.py) More... | |
double | weight () const |
Returns the relative weight of this layout. More... | |
double | weightedParticleSurfaceDensity () const |
Protected Attributes | |
std::vector< double > | m_P |
Private Member Functions | |
void | addAndRegisterAbstractParticle (IParticle *child) |
Adds particle information with simultaneous registration in parent class. More... | |
void | setAndRegisterInterference (IInterference *child) |
Sets interference function with simultaneous registration in parent class. More... | |
Private Attributes | |
std::unique_ptr< IInterference > | m_interparticle |
OwningVector< IParticle > | m_particles |
Vector of particle types. More... | |
double | m_total_particle_density {.01} |
double | m_weight {1} |
|
default |
Referenced by clone().
ParticleLayout::ParticleLayout | ( | const IParticle & | particle, |
double | abundance = -1.0 |
||
) |
Definition at line 21 of file ParticleLayout.cpp.
References addParticle().
|
overridedefault |
|
private |
Adds particle information with simultaneous registration in parent class.
Definition at line 110 of file ParticleLayout.cpp.
References OwningVector< T >::emplace_back(), and m_particles.
Referenced by addParticle().
void ParticleLayout::addParticle | ( | const IParticle & | particle, |
double | abundance = -1.0 |
||
) |
Adds particle to the layout with abundance, position and the rotation defined.
particle | to be added |
abundance | Particle abundance |
Definition at line 56 of file ParticleLayout.cpp.
References addAndRegisterAbstractParticle(), IParticle::clone(), and IParticle::setAbundance().
Referenced by ParticleLayout(), ExemplarySamples::createBasic2DLattice(), ExemplarySamples::createBoxesSquareLattice2D(), ExemplarySamples::createCenteredSquareLattice2D(), ExemplarySamples::createCoreShellBoxRotateZandY(), ExemplarySamples::createCosineRipple(), ExemplarySamples::createCustomMorphology(), ExemplarySamples::createCylindersAndPrisms(), ExemplarySamples::createFiniteSquareLattice2D(), ExemplarySamples::createLayersWithAbsorptionBySLD(), ExemplarySamples::createLayersWithAbsorptionWithFF(), ExemplarySamples::createMagneticLayer(), ExemplarySamples::createMagneticRotation(), ExemplarySamples::createMagneticSpheres(), ExemplarySamples::createMagneticSubstrateZeroField(), ExemplarySamples::createMesoCrystal(), ExemplarySamples::createMultipleLayout(), ExemplarySamples::createParticleComposition(), ExemplarySamples::createRotatedPyramids(), ExemplarySamples::createRotatedSquareLattice2D(), ExemplarySamples::createSizeDistributionDAModel(), ExemplarySamples::createSizeDistributionLMAModel(), ExemplarySamples::createSizeDistributionSSCAModel(), ExemplarySamples::createSlicedComposition(), ExemplarySamples::createSquareLattice2D(), ExemplarySamples::createSuperLattice(), ExemplarySamples::createTransformBox(), and ExemplarySamples::createTriangularRipple().
|
inherited |
Raises exception if a parameter value is invalid.
Definition at line 27 of file INode.cpp.
References ASSERT, RealLimits::check(), INode::className(), INF, RealLimits::limited(), RealLimits::limitless(), INode::m_P, ParaMeta::name, RealLimits::nonnegative(), INode::parDefs(), ParaMeta::vMax, and ParaMeta::vMin.
Referenced by BarGauss::BarGauss(), BarLorentz::BarLorentz(), Bipyramid4::Bipyramid4(), Box::Box(), CantellatedCube::CantellatedCube(), Cone::Cone(), ConstantBackground::ConstantBackground(), CosineRippleBox::CosineRippleBox(), CosineRippleGauss::CosineRippleGauss(), CosineRippleLorentz::CosineRippleLorentz(), Cylinder::Cylinder(), DistributionCosine::DistributionCosine(), DistributionGate::DistributionGate(), DistributionGaussian::DistributionGaussian(), DistributionLogNormal::DistributionLogNormal(), DistributionLorentz::DistributionLorentz(), DistributionTrapezoid::DistributionTrapezoid(), Dodecahedron::Dodecahedron(), EllipsoidalCylinder::EllipsoidalCylinder(), FootprintGauss::FootprintGauss(), FootprintSquare::FootprintSquare(), FuzzySphere::FuzzySphere(), GaussSphere::GaussSphere(), HemiEllipsoid::HemiEllipsoid(), HollowSphere::HollowSphere(), HorizontalCylinder::HorizontalCylinder(), Icosahedron::Icosahedron(), LongBoxGauss::LongBoxGauss(), LongBoxLorentz::LongBoxLorentz(), PlatonicOctahedron::PlatonicOctahedron(), PlatonicTetrahedron::PlatonicTetrahedron(), Prism3::Prism3(), Prism6::Prism6(), Profile1DCauchy::Profile1DCauchy(), Profile1DCosine::Profile1DCosine(), Profile1DGate::Profile1DGate(), Profile1DGauss::Profile1DGauss(), Profile1DTriangle::Profile1DTriangle(), Profile1DVoigt::Profile1DVoigt(), Profile2DCauchy::Profile2DCauchy(), Profile2DCone::Profile2DCone(), Profile2DGate::Profile2DGate(), Profile2DGauss::Profile2DGauss(), Profile2DVoigt::Profile2DVoigt(), Pyramid2::Pyramid2(), Pyramid3::Pyramid3(), Pyramid4::Pyramid4(), Pyramid6::Pyramid6(), RotationEuler::RotationEuler(), RotationX::RotationX(), RotationY::RotationY(), RotationZ::RotationZ(), SawtoothRippleBox::SawtoothRippleBox(), SawtoothRippleGauss::SawtoothRippleGauss(), SawtoothRippleLorentz::SawtoothRippleLorentz(), Sphere::Sphere(), Spheroid::Spheroid(), TruncatedCube::TruncatedCube(), TruncatedSphere::TruncatedSphere(), and TruncatedSpheroid::TruncatedSpheroid().
|
inlinefinalvirtual |
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Implements INode.
Definition at line 35 of file ParticleLayout.h.
|
overridevirtual |
Returns a clone of this ISampleNode object.
Implements ISampleNode.
Definition at line 28 of file ParticleLayout.cpp.
References ParticleLayout(), m_interparticle, m_particles, totalParticleSurfaceDensity(), and weight().
Referenced by Layer::addLayout().
|
inherited |
Returns set of unique materials contained in this ISampleNode.
Definition at line 25 of file ISampleNode.cpp.
References ISampleNode::material(), and INode::nodeChildren().
Referenced by SampleUtils::Multilayer::ContainsCompatibleMaterials(), SampleToPython::initLabels(), and ISampleNode::isMagnetic().
const IInterference * ParticleLayout::interferenceFunction | ( | ) | const |
Definition at line 72 of file ParticleLayout.cpp.
References m_interparticle.
|
inherited |
Returns true if there is any magnetic material in this ISampleNode.
Definition at line 39 of file ISampleNode.cpp.
References ISampleNode::containedMaterials().
Referenced by reSample::make().
|
inlinevirtualinherited |
Returns nullptr, unless overwritten to return a specific material.
Reimplemented in Particle, and Layer.
Definition at line 36 of file ISampleNode.h.
Referenced by ISampleNode::containedMaterials().
|
overridevirtual |
Returns all children.
Reimplemented from INode.
Definition at line 44 of file ParticleLayout.cpp.
References m_interparticle, and m_particles.
|
inherited |
Returns all descendants.
Definition at line 61 of file INode.cpp.
References INode::nodeChildren().
|
inlinefinalvirtual |
Returns the parameter definitions, to be hard-coded in each leaf class.
Reimplemented from INode.
Definition at line 36 of file ParticleLayout.h.
References INF.
std::vector< const IParticle * > ParticleLayout::particles | ( | ) | const |
|
private |
Sets interference function with simultaneous registration in parent class.
Definition at line 116 of file ParticleLayout.cpp.
References m_interparticle.
Referenced by setInterference().
void ParticleLayout::setInterference | ( | const IInterference & | interparticle | ) |
Adds interference functions.
Definition at line 86 of file ParticleLayout.cpp.
References IInterference::clone(), and setAndRegisterInterference().
Referenced by ExemplarySamples::createBasic2DLattice(), ExemplarySamples::createBasic2DParaCrystalWithFTDis(), ExemplarySamples::createBoxesSquareLattice2D(), ExemplarySamples::createCenteredSquareLattice2D(), ExemplarySamples::createCosineRipple(), ExemplarySamples::createFiniteSquareLattice2D(), ExemplarySamples::createHardDisk(), ExemplarySamples::createHexParaCrystal(), ExemplarySamples::createLattice1D(), ExemplarySamples::createParticleComposition(), ExemplarySamples::createRadialParaCrystal(), ExemplarySamples::createRectParaCrystal(), ExemplarySamples::createRotatedSquareLattice2D(), ExemplarySamples::createSizeDistributionDAModel(), ExemplarySamples::createSizeDistributionLMAModel(), ExemplarySamples::createSizeDistributionSSCAModel(), ExemplarySamples::createSquareLattice2D(), ExemplarySamples::createSuperLattice(), and ExemplarySamples::createTriangularRipple().
void ParticleLayout::setTotalParticleSurfaceDensity | ( | double | particle_density | ) |
Sets total particle surface density.
particle_density | number of particles per square nanometer |
Definition at line 104 of file ParticleLayout.cpp.
References m_total_particle_density.
Referenced by ExemplarySamples::createSuperLattice().
|
inline |
Sets the relative weight of this layout.
Definition at line 59 of file ParticleLayout.h.
References m_weight, and weight().
double ParticleLayout::totalAbundance | ( | ) | const |
double ParticleLayout::totalParticleSurfaceDensity | ( | ) | const |
Definition at line 91 of file ParticleLayout.cpp.
References m_interparticle, and m_total_particle_density.
Referenced by clone(), ExemplarySamples::createAveragedSlicedCylinders(), and weightedParticleSurfaceDensity().
|
inlinevirtualinherited |
Used for Python overriding of clone (see swig/tweaks.py)
Definition at line 32 of file ICloneable.h.
|
inline |
Returns the relative weight of this layout.
Definition at line 56 of file ParticleLayout.h.
References m_weight.
Referenced by clone(), setWeight(), and weightedParticleSurfaceDensity().
double ParticleLayout::weightedParticleSurfaceDensity | ( | ) | const |
Definition at line 97 of file ParticleLayout.cpp.
References totalParticleSurfaceDensity(), and weight().
|
private |
Definition at line 70 of file ParticleLayout.h.
Referenced by clone(), interferenceFunction(), nodeChildren(), setAndRegisterInterference(), and totalParticleSurfaceDensity().
|
protectedinherited |
Definition at line 63 of file INode.h.
Referenced by IFootprintFactor::IFootprintFactor(), INode::checkNodeArgs(), IProfile1D::pythonConstructor(), IProfile2D::pythonConstructor(), IFormFactor::pythonConstructor(), Profile1DVoigt::pythonConstructor(), and Profile2DVoigt::pythonConstructor().
|
private |
Vector of particle types.
Definition at line 69 of file ParticleLayout.h.
Referenced by addAndRegisterAbstractParticle(), clone(), nodeChildren(), particles(), and totalAbundance().
|
private |
Definition at line 68 of file ParticleLayout.h.
Referenced by setTotalParticleSurfaceDensity(), and totalParticleSurfaceDensity().
|
private |
Definition at line 67 of file ParticleLayout.h.
Referenced by setWeight(), and weight().