22 {{0, 1, 5, 4},
false},
23 {{1, 2, 6, 5},
false},
24 {{2, 3, 7, 6},
false},
25 {{3, 0, 4, 7},
false},
26 {{4, 5, 9, 8},
false},
27 {{5, 6, 10, 9},
false},
28 {{6, 7, 11, 10},
false},
29 {{7, 4, 8, 11},
false},
30 {{8, 9, 10, 11},
true}},
33 FormFactorCuboctahedron::FormFactorCuboctahedron(
const std::vector<double> P)
36 "truncated quadratic bipyramid",
37 {{
"Length",
"nm",
"edge length of base square (common face of both pyramids)", 0, +INF, 0},
38 {
"Height",
"nm",
"height of the lower pyramid", 0, +INF, 0},
39 {
"HeightRatio",
"nm",
"height ratio of upper to lower pyramid", 0, +INF, 0},
40 {
"Alpha",
"rad",
"angle between the base and a side face", 0., M_PI_2, 0}}},
42 m_length(m_P[0]), m_height(m_P[1]), m_height_ratio(m_P[2]), m_alpha(m_P[3])
47 FormFactorCuboctahedron::FormFactorCuboctahedron(
double length,
double height,
double height_ratio,
57 if (effects.dz_bottom > m_height) {
60 m_length - dbase_edge,
61 m_height * (1 + m_height_ratio) - effects.dz_bottom - effects.dz_top, m_alpha);
62 return createTransformedFormFactor(slicedff, rot, effects.position);
63 }
else if (effects.dz_top > m_height_ratio * m_height) {
66 m_length - dbase_edge,
67 m_height * (1 + m_height_ratio) - effects.dz_bottom - effects.dz_top, M_PI - m_alpha);
68 return createTransformedFormFactor(slicedff, rot, effects.position);
71 m_height_ratio * m_height - effects.dz_top, m_alpha);
72 return createTransformedFormFactor(slicedff, rot, effects.position);
79 if (!std::isfinite(cot_alpha) || cot_alpha < 0)
81 double x = m_height_ratio;
82 double r = cot_alpha * 2 * m_height / m_length;
83 if (std::max(1., x) * r > 1) {
84 std::ostringstream ostr;
85 ostr <<
"FormFactorCuboctahedron() -> Error in class initialization with parameters";
86 ostr <<
" height:" << m_height;
87 ostr <<
" length:" << m_length;
88 ostr <<
" height_ratio:" << m_height_ratio;
89 ostr <<
" alpha[rad]:" << m_alpha <<
"\n\n";
90 ostr <<
"Check for '2.*height <= length*tan(alpha)*min(1.,1.0/height_ratio)' failed.";
94 double a = m_length / 2 * (1 - r);
95 double b = m_length / 2;
96 double c = m_length / 2 * (1 - r * x);
99 m_height * ((x * x - 1) / 2 - 2 * r * (x * x * x - 1) / 3 + r * r * (x * x * x * x - 1) / 4)
100 / ((x + 1) - r * (x * x + 1) + r * r * (x * x * x + 1) / 3);
101 double za = -dzcom - m_height;
103 double zc = -dzcom + x * m_height;
Defines many exception classes in namespace Exceptionss.
Defines M_PI and some more mathematical constants.
Defines namespace MathFunctions.
Pure virtual interface for rotations.
For internal use in IFormFactorPolyhedron.
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
double cot(double x)
cotangent function: