3#include <boost/container/flat_map.hpp>
16template <
typename UnaryPredicate>
21 boost::container::flat_map<VertexID, Vertex *> vertexMap;
28 if (vertex.isTagged())
31 vertexMap[vertex.getID()] = &v;
38 VertexID vertexIndex2 = edge.vertex(1).getID();
39 if (vertexMap.count(vertexIndex1) == 1 &&
40 vertexMap.count(vertexIndex2) == 1) {
41 destination.
createEdge(*vertexMap[vertexIndex1], *vertexMap[vertexIndex2]);
48 VertexID vertexIndex2 = triangle.vertex(1).getID();
49 VertexID vertexIndex3 = triangle.vertex(2).getID();
50 if (vertexMap.count(vertexIndex1) == 1 &&
51 vertexMap.count(vertexIndex2) == 1 &&
52 vertexMap.count(vertexIndex3) == 1) {
53 destination.
createTriangle(*vertexMap[vertexIndex1], *vertexMap[vertexIndex2], *vertexMap[vertexIndex3]);
60 VertexID vertexIndex2 = tetra.vertex(1).getID();
61 VertexID vertexIndex3 = tetra.vertex(2).getID();
62 VertexID vertexIndex4 = tetra.vertex(3).getID();
63 if (vertexMap.count(vertexIndex1) == 1 &&
64 vertexMap.count(vertexIndex2) == 1 &&
65 vertexMap.count(vertexIndex3) == 1 &&
66 vertexMap.count(vertexIndex4) == 1) {
67 destination.
createTetrahedron(*vertexMap[vertexIndex1], *vertexMap[vertexIndex2], *vertexMap[vertexIndex3], *vertexMap[vertexIndex4]);
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.
Triangle & createTriangle(Edge &edgeOne, Edge &edgeTwo, Edge &edgeThree)
Creates and initializes a Triangle object.
VertexContainer & vertices()
Returns modifieable container holding all vertices.
std::size_t nVertices() const
Returns the number of vertices.
TetraContainer & tetrahedra()
Returns modifiable container holding all tetrahedra.
Tetrahedron & createTetrahedron(Vertex &vertexOne, Vertex &vertexTwo, Vertex &vertexThree, Vertex &vertexFour)
Creates and initializes a Tetrahedron object.
TriangleContainer & triangles()
Returns modifiable container holding all triangles.
Edge & createEdge(Vertex &vertexOne, Vertex &vertexTwo)
Creates and initializes an Edge object.
EdgeContainer & edges()
Returns modifiable container holding all edges.
Vertex & createVertex(const Eigen::VectorXd &coords)
Creates and initializes a Vertex object.
Tetrahedron of a mesh, defined by 4 vertices.
Triangle of a mesh, defined by three vertices.
Vertex & vertex(int i)
Returns triangle vertex with index 0, 1 or 2.
VertexID getID() const
Returns the unique (among vertices of one mesh on one processor) ID of the vertex.
void setGlobalIndex(int globalIndex)
void setOwner(bool owner)
void filterMesh(Mesh &destination, const Mesh &source, UnaryPredicate p)
Main namespace of the precice library.