Commit 11938c90 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

max and min refinement level initialized in base class only

parent 90517409
Pipeline #1336 canceled with stage
......@@ -121,10 +121,10 @@ namespace AMDiS
int elMarkCoarsen_ = 0;
/// Maximal level of all elements.
int maxRefineLevel_ = -1;
int maxRefineLevel_ = std::numeric_limits<int>::max();
/// Minimal level of all elements.
int minRefineLevel_ = -1;
int minRefineLevel_ = 0;
/// Allow elements to be marked for refinement
bool refineAllowed_ = true;
......@@ -380,18 +380,10 @@ namespace AMDiS
public:
/// Constructor.
template <class GF>
GridFunctionMarker(std::string const& name, std::shared_ptr<Grid> const& grid, GF&& gf,
Dune::Std::optional<int> maxRef = { /*max*/ },
Dune::Std::optional<int> minRef = { /*0*/ })
GridFunctionMarker(std::string const& name, std::shared_ptr<Grid> const& grid, GF&& gf)
: Super{name, grid}
, gridFct_{makeGridFunction(std::forward<GF>(gf), grid->leafGridView())}
{
this->maxRefineLevel_ = maxRef ? maxRef.value() :
(this->maxRefineLevel_ == -1 ? std::numeric_limits<int>::max() : this->maxRefineLevel_);
this->minRefineLevel_ = minRef ? minRef.value() :
(this->minRefineLevel_ == -1 ? 0 : this->minRefineLevel_);
}
{}
/// \brief Implementation of \ref Marker::markElement. Does nothing since marking is
/// done in \ref markGrid().
......@@ -411,9 +403,7 @@ namespace AMDiS
// Deduction guide for GridFunctionMarker class
template <class Grid, class PreGridFct>
GridFunctionMarker(std::string const& name, std::shared_ptr<Grid> const& grid,
PreGridFct&& preGridFct,
Dune::Std::optional<int> maxRef = {},
Dune::Std::optional<int> minRef = {})
PreGridFct&& preGridFct)
-> GridFunctionMarker<Grid,
std::decay_t<decltype(makeGridFunction(std::forward<PreGridFct>(preGridFct), grid->leafGridView()))>>;
#endif
......@@ -421,13 +411,11 @@ namespace AMDiS
// Generator function for GridFunctionMarker class
template <class Grid, class PreGridFct>
auto makeGridFunctionMarker(std::string const& name, std::shared_ptr<Grid> const& grid,
PreGridFct&& preGridFct,
Dune::Std::optional<int> maxRef = { /*max*/ },
Dune::Std::optional<int> minRef = { /*0*/ })
PreGridFct&& preGridFct)
{
auto gridFct = makeGridFunction(std::forward<PreGridFct>(preGridFct), grid->leafGridView());
using GridFct = decltype(gridFct);
return GridFunctionMarker<Grid,GridFct>{name, grid, gridFct, maxRef, minRef};
return GridFunctionMarker<Grid,GridFct>{name, grid, gridFct};
}
} // end namespace AMDiS
......
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