31 if (a0 == b0 || a0 == b1) {
34 if (a1 == b0 || a1 == b1) {
51template <std::
size_t n>
71template <std::
size_t n>
74 static_assert(n > 1,
"You already know the answer.");
83 if (edges[i - 1]->connectedTo(*edges[j])) {
94 if (!edges[n - 1]->connectedTo(*edges[n - 2]) ||
95 !edges[n - 1]->connectedTo(*edges[0])) {
110template <std::
size_t n>
113 static_assert(n > 0,
"Cannot handle nothing.");
116 [&mesh](
int id) { return &(mesh.vertex(id)); });
121template <std::
size_t n>
126 [&mesh](
int id) { return mesh.vertex(id).getCoords(); });
131template <std::
size_t n>
136 [](
Vertex *v) { return v->getCoords(); });
146template <
typename Container>
149 if (
const auto invalidIter =
std::find_if(container.begin(), container.end(), [&mesh](
VertexID id) { return !mesh.isValidVertexID(id); });
150 invalidIter != container.end()) {
An axis-aligned bounding box around a (partition of a) mesh.
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.
provides Mesh, Data and primitives.
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.
std::size_t countVerticesInBoundingBox(mesh::PtrMesh mesh, const mesh::BoundingBox &bb)
Given a Mesh and a bounding box, counts all vertices within the bounding box.
double edgeLength(const Edge &e)
Chain< n > asChain(std::array< mesh::Edge *, n > edges)
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