Commit dae8a65c authored by Bernd Flemisch's avatar Bernd Flemisch Committed by Timo Koch
Browse files

Merge branch 'fix/error-message-gridgeometry-parallel-box' into 'master'

Fix/error message gridgeometry parallel box

Closes #786

See merge request !1795

(cherry picked from commit c87e5a23)

d77200c6 [fix][box] Throw error if someone tries to run box in parallel with overlap
4e8af5db [fix][box] Box does not support periodic boundaries in parallel
620e8f7c [io][spgrid] dune-spgrid does not support zero overlap
parent 4f26ba68
......@@ -291,6 +291,10 @@ public:
}
}
}
// error check: periodic boundaries currently don't work for box in parallel
if (this->isPeriodic() && this->gridView().comm().size() > 1)
DUNE_THROW(Dune::NotImplemented, "Periodic boundaries for box method for parallel simulations!");
}
//! The finite element cache for creating local FE bases
......@@ -389,9 +393,9 @@ public:
: ParentType(gridView)
{
// Check if the overlap size is what we expect
// if (!CheckOverlapSize<DiscretizationMethod::box>::isValid(gridView))
// DUNE_THROW(Dune::InvalidStateException, "The box discretization method only works with zero overlap for parallel computations. "
// << " Set the parameter \"Grid.Overlap\" in the input file.");
if (!CheckOverlapSize<DiscretizationMethod::box>::isValid(gridView))
DUNE_THROW(Dune::InvalidStateException, "The box discretization method only works with zero overlap for parallel computations. "
<< " Set the parameter \"Grid.Overlap\" in the input file.");
}
//! the vertex mapper is the dofMapper
......@@ -495,6 +499,10 @@ public:
}
}
}
// error check: periodic boundaries currently don't work for box in parallel
if (this->isPeriodic() && this->gridView().comm().size() > 1)
DUNE_THROW(Dune::NotImplemented, "Periodic boundaries for box method for parallel simulations!");
}
//! The finite element cache for creating local FE bases
......
......@@ -58,6 +58,10 @@ public:
*/
void init(const std::string& paramGroup = "")
{
const auto overlap = getParamFromGroup<int>(paramGroup, "Grid.Overlap", 1);
if (overlap == 0)
DUNE_THROW(Dune::NotImplemented, "dune-spgrid does currently not support zero overlap!");
// try to create it from file
if (hasParamInGroup(paramGroup, "Grid.File"))
{
......@@ -78,7 +82,6 @@ public:
cells = getParamFromGroup<IntArray>(paramGroup, "Grid.Cells", cells);
const auto periodic = getParamFromGroup<std::bitset<dim>>(paramGroup, "Grid.Periodic", std::bitset<dim>{});
const auto overlap = getParamFromGroup<int>(paramGroup, "Grid.Overlap", 1);
IntArray spOverlap; spOverlap.fill(overlap);
using Domain = typename Grid::Domain;
......
Supports Markdown
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