22 IFormFactorBorn::IFormFactorBorn() =
default;
24 IFormFactorBorn::IFormFactorBorn(
const NodeMeta& meta,
const std::vector<double>& PValues)
29 IFormFactorBorn::~IFormFactorBorn() =
default;
71 double z_bottom = position.
z();
72 double z_top = position.
z() + height;
75 if (!upper_limit.m_limitless && !lower_limit.m_limitless
76 && lower_limit.m_value > upper_limit.m_value)
77 throw std::runtime_error(getName()
78 +
"::sliceFormFactor error: "
79 "upperlimit < lowerlimit.");
80 double dz_top = upper_limit.m_limitless ? -1 : z_top - upper_limit.m_value;
81 double dz_bottom = lower_limit.m_limitless ? -1 : lower_limit.m_value - z_bottom;
82 if (dz_top < 0 && dz_bottom < 0)
83 throw std::runtime_error(getName()
84 +
"::sliceFormFactor error: "
85 "shape didn't need to be sliced.");
86 if (dz_bottom > height)
87 throw std::runtime_error(getName()
88 +
"::sliceFormFactor error: "
89 "interface outside shape.");
91 throw std::runtime_error(getName()
92 +
"::sliceFormFactor error: "
93 "interface outside shape.");
99 new_position.
setZ(lower_limit.m_value);
100 return {new_position, dz_bottom, dz_top};
105 ASSERT(vertices.size());
107 vertices.begin(), vertices.end(),
108 [&](
const kvector_t& vertex) ->
double { return rotation.transformed(vertex).z(); });
113 ASSERT(vertices.size());
115 vertices.begin(), vertices.end(),
116 [&](
const kvector_t& vertex) ->
double { return rotation.transformed(vertex).z(); });
Defines and implements namespace algo with some algorithms.
Defines many exception classes in namespace Exceptionss.
Defines interface IShape.
Defines IRotation classes.
T z() const
Returns z-component in cartesian coordinate system.
void setZ(const T &a)
Sets z-component in cartesian coordinate system.
Pure virtual interface for rotations.
Holds all wavevector information relevant for calculating form factors.
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
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.
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.
Helper class that represents a onesided limit.
Nested structure that holds slicing effects on position and removed parts.