1 #include "libmesh/distributed_mesh.h" 2 #include "libmesh/replicated_mesh.h" 3 #include "libmesh/checkpoint_io.h" 4 #include "libmesh/mesh_generation.h" 5 #include "libmesh/parallel.h" 6 #include "libmesh/partitioner.h" 22 CPPUNIT_TEST( testAsciiDistRepSplitter );
23 CPPUNIT_TEST( testBinaryDistRepSplitter );
24 CPPUNIT_TEST( testAsciiRepDistSplitter );
25 CPPUNIT_TEST( testBinaryRepDistSplitter );
26 CPPUNIT_TEST( testAsciiRepRepSplitter );
27 CPPUNIT_TEST( testBinaryRepRepSplitter );
28 CPPUNIT_TEST( testAsciiDistDistSplitter );
29 CPPUNIT_TEST( testBinaryDistDistSplitter );
32 CPPUNIT_TEST_SUITE_END();
46 template <
typename MeshA,
typename MeshB>
47 void testSplitter(
bool binary,
bool using_distmesh,
bool skip_partition =
false)
50 #ifdef LIBMESH_HAVE_XDR 55 const unsigned int n_procs = using_distmesh ?
63 const std::string filename =
64 std::string(
"checkpoint_splitter.cp") + (binary ?
"r" :
"a");
115 std::size_t read_in_elements = 0;
120 mesh.pid_elements_end(pid));
125 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(read_in_elements), original_n_elem);
127 #endif // LIBMESH_HAVE_XDR 134 testSplitter<DistributedMesh, ReplicatedMesh>(
false,
true);
141 testSplitter<DistributedMesh, ReplicatedMesh>(
true,
true);
148 testSplitter<ReplicatedMesh, DistributedMesh>(
false,
true);
155 testSplitter<ReplicatedMesh, DistributedMesh>(
true,
true);
162 testSplitter<ReplicatedMesh, ReplicatedMesh>(
false,
false);
169 testSplitter<ReplicatedMesh, ReplicatedMesh>(
true,
false);
176 testSplitter<DistributedMesh, DistributedMesh>(
false,
true);
183 testSplitter<DistributedMesh, DistributedMesh>(
true,
true);
190 testSplitter<DistributedMesh, DistributedMesh>(
false,
true,
true);
The CheckpointIO class can be used to write simplified restart files that can be used to restart simu...
virtual void write(const std::string &name) override
This method implements writing a mesh to a specified file.
const processor_id_type & current_n_processors() const
Get/Set the n_processors to use.
void testBinaryRepRepSplitter()
void skip_partitioning(bool skip)
If true is passed in then nothing on this mesh will be (re)partitioned.
libMesh::Parallel::Communicator * TestCommWorld
virtual void read(const std::string &input_name) override
This method implements reading a mesh from a specified file.
void testAsciiDistDistSplitterCache()
const Parallel::Communicator & comm() const
The libMesh namespace provides an interface to certain functionality in the library.
bool parallel() const
Get/Set the flag indicating if we should read/write binary.
Real distance(const Point &p)
void testSplitter(bool binary, bool using_distmesh, bool skip_partition=false)
virtual void partition(const unsigned int n_parts)
Call the default partitioner (currently metis_partition()).
void testBinaryDistDistSplitter()
const std::vector< processor_id_type > & current_processor_ids() const
Get/Set the processor id or processor ids to use.
processor_id_type size() const
uint8_t processor_id_type
processor_id_type n_processors() const
void testAsciiRepRepSplitter()
CPPUNIT_TEST_SUITE_REGISTRATION(CheckpointIOTest)
unsigned int n_partitions() const
void testAsciiDistDistSplitter()
void testAsciiDistRepSplitter()
bool binary() const
Get/Set the flag indicating if we should read/write binary.
void testBinaryDistRepSplitter()
void testBinaryRepDistSplitter()
virtual dof_id_type n_elem() const =0
processor_id_type processor_id() const
void testAsciiRepDistSplitter()