47 using namespace model;
51 static_assert(!std::is_constructible_v<SphericalInclusionIO<3>,
const Unrelated&>);
52 static_assert(!std::is_constructible_v<PolyhedronInclusionIO<3>,
const Unrelated&>);
53 static_assert(!std::is_constructible_v<EllipsoidalInclusionIO<3>,
const Unrelated&>);
57 e << 1,2,3,4,5,6,7,8,9;
58 const Eigen::Vector3d center(1,-2,3);
62 "Sphere conversion changed fields");
64 const std::map<size_t,PolyhedronInclusionNodeIO<3>> nodes;
65 const std::map<size_t,std::vector<size_t>> faces;
69 "Polyhedron conversion changed fields");
73 std::stringstream sphereText(
"7 1 -2 3 2.5 1 2 3 4 5 6 7 8 9 0.75 2");
76 "Sphere record field order changed");
78 check(best.
num==1 && best.
den==8,
"Rational approximation changed");
80 check(sum.
n==1 && sum.
d==2 && sum.
asDouble()==0.5,
"Rational arithmetic changed");
83 check(6*
x+9*
y==3,
"Diophantine solution changed");
84 const Eigen::Matrix2d
A=Eigen::Matrix2d::Identity()*2;
85 Eigen::Matrix<double,1,2>
B;
87 const Eigen::Vector2d
f(3,5);
88 const Eigen::VectorXd g=Eigen::VectorXd::Constant(1,1);
90 check((
A*solve.
X+
B.transpose()*solve.
L-
f).norm()<1
e-12 && (
B*solve.
X-g).norm()<1
e-12,
91 "Schur solve changed");
93 Eigen::Vector3d(2,0,0),Eigen::Vector3d(3,0,0));
94 check(segment.
get_r(0.25).isApprox(Eigen::Vector3d(1.25,0,0)) &&
95 segment.
get_ru(0.5).isApprox(Eigen::Vector3d(1,0,0)) && segment.
get_ruu(0.5).norm()<1
e-12,
96 "Spline evaluation changed");
98 "String utility changed");
103 reader.
nodes().emplace(9,center);
106 check(reader.
nodes().empty() && reader.
elements().empty(),
"Mesh reader clear failed");
107 std::cout <<
"PASS extracted APIs, concrete inclusion constructors, serialization and numerics\n";
109 catch(
const std::exception&
e)
111 std::cerr <<
e.what() <<
'\n';