BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Lattice3D Class Reference

A Bravais lattice, characterized by three basis vectors, and optionally an ISelectionRule. More...

Inheritance diagram for Lattice3D:
[legend]
Collaboration diagram for Lattice3D:
[legend]

Public Member Functions

 Lattice3D ()=delete
 
 Lattice3D (const kvector_t a, const kvector_t b, const kvector_t c)
 
 Lattice3D (const Lattice3D &lattice)
 
 ~Lattice3D () override
 
void accept (INodeVisitor *visitor) const override
 Calls the INodeVisitor's visit method. More...
 
int copyNumber (const INode *node) const
 Returns copyNumber of child, which takes into account existence of children with same name. More...
 
ParameterPoolcreateParameterTree () const
 Creates new parameter pool, with all local parameters and those of its children. More...
 
std::string displayName () const
 Returns display name, composed from the name of node and it's copy number. More...
 
kvector_t getBasisVectorA () const
 Returns basis vector a. More...
 
kvector_t getBasisVectorB () const
 Returns basis vector b. More...
 
kvector_t getBasisVectorC () const
 Returns basis vector c. More...
 
virtual std::vector< const INode * > getChildren () const
 Returns a vector of children. More...
 
kvector_t getMillerDirection (double h, double k, double l) const
 Returns normalized direction corresponding to the given Miller indices. More...
 
const std::string & getName () const
 
ivector_t getNearestReciprocalLatticeVectorCoordinates (const kvector_t q) const
 Returns the nearest reciprocal lattice point from a given vector. More...
 
void getReciprocalLatticeBasis (kvector_t &ra, kvector_t &rb, kvector_t &rc) const
 Returns the reciprocal basis vectors. More...
 
void initialize ()
 Initializes cached data. More...
 
Lattice3Doperator= (const Lattice3D &)=delete
 
RealParameterparameter (const std::string &name) const
 Returns parameter with given 'name'. More...
 
ParameterPoolparameterPool () const
 Returns pointer to the parameter pool. More...
 
std::string parametersToString () const
 Returns multiline string representing available parameters. More...
 
INodeparent ()
 
const INodeparent () const
 
std::vector< const INode * > progeny () const
 Returns a vector of all descendants. More...
 
std::vector< kvector_treciprocalLatticeVectorsWithinRadius (const kvector_t q, double dq) const
 Returns a list of reciprocal lattice vectors within distance dq of a vector q. More...
 
void registerChild (INode *node)
 
RealParameterregisterParameter (const std::string &name, double *parpointer)
 
void registerVector (const std::string &base_name, kvector_t *p_vec, const std::string &units="nm")
 
void removeParameter (const std::string &name)
 
void removeVector (const std::string &base_name)
 
void setName (const std::string &name)
 
void setParameterValue (const std::string &name, double value)
 
virtual void setParent (const INode *newParent)
 
void setSelectionRule (const ISelectionRule &selection_rule)
 Sets a selection rule for the reciprocal vectors. More...
 
void setVectorValue (const std::string &base_name, kvector_t value)
 
Lattice3D transformed (const Transform3D &transform) const
 Creates transformed lattice. More...
 
virtual std::string treeToString () const
 Returns multiline string representing tree structure below the node. More...
 
double unitCellVolume () const
 Returns the volume of the unit cell. More...
 

Static Public Member Functions

static std::string XComponentName (const std::string &base_name)
 
static std::string YComponentName (const std::string &base_name)
 
static std::string ZComponentName (const std::string &base_name)
 

Protected Attributes

const size_t m_NP
 
std::vector< double > m_P
 

Private Member Functions

void computeReciprocalVectors () const
 
void onChange () override
 Action to be taken in inherited class when a parameter has changed. More...
 

Private Attributes

kvector_t m_a
 
kvector_t m_b
 
kvector_t m_c
 Basis vectors in real space. More...
 
std::string m_name
 
const INodem_parent {nullptr}
 
std::unique_ptr< ParameterPoolm_pool
 parameter pool (kind of pointer-to-implementation) More...
 
kvector_t m_ra
 
kvector_t m_rb
 
kvector_t m_rc
 Cache of basis vectors in reciprocal space. More...
 
std::unique_ptr< ISelectionRulem_selection_rule
 

Detailed Description

A Bravais lattice, characterized by three basis vectors, and optionally an ISelectionRule.

Definition at line 29 of file Lattice3D.h.

Constructor & Destructor Documentation

◆ Lattice3D() [1/3]

Lattice3D::Lattice3D ( )
delete

