diff --git a/CHANGELOG.md b/CHANGELOG.md
index e64eddb1ae76096b6f1625cd738c1e8915140300..cee528531cbbdab46c9fc0e76a8dfe543838ce52 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,14 @@ Differences Between DuMux 3.5 and DuMux 3.4
### Improvements and Enhancements
+- __Discretization tags__: We introduced tags in the namespace `DiscretizationMethods` (with s) for each discretization method.
+ These tags replace the `enum class DiscretizationMethod`. Tags have several advantages over the enum. Each tag is a named type
+ (see `dumux/common/tag.hh`) so they can for example be used in tag dispatch. Moreover specializing with tags is extensible.
+ For example we specialize the template `DarcysLawImplementation` for each discretization. When using the enum no new discretization
+ methods can be added without changing `enum class DiscretizationMethod`. With tags you can make your own tag and specialize a
+ class for that tag. This means new discretization methods can be developed in a modular fashion. The introduction of tags
+ involves a couple of non-backwards-compatible changes, mostly in implementation classes that shouldn't affect most users (see below).
+
- __Geometry__:
- Add implementation of sphere and bounding sphere approximation algorithms
- Add distance queries for Point->BoundingBoxTree
@@ -48,10 +56,14 @@ for (const auto& element : elements(gridGeometry.gridView()))
- __Coupling managers__: The coupling managers now store shared_ptrs of the subdomain solutions to be able to manage memory outside. There is compatibility interface that is deprecated but it won't allow for assignments
of the form `this->curSol() = sol;` since curSol returns a MultiTypeVector of references. If assignment is needed for some reason, use a hybrid loop over all subdomain indices.
- __ShallowWaterViscousFlux__: The template argument `PrimaryVariables` has been removed without deprecation. It was not needed.
+- __Discretization tags__: The following classes have changed from a template argument of type `DiscretizationMethod` (an `enum`) to
+ class type template arguments and are now specialized for tags: `TwoPScvSaturationReconstruction`, `ScvfToScvBoundaryTypes`, `ProblemTraits`, `FluxStencil`, `EffectiveStressLaw`, `HookesLaw`, `FacetCouplingManager`, `FacetCouplingMapper`. Moreover this affects the following helper classes: `IsFicksLaw`, `CheckOverlapSize`, `PartialReassemblerEngine`, `SubDomainAssemblerType`. Finally, this change has been made for many implementation classes. These should not have been used directly anyway, so we do not explicitly list them here. Examples are `DarcysLawImplementation`, `LinearSolverTraitsImpl`. See !2844 for more details.
+ If you face a compiler error from these changes, contact us. Most like the solution is to simply try replacing occurrences of `DiscretizationMethod` with the corresponding tag from `DiscretizationMethods`, or types `DiscretizationMethod` in template arguments by generic `class`.
### Deprecated properties/classes/functions/files, to be removed after 3.5:
- `update()` functions of grid geometries, which do not receive the `gridView`, are deprecated, use `update(gridView)` instead.
+- `enum class DiscretizationMethod` and associated functions, to be replaced by tags
### New experimental features (possibly subject to backwards-incompatible changes in the future)
diff --git a/dumux/adaptive/initializationindicator.hh b/dumux/adaptive/initializationindicator.hh
index 20b90ab00392c6520edf8bb50cfbfec06f596427..555edde9b550ac81e4a119ebe353a61ece5cbb51 100644
--- a/dumux/adaptive/initializationindicator.hh
+++ b/dumux/adaptive/initializationindicator.hh
@@ -52,7 +52,7 @@ class GridAdaptInitializationIndicator
using GridVariables = GetPropType;
using GridGeometry = GetPropType;
- static constexpr bool isBox = GetPropType::discMethod == DiscretizationMethod::box;
+ static constexpr bool isBox = GetPropType::discMethod == DiscretizationMethods::box;
public:
diff --git a/dumux/assembly/fclocalassembler.hh b/dumux/assembly/fclocalassembler.hh
index c9d7dc1f81acf31a2bd13b158ce6aa6f20d84c9a..c58f85ba126bd267cf080a3f8b6bf8e3865e92eb 100644
--- a/dumux/assembly/fclocalassembler.hh
+++ b/dumux/assembly/fclocalassembler.hh
@@ -477,7 +477,7 @@ public:
}
// also consider lateral faces outside the own element for face-centered staggered schemes
- if constexpr (GridGeometry::discMethod == DiscretizationMethod::fcstaggered)
+ if constexpr (GridGeometry::discMethod == DiscretizationMethods::fcstaggered)
{
if (scvf.isLateral())
{
@@ -509,7 +509,7 @@ public:
}
// also consider lateral faces outside the own element for face-centered staggered schemes
- if constexpr (GridGeometry::discMethod == DiscretizationMethod::fcstaggered)
+ if constexpr (GridGeometry::discMethod == DiscretizationMethods::fcstaggered)
{
if (scvf.isLateral())
{
@@ -549,7 +549,7 @@ public:
}
// also consider lateral faces outside the own element for face-centered staggered schemes
- if constexpr (GridGeometry::discMethod == DiscretizationMethod::fcstaggered)
+ if constexpr (GridGeometry::discMethod == DiscretizationMethods::fcstaggered)
{
// treat normal/parallel scvs for parallel runs TODO description, put in function
if (problem.gridGeometry().gridView().comm().size() > 1 && element.partitionType() == Dune::InteriorEntity)
diff --git a/dumux/assembly/fvassembler.hh b/dumux/assembly/fvassembler.hh
index 567fe8274589ab61673a8cfd0193d41286b546ef..e1a6614341bb27bd5395915b5825a435e12d8857 100644
--- a/dumux/assembly/fvassembler.hh
+++ b/dumux/assembly/fvassembler.hh
@@ -41,32 +41,32 @@
namespace Dumux::Detail {
-template
+template
struct LocalAssemblerChooser;
template<>
-struct LocalAssemblerChooser
+struct LocalAssemblerChooser
{
template
using type = BoxLocalAssembler;
};
template<>
-struct LocalAssemblerChooser
+struct LocalAssemblerChooser
{
template
using type = CCLocalAssembler;
};
template<>
-struct LocalAssemblerChooser
+struct LocalAssemblerChooser
{
template
using type = CCLocalAssembler;
};
template<>
-struct LocalAssemblerChooser
+struct LocalAssemblerChooser
{
template
using type = FaceCenteredLocalAssembler;
@@ -74,7 +74,7 @@ struct LocalAssemblerChooser
template
using LocalAssemblerChooser_t = typename LocalAssemblerChooser<
- GetPropType::discMethod
+ typename GetPropType::DiscretizationMethod
>::template type;
} // end namespace Dumux::Detail
@@ -98,7 +98,7 @@ class FVAssembler
using TimeLoop = TimeLoopBase>;
using SolutionVector = GetPropType;
- static constexpr bool isBox = GridGeo::discMethod == DiscretizationMethod::box;
+ static constexpr bool isBox = GridGeo::discMethod == DiscretizationMethods::box;
using ThisType = FVAssembler;
using LocalAssembler = typename Detail::LocalAssemblerChooser_t;
@@ -450,7 +450,7 @@ private:
DUNE_THROW(NumericalProblem, "A process did not succeed in linearizing the system");
}
- template std::enable_if_t
+ template std::enable_if_t
enforcePeriodicConstraints_(JacobianMatrix& jac, SolutionVector& res, const SolutionVector& curSol, const GG& gridGeometry)
{
for (const auto& m : gridGeometry.periodicVertexMap())
@@ -471,7 +471,7 @@ private:
}
}
- template std::enable_if_t
+ template std::enable_if_t
enforcePeriodicConstraints_(JacobianMatrix& jac, SolutionVector& res, const SolutionVector& curSol, const GG& gridGeometry) {}
//! pointer to the problem to be solved
diff --git a/dumux/assembly/fvlocalresidual.hh b/dumux/assembly/fvlocalresidual.hh
index 471ab2ed972cea0b2a6068d1110cf79e8a0279a9..41a7c5f47946cf9c81c08f769a5cd7b9cf6948f3 100644
--- a/dumux/assembly/fvlocalresidual.hh
+++ b/dumux/assembly/fvlocalresidual.hh
@@ -423,7 +423,7 @@ public:
//! Compute the derivative of the flux residual
template
- std::enable_if_t::discMethod != DiscretizationMethod::box, void>
+ std::enable_if_t::discMethod != DiscretizationMethods::box, void>
addFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices,
const Problem& problem,
const Element& element,
@@ -437,7 +437,7 @@ public:
//! Compute the derivative of the flux residual for the box method
template
- std::enable_if_t::discMethod == DiscretizationMethod::box, void>
+ std::enable_if_t::discMethod == DiscretizationMethods::box, void>
addFluxDerivatives(JacobianMatrix& A,
const Problem& problem,
const Element& element,
diff --git a/dumux/assembly/initialsolution.hh b/dumux/assembly/initialsolution.hh
index dc8bf7ebf3a04615577efcac8d7c40de4c726cd6..4054253e0c3f29af95e895b3a407f9cd75053ad8 100644
--- a/dumux/assembly/initialsolution.hh
+++ b/dumux/assembly/initialsolution.hh
@@ -43,7 +43,7 @@ void assembleInitialSolution(SolutionVector& sol, const Problem& problem)
using GridGeometry = std::decay_t;
// box method
- if constexpr (GridGeometry::discMethod == DiscretizationMethod::box)
+ if constexpr (GridGeometry::discMethod == DiscretizationMethods::box)
{
constexpr int dim = GridGeometry::GridView::dimension;
const auto numDofs = gg.vertexMapper().size();
@@ -79,7 +79,7 @@ void assembleInitialSolution(SolutionVector& sol, const Problem& problem)
}
// staggered methods
- else if constexpr (GridGeometry::discMethod == DiscretizationMethod::staggered)
+ else if constexpr (GridGeometry::discMethod == DiscretizationMethods::staggered)
{
problem.applyInitialSolution(sol);
}
diff --git a/dumux/assembly/jacobianpattern.hh b/dumux/assembly/jacobianpattern.hh
index 2dd733cef371086cb3a9fe36955f6e7bc2516ded..e28de66b28af5c4f7f35d6bc93e7b61ec43cabcb 100644
--- a/dumux/assembly/jacobianpattern.hh
+++ b/dumux/assembly/jacobianpattern.hh
@@ -35,7 +35,7 @@ namespace Dumux {
* \brief Helper function to generate Jacobian pattern for the box method
*/
template = 0>
+ typename std::enable_if_t<(GridGeometry::discMethod == DiscretizationMethods::box), int> = 0>
Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
{
const auto numDofs = gridGeometry.numDofs();
@@ -84,8 +84,8 @@ Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
* \brief Helper function to generate Jacobian pattern for cell-centered methods
*/
template = 0>
+ typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethods::cctpfa)
+ || (GridGeometry::discMethod == DiscretizationMethods::ccmpfa) ), int> = 0>
Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
{
const auto numDofs = gridGeometry.numDofs();
@@ -118,7 +118,7 @@ Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
* \brief Helper function to generate Jacobian pattern for the staggered method
*/
template = 0>
+ typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethods::staggered) ), int> = 0>
auto getJacobianPattern(const GridGeometry& gridGeometry)
{
// resize the jacobian and the residual
@@ -200,7 +200,7 @@ Dune::MatrixIndexSet getFEJacobianPattern(const FEBasis& feBasis)
* in fem is the same independent of the time discretization scheme.
*/
template = 0>
+ typename std::enable_if_t<(GridGeometry::discMethod == DiscretizationMethods::fem), int> = 0>
Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
{ return getFEJacobianPattern(gridGeometry.feBasis()); }
@@ -209,7 +209,7 @@ Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
* \brief Helper function to generate Jacobian pattern for the face-centered staggered method
*/
template = 0>
+ typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethods::fcstaggered) ), int> = 0>
Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
{
// resize the jacobian and the residual
diff --git a/dumux/assembly/partialreassembler.hh b/dumux/assembly/partialreassembler.hh
index de2099e710ced5c0781125df70a3fe492bd70fe9..3ac1966a1cd21863484865c5e0c4bf1c2934a0ae 100644
--- a/dumux/assembly/partialreassembler.hh
+++ b/dumux/assembly/partialreassembler.hh
@@ -70,7 +70,7 @@ public:
};
//! the partial reassembler engine specialized for discretization methods
-template
+template
class PartialReassemblerEngine
{
public:
@@ -98,7 +98,7 @@ public:
* \brief The partial reassembler engine specialized for the box method
*/
template
-class PartialReassemblerEngine
+class PartialReassemblerEngine
{
using Scalar = typename Assembler::Scalar;
using GridGeometry = typename Assembler::GridGeometry;
@@ -310,7 +310,7 @@ private:
* \brief The partial reassembler engine specialized for the cellcentered TPFA method
*/
template
-class PartialReassemblerEngine
+class PartialReassemblerEngine
{
using Scalar = typename Assembler::Scalar;
using GridGeometry = typename Assembler::GridGeometry;
@@ -407,10 +407,10 @@ private:
* \brief The partial reassembler engine specialized for the cellcentered MPFA method
*/
template
-class PartialReassemblerEngine
-: public PartialReassemblerEngine
+class PartialReassemblerEngine
+: public PartialReassemblerEngine
{
- using ParentType = PartialReassemblerEngine;
+ using ParentType = PartialReassemblerEngine;
public:
using ParentType::ParentType;
};
@@ -435,8 +435,8 @@ class PartialReassembler
using JacobianMatrix = typename Assembler::JacobianMatrix;
using VertexMapper = typename GridGeometry::VertexMapper;
- static constexpr DiscretizationMethod discMethod = GridGeometry::discMethod;
- using Engine = PartialReassemblerEngine;
+ using DiscretizationMethod = typename GridGeometry::DiscretizationMethod;
+ using Engine = PartialReassemblerEngine;
public:
diff --git a/dumux/common/fvproblem.hh b/dumux/common/fvproblem.hh
index b81375dca7b05a028d76825f2a1937d6f8f6ceb9..7f53a85ae08d03cde982b8b983cbab2d689a7d29 100644
--- a/dumux/common/fvproblem.hh
+++ b/dumux/common/fvproblem.hh
@@ -71,8 +71,8 @@ class FVProblem
using PointSourceMap = std::map< std::pair,
std::vector >;
- static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box;
- static constexpr bool isStaggered = GridGeometry::discMethod == DiscretizationMethod::staggered;
+ static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box;
+ static constexpr bool isStaggered = GridGeometry::discMethod == DiscretizationMethods::staggered;
using Scalar = GetPropType;
using PrimaryVariables = GetPropType;
diff --git a/dumux/common/pointsource.hh b/dumux/common/pointsource.hh
index 3eda1766f34c5603eaab2b30464e9f2f4b48dc0b..eaf3b3f6bd901c2b07a52964bdb3fcf9b63ed353 100644
--- a/dumux/common/pointsource.hh
+++ b/dumux/common/pointsource.hh
@@ -301,7 +301,7 @@ public:
// split the source values equally among all concerned entities
source.setEmbeddings(entities.size()*source.embeddings());
- if constexpr (GridGeometry::discMethod == DiscretizationMethod::box)
+ if constexpr (GridGeometry::discMethod == DiscretizationMethods::box)
{
// loop over all concerned elements
auto fvGeometry = localView(gridGeometry);
diff --git a/dumux/common/typetraits/problem.hh b/dumux/common/typetraits/problem.hh
index 0131254abd3831b190cb0ac61025ca26c5a5c4a3..64570dea8df19811f2e425faf554f5eae50ef4d9 100644
--- a/dumux/common/typetraits/problem.hh
+++ b/dumux/common/typetraits/problem.hh
@@ -31,7 +31,7 @@ namespace Dumux {
// forward declare
namespace Detail {
-template
+template
struct ProblemTraits;
} // end namespace Detail
@@ -43,7 +43,7 @@ template
struct ProblemTraits
{
using GridGeometry = std::decay_t().gridGeometry())>;
- using BoundaryTypes = typename Detail::template ProblemTraits::BoundaryTypes;
+ using BoundaryTypes = typename Detail::template ProblemTraits::BoundaryTypes;
};
} // end namespace Dumux
diff --git a/dumux/discretization/box.hh b/dumux/discretization/box.hh
index 7ec91488a925c62821935a6e1e1500617adbddf2..59669c347fddb697440a5f6fb3896d474e42741c 100644
--- a/dumux/discretization/box.hh
+++ b/dumux/discretization/box.hh
@@ -110,7 +110,7 @@ struct BaseLocalResidual { using type = BoxLocalResidua
namespace Detail {
template
-struct ProblemTraits
+struct ProblemTraits
{
private:
using GG = std::decay_t().gridGeometry())>;
diff --git a/dumux/discretization/box/elementsolution.hh b/dumux/discretization/box/elementsolution.hh
index caf00f7fd8595172fcbfbd729ecbce4f6c468bf5..c11c145582f05a57d8d4fded5086ad8214af68a1 100644
--- a/dumux/discretization/box/elementsolution.hh
+++ b/dumux/discretization/box/elementsolution.hh
@@ -116,7 +116,7 @@ private:
*/
template
auto elementSolution(const Element& element, const SolutionVector& sol, const GridGeometry& gg)
--> std::enable_if_t std::enable_if_t()[0])>>
>
@@ -131,7 +131,7 @@ auto elementSolution(const Element& element, const SolutionVector& sol, const Gr
*/
template
auto elementSolution(const Element& element, const ElementVolumeVariables& elemVolVars, const FVElementGeometry& gg)
--> std::enable_if_t std::enable_if_t>
{
diff --git a/dumux/discretization/box/fvgridgeometry.hh b/dumux/discretization/box/fvgridgeometry.hh
index 95938a6bd58a8f31eb59b11a72b17943db1afe07..d2ea779d43f3dc72460848e50539000529e59309 100644
--- a/dumux/discretization/box/fvgridgeometry.hh
+++ b/dumux/discretization/box/fvgridgeometry.hh
@@ -97,8 +97,9 @@ class BoxFVGridGeometry
typename Traits::SubControlVolumeFace>;
public:
- //! export discretization method
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::box;
+ //! export the discretization method this geometry belongs to
+ using DiscretizationMethod = DiscretizationMethods::Box;
+ static constexpr DiscretizationMethod discMethod{};
//! export the type of the fv element geometry (the local view type)
using LocalView = typename Traits::template LocalView;
@@ -385,8 +386,9 @@ class BoxFVGridGeometry
using CoordScalar = typename GV::ctype;
public:
- //! export discretization method
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::box;
+ //! export the discretization method this geometry belongs to
+ using DiscretizationMethod = DiscretizationMethods::Box;
+ static constexpr DiscretizationMethod discMethod{};
//! export the type of the fv element geometry (the local view type)
using LocalView = typename Traits::template LocalView;
diff --git a/dumux/discretization/box/scvftoscvboundarytypes.hh b/dumux/discretization/box/scvftoscvboundarytypes.hh
index 12ec51306d6d21532ef0c317815f1470df918009..857d4f1b180e28009a401dca2ac954e80ff93b9b 100644
--- a/dumux/discretization/box/scvftoscvboundarytypes.hh
+++ b/dumux/discretization/box/scvftoscvboundarytypes.hh
@@ -34,7 +34,7 @@ namespace Dumux {
* \ingroup BoxDiscretization
* \brief Convert intersection boundary types to vertex boundary types
*/
-template
+template
class ScvfToScvBoundaryTypes
{
public:
@@ -44,7 +44,7 @@ public:
void computeBoundaryTypes(const Problem& problem)
{
// only do something for box
- if (discMethod == DiscretizationMethod::box)
+ if (DiscretizationMethod{} == DiscretizationMethods::box)
{
const auto& gridGeometry = problem.gridGeometry();
scvBoundaryTypes.resize(gridGeometry.vertexMapper().size());
@@ -81,7 +81,7 @@ public:
template
const BoundaryTypes& boundaryTypes(const SubControlVolume& scv) const
{
- if (discMethod == DiscretizationMethod::box)
+ if (DiscretizationMethod{} == DiscretizationMethods::box)
return scvBoundaryTypes[scv.dofIndex()];
else
DUNE_THROW(Dune::InvalidStateException, "Only use this for the box discretization!");
diff --git a/dumux/discretization/ccmpfa.hh b/dumux/discretization/ccmpfa.hh
index 2d0e9e1182b9a77653aadadc668a7db71f1424c3..fbd738fae081515383a353a380995cc49e22e468 100644
--- a/dumux/discretization/ccmpfa.hh
+++ b/dumux/discretization/ccmpfa.hh
@@ -163,7 +163,7 @@ struct BaseLocalResidual { using type = CCLocalResid
namespace Detail {
template
-struct ProblemTraits
+struct ProblemTraits
{
private:
using GG = std::decay_t().gridGeometry())>;
diff --git a/dumux/discretization/cctpfa.hh b/dumux/discretization/cctpfa.hh
index 0735de0923d6340b25a5a285b3d58018b5ac3270..3447dc2c942b18fbddfb266bcde2e61d1a8c6706 100644
--- a/dumux/discretization/cctpfa.hh
+++ b/dumux/discretization/cctpfa.hh
@@ -99,7 +99,7 @@ struct BaseLocalResidual { using type = CCLocalResid
namespace Detail {
template
-struct ProblemTraits
+struct ProblemTraits
{
private:
using GG = std::decay_t().gridGeometry())>;
diff --git a/dumux/discretization/cellcentered/elementsolution.hh b/dumux/discretization/cellcentered/elementsolution.hh
index 5aabd0934e329694e58a65ba5ab512c42e05089d..c8b23c16c79ef0567f5313bf04a4ea08cfec21cf 100644
--- a/dumux/discretization/cellcentered/elementsolution.hh
+++ b/dumux/discretization/cellcentered/elementsolution.hh
@@ -111,8 +111,8 @@ private:
*/
template
auto elementSolution(const Element& element, const SolutionVector& sol, const GridGeometry& gg)
--> std::enable_if_t std::enable_if_t()[0])>>
>
@@ -127,8 +127,8 @@ auto elementSolution(const Element& element, const SolutionVector& sol, const Gr
*/
template
auto elementSolution(const Element& element, const ElementVolumeVariables& elemVolVars, const FVElementGeometry& gg)
--> std::enable_if_t std::enable_if_t>
{
using PrimaryVariables = typename ElementVolumeVariables::VolumeVariables::PrimaryVariables;
@@ -142,8 +142,8 @@ auto elementSolution(const Element& element, const ElementVolumeVariables& elemV
*/
template
auto elementSolution(PrimaryVariables&& priVars)
--> std::enable_if_t std::enable_if_t>
{
return CCElementSolution(std::move(priVars));
@@ -156,8 +156,8 @@ auto elementSolution(PrimaryVariables&& priVars)
*/
template
auto elementSolution(const PrimaryVariables& priVars)
--> std::enable_if_t std::enable_if_t>
{
return CCElementSolution(priVars);
diff --git a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh
index f29ba01a9175f47102a3947d0e002118d1ae1439..7ea6b01127727f5ef19da75f162c9a3adb7c815b 100644
--- a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh
+++ b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh
@@ -56,7 +56,7 @@ template
void checkOverlapSizeCCMpfa(const GridView& gridView)
{
// Check if the overlap size is what we expect
- if (!CheckOverlapSize::isValid(gridView))
+ if (!CheckOverlapSize::isValid(gridView))
DUNE_THROW(Dune::InvalidStateException, "The ccmpfa discretization method needs at least an overlap of 1 for parallel computations. "
<< " Set the parameter \"Grid.Overlap\" in the input file.");
}
@@ -111,7 +111,8 @@ public:
using MpfaHelper = typename Traits::template MpfaHelper;
//! export the discretization method this geometry belongs to
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::ccmpfa;
+ using DiscretizationMethod = DiscretizationMethods::CCMpfa;
+ static constexpr DiscretizationMethod discMethod{};
//! The maximum admissible stencil size (used for static memory allocation during assembly)
static constexpr int maxElementStencilSize = Traits::maxElementStencilSize;
@@ -502,7 +503,8 @@ public:
using MpfaHelper = typename Traits::template MpfaHelper;
//! export the discretization method this geometry belongs to
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::ccmpfa;
+ using DiscretizationMethod = DiscretizationMethods::CCMpfa;
+ static constexpr DiscretizationMethod discMethod{};
//! The maximum admissible stencil size (used for static memory allocation during assembly)
static constexpr int maxElementStencilSize = Traits::maxElementStencilSize;
diff --git a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh
index 538031d5f49b63b829def74a8fbb8aaee110c6a1..8c5e6c670238188b8870963878c4d7663419ec1b 100644
--- a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh
+++ b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh
@@ -112,7 +112,8 @@ public:
using DofMapper = typename Traits::ElementMapper;
//! export the discretization method this geometry belongs to
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::cctpfa;
+ using DiscretizationMethod = DiscretizationMethods::CCTpfa;
+ static constexpr DiscretizationMethod discMethod{};
//! The maximum admissible stencil size (used for static memory allocation during assembly)
static constexpr int maxElementStencilSize = LocalView::maxNumElementScvfs*Traits::maxNumScvfNeighbors + 1;
@@ -125,7 +126,7 @@ public:
: ParentType(gridView)
{
// Check if the overlap size is what we expect
- if (!CheckOverlapSize::isValid(gridView))
+ if (!CheckOverlapSize::isValid(gridView))
DUNE_THROW(Dune::InvalidStateException, "The cctpfa discretization method needs at least an overlap of 1 for parallel computations. "
<< " Set the parameter \"Grid.Overlap\" in the input file.");
@@ -418,7 +419,8 @@ public:
using DofMapper = typename Traits::ElementMapper;
//! Export the discretization method this geometry belongs to
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::cctpfa;
+ using DiscretizationMethod = DiscretizationMethods::CCTpfa;
+ static constexpr DiscretizationMethod discMethod{};
//! The maximum admissible stencil size (used for static memory allocation during assembly)
static constexpr int maxElementStencilSize = LocalView::maxNumElementScvfs*Traits::maxNumScvfNeighbors + 1;
@@ -431,7 +433,7 @@ public:
: ParentType(gridView)
{
// Check if the overlap size is what we expect
- if (!CheckOverlapSize::isValid(gridView))
+ if (!CheckOverlapSize::isValid(gridView))
DUNE_THROW(Dune::InvalidStateException, "The cctpfa discretization method needs at least an overlap of 1 for parallel computations. "
<< " Set the parameter \"Grid.Overlap\" in the input file.");
diff --git a/dumux/discretization/checkoverlapsize.hh b/dumux/discretization/checkoverlapsize.hh
index 68243af08991de74be20cbd280bc9bcb85174d10..cbea9b76a7b66fbc0341456e1b3e332749a81b32 100644
--- a/dumux/discretization/checkoverlapsize.hh
+++ b/dumux/discretization/checkoverlapsize.hh
@@ -35,7 +35,7 @@ namespace Dumux {
* \note for sequential grids every overlap is fine
* \note specialize this for your discretization method if the default doesn't apply
*/
-template
+template
struct CheckOverlapSize
{
template
@@ -45,7 +45,7 @@ struct CheckOverlapSize
//! specialization for the box method which requires an overlap size of 0
template<>
-struct CheckOverlapSize
+struct CheckOverlapSize
{
template
static bool isValid(const GridView& gridView) noexcept
@@ -55,7 +55,7 @@ struct CheckOverlapSize
//! specialization for the finite element method which requires an overlap size of 0
//! \note Overloads for bases that require overlap regions can be defined in the future
template<>
-struct CheckOverlapSize
+struct CheckOverlapSize
{
template
static bool isValid(const FEBasis& feBasis) noexcept
@@ -64,7 +64,7 @@ struct CheckOverlapSize
// fc staggered requires an overlap of exactly 1
template<>
-struct CheckOverlapSize
+struct CheckOverlapSize
{
template
static bool isValid(const GridView& gridView) noexcept
diff --git a/dumux/discretization/facecentered/staggered/elementsolution.hh b/dumux/discretization/facecentered/staggered/elementsolution.hh
index 535e632f4390467d6e9b1873642ff0e69f9bfdb8..05936fee71f52b62e4dc29d17788728055d97577 100644
--- a/dumux/discretization/facecentered/staggered/elementsolution.hh
+++ b/dumux/discretization/facecentered/staggered/elementsolution.hh
@@ -129,7 +129,7 @@ private:
template
auto elementSolution(const Element& element, const SolutionVector& sol, const GridGeometry& gg)
-> std::enable_if_t<
- GridGeometry::discMethod == DiscretizationMethod::fcstaggered,
+ GridGeometry::discMethod == DiscretizationMethods::fcstaggered,
FaceCenteredStaggeredElementSolution<
typename GridGeometry::LocalView,
std::decay_t()[0])>
@@ -144,7 +144,7 @@ auto elementSolution(const Element& element, const SolutionVector& sol, const Gr
template
auto elementSolution(const Element& element, const ElementVolumeVariables& elemVolVars, const FVElementGeometry& gg)
-> std::enable_if_t<
- FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::fcstaggered,
+ FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::fcstaggered,
FaceCenteredStaggeredElementSolution<
FVElementGeometry,
typename ElementVolumeVariables::VolumeVariables::PrimaryVariables
@@ -160,7 +160,7 @@ auto elementSolution(const Element& element, const ElementVolumeVariables& elemV
template
auto elementSolution(PrimaryVariables&& priVars)
-> std::enable_if_t<
- FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::fcstaggered,
+ FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::fcstaggered,
FaceCenteredStaggeredElementSolution<
FVElementGeometry,
std::decay_t
diff --git a/dumux/discretization/facecentered/staggered/fvgridgeometry.hh b/dumux/discretization/facecentered/staggered/fvgridgeometry.hh
index 18af7159e96a1d63d70189f4e7ae20ffaff2c0fb..9c289fd046fef5aaee0426225685983a31bcfb71 100644
--- a/dumux/discretization/facecentered/staggered/fvgridgeometry.hh
+++ b/dumux/discretization/facecentered/staggered/fvgridgeometry.hh
@@ -115,8 +115,10 @@ class FaceCenteredStaggeredFVGridGeometry
using ScvCornerStorage = typename Traits::SubControlVolume::Traits::CornerStorage;
public:
- //! export discretization method
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::fcstaggered;
+ //! export the discretization method this geometry belongs to
+ using DiscretizationMethod = DiscretizationMethods::FCStaggered;
+ static constexpr DiscretizationMethod discMethod{};
+
static constexpr bool cachingEnabled = true;
//! export the type of the fv element geometry (the local view type)
@@ -138,7 +140,7 @@ public:
, intersectionMapper_(gridView)
{
// Check if the overlap size is what we expect
- if (!CheckOverlapSize::isValid(gridView))
+ if (!CheckOverlapSize::isValid(gridView))
DUNE_THROW(Dune::InvalidStateException, "The staggered discretization method needs at least an overlap of 1 for parallel computations. "
<< " Set the parameter \"Grid.Overlap\" in the input file.");
@@ -564,8 +566,10 @@ class FaceCenteredStaggeredFVGridGeometry
+ numFacesPerElement; // number of potential frontal faces on boundary
public:
- //! export discretization method
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::fcstaggered;
+ //! export the discretization method this geometry belongs to
+ using DiscretizationMethod = DiscretizationMethods::FCStaggered;
+ static constexpr DiscretizationMethod discMethod{};
+
static constexpr bool cachingEnabled = false;
//! export the type of the fv element geometry (the local view type)
@@ -587,7 +591,7 @@ public:
, intersectionMapper_(gridView)
{
// Check if the overlap size is what we expect
- if (!CheckOverlapSize::isValid(gridView))
+ if (!CheckOverlapSize::isValid(gridView))
DUNE_THROW(Dune::InvalidStateException, "The staggered discretization method needs at least an overlap of 1 for parallel computations. "
<< " Set the parameter \"Grid.Overlap\" in the input file.");
diff --git a/dumux/discretization/fcstaggered.hh b/dumux/discretization/fcstaggered.hh
index c950aec44e7cbf3339ff77cd1377b632e786b866..6de37e6114c1bcef7748a788d37c8fe238d3cd5f 100644
--- a/dumux/discretization/fcstaggered.hh
+++ b/dumux/discretization/fcstaggered.hh
@@ -118,7 +118,7 @@ public:
namespace Dumux::Detail {
template
-struct ProblemTraits
+struct ProblemTraits
{
private:
using GG = std::decay_t().gridGeometry())>;
diff --git a/dumux/discretization/fem/fegridgeometry.hh b/dumux/discretization/fem/fegridgeometry.hh
index fff2242c474e9650a11f55a7e8ea632c2c6de92b..8f00843a1b75eeaf355cd0db6e602287546f27e6 100644
--- a/dumux/discretization/fem/fegridgeometry.hh
+++ b/dumux/discretization/fem/fegridgeometry.hh
@@ -69,8 +69,9 @@ class FEGridGeometry
using LocalIndexType = typename IndexTraits::LocalIndex;
public:
- //! export discretization method
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::fem;
+ //! export the discretization method this geometry belongs to
+ using DiscretizationMethod = DiscretizationMethods::FEM;
+ static constexpr DiscretizationMethod discMethod{};
//! export the grid view type
using GridView = typename FEB::GridView;
@@ -87,7 +88,7 @@ public:
, feBasis_(feBasis)
{
// Check if the overlap size is what we expect
- if (!CheckOverlapSize::isValid(*feBasis))
+ if (!CheckOverlapSize::isValid(*feBasis))
DUNE_THROW(Dune::InvalidStateException, "The finite element discretization method only works with zero overlap for parallel computations. "
<< " Set the parameter \"Grid.Overlap\" in the input file.");
}
diff --git a/dumux/discretization/fluxstencil.hh b/dumux/discretization/fluxstencil.hh
index f671e143b3621aefc4d5eaa476a3afe8931b60fd..d49fdf39b351fb56c0c1b09520856b3cda58c550 100644
--- a/dumux/discretization/fluxstencil.hh
+++ b/dumux/discretization/fluxstencil.hh
@@ -41,7 +41,7 @@ namespace Dumux {
* since we use the flux stencil for matrix and assembly. This might lead to some zeros stored
* in the matrix.
*/
-template
+template
class FluxStencil;
/*
@@ -50,7 +50,7 @@ class FluxStencil;
* \tparam FVElementGeometry The local view on the finite volume grid geometry
*/
template
-class FluxStencil
+class FluxStencil
{
using GridGeometry = typename FVElementGeometry::GridGeometry;
using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace;
@@ -90,7 +90,7 @@ public:
* \tparam FVElementGeometry The local view on the finite volume grid geometry
*/
template
-class FluxStencil
+class FluxStencil
{
using GridGeometry = typename FVElementGeometry::GridGeometry;
using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace;
diff --git a/dumux/discretization/functionspacebasis.hh b/dumux/discretization/functionspacebasis.hh
index dc7cad7fb970d9a1123d61d1ec69b98d11b5bbfe..ab43af0cbbe0b16551ffb77ef5dcc0141ff56057 100644
--- a/dumux/discretization/functionspacebasis.hh
+++ b/dumux/discretization/functionspacebasis.hh
@@ -40,8 +40,7 @@ namespace Dumux {
* scheme underlying a grid geometry class. Specializations
* of the traits for different schemes are provided below.
*/
-template< class GridGeometry,
- DiscretizationMethod dm = GridGeometry::discMethod >
+template< class GridGeometry, class DiscretizationMethod = typename GridGeometry::DiscretizationMethod >
struct FunctionSpaceBasisTraits;
/*!
@@ -49,7 +48,7 @@ struct FunctionSpaceBasisTraits;
* \brief Creates a Dune::Functions object of the underlying basis
* of a discretization scheme that is not finite elements.
*/
-template = 0>
+template = 0>
typename FunctionSpaceBasisTraits::GlobalBasis
getFunctionSpaceBasis(const GridGeometry& gridGeometry)
{ return {gridGeometry.gridView()}; }
@@ -58,7 +57,7 @@ getFunctionSpaceBasis(const GridGeometry& gridGeometry)
* \ingroup Discretization
* \brief Returns the Dune::Functions object for the basis of a finite element scheme.
*/
-template = 0>
+template = 0>
const typename FunctionSpaceBasisTraits::GlobalBasis&
getFunctionSpaceBasis(const GridGeometry& gridGeometry)
{ return gridGeometry.feBasis(); }
@@ -70,22 +69,22 @@ getFunctionSpaceBasis(const GridGeometry& gridGeometry)
//! Traits specialization: box scheme uses lagrange basis of order 1
template< class GridGeometry >
-struct FunctionSpaceBasisTraits
+struct FunctionSpaceBasisTraits
{ using GlobalBasis = Dune::Functions::LagrangeBasis; };
//! Traits specialization: cc schemes use lagrange bases of order 0
template< class GridGeometry >
-struct FunctionSpaceBasisTraits
+struct FunctionSpaceBasisTraits
{ using GlobalBasis = Dune::Functions::LagrangeBasis; };
//! Traits specialization: cc schemes use lagrange bases of order 0
template< class GridGeometry >
-struct FunctionSpaceBasisTraits
+struct FunctionSpaceBasisTraits
{ using GlobalBasis = Dune::Functions::LagrangeBasis; };
//! Traits specialization: fem defines its basis
template< class GridGeometry >
-struct FunctionSpaceBasisTraits
+struct FunctionSpaceBasisTraits
{ using GlobalBasis = typename GridGeometry::FEBasis; };
} // end namespace Dumux
diff --git a/dumux/discretization/method.hh b/dumux/discretization/method.hh
index 255c0061fa880b582f57651f0c377c836dd5c59e..8da080bdd7691c7cf1771c2231f21ecf79ef8fbd 100644
--- a/dumux/discretization/method.hh
+++ b/dumux/discretization/method.hh
@@ -27,6 +27,8 @@
#include
#include
+#include
+
namespace Dumux {
/*!
@@ -41,10 +43,112 @@ enum class DiscretizationMethod
none, box, cctpfa, ccmpfa, staggered, fem, fcstaggered
};
+
+namespace DiscretizationMethods {
+
+struct CCTpfa : public Utility::Tag {
+ static std::string name() { return "cctpfa"; }
+
+ //conversion operator
+ [[deprecated("Conversion to enum is deprecated. Will be removed after 3.5. Use tags.")]]
+ constexpr operator DiscretizationMethod() const
+ {
+ return DiscretizationMethod::cctpfa;
+ }
+};
+
+
+struct CCMpfa : public Utility::Tag {
+ static std::string name() { return "ccmpfa"; }
+
+ //conversion operator
+ [[deprecated("Conversion to enum is deprecated. Will be removed after 3.5. Use tags.")]]
+ constexpr operator DiscretizationMethod() const
+ {
+ return DiscretizationMethod::ccmpfa;
+ }
+};
+
+
+struct Box : public Utility::Tag {
+ static std::string name() { return "box"; }
+
+ //conversion operator
+ [[deprecated("Conversion to enum is deprecated. Will be removed after 3.5. Use tags.")]]
+ constexpr operator DiscretizationMethod() const
+ {
+ return DiscretizationMethod::box;
+ }
+};
+
+
+
+struct Staggered : public Utility::Tag {
+ static std::string name() { return "staggered"; }
+
+ //conversion operator
+ [[deprecated("Conversion to enum is deprecated. Will be removed after 3.5. Use tags.")]]
+ constexpr operator DiscretizationMethod() const
+ {
+ return DiscretizationMethod::staggered;
+ }
+};
+
+
+
+struct FEM : public Utility::Tag {
+ static std::string name() { return "fem"; }
+
+ //conversion operator
+ [[deprecated("Conversion to enum is deprecated. Will be removed after 3.5. Use tags.")]]
+ constexpr operator DiscretizationMethod() const
+ {
+ return DiscretizationMethod::fem;
+ }
+};
+
+
+
+struct FCStaggered : public Utility::Tag {
+ static std::string name() { return "fcstaggered"; }
+
+ //conversion operator
+ [[deprecated("Conversion to enum is deprecated. Will be removed after 3.5. Use tags.")]]
+ constexpr operator DiscretizationMethod() const
+ {
+ return DiscretizationMethod::fcstaggered;
+ }
+};
+
+
+
+struct None : public Utility::Tag {
+ static std::string name() { return "none"; }
+
+ //conversion operator
+ [[deprecated("Conversion to enum is deprecated. Will be removed after 3.5. Use tags.")]]
+ constexpr operator DiscretizationMethod() const
+ {
+ return DiscretizationMethod::none;
+ }
+};
+
+
+inline constexpr CCTpfa cctpfa{};
+inline constexpr CCMpfa ccmpfa{};
+inline constexpr Box box{};
+inline constexpr Staggered staggered{};
+inline constexpr FEM fem{};
+inline constexpr FCStaggered fcstaggered{};
+inline constexpr None none{};
+
+} // end namespace DiscretizationMethods
+
/*!
* \brief Convert discretization method to string
* \ingroup Discretization
*/
+[[deprecated("Use discretization tags and their name attribute. Will be removed after 3.5")]]
inline std::string toString(DiscretizationMethod m)
{
switch (m)
@@ -63,8 +167,24 @@ inline std::string toString(DiscretizationMethod m)
* \brief Write discretization method to stream
* \ingroup Discretization
*/
+[[deprecated("Use discretization tags which also support operator <<. Will be removed after 3.5")]]
inline std::ostream& operator<<(std::ostream& stream, DiscretizationMethod m)
-{ stream << toString(m); return stream; }
+{
+ // get rid of deprecation warning in the transition period
+ const auto toStringImpl = [](DiscretizationMethod m){
+ switch (m)
+ {
+ case DiscretizationMethod::box: return "box";
+ case DiscretizationMethod::cctpfa: return "cctpfa";
+ case DiscretizationMethod::ccmpfa: return "ccmpfa";
+ case DiscretizationMethod::fcstaggered: return "fcstaggered";
+ case DiscretizationMethod::fem: return "fem";
+ case DiscretizationMethod::staggered: return "staggered";
+ default: return "none";
+ }
+ };
+ stream << toStringImpl(m); return stream;
+}
} // end namespace Dumux
diff --git a/dumux/discretization/porenetwork/gridgeometry.hh b/dumux/discretization/porenetwork/gridgeometry.hh
index ee3407341f38b4f77b784aa38526bab0255a5e60..990f17e95a94c2b051a0b14064f8fa62a8c8b183 100644
--- a/dumux/discretization/porenetwork/gridgeometry.hh
+++ b/dumux/discretization/porenetwork/gridgeometry.hh
@@ -510,8 +510,9 @@ class GridGeometry
static const int dimWorld = GV::dimensionworld;
public:
- //! export discretization method
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::box;
+ //! export the discretization method this geometry belongs to
+ using DiscretizationMethod = DiscretizationMethods::Box;
+ static constexpr DiscretizationMethod discMethod{};
//! export the type of the fv element geometry (the local view type)
using LocalView = typename Traits::template LocalView;
@@ -726,8 +727,9 @@ class GridGeometry
using CoordScalar = typename GV::ctype;
public:
- //! export discretization method
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::box;
+ //! export the discretization method this geometry belongs to
+ using DiscretizationMethod = DiscretizationMethods::Box;
+ static constexpr DiscretizationMethod discMethod{};
//! export the type of the fv element geometry (the local view type)
using LocalView = typename Traits::template LocalView;
diff --git a/dumux/discretization/staggered.hh b/dumux/discretization/staggered.hh
index b5bb1345270574823f10b752b3ae74531d3a8886..3caccbd7a0a0735b32b452bf2e734dcd4265e4ac 100644
--- a/dumux/discretization/staggered.hh
+++ b/dumux/discretization/staggered.hh
@@ -200,7 +200,7 @@ public:
namespace Detail {
template
-struct ProblemTraits
+struct ProblemTraits
{
private:
using GG = std::decay_t().gridGeometry())>;
diff --git a/dumux/discretization/staggered/elementsolution.hh b/dumux/discretization/staggered/elementsolution.hh
index ebb23bf2a6d5d736e78e18f6eec3e171616e7414..330745749daf769e9c9576928a01d8d32964fa09 100644
--- a/dumux/discretization/staggered/elementsolution.hh
+++ b/dumux/discretization/staggered/elementsolution.hh
@@ -60,7 +60,7 @@ using StaggeredElementSolution = Dune::BlockVector;
*/
template
auto elementSolution(PrimaryVariables&& priVars)
--> std::enable_if_t std::enable_if_t>
{
return StaggeredElementSolution({std::move(priVars)});
diff --git a/dumux/discretization/staggered/fvgridgeometry.hh b/dumux/discretization/staggered/fvgridgeometry.hh
index ca051c30715da487b84f2b8a60050ac321fb2cc5..9e14e91c272262006372f6f057470a2fe52c2d46 100644
--- a/dumux/discretization/staggered/fvgridgeometry.hh
+++ b/dumux/discretization/staggered/fvgridgeometry.hh
@@ -50,7 +50,11 @@ public:
//! export the GridView type and the discretization method
using GridView = typename ActualGridGeometry::GridView;
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::staggered;
+
+ //! export the discretization method this geometry belongs to
+ using DiscretizationMethod = DiscretizationMethods::Staggered;
+ static constexpr DiscretizationMethod discMethod{};
+
using LocalView = typename ActualGridGeometry::LocalView;
/*!
@@ -196,8 +200,10 @@ public:
//! export the traits
using Traits = typename T::PublicTraits;
- //! export discretization method
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::staggered;
+ //! export the discretization method this geometry belongs to
+ using DiscretizationMethod = DiscretizationMethods::Staggered;
+ static constexpr DiscretizationMethod discMethod{};
+
static constexpr int upwindSchemeOrder = T::upwindSchemeOrder;
static constexpr bool useHigherOrder = upwindSchemeOrder > 1;
static constexpr bool cachingEnabled = true;
@@ -238,7 +244,7 @@ public:
, intersectionMapper_(gridView)
{
// Check if the overlap size is what we expect
- if (!CheckOverlapSize::isValid(gridView))
+ if (!CheckOverlapSize::isValid(gridView))
DUNE_THROW(Dune::InvalidStateException, "The staggered discretization method needs at least an overlap of 1 for parallel computations. "
<< " Set the parameter \"Grid.Overlap\" in the input file.");
@@ -493,8 +499,10 @@ public:
//! export the traits
using Traits = typename T::PublicTraits;
- //! export discretization method
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::staggered;
+ //! export the discretization method this geometry belongs to
+ using DiscretizationMethod = DiscretizationMethods::Staggered;
+ static constexpr DiscretizationMethod discMethod{};
+
static constexpr int upwindSchemeOrder = T::upwindSchemeOrder;
static constexpr bool useHigherOrder = upwindSchemeOrder > 1;
static constexpr bool cachingEnabled = false;
@@ -537,7 +545,7 @@ public:
, intersectionMapper_(gridView)
{
// Check if the overlap size is what we expect
- if (!CheckOverlapSize::isValid(gridView))
+ if (!CheckOverlapSize::isValid(gridView))
DUNE_THROW(Dune::InvalidStateException, "The staggered discretization method needs at least an overlap of 1 for parallel computations. "
<< " Set the parameter \"Grid.Overlap\" in the input file.");
diff --git a/dumux/flux/box/darcyslaw.hh b/dumux/flux/box/darcyslaw.hh
index 0c011f5d1d8454bd831e281a3eb2a0bb4b197a2f..a1326195e31839e3725ce92242ced0086b24ad44 100644
--- a/dumux/flux/box/darcyslaw.hh
+++ b/dumux/flux/box/darcyslaw.hh
@@ -37,7 +37,7 @@
namespace Dumux {
// forward declaration
-template
+template
class DarcysLawImplementation;
// forward declaration
@@ -49,7 +49,7 @@ class BoxDarcysLaw;
* \brief Specialization of Darcy's Law for the box method.
*/
template
-class DarcysLawImplementation
+class DarcysLawImplementation
: public BoxDarcysLaw, GetPropType>
{ };
diff --git a/dumux/flux/box/effectivestresslaw.hh b/dumux/flux/box/effectivestresslaw.hh
index 629ef693e2eb65c3098a8d1f218c3c1ee1f68621..3d27b0c19378828b5d47999fa5a848c7705d61b8 100644
--- a/dumux/flux/box/effectivestresslaw.hh
+++ b/dumux/flux/box/effectivestresslaw.hh
@@ -39,7 +39,7 @@ namespace Dumux {
* \tparam GridGeometry the finite volume grid geometry
*/
template
-class EffectiveStressLaw
+class EffectiveStressLaw
{
using FVElementGeometry = typename GridGeometry::LocalView;
using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
@@ -51,7 +51,7 @@ class EffectiveStressLaw
static constexpr int dim = GridView::dimension;
static constexpr int dimWorld = GridView::dimensionworld;
static_assert(dim == dimWorld, "EffectiveStressLaw not implemented for network/surface grids");
- static_assert(StressType::discMethod == DiscretizationMethod::box, "The provided stress type must be specialized for the box scheme");
+ static_assert(StressType::discMethod == DiscretizationMethods::box, "The provided stress type must be specialized for the box scheme");
public:
//! export the type used for scalar values
@@ -61,7 +61,10 @@ public:
//! export the type used for force vectors
using ForceVector = typename StressType::ForceVector;
//! state the discretization method this implementation belongs to
- static constexpr DiscretizationMethod discMethod = DiscretizationMethod::box;
+
+ using DiscretizationMethod = DiscretizationMethods::Box;
+ // state the discretization method this implementation belongs to
+ static constexpr DiscretizationMethod discMethod{};
/*!
* \brief Computes the force (in Newton) acting on a sub-control volume face.
diff --git a/dumux/flux/box/fickslaw.hh b/dumux/flux/box/fickslaw.hh
index 61b7a17b268fd9ee2d71c8006d714a8d0452eb89..0349e2549cab98b22f64b3412b803f72fc6b5f04 100644
--- a/dumux/flux/box/fickslaw.hh
+++ b/dumux/flux/box/fickslaw.hh
@@ -39,7 +39,7 @@
namespace Dumux {
// forward declaration
-template
+template
class FicksLawImplementation;
/*!
@@ -47,7 +47,7 @@ class FicksLawImplementation;
* \brief Specialization of Fick's Law for the box method.
*/
template
-class FicksLawImplementation
+class FicksLawImplementation
{
using Scalar = GetPropType;
using Problem = GetPropType;
diff --git a/dumux/flux/box/forchheimerslaw.hh b/dumux/flux/box/forchheimerslaw.hh
index eee7bb7b327835ff76dc7f782ecc2cb657050b40..0ce29b5f0e92c4d60659a4668d6c9e27cb699c0a 100644
--- a/dumux/flux/box/forchheimerslaw.hh
+++ b/dumux/flux/box/forchheimerslaw.hh
@@ -39,7 +39,7 @@
namespace Dumux {
// forward declarations
-template
+template
class ForchheimersLawImplementation;
/*!
@@ -59,7 +59,7 @@ class BoxForchheimersLaw;
* \brief Forchheimer's law for box scheme
*/
template
-class ForchheimersLawImplementation
+class ForchheimersLawImplementation
: public BoxForchheimersLaw,
GetPropType,
ForchheimerVelocity>
@@ -88,8 +88,9 @@ public:
//! state the scalar type of the law
using Scalar = ScalarType;
+ using DiscretizationMethod = DiscretizationMethods::Box;
//! state the discretization method this implementation belongs to
- static const DiscretizationMethod discMethod = DiscretizationMethod::box;
+ static constexpr DiscretizationMethod discMethod{};
/*! \brief Compute the advective flux of a phase across
* the given sub-control volume face using the Forchheimer equation.
diff --git a/dumux/flux/box/fourierslaw.hh b/dumux/flux/box/fourierslaw.hh
index 988f87024ba23808b4cc5e06c73b294f4845006e..6a825e69464a0a4ec4a5fb42a94c06651202bab1 100644
--- a/dumux/flux/box/fourierslaw.hh
+++ b/dumux/flux/box/fourierslaw.hh
@@ -33,7 +33,7 @@
namespace Dumux {
// forward declaration
-template
+template
class FouriersLawImplementation;
/*!
@@ -41,7 +41,7 @@ class FouriersLawImplementation;
* \brief Specialization of Fourier's Law for the box method.
*/
template
-class FouriersLawImplementation
+class FouriersLawImplementation
{
using Scalar = GetPropType;
using Problem = GetPropType;
diff --git a/dumux/flux/box/fourierslawnonequilibrium.hh b/dumux/flux/box/fourierslawnonequilibrium.hh
index 40bf51f39aef1038576543180a6a6e864454e53f..22ea175d80443dd893be1e4722cb37f87ba2f2db 100644
--- a/dumux/flux/box/fourierslawnonequilibrium.hh
+++ b/dumux/flux/box/fourierslawnonequilibrium.hh
@@ -36,7 +36,7 @@
namespace Dumux {
// forward declaration
-template
+template
class FouriersLawNonEquilibriumImplementation;
/*!
@@ -44,7 +44,7 @@ class FouriersLawNonEquilibriumImplementation;
* \brief Specialization of Fourier's Law for the box method for thermal nonequilibrium models.
*/
template
-class FouriersLawNonEquilibriumImplementation
+class FouriersLawNonEquilibriumImplementation
{
using Scalar = GetPropType;
using Problem = GetPropType;
diff --git a/dumux/flux/box/hookeslaw.hh b/dumux/flux/box/hookeslaw.hh
index e7dfe838321cd666573bddac73aaeadae9b5f2e7..f750acd26f406ce194ac6f516d49a8773decaeea 100644
--- a/dumux/flux/box/hookeslaw.hh
+++ b/dumux/flux/box/hookeslaw.hh
@@ -40,7 +40,7 @@ namespace Dumux {
* \tparam GridGeometry the grid geometry
*/
template
-class HookesLaw
+class HookesLaw