20 InterferenceFunction3DLattice::InterferenceFunction3DLattice(
const Lattice& lattice)
23 setName(
"Interference3DLattice");
27 InterferenceFunction3DLattice::~InterferenceFunction3DLattice() =
default;
32 ret->setPositionVariance(m_position_var);
34 ret->setPeakShape(*mP_peak_shape);
38 void InterferenceFunction3DLattice::setPeakShape(
const IPeakShape& peak_shape)
40 mP_peak_shape.reset(peak_shape.
clone());
43 const Lattice& InterferenceFunction3DLattice::lattice()
const
58 double InterferenceFunction3DLattice::iff_without_dw(
const kvector_t q)
const
61 throw std::runtime_error(
"InterferenceFunction3DLattice::evaluate: "
62 "no peak shape defined");
64 double radius = 2.1 * m_rec_radius;
65 double inner_radius = 0.0;
66 if (mP_peak_shape->angularDisorder()) {
68 inner_radius = std::max(0.0, q.
mag() - radius);
73 for (
const auto& q_rec : rec_vectors) {
74 if (!(q_rec.mag() < inner_radius)) {
75 result += mP_peak_shape->evaluate(q, q_rec);
81 void InterferenceFunction3DLattice::initRecRadius()
87 m_rec_radius = std::max(M_PI / a1.
mag(), M_PI / a2.
mag());
88 m_rec_radius = std::max(m_rec_radius, M_PI / a3.
mag());
Defines many exception classes in namespace Exceptionss.
Defines the interface IPeakShape and subclasses.
Defines class InterferenceFunction3DLattice.
double mag() const
Returns magnitude of the vector.
Pure virtual base class of interference functions.
Pure virtual interface class that defines the peak shape of a Bragg peak.
virtual IPeakShape * clone() const =0
Returns a clone of this ISample object.
Interference function of a 3D lattice.
void onChange() override final
Action to be taken in inherited class when a parameter has changed.
InterferenceFunction3DLattice * clone() const override final
Returns a clone of this ISample object.
std::vector< const INode * > getChildren() const override final
Returns a vector of children (const).
A lattice with three basis vectors.
kvector_t getBasisVectorB() const
Returns basis vector b.
std::vector< kvector_t > reciprocalLatticeVectorsWithinRadius(const kvector_t input_vector, double radius) const
Computes a list of reciprocal lattice vectors within a specified distance of a given vector.
kvector_t getBasisVectorC() const
Returns basis vector c.
kvector_t getBasisVectorA() const
Returns basis vector a.