◆ Lattice3D() [2/3]

Lattice3D::Lattice3D ( const kvector_t  a,
const kvector_t  b,
const kvector_t  c 
)

Definition at line 22 of file Lattice3D.cpp.

23  : m_a(a), m_b(b), m_c(c)
24 {
25  setName("Lattice");
26  initialize();
27 }
void setName(const std::string &name)
kvector_t m_c
Basis vectors in real space.
Definition: Lattice3D.h:77
kvector_t m_a
Definition: Lattice3D.h:77
kvector_t m_b
Definition: Lattice3D.h:77
void initialize()
Initializes cached data.
Definition: Lattice3D.cpp:40

References initialize(), and IParametricComponent::setName().

Here is the call graph for this function:

◆ Lattice3D() [3/3]

Lattice3D::Lattice3D ( const Lattice3D lattice)

Definition at line 29 of file Lattice3D.cpp.

30  : INode(), m_a(lattice.m_a), m_b(lattice.m_b), m_c(lattice.m_c)
31 {
32  setName("Lattice");
33  initialize();
34  if (lattice.m_selection_rule)
36 }
INode()
Definition: INode.h:51
void setSelectionRule(const ISelectionRule &selection_rule)
Sets a selection rule for the reciprocal vectors.
Definition: Lattice3D.cpp:128
std::unique_ptr< ISelectionRule > m_selection_rule
Definition: Lattice3D.h:78

References initialize(), m_selection_rule, IParametricComponent::setName(), and setSelectionRule().

Here is the call graph for this function:

◆ ~Lattice3D()

Lattice3D::~Lattice3D ( )
overridedefault

Member Function Documentation

◆ accept()

void Lattice3D::accept ( INodeVisitor visitor) const
inlineoverridevirtual

Calls the INodeVisitor's visit method.

Implements INode.

Definition at line 37 of file Lattice3D.h.

37 { visitor->visit(this); }
virtual void visit(const BasicLattice2D *)
Definition: INodeVisitor.h:151

References INodeVisitor::visit().

Here is the call graph for this function:

◆ computeReciprocalVectors()

void Lattice3D::computeReciprocalVectors ( ) const
private

Definition at line 118 of file Lattice3D.cpp.

119 {
120  kvector_t q23 = m_b.cross(m_c);
121  kvector_t q31 = m_c.cross(m_a);
122  kvector_t q12 = m_a.cross(m_b);
123  m_ra = M_TWOPI / m_a.dot(q23) * q23;
124  m_rb = M_TWOPI / m_b.dot(q31) * q31;
125  m_rc = M_TWOPI / m_c.dot(q12) * q12;
126 }
#define M_TWOPI
Definition: Constants.h:54
auto dot(const BasicVector3D< U > &v) const
Returns dot product of vectors (antilinear in the first [=self] argument).
auto cross(const BasicVector3D< U > &v) const
Returns cross product of vectors (linear in both arguments).
kvector_t m_ra
Definition: Lattice3D.h:80
kvector_t m_rb
Definition: Lattice3D.h:80
kvector_t m_rc
Cache of basis vectors in reciprocal space.
Definition: Lattice3D.h:80

References BasicVector3D< T >::cross(), BasicVector3D< T >::dot(), m_a, m_b, m_c, m_ra, m_rb, m_rc, and M_TWOPI.

Referenced by initialize(), and onChange().

Here is the call graph for this function:

◆ copyNumber()

int INode::copyNumber ( const INode node) const
inherited

Returns copyNumber of child, which takes into account existence of children with same name.

Definition at line 94 of file INode.cpp.

95 {
96  if (node->parent() != this)
97  return -1;
98 
99  int result(-1), count(0);
100  for (auto child : getChildren()) {
101 
102  if (child == nullptr)
103  throw std::runtime_error("INode::copyNumber() -> Error. Nullptr as child.");
104 
105  if (child == node)
106  result = count;
107 
108  if (child->getName() == node->getName())
109  ++count;
110  }
111 
112  return count > 1 ? result : -1;
113 }
const INode * parent() const
Definition: INode.cpp:84
virtual std::vector< const INode * > getChildren() const
Returns a vector of children.
Definition: INode.cpp:63
const std::string & getName() const

References INode::getChildren(), IParametricComponent::getName(), and INode::parent().

Referenced by INode::displayName().

Here is the call graph for this function:

◆ createParameterTree()

ParameterPool * INode::createParameterTree ( ) const
virtualinherited

Creates new parameter pool, with all local parameters and those of its children.

