23 using Eigen::Vector3d;
24 Vector3d coords1(0.0, 0.0, 0.0);
25 Vector3d coords2(1.0, 0.0, 0.0);
26 Vector3d coords3(1.0, 1.0, 0.0);
48 BOOST_TEST((coords2 - coords1).dot(normal) == 0.0);
49 BOOST_TEST((coords3 - coords1).dot(normal) == 0.0);
54 constexpr double expectedRadius = 0.74535599249993001;
57 constexpr double expectedArea = 0.5;
58 BOOST_TEST(triangle.
getArea() == expectedArea);
65 using Eigen::Vector3d;
66 Vector3d coords1(0.0, 0.0, 0.0);
67 Vector3d coords2(1.0, 0.0, 0.0);
68 Vector3d coords3(1.0, 1.0, 0.0);
89 BOOST_TEST((coords2 - coords1).dot(normal) == 0.0);
90 BOOST_TEST((coords3 - coords1).dot(normal) == 0.0);
95 constexpr double expectedRadius = 0.74535599249993001;
98 constexpr double expectedArea = 0.5;
99 BOOST_TEST(triangle.
getArea() == expectedArea);
106 using Eigen::Vector3d;
107 Vector3d coords1(0.0, 0.0, 0.0);
108 Vector3d coords2(1.0, 0.0, 0.0);
109 Vector3d coords3(1.0, 1.0, 0.0);
131 BOOST_TEST((coords2 - coords1).dot(normal) == 0.0);
132 BOOST_TEST((coords3 - coords1).dot(normal) == 0.0);
135 BOOST_TEST(
testing::equals(center, (coords1 + coords2 + coords3) / 3));
137 constexpr double expectedRadius = 0.74535599249993001;
140 constexpr double expectedArea = 0.5;
141 BOOST_TEST(triangle.
getArea() == expectedArea);
148 using Eigen::Vector3d;
149 Vector3d coords1(0.0, 0.0, 0.0);
150 Vector3d coords2(1.0, 0.0, 0.0);
151 Vector3d coords3(1.0, 1.0, 0.0);
173 BOOST_TEST((coords2 - coords1).dot(normal) == 0.0);
174 BOOST_TEST((coords3 - coords1).dot(normal) == 0.0);
177 BOOST_TEST(
testing::equals(center, (coords1 + coords2 + coords3) / 3));
179 constexpr double expectedRadius = 0.74535599249993001;
182 constexpr double expectedArea = 0.5;
183 BOOST_TEST(triangle.
getArea() == expectedArea);
190 using Eigen::Vector3d;
191 Vector3d coords1(0.0, 0.0, 0.0);
192 Vector3d coords2(1.0, 0.0, 0.0);
193 Vector3d coords3(1.0, 1.0, 0.0);
207 auto ibegin = triangle.
begin();
208 const auto iend = triangle.
end();
216 BOOST_TEST((ibegin == iend));
220 const Triangle &ctriangle = triangle;
221 auto ibegin = ctriangle.
begin();
222 const auto iend = ctriangle.
end();
230 BOOST_TEST((ibegin == iend));
234 auto ibegin = triangle.
cbegin();
235 const auto iend = triangle.
cend();
243 BOOST_TEST((ibegin == iend));
251 using Eigen::Vector3d;
252 Vector3d coords1(0.0, 0.0, 0.0);
253 Vector3d coords2(1.0, 0.0, 0.0);
254 Vector3d coords3(1.0, 1.0, 0.0);
255 Vector3d coords4(2.0, 0.0, 0.0);
273 BOOST_TEST(triangle1 == triangle2);
279 BOOST_TEST(triangle1 == triangle2);
280 BOOST_TEST(triangle1 != triangle3);
281 BOOST_TEST(triangle4 == triangle3);
288 Vertex v1(Eigen::Vector3d(0., 0., 0.), 0);
289 Vertex v2(Eigen::Vector3d(0., 1., 0.), 0);
290 Vertex v3(Eigen::Vector3d(1., 0., 0.), 0);
297 std::string t1string(
"POLYGON ((0 0 0, 0 1 0, 1 0 0, 0 0 0))");
298 BOOST_TEST(t1string == stream.
str());
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
#define PRECICE_TEST_SETUP(...)
Creates and attaches a TestSetup to a Boost test case.
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.