BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ReCompound Class Reference

Description

A reprocessed ParticleComposition.

Definition at line 29 of file ReCompound.h.

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

Public Member Functions

 ReCompound ()=default
 
 ~ReCompound () override
 
void addFormFactor (const IReParticle &formfactor)
 
double bottomZ (const IRotation *rotation) const override
 Returns the z-coordinate of the lowest point in this shape after a given rotation. More...
 
ReCompoundclone () const override
 
double radialExtension () const override
 Returns the (approximate in some cases) radial size of the particle of this form factor's shape. This is used for SSCA calculations. More...
 
void setAmbientMaterial (const Material &material) override
 Passes the material in which this particle is embedded. More...
 
complex_t theFF (const WavevectorInfo &wavevectors) const override
 Returns scattering amplitude for complex wavevectors ki, kf. More...
 
SpinMatrix thePolFF (const WavevectorInfo &wavevectors) const override
 Calculates and returns a polarized form factor calculation in DWBA. More...
 
double topZ (const IRotation *rotation) const override
 Returns the z-coordinate of the lowest point in this shape after a given rotation. More...
 
virtual void transferToCPP ()
 Used for Python overriding of clone (see swig/tweaks.py) More...
 
virtual double volume () const
 Returns the total volume of the particle of this form factor's shape. More...
 

Protected Attributes

std::vector< IReParticle * > m_components
 

Constructor & Destructor Documentation

◆ ReCompound()

ReCompound::ReCompound ( )
default

Referenced by clone().

◆ ~ReCompound()

ReCompound::~ReCompound ( )
override

Definition at line 19 of file ReCompound.cpp.

20 {
21  for (size_t index = 0; index < m_components.size(); ++index)
22  delete m_components[index];
23 }
std::vector< IReParticle * > m_components
Definition: ReCompound.h:52

References m_components.

Member Function Documentation

◆ addFormFactor()

void ReCompound::addFormFactor ( const IReParticle formfactor)

Definition at line 60 of file ReCompound.cpp.

61 {
62  m_components.push_back(formfactor.clone());
63 }
IReParticle * clone() const override=0

References IReParticle::clone(), and m_components.

Here is the call graph for this function:

◆ bottomZ()

double ReCompound::bottomZ ( const IRotation rotation) const
overridevirtual

Returns the z-coordinate of the lowest point in this shape after a given rotation.

Implements IReParticle.

Definition at line 41 of file ReCompound.cpp.

42 {
43  if (m_components.empty())
44  throw std::runtime_error("ReCompound::bottomZ() -> Error: "
45  "'this' contains no form factors.");
47  m_components.begin(), m_components.end(),
48  [&rotation](IReParticle* ff) { return ff->bottomZ(rotation); });
49 }
Abstract base class for reprocessed particles.
Definition: IReParticle.h:37
double min_value(const Iterator &begin, const Iterator &end, const Evaluator &evaluate)
Returns the minimum value of function evaluate as applied to the elements of an iterator range.
Definition: Algorithms.h:58

References m_components, and BaseUtils::algo::min_value().

Here is the call graph for this function:

◆ clone()

ReCompound * ReCompound::clone ( ) const
overridevirtual

Implements IReParticle.

Definition at line 25 of file ReCompound.cpp.

26 {
27  auto* result = new ReCompound();
28  for (size_t index = 0; index < m_components.size(); ++index)
29  result->addFormFactor(*m_components[index]);
30  return result;
31 }
ReCompound()=default

References ReCompound(), and m_components.

Here is the call graph for this function:

◆ radialExtension()

double ReCompound::radialExtension ( ) const
overridevirtual

Returns the (approximate in some cases) radial size of the particle of this form factor's shape. This is used for SSCA calculations.

Implements IReParticle.

Definition at line 33 of file ReCompound.cpp.

