1 #include "../geom/elem_test.h" 3 #ifdef LIBMESH_HAVE_EXODUS_API 5 #include "libmesh/enum_to_string.h" 6 #include "libmesh/exodusII_io.h" 7 #include "libmesh/mesh_communication.h" 8 #include "libmesh/mesh_serializer.h" 12 template <ElemType elem_type>
32 const dof_id_type max_elem_id = this->_mesh->max_elem_id();
33 const dof_id_type max_node_id = this->_mesh->max_node_id();
35 CPPUNIT_ASSERT_EQUAL(max_elem_id, other_mesh.
max_elem_id());
36 CPPUNIT_ASSERT_EQUAL(max_node_id, other_mesh.
max_node_id());
40 for (
Elem * e1 : this->_mesh->element_ptr_range())
42 const Elem * e2c = (*locator)(e1->vertex_average());
58 #ifdef LIBMESH_ENABLE_UNIQUE_ID 63 for (
Node * n1 : this->_mesh->node_ptr_range())
65 const Elem * e1c = (*locator)(*n1);
71 n1->processor_id() = 0;
84 #ifdef LIBMESH_ENABLE_UNIQUE_ID 89 #ifdef LIBMESH_ENABLE_UNIQUE_ID 91 this->_mesh->set_next_unique_id(this->_mesh->parallel_max_unique_id());
94 return *this->_mesh == other_mesh;
107 exii.
read(
"meshes/exodus_elements/read_exodus_" +
113 CPPUNIT_ASSERT(this->meshes_equal_enough(input_mesh));
126 exii.
write(
"write_exodus_" +
133 exii_input.
read(
"write_exodus_" +
139 CPPUNIT_ASSERT(this->meshes_equal_enough(input_mesh));
144 CPPUNIT_TEST( test_read_gold ); \ 145 CPPUNIT_TEST( test_write ); 147 #define INSTANTIATE_EXODUSTEST(elemtype) \ 148 class ExodusTest_##elemtype : public ExodusTest<elemtype> { \ 150 ExodusTest_##elemtype() : \ 151 ExodusTest<elemtype>() { \ 152 if (unitlog->summarized_logs_enabled()) \ 153 this->libmesh_suite_name = "ExodusTest"; \ 155 this->libmesh_suite_name = "ExodusTest_" #elemtype; \ 157 CPPUNIT_TEST_SUITE( ExodusTest_##elemtype ); \ 159 CPPUNIT_TEST_SUITE_END(); \ 162 CPPUNIT_TEST_SUITE_REGISTRATION( ExodusTest_##elemtype ) 180 #endif // LIBMESH_DIM > 1 200 #ifdef LIBMESH_ENABLE_EXCEPTIONS 206 #endif // LIBMESH_DIM > 2 208 #endif // LIBMESH_HAVE_EXODUS_API unique_id_type & set_unique_id()
A Node is like a Point, but with more information.
std::unique_ptr< PointLocatorBase > sub_point_locator() const
virtual void renumber_elem(dof_id_type old_id, dof_id_type new_id) override final
Changes the id of element old_id, both by changing elem(old_id)->id() and by moving elem(old_id) in t...
libMesh::Parallel::Communicator * TestCommWorld
The ExodusII_IO class implements reading meshes in the ExodusII file format from Sandia National Labs...
void prepare_for_use(const bool skip_renumber_nodes_and_elements, const bool skip_find_neighbors)
Prepare a newly ecreated (or read) mesh for use.
bool meshes_equal_enough(Mesh &other_mesh)
This is the base class from which all geometric element types are derived.
The libMesh namespace provides an interface to certain functionality in the library.
This is the MeshCommunication class.
virtual void set_next_unique_id(unique_id_type id) override
Sets the next available unique id to be used.
virtual void read(const std::string &name) override
This method implements reading a mesh from a specified file.
std::string enum_to_string(const T e)
SimpleRange< NodeRefIter > node_ref_range()
Returns a range with all nodes of an element, usable in range-based for loops.
virtual void renumber_node(dof_id_type old_id, dof_id_type new_id) override final
Changes the id of node old_id, both by changing node(old_id)->id() and by moving node(old_id) in the ...
Temporarily serialize a DistributedMesh for non-distributed-mesh capable code paths.
virtual void write(const std::string &fname) override
This method implements writing a mesh to a specified file.
virtual dof_id_type max_node_id() const override final
void broadcast(MeshBase &) const
Finds all the processors that may contain elements that neighbor my elements.
INSTANTIATE_EXODUSTEST(EDGE2)
virtual const Elem & elem_ref(const dof_id_type i) const
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
processor_id_type processor_id() const
virtual dof_id_type max_elem_id() const override final
processor_id_type processor_id() const
A Point defines a location in LIBMESH_DIM dimensional Real space.
virtual const Node * node_ptr(const dof_id_type i) const override final