Commit 43a2cbb8 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'issue/structured-grid-factory-dim-dow' into 'master'

Restrict the structured mesh creator to dim=dow grids

See merge request amdis/amdis!3
parents 5a7ecdc2 afd43f49
......@@ -164,17 +164,22 @@ namespace AMDiS
template <class Size = unsigned int, class Factory>
std::unique_ptr<HostGrid> create_structured_grid(Factory factory) const
{
// Lower left corner of the domain
Dune::FieldVector<ctype,int(dimworld)> lower(0);
// Upper right corner of the domain
Dune::FieldVector<ctype,int(dimworld)> upper(1);
// number of blocks in each coordinate direction
auto numCells = Dune::filledArray<std::size_t(dimension),Size>(1);
Parameters::get(name_ + "->min corner", lower);
Parameters::get(name_ + "->max corner", upper);
Parameters::get(name_ + "->num cells", numCells);
return factory(lower, upper, numCells);
if constexpr (int(Grid::dimension) == int(Grid::dimensionworld)) {
// Lower left corner of the domain
Dune::FieldVector<ctype,int(dimworld)> lower(0);
// Upper right corner of the domain
Dune::FieldVector<ctype,int(dimworld)> upper(1);
// number of blocks in each coordinate direction
auto numCells = Dune::filledArray<std::size_t(dimension),Size>(1);
Parameters::get(name_ + "->min corner", lower);
Parameters::get(name_ + "->max corner", upper);
Parameters::get(name_ + "->num cells", numCells);
return factory(lower, upper, numCells);
} else {
error_exit("Structured grids can be created for dim == dow only.");
return nullptr;
}
}
// read a filename from `[meshName]->macro file name` and determine from the extension the fileformat
......
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