diff --git a/src/amdis/Marker.hpp b/src/amdis/Marker.hpp index 2941248b0e2715b2ae89a40d22f0b05196365a21..fc346c79687c30e1da5a111885cade954cfa3f49 100644 --- a/src/amdis/Marker.hpp +++ b/src/amdis/Marker.hpp @@ -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