Reimplemented from IParametricComponent.

Definition at line 126 of file INode.cpp.

127 {
128  std::unique_ptr<ParameterPool> result(new ParameterPool);
129 
130  for (const INode* child : progeny()) {
131  const std::string path = NodeUtils::nodePath(child, parent()) + "/";
132  child->parameterPool()->copyToExternalPool(path, result.get());
133  }
134 
135  return result.release();
136 }
Base class for tree-like structures containing parameterized objects.
Definition: INode.h:49
std::vector< const INode * > progeny() const
Returns a vector of all descendants.
Definition: INode.cpp:68
Container with parameters for IParametricComponent object.
Definition: ParameterPool.h:29
std::string nodePath(const INode *node, const INode *root=nullptr)
Returns path composed of node's displayName, with respect to root node.
Definition: NodeUtils.cpp:89

References NodeUtils::nodePath(), INode::parent(), and INode::progeny().

Referenced by ISimulation::runSimulation(), DepthProbeSimulation::validateParametrization(), OffSpecularSimulation::validateParametrization(), and SpecularSimulation::validateParametrization().

Here is the call graph for this function:

◆ displayName()

std::string INode::displayName ( ) const
inherited

Returns display name, composed from the name of node and it's copy number.

Definition at line 115 of file INode.cpp.

116 {
117  std::string result = getName();
118  if (m_parent) {
119  int index = m_parent->copyNumber(this);
120  if (index >= 0)
121  result = result + std::to_string(index);
122  }
123  return result;
124 }
const INode * m_parent
Definition: INode.h:83
int copyNumber(const INode *node) const
Returns copyNumber of child, which takes into account existence of children with same name.
Definition: INode.cpp:94

References INode::copyNumber(), IParametricComponent::getName(), and INode::m_parent.

Referenced by NodeUtils::nodePath().

Here is the call graph for this function:

◆ getBasisVectorA()

kvector_t Lattice3D::getBasisVectorA ( ) const
inline

Returns basis vector a.

Definition at line 46 of file Lattice3D.h.

46 { return m_a; }

References m_a.

Referenced by FormFactorCrystal::calculateLargestReciprocalDistance(), InterferenceFunction3DLattice::initRecRadius(), and GUIDomainSampleVisitor::visit().

◆ getBasisVectorB()

kvector_t Lattice3D::getBasisVectorB ( ) const
inline

Returns basis vector b.

Definition at line 49 of file Lattice3D.h.

49 { return m_b; }

References m_b.

Referenced by FormFactorCrystal::calculateLargestReciprocalDistance(), and InterferenceFunction3DLattice::initRecRadius().

◆ getBasisVectorC()

kvector_t Lattice3D::getBasisVectorC ( ) const
inline

Returns basis vector c.

Definition at line 52 of file Lattice3D.h.

52 { return m_c; }

References m_c.

Referenced by FormFactorCrystal::calculateLargestReciprocalDistance(), and InterferenceFunction3DLattice::initRecRadius().

◆ getChildren()

◆ getMillerDirection()

kvector_t Lattice3D::getMillerDirection ( double  h,
double  k,
double  l 
) const

Returns normalized direction corresponding to the given Miller indices.

Currently unused but may be useful for checks.

Definition at line 67 of file Lattice3D.cpp.

68 {
69  kvector_t direction = h * m_ra + k * m_rb + l * m_rc;
70  return direction.unit();
71 }
BasicVector3D< T > unit() const
Returns unit vector in direction of this. Throws for null vector.

References m_ra, m_rb, m_rc, and BasicVector3D< T >::unit().

Here is the call graph for this function:

◆ getName()

◆ getNearestReciprocalLatticeVectorCoordinates()

ivector_t Lattice3D::getNearestReciprocalLatticeVectorCoordinates ( const kvector_t  q) const

Returns the nearest reciprocal lattice point from a given vector.

Definition at line 86 of file Lattice3D.cpp.

87 {
88  return {(int)std::lround(q.dot(m_a) / M_TWOPI), (int)std::lround(q.dot(m_b) / M_TWOPI),
89  (int)std::lround(q.dot(m_c) / M_TWOPI)};
90 }

References BasicVector3D< T >::dot(), m_a, m_b, m_c, and M_TWOPI.

Referenced by reciprocalLatticeVectorsWithinRadius().

Here is the call graph for this function:

◆ getReciprocalLatticeBasis()

void Lattice3D::getReciprocalLatticeBasis ( kvector_t ra,
kvector_t rb,
kvector_t rc 
) const

