BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularSimulationElement Class Reference
Collaboration diagram for SpecularSimulationElement:

Public Member Functions

 SpecularSimulationElement (double kz, bool computable)
 
 SpecularSimulationElement (double wavelength, double alpha, bool computable)
 
 SpecularSimulationElement (const SpecularSimulationElement &other)
 
 SpecularSimulationElement (SpecularSimulationElement &&other) noexcept
 
 ~SpecularSimulationElement ()
 
SpecularSimulationElementoperator= (const SpecularSimulationElement &other)
 
void setPolarizationHandler (const PolarizationHandler &handler)
 
const PolarizationHandlerpolarizationHandler () const
 
double getIntensity () const
 
void setIntensity (double intensity)
 
bool isCalculated () const
 
std::vector< complex_tproduceKz (const std::vector< Slice > &slices)
 

Private Member Functions

void swapContent (SpecularSimulationElement &other)
 

Private Attributes

PolarizationHandler m_polarization
 
double m_intensity
 
const bool m_computable
 
std::function< std::vector< complex_t >const std::vector< Slice > &)> m_kz_computation
 

Detailed Description

Data stucture containing both input and output of a single image pixel for specular simulation.

Definition at line 29 of file SpecularSimulationElement.h.

Constructor & Destructor Documentation

◆ SpecularSimulationElement() [1/4]

SpecularSimulationElement::SpecularSimulationElement ( double  kz,
bool  computable 
)

Definition at line 18 of file SpecularSimulationElement.cpp.

19  : m_intensity(0.0), m_computable(computable),
20  m_kz_computation([kz](const std::vector<Slice>& slices) {
21  return KzComputation::computeKzFromSLDs(slices, kz);
22  })
23 {
24 }
std::function< std::vector< complex_t >const std::vector< Slice > &)> m_kz_computation
double m_intensity
simulated intensity for detector cell
std::vector< complex_t > computeKzFromSLDs(const std::vector< Slice > &slices, double kz)

References KzComputation::computeKzFromSLDs().

Here is the call graph for this function:

◆ SpecularSimulationElement() [2/4]

SpecularSimulationElement::SpecularSimulationElement ( double  wavelength,
double  alpha,
bool  computable 
)

Definition at line 26 of file SpecularSimulationElement.cpp.

28  : m_intensity(0.0), m_computable(computable),
30  [k = vecOfLambdaAlphaPhi(wavelength, alpha, 0.0)](const std::vector<Slice>& slices) {
32  })
33 {
34 }
BasicVector3D< double > vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi)
Creates a vector<double> as a wavevector with given wavelength and angles.
std::vector< complex_t > computeKzFromRefIndices(const std::vector< Slice > &slices, kvector_t k)

References KzComputation::computeKzFromRefIndices().

Here is the call graph for this function:

◆ SpecularSimulationElement() [3/4]

SpecularSimulationElement::SpecularSimulationElement ( const SpecularSimulationElement other)

Definition at line 36 of file SpecularSimulationElement.cpp.

◆ SpecularSimulationElement() [4/4]

SpecularSimulationElement::SpecularSimulationElement ( SpecularSimulationElement &&  other)
noexcept

Definition at line 42 of file SpecularSimulationElement.cpp.

43  : m_polarization(std::move(other.m_polarization)), m_intensity(other.m_intensity),
45 {
46 }

◆ ~SpecularSimulationElement()

SpecularSimulationElement::~SpecularSimulationElement ( )
default

Member Function Documentation

◆ operator=()

SpecularSimulationElement & SpecularSimulationElement::operator= ( const SpecularSimulationElement other)

Definition at line 51 of file SpecularSimulationElement.cpp.

52 {
53  if (this != &other) {
54  SpecularSimulationElement tmp(other);
55  tmp.swapContent(*this);
56  }
57  return *this;
58 }
Data stucture containing both input and output of a single image pixel for specular simulation.

References swapContent().

Here is the call graph for this function:

◆ setPolarizationHandler()

void SpecularSimulationElement::setPolarizationHandler ( const PolarizationHandler handler)

Assigns PolarizationHandler.

Definition at line 60 of file SpecularSimulationElement.cpp.

61 {
62  m_polarization = handler;
63 }

References m_polarization.

◆ polarizationHandler()

const PolarizationHandler& SpecularSimulationElement::polarizationHandler ( ) const
inline

Returns assigned PolarizationHandler.

Definition at line 46 of file SpecularSimulationElement.h.

46 { return m_polarization; }

References m_polarization.

Referenced by anonymous_namespace{SpecularComputationTerm.cpp}::matrix_intensity().

◆ getIntensity()

double SpecularSimulationElement::getIntensity ( ) const
inline

Definition at line 48 of file SpecularSimulationElement.h.

48 { return m_intensity; }

References m_intensity.

◆ setIntensity()

void SpecularSimulationElement::setIntensity ( double  intensity)
inline

Definition at line 49 of file SpecularSimulationElement.h.

49 { m_intensity = intensity; }

References m_intensity.

Referenced by SpecularScalarTerm::eval(), and SpecularMatrixTerm::eval().

◆ isCalculated()

bool SpecularSimulationElement::isCalculated ( ) const
inline

Returns calculation flag (if it's false, zero intensity is assigned to the element)

Definition at line 52 of file SpecularSimulationElement.h.

52 { return m_computable; }

References m_computable.

Referenced by SpecularComputationTerm::computeIntensity().

◆ produceKz()

std::vector< complex_t > SpecularSimulationElement::produceKz ( const std::vector< Slice > &  slices)

Returns kz values for Abeles computation of reflection/transition coefficients.

Definition at line 65 of file SpecularSimulationElement.cpp.

66 {
67  return m_kz_computation(slices);
68 }

References m_kz_computation.

Referenced by SpecularScalarTerm::eval(), and SpecularMatrixTerm::eval().

◆ swapContent()

void SpecularSimulationElement::swapContent ( SpecularSimulationElement other)
private

Definition at line 70 of file SpecularSimulationElement.cpp.

71 {
75 }
void swap(OutputDataIterator< TValue, TContainer > &left, OutputDataIterator< TValue, TContainer > &right)
make Swappable
void swapContent(PolarizationHandler &other)

References m_intensity, m_kz_computation, m_polarization, swap(), and PolarizationHandler::swapContent().

Referenced by operator=().

Here is the call graph for this function:

Member Data Documentation

◆ m_polarization

PolarizationHandler SpecularSimulationElement::m_polarization
private

◆ m_intensity

double SpecularSimulationElement::m_intensity
private

simulated intensity for detector cell

Definition at line 61 of file SpecularSimulationElement.h.

Referenced by getIntensity(), setIntensity(), and swapContent().

◆ m_computable

const bool SpecularSimulationElement::m_computable
private

Definition at line 62 of file SpecularSimulationElement.h.

Referenced by isCalculated().

◆ m_kz_computation

std::function<std::vector<complex_t>const std::vector<Slice>&)> SpecularSimulationElement::m_kz_computation
private

Definition at line 63 of file SpecularSimulationElement.h.

Referenced by produceKz(), and swapContent().


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