Commit 91526966 authored by Katharina Heck's avatar Katharina Heck
Browse files

Merge branch 'cherry-pick-c3a75063' into 'releases/3.1'

Merge branch 'fix/alugrid-dim-dimworld' into 'master'

See merge request !1774
parents 41cbd22a 9e7163da
......@@ -105,13 +105,13 @@ public:
// Then look for the necessary keys to construct from the input file
else if (hasParamInGroup(modelParamGroup, "Grid.UpperRight"))
{
// make a structured grid
if (elType == Dune::cube)
ParentType::template makeStructuredGrid<dim, dimworld>(ParentType::CellType::Cube, modelParamGroup);
makeStructuredGrid<dim, dimworld>(ParentType::CellType::Cube, modelParamGroup);
else if (elType == Dune::simplex)
ParentType::template makeStructuredGrid<dim, dimworld>(ParentType::CellType::Simplex, modelParamGroup);
makeStructuredGrid<dim, dimworld>(ParentType::CellType::Simplex, modelParamGroup);
else
DUNE_THROW(Dune::IOError, "ALUGrid only supports Dune::cube or Dune::simplex as cell type!");
ParentType::maybeRefineGrid(modelParamGroup);
ParentType::loadBalance();
}
......@@ -203,6 +203,32 @@ public:
}
}
}
/*!
* \brief Makes a structured cube grid using the structured grid factory
*/
template <int dimension, int dimensionworld, std::enable_if_t<dimension != dimensionworld, int> = 0>
void makeStructuredGrid(typename ParentType::CellType cellType,
const std::string& modelParamGroup)
{
DUNE_THROW(Dune::IOError, "ALUGrid currently only supports the creation of structured grids with dimension == dimensionworld. Consider reading in a grid file instead.");
}
/*!
* \brief Makes a structured cube grid using the structured grid factory
*/
template <int dimension, int dimensionworld, std::enable_if_t<dimension == dimensionworld, int> = 0>
void makeStructuredGrid(typename ParentType::CellType cellType,
const std::string& modelParamGroup)
{
// make a structured grid
if (elType == Dune::cube)
ParentType::template makeStructuredGrid<dimension, dimensionworld>(ParentType::CellType::Cube, modelParamGroup);
else if (elType == Dune::simplex)
ParentType::template makeStructuredGrid<dimension, dimensionworld>(ParentType::CellType::Simplex, modelParamGroup);
else
DUNE_THROW(Dune::IOError, "ALUGrid only supports Dune::cube or Dune::simplex as cell type!");
}
};
#if DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS
......
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