Returns the reciprocal basis vectors.

Currently only used in tests.

Definition at line 79 of file Lattice3D.cpp.

80 {
81  ra = m_ra;
82  rb = m_rb;
83  rc = m_rc;
84 }

References m_ra, m_rb, and m_rc.

◆ initialize()

void Lattice3D::initialize ( )

Initializes cached data.

Definition at line 40 of file Lattice3D.cpp.

41 {
43  if (!parameter(XComponentName("BasisA"))) {
44  registerVector("BasisA", &m_a, "nm");
45  registerVector("BasisB", &m_b, "nm");
46  registerVector("BasisC", &m_c, "nm");
47  }
48 }
void registerVector(const std::string &base_name, kvector_t *p_vec, const std::string &units="nm")
static std::string XComponentName(const std::string &base_name)
RealParameter * parameter(const std::string &name) const
Returns parameter with given 'name'.
void computeReciprocalVectors() const
Definition: Lattice3D.cpp:118

References computeReciprocalVectors(), m_a, m_b, m_c, IParametricComponent::parameter(), IParametricComponent::registerVector(), and IParametricComponent::XComponentName().

Referenced by Lattice3D().

Here is the call graph for this function:

◆ onChange()

void Lattice3D::onChange ( )
overrideprivatevirtual

Action to be taken in inherited class when a parameter has changed.

Reimplemented from IParametricComponent.

Definition at line 50 of file Lattice3D.cpp.

51 {
53 }

References computeReciprocalVectors().

Here is the call graph for this function:

◆ operator=()

Lattice3D& Lattice3D::operator= ( const Lattice3D )
delete

◆ parameter()

RealParameter * IParametricComponent::parameter ( const std::string &  name) const
inherited

Returns parameter with given 'name'.

Definition at line 86 of file IParametricComponent.cpp.

87 {
88  return m_pool->parameter(name);
89 }
std::unique_ptr< ParameterPool > m_pool
parameter pool (kind of pointer-to-implementation)
QString const & name(EShape k)
Definition: particles.cpp:21

References IParametricComponent::m_pool, and RealSpace::Particles::name().

Referenced by DepthProbeSimulation::initialize(), SpecularSimulation::initialize(), initialize(), IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), IParticle::registerPosition(), Layer::registerThickness(), Lattice2D::setRotationEnabled(), and DistributionLogNormal::setUnits().

Here is the call graph for this function:

◆ parameterPool()

ParameterPool* IParametricComponent::parameterPool ( ) const
inlineinherited

Returns pointer to the parameter pool.

Definition at line 39 of file IParametricComponent.h.

39 { return m_pool.get(); } // has non-const usages!

References IParametricComponent::m_pool.

Referenced by INode::INode(), IParametricComponent::IParametricComponent(), pyfmt2::argumentList(), SampleBuilderNode::borrow_builder_parameters(), SampleBuilderNode::reset(), and IDistribution1D::setUnits().

◆ parametersToString()

std::string IParametricComponent::parametersToString ( ) const
inherited

Returns multiline string representing available parameters.

Definition at line 43 of file IParametricComponent.cpp.

44 {
45  std::ostringstream result;
46  std::unique_ptr<ParameterPool> P_pool(createParameterTree());
47  result << *P_pool << "\n";
48  return result.str();
49 }
virtual ParameterPool * createParameterTree() const
Creates new parameter pool, with all local parameters and those of its children.

References IParametricComponent::createParameterTree().

Here is the call graph for this function:

◆ parent() [1/2]

INode * INode::parent ( )
inherited

Definition at line 89 of file INode.cpp.

90 {
91  return const_cast<INode*>(m_parent);
92 }

References INode::m_parent.

◆ parent() [2/2]

◆ progeny()

std::vector< const INode * > INode::progeny ( ) const
inherited

Returns a vector of all descendants.

Definition at line 68 of file INode.cpp.

69 {
70  std::vector<const INode*> result;
71  result.push_back(this);
72  for (const auto* child : getChildren()) {
73  for (const auto* p : child->progeny())
74  result.push_back(p);
75  }
76  return result;
77 }

References INode::getChildren().

Referenced by INode::createParameterTree(), and ParticleDistribution::generateParticles().

Here is the call graph for this function:

◆ reciprocalLatticeVectorsWithinRadius()

std::vector< kvector_t > Lattice3D::reciprocalLatticeVectorsWithinRadius ( const kvector_t  q,
double  dq 
) const

Returns a list of reciprocal lattice vectors within distance dq of a vector q.

