3#include "libmesh/enum_to_string.h"
4#include "libmesh/mesh_communication.h"
5#include "libmesh/xdr_io.h"
9template <ElemType elem_type>
20 XdrIO xdr_io(input_mesh);
22 xdr_io.
read(
"meshes/xdrio_elements/read_xdrio_" +
24 (binary ?
".xdr" :
".xda"));
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"));
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 )
133#ifdef LIBMESH_ENABLE_EXCEPTIONS
bool meshes_equal_enough(Mesh &other_mesh, bool double_precision)
std::unique_ptr< Mesh > _mesh
void test_read_gold(bool binary)
void test_write(bool binary)
void test_read_gold_xda()
void test_read_gold_xdr()
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.
This is the MeshCommunication class.
void broadcast(MeshBase &) const
This method takes a mesh (which is assumed to reside on processor 0) and broadcasts it to all the oth...
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
MeshIO class used for writing XDR (eXternal Data Representation) and XDA mesh files.
bool binary() const
Get/Set the flag indicating if we should read/write binary.
virtual void write(const std::string &) override
This method implements writing a mesh to a specified file.
virtual void read(const std::string &) override
This method implements reading a mesh from a specified file.
Communicator * TestCommWorld
std::string enum_to_string(const T e)
The libMesh namespace provides an interface to certain functionality in the library.
INSTANTIATE_XDRIOTEST(EDGE2)