22 using Eigen::Vector3d;
23 Vector3d coords1(0.0, 0.0, 0.0);
24 Vector3d coords2(1.0, 0.0, 0.0);
25 Vector3d coords3(1.0, 1.0, 0.0);
47 BOOST_TEST((coords2 - coords1).dot(normal) == 0.0);
48 BOOST_TEST((coords3 - coords1).dot(normal) == 0.0);
53 constexpr double expectedRadius = 0.74535599249993001;
56 constexpr double expectedArea = 0.5;
57 BOOST_TEST(triangle.
getArea() == expectedArea);
63 using Eigen::Vector3d;
64 Vector3d coords1(0.0, 0.0, 0.0);
65 Vector3d coords2(1.0, 0.0, 0.0);
66 Vector3d coords3(1.0, 1.0, 0.0);
87 BOOST_TEST((coords2 - coords1).dot(normal) == 0.0);
88 BOOST_TEST((coords3 - coords1).dot(normal) == 0.0);
93 constexpr double expectedRadius = 0.74535599249993001;
96 constexpr double expectedArea = 0.5;
97 BOOST_TEST(triangle.
getArea() == expectedArea);
103 using Eigen::Vector3d;
104 Vector3d coords1(0.0, 0.0, 0.0);
105 Vector3d coords2(1.0, 0.0, 0.0);
106 Vector3d coords3(1.0, 1.0, 0.0);
128 BOOST_TEST((coords2 - coords1).dot(normal) == 0.0);
129 BOOST_TEST((coords3 - coords1).dot(normal) == 0.0);
132 BOOST_TEST(
testing::equals(center, (coords1 + coords2 + coords3) / 3));
134 constexpr double expectedRadius = 0.74535599249993001;
137 constexpr double expectedArea = 0.5;
138 BOOST_TEST(triangle.
getArea() == expectedArea);
144 using Eigen::Vector3d;
145 Vector3d coords1(0.0, 0.0, 0.0);
146 Vector3d coords2(1.0, 0.0, 0.0);
147 Vector3d coords3(1.0, 1.0, 0.0);
169 BOOST_TEST((coords2 - coords1).dot(normal) == 0.0);
170 BOOST_TEST((coords3 - coords1).dot(normal) == 0.0);
173 BOOST_TEST(
testing::equals(center, (coords1 + coords2 + coords3) / 3));
175 constexpr double expectedRadius = 0.74535599249993001;
178 constexpr double expectedArea = 0.5;
179 BOOST_TEST(triangle.
getArea() == expectedArea);
185 using Eigen::Vector3d;
186 Vector3d coords1(0.0, 0.0, 0.0);
187 Vector3d coords2(1.0, 0.0, 0.0);
188 Vector3d coords3(1.0, 1.0, 0.0);
202 auto ibegin = triangle.
begin();
203 const auto iend = triangle.
end();
211 BOOST_TEST((ibegin == iend));
215 const Triangle &ctriangle = triangle;
216 auto ibegin = ctriangle.
begin();
217 const auto iend = ctriangle.
end();
225 BOOST_TEST((ibegin == iend));
229 auto ibegin = triangle.
cbegin();
230 const auto iend = triangle.
cend();
238 BOOST_TEST((ibegin == iend));
245 using Eigen::Vector3d;
246 Vector3d coords1(0.0, 0.0, 0.0);
247 Vector3d coords2(1.0, 0.0, 0.0);
248 Vector3d coords3(1.0, 1.0, 0.0);
249 Vector3d coords4(2.0, 0.0, 0.0);
267 BOOST_TEST(triangle1 == triangle2);
273 BOOST_TEST(triangle1 == triangle2);
274 BOOST_TEST(triangle1 != triangle3);
275 BOOST_TEST(triangle4 == triangle3);
281 Vertex v1(Eigen::Vector3d(0., 0., 0.), 0);
282 Vertex v2(Eigen::Vector3d(0., 1., 0.), 0);
283 Vertex v3(Eigen::Vector3d(1., 0., 0.), 0);
290 std::string t1string(
"POLYGON ((0 0 0, 0 1 0, 1 0 0, 0 0 0))");
291 BOOST_TEST(t1string == stream.
str());
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
#define PRECICE_TEST(...)
BOOST_AUTO_TEST_CASE(DirectionalEdges)
Linear edge of a mesh, defined by two Vertex objects.
Triangle of a mesh, defined by three vertices.
double getArea() const
Returns the surface area of the triangle.
iterator begin()
Returns a read-only random-access iterator to the begin (0) of the vertex range [0,...
const_iterator cbegin() const
Returns a read-only random-access iterator to the begin (0) of the vertex range [0,...
iterator end()
Returns a read-only random-access iterator to the end (3) of the vertex range [0,1,...
double getEnclosingRadius() const
Returns the radius of the circle enclosing the triangle.
Eigen::VectorXd computeNormal() const
Computes the normal of the triangle.
Vertex & vertex(int i)
Returns triangle vertex with index 0, 1 or 2.
const Eigen::VectorXd getCenter() const
Returns the barycenter of the triangle.
const_iterator cend() const
Returns a read-only random access iterator to the end (3) of the vertex range [0,1,...
VertexID getID() const
Returns the unique (among vertices of one mesh on one processor) ID of the vertex.
const RawCoords & rawCoords() const
Direct access to the coordinates.
provides Mesh, Data and primitives.
boost::test_tools::predicate_result equals(const std::vector< float > &VectorA, const std::vector< float > &VectorB, float tolerance)
equals to be used in tests. Compares two std::vectors using a given tolerance. Prints both operands o...
Main namespace of the precice library.