Definition at line 92 of file Lattice3D.cpp.

94 {
96 
97  int max_X = std::lround(m_a.mag() * dq / M_TWOPI);
98  int max_Y = std::lround(m_b.mag() * dq / M_TWOPI);
99  int max_Z = std::lround(m_c.mag() * dq / M_TWOPI);
100 
101  std::vector<kvector_t> ret;
102  for (int index_X = -max_X; index_X <= max_X; ++index_X) {
103  for (int index_Y = -max_Y; index_Y <= max_Y; ++index_Y) {
104  for (int index_Z = -max_Z; index_Z <= max_Z; ++index_Z) {
105  ivector_t coords(index_X + nearest_coords[0], index_Y + nearest_coords[1],
106  index_Z + nearest_coords[2]);
107  if (m_selection_rule && !m_selection_rule->coordinateSelected(coords))
108  continue;
109  kvector_t latticePoint = coords[0] * m_ra + coords[1] * m_rb + coords[2] * m_rc;
110  if ((latticePoint - q).mag() <= dq)
111  ret.push_back(latticePoint);
112  }
113  }
114  }
115  return ret;
116 }
double mag() const
Returns magnitude of the vector.
ivector_t getNearestReciprocalLatticeVectorCoordinates(const kvector_t q) const
Returns the nearest reciprocal lattice point from a given vector.
Definition: Lattice3D.cpp:86

References getNearestReciprocalLatticeVectorCoordinates(), m_a, m_b, m_c, m_ra, m_rb, m_rc, m_selection_rule, M_TWOPI, and BasicVector3D< T >::mag().

Referenced by FormFactorCrystal::evaluate(), FormFactorCrystal::evaluatePol(), and InterferenceFunction3DLattice::iff_without_dw().

Here is the call graph for this function:

◆ registerChild()

void INode::registerChild ( INode node)
inherited

Definition at line 57 of file INode.cpp.

58 {
59  ASSERT(node);
60  node->setParent(this);
61 }
#define ASSERT(condition)
Definition: Assert.h:31
virtual void setParent(const INode *newParent)
Definition: INode.cpp:79

References ASSERT, and INode::setParent().

Referenced by Beam::Beam(), Crystal::Crystal(), IDetector::IDetector(), Instrument::Instrument(), InterferenceFunction2DLattice::InterferenceFunction2DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunction2DSuperLattice::InterferenceFunction2DSuperLattice(), InterferenceFunctionFinite2DLattice::InterferenceFunctionFinite2DLattice(), Particle::Particle(), ParticleDistribution::ParticleDistribution(), ParticleLayout::addAndRegisterAbstractParticle(), ParticleCoreShell::addAndRegisterCore(), MultiLayer::addAndRegisterInterface(), MultiLayer::addAndRegisterLayer(), ParticleCoreShell::addAndRegisterShell(), Layer::addLayout(), ParticleComposition::addParticlePointer(), ISimulation::initialize(), MesoCrystal::initialize(), Beam::operator=(), Instrument::operator=(), IParticle::rotate(), ParticleLayout::setAndRegisterInterferenceFunction(), ISimulation::setBackground(), InterferenceFunction1DLattice::setDecayFunction(), InterferenceFunction2DLattice::setDecayFunction(), Instrument::setDetector(), IDetector::setDetectorResolution(), Beam::setFootprintFactor(), Particle::setFormFactor(), InterferenceFunctionFinite3DLattice::setLattice(), InterferenceFunctionRadialParaCrystal::setProbabilityDistribution(), InterferenceFunction2DParaCrystal::setProbabilityDistributions(), ConvolutionDetectorResolution::setResolutionFunction(), IParticle::setRotation(), LayerInterface::setRoughness(), and InterferenceFunction2DSuperLattice::setSubstructureIFF().

Here is the call graph for this function:

◆ registerParameter()

RealParameter & IParametricComponent::registerParameter ( const std::string &  name,
double *  parpointer 
)
inherited

Definition at line 51 of file IParametricComponent.cpp.

52 {
53  return m_pool->addParameter(
54  new RealParameter(name, data, getName(), [&]() -> void { onChange(); }));
55 }
virtual void onChange()
Action to be taken in inherited class when a parameter has changed.
Wraps a parameter of type double.
Definition: RealParameter.h:31

References IParametricComponent::getName(), IParametricComponent::m_pool, RealSpace::Particles::name(), and IParametricComponent::onChange().

