BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Abstract base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal. Provides position/rotation and form factor. Abundance is inherited from IParticle.
Definition at line 31 of file IParticle.h.
Public Member Functions | |
~IParticle () override | |
double | abundance () const |
void | checkNodeArgs () const |
Raises exception if a parameter value is invalid. More... | |
virtual std::string | className () const =0 |
Returns the class name, to be hard-coded in each leaf class that inherits from INode. More... | |
IParticle * | clone () const override=0 |
Returns a clone of this ISampleNode object. More... | |
std::vector< const Material * > | containedMaterials () const |
Returns set of unique materials contained in this ISampleNode. More... | |
virtual std::vector< std::unique_ptr< IParticle > > | decompose () const |
Decompose in constituent IParticle objects. More... | |
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... | |
virtual std::vector< ParaMeta > | parDefs () const |
Returns the parameter definitions, to be hard-coded in each leaf class. More... | |
R3 | particlePosition () const |
Returns particle position. More... | |
IParticle * | rotate (const IRotation &rotation) |
Rotates the particle, and returns this. More... | |
const IRotation * | rotation () const |
Returns rotation object. More... | |
void | setAbundance (double abundance) |
Sets particle abundance. More... | |
void | setParticlePosition (double x, double y, double z) |
Sets relative position of the particle's reference point in the coordinate system of parent. More... | |
void | setParticlePosition (R3 position) |
Sets relative position of the particle's reference point in the coordinate system of parent. More... | |
void | setRotation (const IRotation &rotation) |
Sets transformation. More... | |
virtual void | transferToCPP () |
Used for Python overriding of clone (see swig/tweaks.py) More... | |
IParticle * | translate (R3 translation) |
Translates the particle, and returns this. More... | |
Protected Attributes | |
double | m_abundance {1.0} |
std::vector< double > | m_P |
R3 | m_position |
std::unique_ptr< IRotation > | m_rotation |
|
overridedefault |
|
inline |
Definition at line 38 of file IParticle.h.
References m_abundance.
Referenced by SampleToPython::defineParticleLayouts(), and setAbundance().
|
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().
|
pure virtualinherited |
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Implemented in Particle, SphericalDetector, SpecularSimulation, ScatteringSimulation, OffspecSimulation, DepthProbeSimulation, PoissonBackground, ConstantBackground, GaussSphere, FuzzySphere, RotationEuler, RotationZ, RotationY, RotationX, IdentityRotation, ParticleCoreShell, ParticleComposition, MesoCrystal, Crystal, MultiLayer, Layer, Lattice3D, HexagonalLattice2D, SquareLattice2D, BasicLattice2D, LayerRoughness, LayerInterface, TruncatedSpheroid, TruncatedSphere, TruncatedCube, Spheroid, Sphere, SawtoothRippleLorentz, SawtoothRippleGauss, SawtoothRippleBox, Pyramid6, Pyramid4, Pyramid3, Pyramid2, Prism6, Prism3, PlatonicTetrahedron, PlatonicOctahedron, LongBoxLorentz, LongBoxGauss, Icosahedron, HorizontalCylinder, HollowSphere, HemiEllipsoid, EllipsoidalCylinder, Dodecahedron, Cylinder, CosineRippleLorentz, CosineRippleGauss, CosineRippleBox, Cone, CantellatedCube, Box, Bipyramid4, BarLorentz, BarGauss, Profile2DVoigt, Profile2DCone, Profile2DGate, Profile2DGauss, Profile2DCauchy, Profile1DVoigt, Profile1DCosine, Profile1DTriangle, Profile1DGate, Profile1DGauss, Profile1DCauchy, MisesGaussPeakShape, MisesFisherGaussPeakShape, LorentzFisherPeakShape, GaussFisherPeakShape, IsotropicLorentzPeakShape, IsotropicGaussPeakShape, ParticleLayout, InterferenceTwin, InterferenceRadialParaCrystal, InterferenceNone, InterferenceHardDisk, InterferenceFinite3DLattice, InterferenceFinite2DLattice, Interference3DLattice, Interference2DSuperLattice, Interference2DParaCrystal, Interference2DLattice, Interference1DLattice, DistributionTrapezoid, DistributionCosine, DistributionLogNormal, DistributionGaussian, DistributionLorentz, DistributionGate, ResolutionFunction2DGaussian, ConvolutionDetectorResolution, PolFilter, RectangularDetector, FootprintSquare, FootprintGauss, and Beam.
Referenced by INode::checkNodeArgs(), ExemplarySamples::createBasic2DParaCrystalWithFTDis(), IProfile1D::pythonConstructor(), IProfile2D::pythonConstructor(), IFormFactor::pythonConstructor(), and IFormFactor::shapeName().
|
overridepure virtual |
Returns a clone of this ISampleNode object.
Implements ISampleNode.
Implemented in ParticleCoreShell, ParticleComposition, Particle, and MesoCrystal.
Referenced by ParticleComposition::addParticle(), ParticleLayout::addParticle(), decompose(), and ParticleComposition::decompose().
|
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().
|
virtual |
Decompose in constituent IParticle objects.
Reimplemented in ParticleComposition.
Definition at line 52 of file IParticle.cpp.
References clone().
Referenced by Compute::Slicing::createParticleInSlice().
|
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.
Reimplemented in ParticleCoreShell, ParticleComposition, Particle, and MesoCrystal.
Definition at line 20 of file IParticle.cpp.
References m_rotation.
Referenced by MesoCrystal::nodeChildren(), Particle::nodeChildren(), ParticleComposition::nodeChildren(), and ParticleCoreShell::nodeChildren().
|
inherited |
Returns all descendants.
Definition at line 61 of file INode.cpp.
References INode::nodeChildren().
|
inlinevirtualinherited |
Returns the parameter definitions, to be hard-coded in each leaf class.
Reimplemented in ConstantBackground, GaussSphere, FuzzySphere, RotationEuler, RotationZ, RotationY, RotationX, Crystal, Layer, HexagonalLattice2D, SquareLattice2D, BasicLattice2D, LayerRoughness, TruncatedSpheroid, TruncatedSphere, TruncatedCube, Spheroid, Sphere, SawtoothRippleLorentz, SawtoothRippleGauss, SawtoothRippleBox, Pyramid6, Pyramid4, Pyramid3, Pyramid2, Prism6, Prism3, PlatonicTetrahedron, PlatonicOctahedron, LongBoxLorentz, LongBoxGauss, Icosahedron, HorizontalCylinder, HollowSphere, HemiEllipsoid, EllipsoidalCylinder, Dodecahedron, Cylinder, CosineRippleLorentz, CosineRippleGauss, CosineRippleBox, Cone, CantellatedCube, Box, Bipyramid4, BarLorentz, BarGauss, Profile2DVoigt, Profile2DCone, Profile2DGate, Profile2DGauss, Profile2DCauchy, Profile1DVoigt, Profile1DCosine, Profile1DTriangle, Profile1DGate, Profile1DGauss, Profile1DCauchy, MisesGaussPeakShape, MisesFisherGaussPeakShape, LorentzFisherPeakShape, GaussFisherPeakShape, IsotropicLorentzPeakShape, IsotropicGaussPeakShape, ParticleLayout, InterferenceTwin, InterferenceRadialParaCrystal, InterferenceHardDisk, Interference2DSuperLattice, Interference2DParaCrystal, Interference1DLattice, DistributionTrapezoid, DistributionCosine, DistributionLogNormal, DistributionGaussian, DistributionLorentz, DistributionGate, ResolutionFunction2DGaussian, PolFilter, FootprintSquare, and FootprintGauss.
Definition at line 51 of file INode.h.
Referenced by INode::checkNodeArgs(), and IFormFactor::pythonConstructor().
|
inline |
Returns particle position.
Definition at line 46 of file IParticle.h.
References m_position.
Referenced by ParticleComposition::decompose().
Rotates the particle, and returns this.
Definition at line 41 of file IParticle.cpp.
References IRotation::clone(), createProduct(), m_position, m_rotation, rotation(), and IRotation::transformed().
Referenced by ExemplarySamples::createBoxCompositionRotateZandY(), ExemplarySamples::createCoreShellBoxRotateZandY(), ExemplarySamples::createLayersWithAbsorptionBySLD(), ExemplarySamples::createLayersWithAbsorptionWithFF(), ExemplarySamples::createMagneticRotation(), ExemplarySamples::createRotatedPyramids(), ExemplarySamples::createTransformBox(), and ParticleComposition::decompose().
const IRotation * IParticle::rotation | ( | ) | const |
Returns rotation object.
Definition at line 31 of file IParticle.cpp.
References m_rotation.
Referenced by Particle::Particle(), ParticleComposition::decompose(), rotate(), and setRotation().
|
inline |
Sets particle abundance.
abundance | proportion of this type of particles normalized to the total number of particles in the layout. |
Definition at line 43 of file IParticle.h.
References abundance(), and m_abundance.
Referenced by ParticleLayout::addParticle().
|
inline |
Sets relative position of the particle's reference point in the coordinate system of parent.
x | x-coordinate in nanometers |
y | y-coordinate in nanometers |
z | z-coordinate in nanometers |
Definition at line 58 of file IParticle.h.
References m_position.
|
inline |
Sets relative position of the particle's reference point in the coordinate system of parent.
position | relative position vector (components are in nanometers) |
Definition at line 51 of file IParticle.h.
References m_position.
Referenced by ExemplarySamples::createBoxCompositionRotateX(), ExemplarySamples::createBoxCompositionRotateY(), ExemplarySamples::createBoxCompositionRotateZ(), ExemplarySamples::createBoxCompositionRotateZandY(), ExemplarySamples::createBoxStackComposition(), ExemplarySamples::createCoreShellBoxRotateZandY(), ExemplarySamples::createCustomMorphology(), ExemplarySamples::createLayersWithAbsorptionBySLD(), ExemplarySamples::createLayersWithAbsorptionWithFF(), ExemplarySamples::createRotatedSquareLattice2D(), ExemplarySamples::createSlicedComposition(), and ExemplarySamples::createTransformBox().
void IParticle::setRotation | ( | const IRotation & | rotation | ) |
Sets transformation.
Definition at line 36 of file IParticle.cpp.
References IRotation::clone(), m_rotation, and rotation().
Referenced by Particle::Particle(), ExemplarySamples::createBoxCompositionRotateX(), ExemplarySamples::createBoxCompositionRotateY(), ExemplarySamples::createBoxCompositionRotateZ(), ExemplarySamples::createBoxCompositionRotateZandY(), ExemplarySamples::createBoxStackComposition(), ExemplarySamples::createCoreShellBoxRotateZandY(), ExemplarySamples::createLayersWithAbsorptionBySLD(), ExemplarySamples::createLayersWithAbsorptionWithFF(), ExemplarySamples::createSlicedComposition(), and ExemplarySamples::createTransformBox().
|
inlinevirtualinherited |
Used for Python overriding of clone (see swig/tweaks.py)
Definition at line 32 of file ICloneable.h.
IParticle * IParticle::translate | ( | R3 | translation | ) |
Translates the particle, and returns this.
Definition at line 25 of file IParticle.cpp.
References m_position.
Referenced by ParticleComposition::addParticle(), ExemplarySamples::createMagneticRotation(), ExemplarySamples::createMagneticSpheres(), ExemplarySamples::createMagneticSubstrateZeroField(), ExemplarySamples::createSuperLattice(), and ParticleComposition::decompose().
|
protected |
Definition at line 78 of file IParticle.h.
Referenced by abundance(), MesoCrystal::clone(), Particle::clone(), ParticleComposition::clone(), ParticleCoreShell::clone(), and setAbundance().
|
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().
|
protected |
Definition at line 79 of file IParticle.h.
Referenced by MesoCrystal::clone(), Particle::clone(), ParticleComposition::clone(), ParticleCoreShell::clone(), particlePosition(), rotate(), setParticlePosition(), and translate().
|
protected |
Definition at line 80 of file IParticle.h.
Referenced by MesoCrystal::clone(), Particle::clone(), ParticleComposition::clone(), ParticleCoreShell::clone(), nodeChildren(), rotate(), rotation(), and setRotation().