1 #include <libmesh/libmesh.h> 2 #include <libmesh/replicated_mesh.h> 3 #include <libmesh/elem.h> 4 #include <libmesh/mesh_generation.h> 5 #include <libmesh/mesh_modification.h> 6 #include "libmesh/mapped_subdomain_partitioner.h" 24 CPPUNIT_TEST( testMappedSubdomainPartitioner );
27 CPPUNIT_TEST_SUITE_END();
46 ymin = 0., ymax = 10.;
74 subdomain_partitioner->subdomain_to_proc[sbd_id] = sbd_id/2;
75 subdomain_partitioner->subdomain_to_proc[sbd_id+1] = sbd_id/2;
81 for (
auto & elem :
mesh.element_ptr_range())
83 elem->subdomain_id() = current_subdomain_id++;
86 if (current_subdomain_id == n_subdomains)
87 current_subdomain_id = 0;
95 for (
auto & elem :
mesh.element_ptr_range())
98 CPPUNIT_ASSERT_EQUAL(static_cast<int>(elem->subdomain_id()/2),
99 static_cast<int>(elem->processor_id()));
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
CPPUNIT_TEST_SUITE_REGISTRATION(MappedSubdomainPartitionerTest)
void testMappedSubdomainPartitioner()
libMesh::Parallel::Communicator * TestCommWorld
The MappedSubdomainPartitioner partitions the elements based on their subdomain ids.
virtual std::unique_ptr< Partitioner > & partitioner()
A partitioner to use at each prepare_for_use()
The libMesh namespace provides an interface to certain functionality in the library.
void setUp()
Note: this second public is necessary, something in the macros above leaves us in a private region...
virtual void partition(const unsigned int n_parts)
Call the default partitioner (currently metis_partition()).
processor_id_type size() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real