Referenced by BasicLattice2D::BasicLattice2D(), Beam::Beam(), CylindersInBABuilder::CylindersInBABuilder(), DetectionProperties::DetectionProperties(), HexagonalLattice2D::HexagonalLattice2D(), IInterferenceFunction::IInterferenceFunction(), INode::INode(), InterferenceFunction1DLattice::InterferenceFunction1DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunctionHardDisk::InterferenceFunctionHardDisk(), InterferenceFunctionRadialParaCrystal::InterferenceFunctionRadialParaCrystal(), InterferenceFunctionTwin::InterferenceFunctionTwin(), Lattice2D::Lattice2D(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), ParticleDistribution::ParticleDistribution(), PlainMultiLayerBySLDBuilder::PlainMultiLayerBySLDBuilder(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), ResonatorBuilder::ResonatorBuilder(), SquareLattice2D::SquareLattice2D(), TriangularRippleBuilder::TriangularRippleBuilder(), IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), IParametricComponent::registerVector(), ParticleLayout::registerWeight(), and Lattice2D::setRotationEnabled().

Here is the call graph for this function:

◆ registerVector()

void IParametricComponent::registerVector ( const std::string &  base_name,
kvector_t p_vec,
const std::string &  units = "nm" 
)
inherited

Definition at line 57 of file IParametricComponent.cpp.

59 {
60  registerParameter(XComponentName(base_name), &((*p_vec)[0])).setUnit(units);
61  registerParameter(YComponentName(base_name), &((*p_vec)[1])).setUnit(units);
62  registerParameter(ZComponentName(base_name), &((*p_vec)[2])).setUnit(units);
63 }
static std::string ZComponentName(const std::string &base_name)
RealParameter & registerParameter(const std::string &name, double *parpointer)
static std::string YComponentName(const std::string &base_name)
RealParameter & setUnit(const std::string &name)
MVVM_MODEL_EXPORT std::string base_name(const std::string &path)
Provide the filename of a file path.
Definition: fileutils.cpp:78

References ModelView::Utils::base_name(), IParametricComponent::registerParameter(), RealParameter::setUnit(), IParametricComponent::XComponentName(), IParametricComponent::YComponentName(), and IParametricComponent::ZComponentName().

Referenced by Beam::Beam(), DetectionProperties::DetectionProperties(), InterferenceFunctionTwin::InterferenceFunctionTwin(), MultiLayer::MultiLayer(), initialize(), and IParticle::registerPosition().

Here is the call graph for this function:

◆ removeParameter()

void IParametricComponent::removeParameter ( const std::string &  name)
inherited

Definition at line 91 of file IParametricComponent.cpp.

92 {
93  m_pool->removeParameter(name);
94 }

References IParametricComponent::m_pool, and RealSpace::Particles::name().

Referenced by IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), IParametricComponent::removeVector(), and Lattice2D::setRotationEnabled().

Here is the call graph for this function:

◆ removeVector()

void IParametricComponent::removeVector ( const std::string &  base_name)
inherited

Definition at line 96 of file IParametricComponent.cpp.

References ModelView::Utils::base_name(), IParametricComponent::removeParameter(), IParametricComponent::XComponentName(), IParametricComponent::YComponentName(), and IParametricComponent::ZComponentName().

Referenced by IParticle::registerPosition().

Here is the call graph for this function:

◆ setName()

void IParametricComponent::setName ( const std::string &  name)
inlineinherited

Definition at line 69 of file IParametricComponent.h.

69 { m_name = name; }

References IParametricComponent::m_name, and RealSpace::Particles::name().

