Skip to content
Snippets Groups Projects
Commit 0c85f048 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

polyhedral ff tests moved to libff

parent 6d258eed
No related branches found
No related tags found
1 merge request!1193polyhedral ff tests moved to libff
Pipeline #83430 passed
......@@ -18,65 +18,6 @@ protected:
}
};
const double eps_polyh = 6e-12; // Linux 3e-12, relaxed for Win
TEST_F(FFSpecializationTest, TruncatedCubeAsBox)
{
const double L = .5;
TruncatedCube p0(L, 0);
Box p1(L, L, L);
run_test(&p0, &p1, eps_polyh, 1e-99, 5e2);
}
TEST_F(FFSpecializationTest, Pyramid2AsPyramid4)
{
const double L = 1.5, H = .24, alpha = .6;
Pyramid2 p0(L, L, H, alpha);
Pyramid4 p1(L, H, alpha);
run_test(&p0, &p1, eps_polyh, 1e-99, 50);
}
TEST_F(FFSpecializationTest, Pyramid3AsTetrahedron)
{
static const double alpha = atan(sqrt(8));
const double L = 1.8;
Pyramid3 p0(L, sqrt(2. / 3) * L, alpha);
PlatonicTetrahedron p1(L);
run_test(&p0, &p1, eps_polyh, 1e-99, 50);
}
TEST_F(FFSpecializationTest, OctahedronAsTruncated)
{
const double L = 1.8;
PlatonicOctahedron p0(L);
Bipyramid4 p1(L, L / sqrt(2), 1., atan(sqrt(2)));
run_test(&p0, &p1, eps_polyh, 1e-99, 50);
}
TEST_F(FFSpecializationTest, Pyramid3AsPrism)
{
const double L = 1.8, H = .3;
Pyramid3 p0(L, H, M_PI / 2);
Prism3 p1(L, H);
run_test(&p0, &p1, eps_polyh, 1e-99, 50);
}
TEST_F(FFSpecializationTest, Pyramid4AsBox)
{
const double L = 1.8, H = .3;
Pyramid4 p0(L, H, M_PI / 2);
Box p1(L, L, H);
run_test(&p0, &p1, eps_polyh, 1e-99, 100);
}
TEST_F(FFSpecializationTest, Pyramid6AsPrism)
{
const double L = .8, H = 1.13;
Pyramid6 p0(L, H, M_PI / 2);
Prism6 p1(L, H);
run_test(&p0, &p1, eps_polyh, 1e-99, 100);
}
//*********** cylinders ***************
TEST_F(FFSpecializationTest, HorizontalCylinderSlicedVsUnsliced)
......
......@@ -18,48 +18,6 @@ protected:
}
};
//*********** polyhedra ***************
TEST_F(FFSymmetryTest, Prism3)
{
Prism3 ff(.83, .45);
run_test(
&ff, [](const C3& q) -> C3 { return q.rotatedZ(M_TWOPI / 3); }, 1e-13, 1e-99, 2e2);
}
TEST_F(FFSymmetryTest, Prism6)
{
Prism6 ff(1.33, .42);
run_test(
&ff, [](const C3& q) -> C3 { return q.rotatedZ(M_PI / 3); }, 1e-13, 1e-99, 50);
run_test(
&ff, [](const C3& q) -> C3 { return q.rotatedZ(-M_TWOPI / 3); }, 1e-13, 1e-99, 50);
}
TEST_F(FFSymmetryTest, Pyramid3)
{
Pyramid3 ff(8.43, .25, .53);
run_test(
&ff, [](const C3& q) -> C3 { return q.rotatedZ(M_TWOPI / 3); }, 1e-11, 1e-99, 100);
// Linux: 3e-12, relaxed for Mac
}
TEST_F(FFSymmetryTest, Pyramid6xFlat)
{
// TODO for larger q, imag(ff) is nan
Pyramid6 ff(4.3, .09, .1);
run_test(
&ff, [](const C3& q) -> C3 { return q.rotatedZ(-M_PI / 3); }, 8e-10, 1e-99,
50); // Linux: 2e-12, relaxed for Mac
}
TEST_F(FFSymmetryTest, Pyramid6xSteep)
{
Pyramid6 ff(.23, 3.5, .999 * M_PI / 2);
run_test(
&ff, [](const C3& q) -> C3 { return q.rotatedZ(-M_PI / 3); }, 3e-10, 1e-99, 50);
}
//*********** spheroids ***************
TEST_F(FFSymmetryTest, HemiEllipsoid)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment