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>
136 const unsigned int node_offset = elem->
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());
274 Point z_trans(0,0,1);
345 const unsigned int node_offset = elem->
n_nodes();
370 CPPUNIT_ASSERT_EQUAL(
QUAD9, elem->
type());
CPPUNIT_TEST_SUITE_REGISTRATION(AllSecondOrderTest)
CPPUNIT_TEST(allCompleteOrder)
void allCompleteOrderMixed()
CPPUNIT_TEST(allCompleteOrderRange)
void allCompleteOrderRange()
void allSecondOrderRange()
CPPUNIT_TEST(allSecondOrderMixed)
CPPUNIT_TEST(allCompleteOrderDoNothing)
CPPUNIT_TEST(allSecondOrderMixedFixing)
CPPUNIT_TEST(allCompleteOrderMixed)
static void MixedFixingImpl(MeshBase &mesh, ConversionFunc &conv, dof_id_type expected_n_elem, dof_id_type expected_n_nodes, ElemType expected_type)
CPPUNIT_TEST(allCompleteOrderMixedFixing3D)
void allCompleteOrderMixedFixing3D()
CPPUNIT_TEST(allSecondOrder)
CPPUNIT_TEST(allSecondOrderDoNothing)
void allCompleteOrderMixedFixing()
void allSecondOrderMixedFixing()
void allSecondOrderMixedFixing3D()
LIBMESH_CPPUNIT_TEST_SUITE(AllSecondOrderTest)
void allCompleteOrderDoNothing()
void allSecondOrderDoNothing()
CPPUNIT_TEST(allSecondOrderRange)
void allSecondOrderMixed()
CPPUNIT_TEST(allSecondOrderMixedFixing3D)
CPPUNIT_TEST(allCompleteOrderMixedFixing)
The DistributedMesh class is derived from the MeshBase class, and is intended to provide identical fu...
This is the base class from which all geometric element types are derived.
virtual Node *& set_node(const unsigned int i)
virtual unsigned int n_vertices() const =0
virtual unsigned int n_nodes() const =0
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
subdomain_id_type subdomain_id() const
virtual ElemType type() const =0
This is the MeshBase class.
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 const Point & point(const dof_id_type i) const =0
virtual const Node * node_ptr(const dof_id_type i) const =0
virtual dof_id_type n_elem() const =0
void allow_renumbering(bool allow)
If false is passed in then this mesh will no longer be renumbered when being prepared for use.
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.
virtual dof_id_type n_nodes() const =0
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.
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.
virtual const Elem * elem_ptr(const dof_id_type i) const =0
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,...
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 dof_id_type max_elem_id() const =0
virtual void all_complete_order()
Calls the range-based version of this function with a range consisting of all elements in the mesh.
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
A Point defines a location in LIBMESH_DIM dimensional Real space.
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
The SimpleRange templated class is intended to make it easy to construct ranges from pairs of iterato...
Communicator * TestCommWorld
The libMesh namespace provides an interface to certain functionality in the library.
ElemType
Defines an enum for geometric element types.
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...