Commit 69ec956f authored by Lukas Riedel's avatar Lukas Riedel

Run GridMapper algorithms for parallel runs only

parent 0cffdd69
......@@ -61,20 +61,23 @@ public:
_element_index_map(element_index_map),
_boundary_index_map(boundary_index_map)
{
// create a mapping using global persistent IDs
auto id_map = build_id_map();
// broadcast this map
broadcast_id_map(id_map);
// load-balance the grid to all processors
_grid->loadBalance();
_mapper.update();
// rebuild the index map for local grid partition
rebuild_index_maps(id_map);
// broadcast the (global) boundary map
broadcast_vector(_boundary_index_map);
if (_gv.comm().size() > 1)
{
// create a mapping using global persistent IDs
auto id_map = build_id_map();
// broadcast this map
broadcast_id_map(id_map);
// load-balance the grid to all processors
_grid->loadBalance();
_mapper.update();
// rebuild the index map for local grid partition
rebuild_index_maps(id_map);
// broadcast the (global) boundary map
broadcast_vector(_boundary_index_map);
}
}
/// Create a GridMapper for a rectangular grid using cell coordinates.
......@@ -101,16 +104,19 @@ public:
_element_index_map(element_index_map),
_boundary_index_map(boundary_index_map)
{
// load-balance the grid to all processors
// (might have happened already)
_grid->loadBalance();
_mapper.update();
// broadcast the index vectors
broadcast_vector(element_index_map);
// recompute stuff
rebuild_index_maps(cells);
if (_gv.comm().size() > 1)
{
// load-balance the grid to all processors
// (might have happened already)
_grid->loadBalance();
_mapper.update();
// broadcast the index vectors
broadcast_vector(element_index_map);
// recompute stuff
rebuild_index_maps(cells);
}
}
/// Return a reference to the element index map
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment