2 #include <libmesh/libmesh.h> 3 #include <libmesh/distributed_mesh.h> 4 #include <libmesh/replicated_mesh.h> 5 #include <libmesh/mesh_generation.h> 6 #include <libmesh/mesh.h> 7 #include <libmesh/point.h> 8 #include <libmesh/elem.h> 21 CPPUNIT_TEST( allSecondOrder );
22 CPPUNIT_TEST( allSecondOrderRange );
23 CPPUNIT_TEST( allSecondOrderDoNothing );
24 CPPUNIT_TEST( allSecondOrderMixed );
25 CPPUNIT_TEST( allSecondOrderMixedFixing );
26 CPPUNIT_TEST( allSecondOrderMixedFixing3D );
28 CPPUNIT_TEST( allCompleteOrder );
29 CPPUNIT_TEST( allCompleteOrderRange );
30 CPPUNIT_TEST( allCompleteOrderDoNothing );
31 CPPUNIT_TEST( allCompleteOrderMixed );
32 CPPUNIT_TEST( allCompleteOrderMixedFixing );
33 CPPUNIT_TEST( allCompleteOrderMixedFixing3D );
35 CPPUNIT_TEST_SUITE_END();
83 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(5),
mesh.
n_elem());
86 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(12),
mesh.
n_nodes());
115 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(4),
mesh.
n_elem());
118 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(25),
mesh.
n_nodes());
136 const unsigned int node_offset = elem->
n_nodes();
155 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(5),
mesh.
n_elem());
158 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(17),
mesh.
n_nodes());
161 CPPUNIT_ASSERT_EQUAL(
QUAD9, elem->
type());
168 template <
typename ConversionFunc>
170 ConversionFunc & conv,
189 auto range_start =
mesh.elements_begin();
190 const auto end =
mesh.elements_end();
191 while (range_start != end && (*range_start)->id() < start_elem_id)
193 auto range_end = range_start;
194 while (range_end != end && (*range_end)->id() < start_elem_id+1+start_elem_id%2)
197 conv({range_start, range_end});
201 CPPUNIT_ASSERT_EQUAL(expected_n_elem,
mesh.
n_elem());
204 CPPUNIT_ASSERT_EQUAL(expected_n_nodes,
mesh.
n_nodes());
207 for (
const auto & elem :
mesh.element_ptr_range())
208 CPPUNIT_ASSERT_EQUAL(expected_type, elem->type());
230 MixedFixingImpl(
mesh, conversion, 3*3, 7*7,
QUAD9);
249 MixedFixingImpl(
mesh, conversion, 3*3*3, 7*7*7,
HEX27);
274 Point z_trans(0,0,1);
293 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(5),
mesh.
n_elem());
296 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(12),
mesh.
n_nodes());
324 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(4),
mesh.
n_elem());
327 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(25),
mesh.
n_nodes());
345 const unsigned int node_offset = elem->
n_nodes();
364 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(5),
mesh.
n_elem());
367 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(17),
mesh.
n_nodes());
370 CPPUNIT_ASSERT_EQUAL(
QUAD9, elem->
type());
393 MixedFixingImpl(
mesh, conversion, 3*3*2, 7*7+3*3*2,
TRI7);
412 MixedFixingImpl(
mesh, conversion, 3*3*3*2, 7*7*7+3*3*2*7,
PRISM21);
void allCompleteOrderMixed()
ElemType
Defines an enum for geometric element types.
The SimpleRange templated class is intended to make it easy to construct ranges from pairs of iterato...
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
virtual Node *& set_node(const unsigned int i)
void allSecondOrderMixedFixing3D()
virtual void all_second_order_range(const SimpleRange< element_iterator > &range, const bool full_ordered=true)=0
Converts a set of this Mesh's elements defined by range from FIRST order to SECOND order...
void allow_renumbering(bool allow)
If false is passed in then this mesh will no longer be renumbered when being prepared for use...
void allSecondOrderMixedFixing()
libMesh::Parallel::Communicator * TestCommWorld
This is the base class from which all geometric element types are derived.
static void MixedFixingImpl(MeshBase &mesh, ConversionFunc &conv, dof_id_type expected_n_elem, dof_id_type expected_n_nodes, ElemType expected_type)
CPPUNIT_TEST_SUITE_REGISTRATION(AllSecondOrderTest)
The libMesh namespace provides an interface to certain functionality in the library.
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.
This is the MeshBase class.
virtual void all_complete_order_range(const SimpleRange< element_iterator > &range)=0
Converts a set of elements in this (conforming, non-refined) mesh into "complete" order elements...
void allow_remote_element_removal(bool allow)
If false is passed in then this mesh will no longer have remote elements deleted when being prepared ...
virtual unsigned int n_nodes() const =0
void allSecondOrderRange()
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
virtual dof_id_type max_elem_id() const =0
void allCompleteOrderRange()
void allCompleteOrderDoNothing()
The DistributedMesh class is derived from the MeshBase class, and is intended to provide identical fu...
virtual const Elem * elem_ptr(const dof_id_type i) const =0
void allCompleteOrderMixedFixing3D()
void allCompleteOrderMixedFixing()
virtual unsigned int n_vertices() const =0
subdomain_id_type subdomain_id() const
virtual void all_complete_order()
Calls the range-based version of this function with a range consisting of all elements in the mesh...
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...
void all_second_order(const bool full_ordered=true)
Calls the range-based version of this function with a range consisting of all elements in the mesh...
unsigned int level ElemType type std::set< subdomain_id_type > ss processor_id_type pid unsigned int level std::set< subdomain_id_type > virtual ss SimpleRange< element_iterator > active_subdomain_elements_ptr_range(subdomain_id_type sid)=0
virtual const Point & point(const dof_id_type i) const =0
void allSecondOrderDoNothing()
void allSecondOrderMixed()
virtual dof_id_type n_elem() const =0
virtual const Node * node_ptr(const dof_id_type i) const =0
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
virtual ElemType type() const =0
A Point defines a location in LIBMESH_DIM dimensional Real space.
virtual dof_id_type n_nodes() const =0