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);
69 #if LIBMESH_DEFAULT_QUADRUPLE_PRECISION 82 if (diff.
norm() < 1e-15)
84 (*n1)(d) =
double(n(d));
90 n1->processor_id() = 0;
103 #ifdef LIBMESH_ENABLE_UNIQUE_ID 108 #ifdef LIBMESH_ENABLE_UNIQUE_ID 110 this->_mesh->set_next_unique_id(this->_mesh->parallel_max_unique_id());
113 return *this->_mesh == other_mesh;
126 exii.
read(
"meshes/exodus_elements/read_exodus_" +
132 CPPUNIT_ASSERT(this->meshes_equal_enough(input_mesh));
145 exii.
write(
"write_exodus_" +
152 exii_input.
read(
"write_exodus_" +
158 CPPUNIT_ASSERT(this->meshes_equal_enough(input_mesh));
163 CPPUNIT_TEST( test_read_gold ); \ 164 CPPUNIT_TEST( test_write ); 166 #define INSTANTIATE_EXODUSTEST(elemtype) \ 167 class ExodusTest_##elemtype : public ExodusTest<elemtype> { \ 169 ExodusTest_##elemtype() : \ 170 ExodusTest<elemtype>() { \ 171 if (unitlog->summarized_logs_enabled()) \ 172 this->libmesh_suite_name = "ExodusTest"; \ 174 this->libmesh_suite_name = "ExodusTest_" #elemtype; \ 176 CPPUNIT_TEST_SUITE( ExodusTest_##elemtype ); \ 178 CPPUNIT_TEST_SUITE_END(); \ 181 CPPUNIT_TEST_SUITE_REGISTRATION( ExodusTest_##elemtype ) 199 #endif // LIBMESH_DIM > 1 219 #ifdef LIBMESH_ENABLE_EXCEPTIONS 225 #endif // LIBMESH_DIM > 2 227 #endif // LIBMESH_HAVE_EXODUS_API unique_id_type & set_unique_id()
A Node is like a Point, but with more information.
auto norm() const -> decltype(std::norm(T()))
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
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...
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