BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
A particle with a form factor and refractive index.
Definition at line 25 of file Particle.h.
Public Member Functions | |
Particle (Material material, const IFormFactor &formfactor) | |
Particle (Material material, const IFormFactor &formfactor, const IRotation &rotation) | |
~Particle () override | |
double | abundance () const |
void | checkNodeArgs () const |
Raises exception if a parameter value is invalid. More... | |
std::string | className () const override |
Returns the class name, to be hard-coded in each leaf class that inherits from INode. More... | |
Particle * | 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... | |
virtual std::vector< std::unique_ptr< IParticle > > | decompose () const |
Decompose in constituent IParticle objects. More... | |
const IFormFactor * | formfactor_at_bottom () const |
bool | isMagnetic () const |
Returns true if there is any magnetic material in this ISampleNode. More... | |
const Material * | material () const override |
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 |
Private Attributes | |
std::unique_ptr< const IFormFactor > | m_formfactor |
const Material | m_material |
Particle::Particle | ( | Material | material, |
const IFormFactor & | formfactor | ||
) |
Definition at line 20 of file Particle.cpp.
Referenced by clone().
Particle::Particle | ( | Material | material, |
const IFormFactor & | formfactor, | ||
const IRotation & | rotation | ||
) |
Definition at line 26 of file Particle.cpp.
References IParticle::rotation(), and IParticle::setRotation().
|
overridedefault |
|
inlineinherited |
Definition at line 38 of file IParticle.h.
References IParticle::m_abundance.
Referenced by SampleToPython::defineParticleLayouts(), and IParticle::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().
|
inlineoverridevirtual |
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Implements INode.
Definition at line 32 of file Particle.h.
|
overridevirtual |
Returns a clone of this ISampleNode object.
Implements IParticle.
Definition at line 34 of file Particle.cpp.
References Particle(), ASSERT, IParticle::m_abundance, m_formfactor, m_material, IParticle::m_position, and IParticle::m_rotation.
Referenced by ParticleCoreShell::ParticleCoreShell(), and Compute::Slicing::createParticleInSlice().
|
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().
|
virtualinherited |
Decompose in constituent IParticle objects.
Reimplemented in ParticleComposition.
Definition at line 52 of file IParticle.cpp.
References IParticle::clone().
Referenced by Compute::Slicing::createParticleInSlice().
|
inline |
|
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().
|
inlineoverridevirtual |
Returns nullptr, unless overwritten to return a specific material.
Reimplemented from ISampleNode.
Definition at line 35 of file Particle.h.
References m_material.
|
overridevirtual |
Returns all children.
Reimplemented from IParticle.
Definition at line 46 of file Particle.cpp.
References m_formfactor, and IParticle::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().
|
inlineinherited |
Returns particle position.
Definition at line 46 of file IParticle.h.
References IParticle::m_position.
Referenced by ParticleComposition::decompose().
Rotates the particle, and returns this.
Definition at line 41 of file IParticle.cpp.
References IRotation::clone(), createProduct(), IParticle::m_position, IParticle::m_rotation, IParticle::rotation(), and IRotation::transformed().
Referenced by ExemplarySamples::createBoxCompositionRotateZandY(), ExemplarySamples::createCoreShellBoxRotateZandY(), ExemplarySamples::createLayersWithAbsorptionBySLD(), ExemplarySamples::createLayersWithAbsorptionWithFF(), ExemplarySamples::createMagneticRotation(), ExemplarySamples::createRotatedPyramids(), ExemplarySamples::createTransformBox(), and ParticleComposition::decompose().
|
inherited |
Returns rotation object.
Definition at line 31 of file IParticle.cpp.
References IParticle::m_rotation.
Referenced by Particle(), ParticleComposition::decompose(), IParticle::rotate(), and IParticle::setRotation().
|
inlineinherited |
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 IParticle::abundance(), and IParticle::m_abundance.
Referenced by ParticleLayout::addParticle().
|
inlineinherited |
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 IParticle::m_position.
|
inlineinherited |
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 IParticle::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().
|
inherited |
Sets transformation.
Definition at line 36 of file IParticle.cpp.
References IRotation::clone(), IParticle::m_rotation, and IParticle::rotation().
Referenced by 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.
|
inherited |
Translates the particle, and returns this.
Definition at line 25 of file IParticle.cpp.
References IParticle::m_position.
Referenced by ParticleComposition::addParticle(), ExemplarySamples::createMagneticRotation(), ExemplarySamples::createMagneticSpheres(), ExemplarySamples::createMagneticSubstrateZeroField(), ExemplarySamples::createSuperLattice(), and ParticleComposition::decompose().
|
protectedinherited |
Definition at line 78 of file IParticle.h.
Referenced by IParticle::abundance(), MesoCrystal::clone(), clone(), ParticleComposition::clone(), ParticleCoreShell::clone(), and IParticle::setAbundance().
|
private |
Definition at line 41 of file Particle.h.
Referenced by clone(), formfactor_at_bottom(), and nodeChildren().
|
private |
Definition at line 40 of file Particle.h.
Referenced by clone(), and material().
|
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().
|
protectedinherited |
Definition at line 79 of file IParticle.h.
Referenced by MesoCrystal::clone(), clone(), ParticleComposition::clone(), ParticleCoreShell::clone(), IParticle::particlePosition(), IParticle::rotate(), IParticle::setParticlePosition(), and IParticle::translate().
|
protectedinherited |
Definition at line 80 of file IParticle.h.
Referenced by MesoCrystal::clone(), clone(), ParticleComposition::clone(), ParticleCoreShell::clone(), IParticle::nodeChildren(), IParticle::rotate(), IParticle::rotation(), and IParticle::setRotation().