16 #error no need to expose this header to Swig
20 #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_POLYHEDRALCOMPONENTS_H
21 #define BORNAGAIN_SAMPLE_HARDPARTICLE_POLYHEDRALCOMPONENTS_H
26 #ifdef ALGORITHM_DIAGNOSTIC
28 struct PolyhedralDiagnosis {
33 std::string message()
const;
34 bool operator==(
const PolyhedralDiagnosis&)
const;
35 bool operator!=(
const PolyhedralDiagnosis&)
const;
37 inline PolyhedralDiagnosis polyhedralDiagnosis;
62 static double diameter(
const std::vector<kvector_t>& V);
64 PolyhedralFace(
const std::vector<kvector_t>& _V = std::vector<kvector_t>(),
65 bool _sym_S2 =
false);
84 std::vector<PolyhedralEdge>
edges;
95 double abslevel)
const;
std::complex< double > complex_t
bool operator!=(const Material &left, const Material &right)
Comparison operator for material wrapper (inequality check)
bool operator==(const Material &left, const Material &right)
Comparison operator for material wrapper (equality check)
Defines basic vectors in Z^3, R^3, C^3.
auto dot(const BasicVector3D< U > &v) const
Returns dot product of vectors (antilinear in the first [=self] argument).
One edge of a polygon, for form factor computation.
PolyhedralEdge(const kvector_t _Vlow, const kvector_t _Vhig)
kvector_t m_R
position vector of edge midpoint
complex_t qE(cvector_t q) const
complex_t qR(cvector_t q) const
complex_t contrib(int m, cvector_t qpa, complex_t qrperp) const
Returns sum_l=0^M/2 u^2l v^(M-2l) / (2l+1)!(M-2l)! - vperp^M/M!
kvector_t m_E
vector pointing from mid of edge to upper vertex
A polygon, for form factor computation.
complex_t ff_2D_direct(cvector_t qpa) const
Two-dimensional form factor, for use in prism, from sum over edge form factors.
complex_t ff_n(int m, cvector_t q) const
Returns contribution qn*f_n [of order q^(n+1)] from this face to the polyhedral form factor.
complex_t normalProjectionConj(cvector_t q) const
Returns conj(q)*normal [BasicVector3D::dot is antilinear in 'this' argument].
bool sym_S2
if true, then edges obtainable by inversion are not provided
complex_t ff_n_core(int m, cvector_t qpa, complex_t qperp) const
Returns core contribution to f_n.
static int n_limit_series
static double qpa_limit_series
determines when use power series
double m_radius_2d
radius of enclosing cylinder
double m_rperp
distance of this polygon's plane from the origin, along 'm_normal'
complex_t ff_2D_expanded(cvector_t qpa) const
Two-dimensional form factor, for use in prism, from power series.
static double diameter(const std::vector< kvector_t > &V)
Static method, returns diameter of circle that contains all vertices.
double pyramidalVolume() const
complex_t ff_2D(cvector_t qpa) const
Returns the two-dimensional form factor of this face, for use in a prism.
complex_t expansion(complex_t fac_even, complex_t fac_odd, cvector_t qpa, double abslevel) const
Returns sum of n>=1 terms of qpa expansion of 2d form factor.
PolyhedralFace(const std::vector< kvector_t > &_V=std::vector< kvector_t >(), bool _sym_S2=false)
Sets internal variables for given vertex chain.
std::vector< PolyhedralEdge > edges
void decompose_q(cvector_t q, complex_t &qperp, cvector_t &qpa) const
Sets qperp and qpa according to argument q and to this polygon's normal.
kvector_t m_normal
normal vector of this polygon's plane
void assert_Ci(const PolyhedralFace &other) const
Throws if deviation from inversion symmetry is detected. Does not check vertices.
complex_t edge_sum_ff(cvector_t q, cvector_t qpa, bool sym_Ci) const
Returns core contribution to analytic 2d form factor.
complex_t ff(cvector_t q, bool sym_Ci) const
Returns the contribution ff(q) of this face to the polyhedral form factor.
double m_radius_3d
radius of enclosing sphere
Some additions to standard library algorithms.