Referenced by BasicLattice2D::BasicLattice2D(), Beam::Beam(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), Crystal::Crystal(), DetectionProperties::DetectionProperties(), DistributionHandler::DistributionHandler(), FormFactorCoreShell::FormFactorCoreShell(), FormFactorCrystal::FormFactorCrystal(), FormFactorDecoratorMaterial::FormFactorDecoratorMaterial(), FormFactorDecoratorPositionFactor::FormFactorDecoratorPositionFactor(), FormFactorDecoratorRotation::FormFactorDecoratorRotation(), FormFactorWeighted::FormFactorWeighted(), HexagonalLattice2D::HexagonalLattice2D(), IDetector::IDetector(), INode::INode(), Instrument::Instrument(), InterferenceFunction1DLattice::InterferenceFunction1DLattice(), InterferenceFunction2DLattice::InterferenceFunction2DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunction2DSuperLattice::InterferenceFunction2DSuperLattice(), InterferenceFunction3DLattice::InterferenceFunction3DLattice(), InterferenceFunctionFinite2DLattice::InterferenceFunctionFinite2DLattice(), InterferenceFunctionFinite3DLattice::InterferenceFunctionFinite3DLattice(), InterferenceFunctionHardDisk::InterferenceFunctionHardDisk(), InterferenceFunctionNone::InterferenceFunctionNone(), InterferenceFunctionRadialParaCrystal::InterferenceFunctionRadialParaCrystal(), InterferenceFunctionTwin::InterferenceFunctionTwin(), ISampleBuilder::ISampleBuilder(), IsGISAXSDetector::IsGISAXSDetector(), Lattice3D(), Layer::Layer(), LayerInterface::LayerInterface(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), ParticleCoreShell::ParticleCoreShell(), ParticleDistribution::ParticleDistribution(), ParticleLayout::ParticleLayout(), RectangularDetector::RectangularDetector(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), SampleBuilderNode::SampleBuilderNode(), SphericalDetector::SphericalDetector(), SquareLattice2D::SquareLattice2D(), Layer::clone(), LayersWithAbsorptionBuilder::createSampleByIndex(), Basic2DParaCrystalBuilder::createSampleByIndex(), ParticleInVacuumBuilder::createSampleByIndex(), SimpleMagneticRotationBuilder::createSampleByIndex(), DepthProbeSimulation::initialize(), GISASSimulation::initialize(), OffSpecularSimulation::initialize(), SpecularSimulation::initialize(), SpecularDetector1D::initialize(), MesoCrystal::initialize(), Particle::initialize(), ParticleComposition::initialize(), Beam::operator=(), SampleBuilderNode::operator=(), SampleBuilderNode::reset(), and SampleBuilderNode::setSBN().

Here is the call graph for this function:

◆ setParameterValue()

void IParametricComponent::setParameterValue ( const std::string &  name,
double  value 
)
inherited

Definition at line 65 of file IParametricComponent.cpp.

66 {
67  if (name.find('*') == std::string::npos && name.find('/') == std::string::npos) {
68  m_pool->setParameterValue(name, value);
69  } else {
70  std::unique_ptr<ParameterPool> P_pool{createParameterTree()};
71  if (name.find('*') != std::string::npos)
72  P_pool->setMatchedParametersValue(name, value);
73  else
74  P_pool->setParameterValue(name, value);
75  }
76 }
int setMatchedParametersValue(const std::string &wildcards, double value)
Sets value of the nonzero parameters that match pattern ('*' allowed), or throws.

References IParametricComponent::createParameterTree(), IParametricComponent::m_pool, RealSpace::Particles::name(), and ParameterPool::setMatchedParametersValue().

Referenced by AsymRippleBuilder::buildSample(), and IParametricComponent::setVectorValue().

Here is the call graph for this function:

◆ setParent()

void INode::setParent ( const INode newParent)
virtualinherited

Reimplemented in SampleProvider.

Definition at line 79 of file INode.cpp.

80 {
81  m_parent = newParent;
82 }

References INode::m_parent.

Referenced by INode::registerChild(), SampleProvider::setBuilder(), and SampleProvider::setParent().

◆ setSelectionRule()

void Lattice3D::setSelectionRule ( const ISelectionRule selection_rule)

Sets a selection rule for the reciprocal vectors.

Definition at line 128 of file Lattice3D.cpp.

129 {
130  m_selection_rule.reset(selection_rule.clone());
131 }
virtual ISelectionRule * clone() const =0

References ISelectionRule::clone(), and m_selection_rule.

Referenced by Lattice3D(), and transformed().

Here is the call graph for this function:

◆ setVectorValue()

void IParametricComponent::setVectorValue ( const std::string &  base_name,
kvector_t  value 
)
inherited

Definition at line 78 of file IParametricComponent.cpp.

79 {
83 }
T z() const
Returns z-component in cartesian coordinate system.
Definition: BasicVector3D.h:67
T y() const
Returns y-component in cartesian coordinate system.
Definition: BasicVector3D.h:65
T x() const
Returns x-component in cartesian coordinate system.
Definition: BasicVector3D.h:63
void setParameterValue(const std::string &name, double value)

References ModelView::Utils::base_name(), IParametricComponent::setParameterValue(), BasicVector3D< T >::x(), IParametricComponent::XComponentName(), BasicVector3D< T >::y(), IParametricComponent::YComponentName(), BasicVector3D< T >::z(), and IParametricComponent::ZComponentName().

Here is the call graph for this function:

◆ transformed()

