223 std::vector<std::shared_ptr<Polygon>> sides(nodes_on_side.size());
226 const auto & nodes_on_s = nodes_on_side[s];
227 sides[s] = std::make_shared<C0Polygon>(nodes_on_s.size());
232 std::unique_ptr<Node> mid_elem_node;
233 std::unique_ptr<Elem> polyhedron =
234 std::make_unique<C0Polyhedron>(sides, mid_elem_node);
240 const auto * poly = cast_ptr<const C0Polyhedron *>(elem);
241 const dof_id_type n_elem_expected = poly->n_subelements();
245 for (
unsigned int s = 0; s < elem->
n_sides(); ++s)
250 std::size_t n_bcs_expected = 0;
251 for (
unsigned int s = 0; s < elem->
n_sides(); ++s)
252 n_bcs_expected += sides[s]->n_subtriangles();
255 std::vector<std::array<int, 4>> sub_elem_sides_to_parent_side(elem->
n_sub_elem());
257 sub_elem_sides_to_parent_side[
b] = poly->subelement_sides_to_poly_sides(
b);
259 Real poly_volume = poly->volume();
264 CPPUNIT_ASSERT_EQUAL(n_elem_expected,
mesh.
n_elem());
265 CPPUNIT_ASSERT_EQUAL(n_bcs_expected,
268 for (
const Elem * e :
mesh.element_ptr_range())
272 for (
const Elem * e :
mesh.element_ptr_range())
276 const auto side = sub_elem_sides_to_parent_side[e->id()][s];
std::size_t n_boundary_conds() const
ElemType
Defines an enum for geometric element types.
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
libMesh::Parallel::Communicator * TestCommWorld
static constexpr Real TOLERANCE
void prepare_for_use(const bool skip_renumber_nodes_and_elements, const bool skip_find_neighbors)
Prepare a newly created (or read) mesh for use.
This is the base class from which all geometric element types are derived.
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
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
Add a new Node at Point p to the end of the vertex array, with processor_id procid.
const int invalid_int
A number which is used quite often to represent an invalid or uninitialized value for an integer...
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
virtual Node * add_node(Node *n)=0
Add Node n to the end of the vertex array.
virtual unsigned int n_sides() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void add_side(const dof_id_type elem, const unsigned short int side, const boundary_id_type id)
Add side side of element number elem with boundary id id to the boundary information data structure...
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
virtual unsigned int n_sub_elem() const =0
virtual dof_id_type n_elem() const =0
virtual const Node * node_ptr(const dof_id_type i) const =0
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...