10 #include "gtest/gtest.h" 12 #include "libmesh/face_tri3.h" 13 #include "libmesh/edge_edge2.h" 15 #include <libmesh/serial_mesh.h> 19 TEST(WaterTightTest, TwoDGeoOpenAndClose)
22 std::vector<Point> points = {
31 auto mesh = std::make_unique<libMesh::SerialMesh>(comm);
32 std::vector<Node *> node_ptrs;
34 for (
unsigned int i = 0; i < points.size(); ++i)
37 std::vector<std::pair<unsigned int, unsigned int>> open_edges = {{0, 1}, {1, 2}, {2, 3}};
38 for (
const auto & [id1, id2] : open_edges)
41 edge->set_node(0) = node_ptrs[id1];
42 edge->set_node(1) = node_ptrs[id2];
48 std::vector<const Elem *> raw_ptrs;
49 for (
const auto * el :
mesh->active_local_element_ptr_range())
50 raw_ptrs.push_back(el);
57 auto mesh = std::make_unique<libMesh::SerialMesh>(comm);
58 std::vector<Node *> node_ptrs;
60 for (
unsigned int i = 0; i < points.size(); ++i)
63 std::vector<std::pair<unsigned int, unsigned int>> closed_edges = {
64 {0, 1}, {1, 2}, {2, 3}, {3, 0}};
65 for (
const auto & [id1, id2] : closed_edges)
68 edge->set_node(0) = node_ptrs[id1];
69 edge->set_node(1) = node_ptrs[id2];
75 std::vector<const Elem *> raw_ptrs;
76 for (
const auto * el :
mesh->active_local_element_ptr_range())
77 raw_ptrs.push_back(el);
83 TEST(WaterTightTest, ThreeDGeoOpenAndClose)
86 std::vector<Point> points = {
95 auto mesh = std::make_unique<libMesh::SerialMesh>(comm);
96 std::vector<Node *> node_ptrs;
98 for (
unsigned int i = 0; i < points.size(); ++i)
101 std::vector<std::tuple<unsigned int, unsigned int, unsigned int>> open_faces = {
102 {0, 1, 2}, {0, 1, 3}, {1, 2, 3}};
103 for (
const auto & [id1, id2, id3] : open_faces)
105 auto tri =
new Tri3();
106 tri->set_node(0) = node_ptrs[id1];
107 tri->set_node(1) = node_ptrs[id2];
108 tri->set_node(2) = node_ptrs[id3];
114 std::vector<const Elem *> raw_ptrs;
115 for (
const auto * el :
mesh->active_local_element_ptr_range())
116 raw_ptrs.push_back(el);
123 auto mesh = std::make_unique<libMesh::SerialMesh>(comm);
124 std::vector<Node *> node_ptrs;
126 for (
unsigned int i = 0; i < points.size(); ++i)
129 std::vector<std::tuple<unsigned int, unsigned int, unsigned int>> closed_faces = {
130 {0, 1, 2}, {0, 1, 3}, {1, 2, 3}, {0, 2, 3}};
131 for (
const auto & [id1, id2, id3] : closed_faces)
133 auto tri =
new Tri3();
134 tri->set_node(0) = node_ptrs[id1];
135 tri->set_node(1) = node_ptrs[id2];
136 tri->set_node(2) = node_ptrs[id3];
142 std::vector<const Elem *> raw_ptrs;
143 for (
const auto * el :
mesh->active_local_element_ptr_range())
144 raw_ptrs.push_back(el);
void prepare_for_use(const bool skip_renumber_nodes_and_elements, const bool skip_find_neighbors)
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
virtual Node * add_point(const Point &p, const dof_id_type id=DofObject::invalid_id, const processor_id_type proc_id=DofObject::invalid_processor_id)=0
bool checkWatertightnessFromRawElems(const std::vector< const Elem *> &bd_elements)
virtual Elem * add_elem(Elem *e)=0
TEST(WaterTightTest, TwoDGeoOpenAndClose)