Lattice3D Lattice3D::transformed ( const Transform3D transform) const

Creates transformed lattice.

Definition at line 55 of file Lattice3D.cpp.

56 {
57  kvector_t q1 = transform.transformed(m_a);
58  kvector_t q2 = transform.transformed(m_b);
59  kvector_t q3 = transform.transformed(m_c);
60  Lattice3D result = {q1, q2, q3};
61  if (m_selection_rule)
63  return result;
64 }
A Bravais lattice, characterized by three basis vectors, and optionally an ISelectionRule.
Definition: Lattice3D.h:29
ivector_t transformed(const ivector_t &v) const
Return transformed vector v.

References m_a, m_b, m_c, m_selection_rule, setSelectionRule(), and Transform3D::transformed().

Referenced by Crystal::transformedLattice().

Here is the call graph for this function:

◆ treeToString()

std::string INode::treeToString ( ) const
virtualinherited

Returns multiline string representing tree structure below the node.

Definition at line 52 of file INode.cpp.

53 {
54  return NodeUtils::nodeToString(this);
55 }
std::string nodeToString(const INode *node)
Returns multiline string representing tree structure starting from given node.
Definition: NodeUtils.cpp:81

References NodeUtils::nodeToString().

Here is the call graph for this function:

◆ unitCellVolume()

double Lattice3D::unitCellVolume ( ) const

Returns the volume of the unit cell.

Definition at line 73 of file Lattice3D.cpp.

74 {
75  return std::abs(m_a.dot(m_b.cross(m_c)));
76 }

References BasicVector3D< T >::cross(), BasicVector3D< T >::dot(), m_a, m_b, and m_c.

Referenced by MesoCrystalItem::createMesoCrystal(), FormFactorCrystal::evaluate(), FormFactorCrystal::evaluatePol(), and Crystal::homogeneousRegions().

Here is the call graph for this function:

◆ XComponentName()

std::string IParametricComponent::XComponentName ( const std::string &  base_name)
staticinherited

Definition at line 103 of file IParametricComponent.cpp.

104 {
105  return base_name + "X";
106 }

References ModelView::Utils::base_name().

Referenced by initialize(), IParticle::registerPosition(), IParametricComponent::registerVector(), IParametricComponent::removeVector(), IParametricComponent::setVectorValue(), and VectorParameterTranslator::translate().

Here is the call graph for this function:

◆ YComponentName()

std::string IParametricComponent::YComponentName ( const std::string &  base_name)
staticinherited

Definition at line 108 of file IParametricComponent.cpp.

109 {
110  return base_name + "Y";
111 }

References ModelView::Utils::base_name().

Referenced by IParametricComponent::registerVector(), IParametricComponent::removeVector(), IParametricComponent::setVectorValue(), and VectorParameterTranslator::translate().

Here is the call graph for this function:

◆ ZComponentName()

std::string IParametricComponent::ZComponentName ( const std::string &  base_name)
staticinherited

Definition at line 113 of file IParametricComponent.cpp.

114 {
115  return base_name + "Z";
116 }

References ModelView::Utils::base_name().

Referenced by IParametricComponent::registerVector(), IParametricComponent::removeVector(), IParametricComponent::setVectorValue(), and VectorParameterTranslator::translate().

Here is the call graph for this function:

Member Data Documentation

◆ m_a

◆ m_b

◆ m_c

◆ m_name

std::string IParametricComponent::m_name
privateinherited

◆ m_NP

const size_t INode::m_NP
protectedinherited

Definition at line 88 of file INode.h.

Referenced by INode::INode().

◆ m_P

std::vector<double> INode::m_P
protectedinherited

Definition at line 89 of file INode.h.

Referenced by INode::INode(), and IFootprintFactor::setWidthRatio().

◆ m_parent

const INode* INode::m_parent {nullptr}
privateinherited

Definition at line 83 of file INode.h.

Referenced by INode::displayName(), INode::parent(), and INode::setParent().

◆ m_pool

◆ m_ra

kvector_t Lattice3D::m_ra
mutableprivate

◆ m_rb

◆ m_rc

kvector_t Lattice3D::m_rc
private

Cache of basis vectors in reciprocal space.

Definition at line 80 of file Lattice3D.h.

Referenced by computeReciprocalVectors(), getMillerDirection(), getReciprocalLatticeBasis(), and reciprocalLatticeVectorsWithinRadius().

◆ m_selection_rule

std::unique_ptr<ISelectionRule> Lattice3D::m_selection_rule
private

The documentation for this class was generated from the following files: