2#include <Eigen/src/Core/Matrix.h>
21 Vertex v1(Vector3d::Constant(0.0), 0);
22 Vertex v2(Vector3d::Constant(1.0), 1);
28 BOOST_TEST(coords1 == Vector3d::Constant(0.0));
29 BOOST_TEST(coords2 == Vector3d::Constant(1.0));
32 double expectedRadius = expectedLenght / 2.0;
33 BOOST_TEST(edge.
getLength() == expectedLenght);
41 Vertex v1(Vector2d::Constant(0.0), 0);
42 Vertex v2(Vector2d::Constant(1.0), 1);
47 double expectedRadius = expectedLenght / 2.0;
48 BOOST_TEST(edge.
getLength() == expectedLenght);
56 Vertex v1(Vector2d::Constant(0.0), 0);
57 Vertex v2(Vector2d{1, 0}, 1);
59 BOOST_TEST(edge.getDimensions() == 2);
62 double expectedRadius = expectedLenght / 2.0;
63 BOOST_TEST(edge.getLength() == expectedLenght);
64 BOOST_TEST(edge.getEnclosingRadius() == expectedRadius);
71 Vertex v1(Vector2d::Constant(0.0), 0);
72 Vertex v2(Vector2d{0, 1}, 1);
74 BOOST_TEST(edge.getDimensions() == 2);
77 double expectedRadius = expectedLenght / 2.0;
78 BOOST_TEST(edge.getLength() == expectedLenght);
79 BOOST_TEST(edge.getEnclosingRadius() == expectedRadius);
86 Vertex v1(Vector3d::Constant(0.0), 0);
87 Vertex v2(Vector3d{1, 0, 0}, 1);
89 BOOST_TEST(edge.getDimensions() == 3);
92 double expectedRadius = expectedLenght / 2.0;
93 BOOST_TEST(edge.getLength() == expectedLenght);
94 BOOST_TEST(edge.getEnclosingRadius() == expectedRadius);
101 Vertex v1(Vector3d::Constant(0.0), 0);
102 Vertex v2(Vector3d{0, 1, 0}, 1);
104 BOOST_TEST(edge.getDimensions() == 3);
107 double expectedRadius = expectedLenght / 2.0;
108 BOOST_TEST(edge.getLength() == expectedLenght);
109 BOOST_TEST(edge.getEnclosingRadius() == expectedRadius);
116 Vertex v1(Vector3d::Constant(0.0), 0);
117 Vertex v2(Vector3d{0, 0, 1}, 1);
119 BOOST_TEST(edge.getDimensions() == 3);
122 double expectedRadius = expectedLenght / 2.0;
123 BOOST_TEST(edge.getLength() == expectedLenght);
124 BOOST_TEST(edge.getEnclosingRadius() == expectedRadius);
131 Vertex v1(Vector3d::Constant(0.0), 0);
132 Vertex v2(Vector3d::Constant(1.0), 1);
137 double expectedRadius = expectedLenght / 2.0;
138 BOOST_TEST(edge.
getLength() == expectedLenght);
146 Vertex v1(Vector3d(0, 0, 0), 0);
147 Vertex v2(Vector3d(0, 0, 1), 0);
148 Vertex v3(Vector3d(0, 0, 2), 0);
153 BOOST_TEST(edge1 == edge2);
154 BOOST_TEST(edge1 != edge3);
155 BOOST_TEST(edge3 == edge4);
161 Vertex v1(Vector2d(1., 2.), 0);
162 Vertex v2(Vector2d(2., 3.), 0);
167 BOOST_TEST(e1str == e1stream.
str());
168 Vertex v3(Vector3d(1., 2., 3.), 0);
169 Vertex v4(Vector3d(3., 2., 1.), 0);
174 BOOST_TEST(e2str == e2stream.
str());
180 Vertex v1(Vector3d(0, 0, 1), 0);
181 Vertex v2(Vector3d(0, 0, 2), 0);
182 Vertex v3(Vector3d(0, 0, 3), 0);
183 Vertex v4(Vector3d(0, 0, 4), 0);
BOOST_AUTO_TEST_CASE(Edges)
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
#define PRECICE_TEST(...)
Linear edge of a mesh, defined by two Vertex objects.
double getEnclosingRadius() const
Returns the radius of the enclosing circle of the edge.
double getLength() const
Returns the length of the edge.
int getDimensions() const
Returns number of spatial dimensions (2 or 3) the edge is embedded to.
const Eigen::VectorXd getCenter() const
Returns the center of the edge.
Vertex & vertex(int i)
Returns the edge's vertex with index 0 or 1.
bool connectedTo(const Edge &other) const
Checks whether both edges share a vertex.
Eigen::VectorXd getCoords() const
Returns the coordinates of the vertex.
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.