34 {
35  double result{0.0};
36  for (size_t index = 0; index < m_components.size(); ++index)
37  result += m_components[index]->radialExtension();
38  return result;
39 }
double radialExtension() const override
Returns the (approximate in some cases) radial size of the particle of this form factor's shape....
Definition: ReCompound.cpp:33

References m_components.

◆ setAmbientMaterial()

void ReCompound::setAmbientMaterial ( const Material )
overridevirtual

Passes the material in which this particle is embedded.

Reimplemented from IReParticle.

Definition at line 65 of file ReCompound.cpp.

66 {
67  for (size_t index = 0; index < m_components.size(); ++index)
68  m_components[index]->setAmbientMaterial(material);
69 }
void setAmbientMaterial(const Material &material) override
Passes the material in which this particle is embedded.
Definition: ReCompound.cpp:65

References m_components.

◆ theFF()

complex_t ReCompound::theFF ( const WavevectorInfo wavevectors) const
overridevirtual

Returns scattering amplitude for complex wavevectors ki, kf.

Implements IReParticle.

Definition at line 71 of file ReCompound.cpp.

72 {
73  complex_t result(0.0, 0.0);
74  for (size_t index = 0; index < m_components.size(); ++index)
75  result += m_components[index]->theFF(wavevectors);
76  return result;
77 }
complex_t theFF(const WavevectorInfo &wavevectors) const override
Returns scattering amplitude for complex wavevectors ki, kf.
Definition: ReCompound.cpp:71

References m_components.

◆ thePolFF()

SpinMatrix ReCompound::thePolFF ( const WavevectorInfo wavevectors) const
overridevirtual

Calculates and returns a polarized form factor calculation in DWBA.

Reimplemented from IReParticle.

Definition at line 79 of file ReCompound.cpp.

80 {
81  SpinMatrix result;
82  for (size_t index = 0; index < m_components.size(); ++index)
83  result += m_components[index]->thePolFF(wavevectors);
84  return result;
85 }
SpinMatrix thePolFF(const WavevectorInfo &wavevectors) const override
Calculates and returns a polarized form factor calculation in DWBA.
Definition: ReCompound.cpp:79

References m_components.

◆ topZ()

double ReCompound::topZ ( const IRotation rotation) const
overridevirtual

Returns the z-coordinate of the lowest point in this shape after a given rotation.

Implements IReParticle.

Definition at line 51 of file ReCompound.cpp.

52 {
53  if (m_components.empty())
54  throw std::runtime_error("ReCompound::topZ() -> Error: "
55  "'this' contains no form factors.");
57  [&rotation](IReParticle* ff) { return ff->topZ(rotation); });
58 }
double max_value(const Iterator &begin, const Iterator &end, const Evaluator &evaluate)
Returns the maximum value of function evaluate as applied to the elements of an iterator range.
Definition: Algorithms.h:70

References m_components, and BaseUtils::algo::max_value().

Here is the call graph for this function:

◆ transferToCPP()

virtual void ICloneable::transferToCPP ( )
inlinevirtualinherited

Used for Python overriding of clone (see swig/tweaks.py)

Definition at line 32 of file ICloneable.h.

◆ volume()

double IReParticle::volume ( ) const
virtualinherited

Returns the total volume of the particle of this form factor's shape.

Reimplemented in ReParticle, and ReMesocrystal.

Definition at line 26 of file IReParticle.cpp.

27 {
28  auto zero_wavevectors = WavevectorInfo::makeZeroQ();
29  return std::abs(theFF(zero_wavevectors));
30 }
virtual complex_t theFF(const WavevectorInfo &wavevectors) const =0
Returns scattering amplitude for complex wavevectors ki, kf.
static WavevectorInfo makeZeroQ()

References WavevectorInfo::makeZeroQ(), and IReParticle::theFF().

Here is the call graph for this function:

Member Data Documentation

◆ m_components

std::vector<IReParticle*> ReCompound::m_components
protected

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