3 #include "libmesh/enum_to_string.h" 4 #include "libmesh/mesh_communication.h" 5 #include "libmesh/xdr_io.h" 9 template <ElemType elem_type>
20 XdrIO xdr_io(input_mesh);
22 xdr_io.
read(
"meshes/xdrio_elements/read_xdrio_" +
24 (binary ?
".xdr" :
".xda"));
28 CPPUNIT_ASSERT(this->meshes_equal_enough(input_mesh,
false));
43 XdrIO xdr_io(*this->_mesh);
45 xdr_io.
write(
"write_xdrio_" +
47 (binary ?
".xdr" :
".xda"));
51 XdrIO xdr_io_input(input_mesh);
52 xdr_io_input.
binary() = binary;
53 xdr_io_input.
read(
"write_xdrio_" +
55 (binary ?
".xdr" :
".xda"));
60 CPPUNIT_ASSERT(this->meshes_equal_enough(input_mesh,
false));
70 CPPUNIT_TEST( test_read_gold_xda ); \ 71 CPPUNIT_TEST( test_read_gold_xdr ); \ 72 CPPUNIT_TEST( test_write_xda ); \ 73 CPPUNIT_TEST( test_write_xdr ); 76 CPPUNIT_TEST( test_read_gold_xda ); \ 77 CPPUNIT_TEST( test_write_xda ); 80 #define INSTANTIATE_XDRIOTEST(elemtype) \ 81 class XdrIOTest_##elemtype : public XdrIOTest<elemtype> { \ 83 XdrIOTest_##elemtype() : \ 84 XdrIOTest<elemtype>() { \ 85 if (unitlog->summarized_logs_enabled()) \ 86 this->libmesh_suite_name = "XdrIOTest"; \ 88 this->libmesh_suite_name = "XdrIOTest_" #elemtype; \ 90 CPPUNIT_TEST_SUITE( XdrIOTest_##elemtype ); \ 92 CPPUNIT_TEST_SUITE_END(); \ 95 CPPUNIT_TEST_SUITE_REGISTRATION( XdrIOTest_##elemtype ) 113 #endif // LIBMESH_DIM > 1 133 #ifdef LIBMESH_ENABLE_EXCEPTIONS 139 #endif // LIBMESH_DIM > 2
libMesh::Parallel::Communicator * TestCommWorld
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.
The libMesh namespace provides an interface to certain functionality in the library.
MeshIO class used for writing XDR (eXternal Data Representation) and XDA mesh files.
INSTANTIATE_XDRIOTEST(EDGE2)
This is the MeshCommunication class.
virtual void write(const std::string &) override
This method implements writing a mesh to a specified file.
void test_write(bool binary)
std::string enum_to_string(const T e)
void test_read_gold_xdr()
void broadcast(MeshBase &) const
Finds all the processors that may contain elements that neighbor my elements.
bool binary() const
Get/Set the flag indicating if we should read/write binary.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
void test_read_gold(bool binary)
virtual void read(const std::string &) override
This method implements reading a mesh from a specified file.
void test_read_gold_xda()