32 if (a0 == b0 || a0 == b1) {
35 if (a1 == b0 || a1 == b1) {
52template <std::
size_t n>
72template <std::
size_t n>
75 static_assert(n > 1,
"You already know the answer.");
84 if (edges[i - 1]->connectedTo(*edges[j])) {
95 if (!edges[n - 1]->connectedTo(*edges[n - 2]) ||
96 !edges[n - 1]->connectedTo(*edges[0])) {
111template <std::
size_t n>
114 static_assert(n > 0,
"Cannot handle nothing.");
117 [&mesh](
int id) { return &(mesh.vertex(id)); });
122template <std::
size_t n>
127 [&mesh](
int id) { return mesh.vertex(id).getCoords(); });
132template <std::
size_t n>
137 [](
Vertex *v) { return v->getCoords(); });
147template <
typename Container>
150 if (
const auto invalidIter =
std::find_if(container.begin(), container.end(), [&mesh](
VertexID id) { return !mesh.isValidVertexID(id); });
151 invalidIter != container.end()) {
Linear edge of a mesh, defined by two Vertex objects.
Vertex & vertex(int i)
Returns the edge's vertex with index 0 or 1.
Container and creator for meshes.
Eigen::VectorXd getCoords() const
Returns the coordinates of the vertex.
contains data mapping from points to meshes.
Eigen::VectorXd integrateSurface(const PtrMesh &mesh, const Eigen::VectorXd &input)
Given the data and the mesh, this function returns the surface integral. Assumes no overlap exists fo...
Eigen::VectorXd integrateVolume(const PtrMesh &mesh, const Eigen::VectorXd &input)
Given the data and the mesh, this function returns the volume integral. Assumes no overlap exists for...
std::array< Eigen::VectorXd, n > coordsFor(const Mesh &mesh, const std::array< int, n > &vertexIDs)
Given a mesh and an array of vertexIDS, this function returns an array of coordinates of the vertices...
std::shared_ptr< Mesh > PtrMesh
Vertex * sharedVertex(Edge &a, Edge &b)
std::optional< std::size_t > locateInvalidVertexID(const Mesh &mesh, const Container &container)
std::array< Vertex *, n > vertexPtrsFor(Mesh &mesh, const std::array< int, n > &vertexIDs)
Given a mesh and an array of vertexIDS, this function returns an array of pointers to vertices.
double edgeLength(const Edge &e)
Chain< n > asChain(std::array< mesh::Edge *, n > edges)
Main namespace of the precice library.
std::array< Edge *, n > edges
undefined if not connected
bool connected
true if the chain is connected or closed and thus valid
std::array< Vertex *, n > vertices
undefined if not connected