Skip to content

Commit

Permalink
Test MatchingPartitioner in atlas_test_meshgen_splitcomm
Browse files Browse the repository at this point in the history
  • Loading branch information
wdeconinck committed Aug 30, 2023
1 parent a760ea9 commit b5f8bda
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/tests/mesh/test_meshgen_splitcomm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include "atlas/mesh/Mesh.h"
#include "atlas/meshgenerator.h"
#include "atlas/output/Gmsh.h"
#include "atlas/grid/Partitioner.h"

#include "tests/AtlasTestEnvironment.h"

namespace atlas {
Expand All @@ -37,6 +39,11 @@ Grid grid() {
return g;
}

Grid grid_B() {
static Grid g (color() == 0 ? "F64" : "O64" );
return g;
}

struct Fixture {
Fixture() {
mpi::comm().split(color(),"split");
Expand Down Expand Up @@ -83,6 +90,23 @@ CASE("Mesh constructor") {
mesh.polygon().outputPythonScript(grid().name()+"_polygons_2.py");
}

CASE("MatchingPartitioner") {
Fixture fixture;

auto mesh_A = Mesh(grid(), option::mpi_comm("split"));
auto mesh_B = Mesh(grid_B(), grid::MatchingPartitioner(mesh_A), option::mpi_comm("split"));

output::Gmsh gmsh_B(grid_B().name()+"_3.msh");
gmsh_B.write(mesh_B);

// partitioning graph and polygon output
EXPECT_NO_THROW(mesh_B.partitionGraph());
EXPECT_NO_THROW(mesh_B.polygons());
mesh_B.polygon().outputPythonScript(grid_B().name()+"_polygons_3.py");
}



} // namespace test
} // namespace atlas

Expand Down

0 comments on commit b5f8bda

Please sign in to comment.