From 221311fbab97420f975cea57cb09d6df963ab38e Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Tue, 26 Oct 2021 14:38:12 +0200 Subject: [PATCH 01/26] [disc] Introduce discretization tags in namespace DiscretizationMethods Tags have some advantages over enums. There are separate types and allow for things like tag dispatch. They are also extensible. That means you can now define your own discretization tag in a downstream module and specialize classes for it. With enums you always need to modify the dumux core, i.e. add the enum to the list of discretization method in this header. --- dumux/discretization/method.hh | 122 ++++++++++++++++++++++++++++++++- 1 file changed, 121 insertions(+), 1 deletion(-) diff --git a/dumux/discretization/method.hh b/dumux/discretization/method.hh index 255c0061fa..8da080bdd7 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 -- GitLab From b1d309b39e048ed7c346eff9021fa624f5e37048 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Tue, 26 Oct 2021 14:38:46 +0200 Subject: [PATCH 02/26] [disc] Use discretization tags in the grid geometries --- dumux/discretization/box/fvgridgeometry.hh | 10 +++++---- .../cellcentered/mpfa/fvgridgeometry.hh | 8 ++++--- .../cellcentered/tpfa/fvgridgeometry.hh | 10 +++++---- .../facecentered/staggered/fvgridgeometry.hh | 16 +++++++++----- dumux/discretization/fem/fegridgeometry.hh | 7 +++--- .../porenetwork/gridgeometry.hh | 10 +++++---- .../staggered/fvgridgeometry.hh | 22 +++++++++++++------ dumux/multidomain/facet/box/fvgridgeometry.hh | 10 +++++---- .../porousmediumflow/boxdfm/fvgridgeometry.hh | 10 +++++---- 9 files changed, 64 insertions(+), 39 deletions(-) diff --git a/dumux/discretization/box/fvgridgeometry.hh b/dumux/discretization/box/fvgridgeometry.hh index 95938a6bd5..d2ea779d43 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/cellcentered/mpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh index f29ba01a91..050e64142a 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 538031d5f4..80f6442203 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/facecentered/staggered/fvgridgeometry.hh b/dumux/discretization/facecentered/staggered/fvgridgeometry.hh index 18af7159e9..d76b73b76b 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/fem/fegridgeometry.hh b/dumux/discretization/fem/fegridgeometry.hh index fff2242c47..5a99a1f334 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/porenetwork/gridgeometry.hh b/dumux/discretization/porenetwork/gridgeometry.hh index ee3407341f..990f17e95a 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/fvgridgeometry.hh b/dumux/discretization/staggered/fvgridgeometry.hh index ca051c3071..1aea7a1b96 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/multidomain/facet/box/fvgridgeometry.hh b/dumux/multidomain/facet/box/fvgridgeometry.hh index deff0e2f51..d6b087a68a 100644 --- a/dumux/multidomain/facet/box/fvgridgeometry.hh +++ b/dumux/multidomain/facet/box/fvgridgeometry.hh @@ -109,8 +109,9 @@ class BoxFacetCouplingFVGridGeometry using GeometryHelper = BoxGeometryHelper; 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; @@ -422,8 +423,9 @@ class BoxFacetCouplingFVGridGeometry 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/porousmediumflow/boxdfm/fvgridgeometry.hh b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh index 16dd5b706c..5d99c297f5 100644 --- a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh +++ b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh @@ -115,8 +115,9 @@ class BoxDfmFVGridGeometry 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; @@ -446,8 +447,9 @@ class BoxDfmFVGridGeometry 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; -- GitLab From c6f24926c9259ffba6e56c04c7b8221ce5446ada Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 14:25:05 +0200 Subject: [PATCH 03/26] [discmethod] Update laws in flux and multidomain to use discretization tags --- dumux/flux/box/darcyslaw.hh | 4 ++-- dumux/flux/box/fickslaw.hh | 4 ++-- dumux/flux/box/forchheimerslaw.hh | 7 ++++--- dumux/flux/box/fourierslaw.hh | 4 ++-- dumux/flux/box/fourierslawnonequilibrium.hh | 4 ++-- dumux/flux/box/maxwellstefanslaw.hh | 4 ++-- dumux/flux/ccmpfa/darcyslaw.hh | 7 ++++--- dumux/flux/ccmpfa/fickslaw.hh | 7 ++++--- dumux/flux/ccmpfa/fourierslaw.hh | 7 ++++--- dumux/flux/cctpfa/darcyslaw.hh | 10 ++++++---- dumux/flux/cctpfa/fickslaw.hh | 10 ++++++---- dumux/flux/cctpfa/forchheimerslaw.hh | 7 ++++--- dumux/flux/cctpfa/fourierslaw.hh | 9 +++++---- dumux/flux/cctpfa/fourierslawnonequilibrium.hh | 9 +++++---- dumux/flux/cctpfa/maxwellstefanslaw.hh | 8 +++++--- dumux/flux/darcyslaw_fwd.hh | 4 ++-- dumux/flux/effectivestresslaw_fwd.hh | 2 +- dumux/flux/fickslaw_fwd.hh | 4 ++-- dumux/flux/forchheimerslaw_fwd.hh | 9 +++++---- dumux/flux/fourierslaw_fwd.hh | 4 ++-- dumux/flux/fourierslawnonequilibrium_fwd.hh | 4 ++-- dumux/flux/hookeslaw_fwd.hh | 2 +- dumux/flux/maxwellstefanslaw_fwd.hh | 4 ++-- dumux/flux/staggered/freeflow/fickslaw.hh | 8 +++++--- dumux/flux/staggered/freeflow/fourierslaw.hh | 7 ++++--- dumux/flux/staggered/freeflow/maxwellstefanslaw.hh | 8 +++++--- .../boundary/stokesdarcy/couplingdata.hh | 14 +++++++------- dumux/multidomain/facet/box/fickslaw.hh | 4 ++-- dumux/multidomain/facet/box/fourierslaw.hh | 4 ++-- .../facet/cellcentered/tpfa/darcyslaw.hh | 6 ++++-- .../facet/cellcentered/tpfa/fickslaw.hh | 14 ++++++++------ .../facet/cellcentered/tpfa/fourierslaw.hh | 14 ++++++++------ 32 files changed, 119 insertions(+), 94 deletions(-) diff --git a/dumux/flux/box/darcyslaw.hh b/dumux/flux/box/darcyslaw.hh index 0c011f5d1d..a1326195e3 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/fickslaw.hh b/dumux/flux/box/fickslaw.hh index 61b7a17b26..0349e2549c 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 eee7bb7b32..0ce29b5f0e 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 988f87024b..6a825e6946 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 40bf51f39a..22ea175d80 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/maxwellstefanslaw.hh b/dumux/flux/box/maxwellstefanslaw.hh index 76b2b5b583..fa2a845e9a 100644 --- a/dumux/flux/box/maxwellstefanslaw.hh +++ b/dumux/flux/box/maxwellstefanslaw.hh @@ -40,7 +40,7 @@ namespace Dumux { // forward declaration -template +template class MaxwellStefansLawImplementation; /*! @@ -48,7 +48,7 @@ class MaxwellStefansLawImplementation; * \brief Specialization of Maxwell Stefan's Law for the Box method. */ template -class MaxwellStefansLawImplementation +class MaxwellStefansLawImplementation { using Scalar = GetPropType; using Problem = GetPropType; diff --git a/dumux/flux/ccmpfa/darcyslaw.hh b/dumux/flux/ccmpfa/darcyslaw.hh index 97a5a3a2d8..9627f8e7ac 100644 --- a/dumux/flux/ccmpfa/darcyslaw.hh +++ b/dumux/flux/ccmpfa/darcyslaw.hh @@ -35,7 +35,7 @@ namespace Dumux { //! forward declaration of the method-specific implementation -template +template class DarcysLawImplementation; /*! @@ -44,7 +44,7 @@ class DarcysLawImplementation; * with multi-point flux approximation. */ template -class DarcysLawImplementation +class DarcysLawImplementation { using Scalar = GetPropType; using Problem = GetPropType; @@ -151,8 +151,9 @@ class DarcysLawImplementation }; public: + using DiscretizationMethod = DiscretizationMethods::CCMpfa; // state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::ccmpfa; + static constexpr DiscretizationMethod discMethod{}; // export the type for the corresponding cache using Cache = MpfaDarcysLawCache; diff --git a/dumux/flux/ccmpfa/fickslaw.hh b/dumux/flux/ccmpfa/fickslaw.hh index 0e13b4eebc..071a9b2e23 100644 --- a/dumux/flux/ccmpfa/fickslaw.hh +++ b/dumux/flux/ccmpfa/fickslaw.hh @@ -34,7 +34,7 @@ namespace Dumux { //! forward declaration of the method-specific implemetation -template +template class FicksLawImplementation; /*! @@ -42,7 +42,7 @@ class FicksLawImplementation; * \brief Fick's law for cell-centered finite volume schemes with multi-point flux approximation */ template -class FicksLawImplementation +class FicksLawImplementation { using Scalar = GetPropType; using Problem = GetPropType; @@ -162,8 +162,9 @@ class FicksLawImplementation +template class FouriersLawImplementation; /*! @@ -41,7 +41,7 @@ class FouriersLawImplementation; * \brief Fourier's law for cell-centered finite volume schemes with two-point flux approximation */ template -class FouriersLawImplementation +class FouriersLawImplementation { using Scalar = GetPropType; using Problem = GetPropType; @@ -148,8 +148,9 @@ class FouriersLawImplementation }; public: + using DiscretizationMethod = DiscretizationMethods::CCMpfa; // state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::ccmpfa; + static constexpr DiscretizationMethod discMethod{}; // state the type for the corresponding cache and its filler using Cache = MpfaFouriersLawCache; diff --git a/dumux/flux/cctpfa/darcyslaw.hh b/dumux/flux/cctpfa/darcyslaw.hh index 98e6bc3f7a..fa9b7eb164 100644 --- a/dumux/flux/cctpfa/darcyslaw.hh +++ b/dumux/flux/cctpfa/darcyslaw.hh @@ -35,7 +35,7 @@ namespace Dumux { // forward declarations -template +template class DarcysLawImplementation; /*! @@ -55,7 +55,7 @@ class CCTpfaDarcysLaw; * \note Darcy's law is specialized for network and surface grids (i.e. if grid dim < dimWorld) */ template -class DarcysLawImplementation +class DarcysLawImplementation : public CCTpfaDarcysLaw, GetPropType, (GetPropType::GridView::dimension < GetPropType::GridView::dimensionworld)> @@ -145,8 +145,9 @@ class CCTpfaDarcysLaw //! state the scalar type of the law using Scalar = ScalarType; + using DiscretizationMethod = DiscretizationMethods::CCTpfa; //! state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + static constexpr DiscretizationMethod discMethod{}; //! state the type for the corresponding cache using Cache = TpfaDarcysLawCache; @@ -309,8 +310,9 @@ public: //! state the scalar type of the law using Scalar = ScalarType; + using DiscretizationMethod = DiscretizationMethods::CCTpfa; //! state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + static constexpr DiscretizationMethod discMethod{}; //! state the type for the corresponding cache using Cache = TpfaDarcysLawCache; diff --git a/dumux/flux/cctpfa/fickslaw.hh b/dumux/flux/cctpfa/fickslaw.hh index 29c1aa8ea5..7876e600e1 100644 --- a/dumux/flux/cctpfa/fickslaw.hh +++ b/dumux/flux/cctpfa/fickslaw.hh @@ -39,7 +39,7 @@ namespace Dumux { // forward declaration -template +template class FicksLawImplementation; /*! @@ -47,9 +47,9 @@ class FicksLawImplementation; * \brief Fick's law for cell-centered finite volume schemes with two-point flux approximation */ template -class FicksLawImplementation +class FicksLawImplementation { - using Implementation = FicksLawImplementation; + using Implementation = FicksLawImplementation; using Scalar = GetPropType; using Problem = GetPropType; using GridGeometry = GetPropType; @@ -117,8 +117,10 @@ class FicksLawImplementation +template class ForchheimersLawImplementation; /*! @@ -60,7 +60,7 @@ class CCTpfaForchheimersLaw; * \note Forchheimer's law is specialized for network and surface grids (i.e. if grid dim < dimWorld) */ template -class ForchheimersLawImplementation +class ForchheimersLawImplementation : public CCTpfaForchheimersLaw, GetPropType, ForchheimerVelocity, @@ -157,8 +157,9 @@ class CCTpfaForchheimersLaw; diff --git a/dumux/flux/cctpfa/fourierslaw.hh b/dumux/flux/cctpfa/fourierslaw.hh index 90fa112ac9..ac3b95b99c 100644 --- a/dumux/flux/cctpfa/fourierslaw.hh +++ b/dumux/flux/cctpfa/fourierslaw.hh @@ -34,7 +34,7 @@ namespace Dumux { // forward declaration -template +template class FouriersLawImplementation; /*! @@ -42,9 +42,9 @@ class FouriersLawImplementation; * \brief Fourier's law for cell-centered finite volume schemes with two-point flux approximation */ template -class FouriersLawImplementation +class FouriersLawImplementation { - using Implementation = FouriersLawImplementation; + using Implementation = FouriersLawImplementation; using Scalar = GetPropType; using Problem = GetPropType; using GridGeometry = GetPropType; @@ -103,8 +103,9 @@ class FouriersLawImplementation }; public: + using DiscretizationMethod = DiscretizationMethods::CCTpfa; //! state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + static constexpr DiscretizationMethod discMethod{}; //! export the type for the corresponding cache using Cache = TpfaFouriersLawCache; diff --git a/dumux/flux/cctpfa/fourierslawnonequilibrium.hh b/dumux/flux/cctpfa/fourierslawnonequilibrium.hh index cf0dc419c7..a2ddb1e83d 100644 --- a/dumux/flux/cctpfa/fourierslawnonequilibrium.hh +++ b/dumux/flux/cctpfa/fourierslawnonequilibrium.hh @@ -33,7 +33,7 @@ namespace Dumux { // forward declaration -template +template class FouriersLawNonEquilibriumImplementation; /*! @@ -41,9 +41,9 @@ class FouriersLawNonEquilibriumImplementation; * \brief Fourier's law for cell-centered finite volume schemes with two-point flux approximation */ template -class FouriersLawNonEquilibriumImplementation +class FouriersLawNonEquilibriumImplementation { - using Implementation = FouriersLawNonEquilibriumImplementation; + using Implementation = FouriersLawNonEquilibriumImplementation; using Scalar = GetPropType; using Problem = GetPropType; using GridGeometry = GetPropType; @@ -66,8 +66,9 @@ class FouriersLawNonEquilibriumImplementation +template class MaxwellStefansLawImplementation; /*! @@ -48,7 +48,7 @@ class MaxwellStefansLawImplementation; * \brief Specialization of Maxwell Stefan's Law for the CCTpfa method. */ template -class MaxwellStefansLawImplementation +class MaxwellStefansLawImplementation { using Scalar = GetPropType; using Problem = GetPropType; @@ -78,8 +78,10 @@ class MaxwellStefansLawImplementation; public: + using DiscretizationMethod = DiscretizationMethods::CCTpfa; // state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + static constexpr DiscretizationMethod discMethod{}; + //return the reference system static constexpr ReferenceSystemFormulation referenceSystemFormulation() { return referenceSystem; } diff --git a/dumux/flux/darcyslaw_fwd.hh b/dumux/flux/darcyslaw_fwd.hh index 9cba7efb4f..f69444c702 100644 --- a/dumux/flux/darcyslaw_fwd.hh +++ b/dumux/flux/darcyslaw_fwd.hh @@ -33,7 +33,7 @@ namespace Dumux { // declaration of primary template -template +template class DarcysLawImplementation; /*! @@ -43,7 +43,7 @@ class DarcysLawImplementation; * These specializations are found in the headers included below. */ template -using DarcysLaw = DarcysLawImplementation::discMethod>; +using DarcysLaw = DarcysLawImplementation::DiscretizationMethod>; } // end namespace Dumux diff --git a/dumux/flux/effectivestresslaw_fwd.hh b/dumux/flux/effectivestresslaw_fwd.hh index 75e66af3e3..9b2092081d 100644 --- a/dumux/flux/effectivestresslaw_fwd.hh +++ b/dumux/flux/effectivestresslaw_fwd.hh @@ -35,7 +35,7 @@ namespace Dumux { * \note Specializations are provided for the different discretization methods. * These specializations are found in the headers included below. */ -template +template class EffectiveStressLaw; } // end namespace Dumux diff --git a/dumux/flux/fickslaw_fwd.hh b/dumux/flux/fickslaw_fwd.hh index 265c964c03..8264f2c6c5 100644 --- a/dumux/flux/fickslaw_fwd.hh +++ b/dumux/flux/fickslaw_fwd.hh @@ -34,7 +34,7 @@ namespace Dumux { // declaration of primary template -template +template class FicksLawImplementation; /*! @@ -42,7 +42,7 @@ class FicksLawImplementation; * \brief Evaluates the diffusive mass flux according to Fick's law */ template -using FicksLaw = FicksLawImplementation::discMethod, referenceSystem>; +using FicksLaw = FicksLawImplementation::DiscretizationMethod, referenceSystem>; } // end namespace Dumux diff --git a/dumux/flux/forchheimerslaw_fwd.hh b/dumux/flux/forchheimerslaw_fwd.hh index fe008ed2ff..9e45d2165e 100644 --- a/dumux/flux/forchheimerslaw_fwd.hh +++ b/dumux/flux/forchheimerslaw_fwd.hh @@ -34,12 +34,13 @@ namespace Dumux { // definition of primary template -template +template class ForchheimersLawImplementation { static_assert( - discMethod == DiscretizationMethod::cctpfa || discMethod == DiscretizationMethod::box, - "Forchheimer only implemented for cctpfa or box!" + GetPropType::discMethod == DiscretizationMethods::cctpfa || + GetPropType::discMethod == DiscretizationMethods::box, + "Forchheimer only implemented for cctpfa or box!") ); }; @@ -57,7 +58,7 @@ using ForchheimersLaw = ForchheimersLawImplementation< GetPropType, GetPropType >, - GetPropType::discMethod + typename GetPropType::DiscretizationMethod >; } // end namespace Dumux diff --git a/dumux/flux/fourierslaw_fwd.hh b/dumux/flux/fourierslaw_fwd.hh index 1658102bfa..ef6da70c55 100644 --- a/dumux/flux/fourierslaw_fwd.hh +++ b/dumux/flux/fourierslaw_fwd.hh @@ -32,7 +32,7 @@ namespace Dumux { // declaration of primary template -template +template class FouriersLawImplementation; /*! @@ -40,7 +40,7 @@ class FouriersLawImplementation; * \brief Evaluates the heat conduction flux according to Fouriers's law */ template -using FouriersLaw = FouriersLawImplementation::discMethod>; +using FouriersLaw = FouriersLawImplementation::DiscretizationMethod>; } // end namespace Dumux diff --git a/dumux/flux/fourierslawnonequilibrium_fwd.hh b/dumux/flux/fourierslawnonequilibrium_fwd.hh index a940df1c0d..77969c91d2 100644 --- a/dumux/flux/fourierslawnonequilibrium_fwd.hh +++ b/dumux/flux/fourierslawnonequilibrium_fwd.hh @@ -31,7 +31,7 @@ namespace Dumux { // forward declaration -template +template class FouriersLawNonEquilibriumImplementation; /*! @@ -39,7 +39,7 @@ class FouriersLawNonEquilibriumImplementation; * \brief Evaluates the heat conduction flux according to Fouriers's law */ template -using FouriersLawNonEquilibrium = FouriersLawNonEquilibriumImplementation::discMethod>; +using FouriersLawNonEquilibrium = FouriersLawNonEquilibriumImplementation::DiscretizationMethod>; } // end namespace Dumux diff --git a/dumux/flux/hookeslaw_fwd.hh b/dumux/flux/hookeslaw_fwd.hh index 2ee6c30c7a..e3cc7c4982 100644 --- a/dumux/flux/hookeslaw_fwd.hh +++ b/dumux/flux/hookeslaw_fwd.hh @@ -35,7 +35,7 @@ namespace Dumux { * \note Specializations are provided for the different discretization methods. * These specializations are found in the headers included below. */ -template +template class HookesLaw; } // end namespace Dumux diff --git a/dumux/flux/maxwellstefanslaw_fwd.hh b/dumux/flux/maxwellstefanslaw_fwd.hh index fad0ea05a8..f320dd1aa8 100644 --- a/dumux/flux/maxwellstefanslaw_fwd.hh +++ b/dumux/flux/maxwellstefanslaw_fwd.hh @@ -32,7 +32,7 @@ namespace Dumux { // forward declaration -template +template class MaxwellStefansLawImplementation; /*! @@ -40,7 +40,7 @@ class MaxwellStefansLawImplementation; * \brief Evaluates the diffusive mass flux according to Maxwell Stefan's law */ template -using MaxwellStefansLaw = MaxwellStefansLawImplementation::discMethod, referenceSystem>; +using MaxwellStefansLaw = MaxwellStefansLawImplementation::DiscretizationMethod, referenceSystem>; } // end namespace Dumux diff --git a/dumux/flux/staggered/freeflow/fickslaw.hh b/dumux/flux/staggered/freeflow/fickslaw.hh index a1a36d25ae..146b025e11 100644 --- a/dumux/flux/staggered/freeflow/fickslaw.hh +++ b/dumux/flux/staggered/freeflow/fickslaw.hh @@ -42,7 +42,7 @@ namespace Dumux { // forward declaration -template +template class FicksLawImplementation; /*! @@ -50,7 +50,7 @@ class FicksLawImplementation; * \brief Specialization of Fick's Law for the staggered free flow method. */ template -class FicksLawImplementation +class FicksLawImplementation { using Scalar = GetPropType; using GridGeometry = GetPropType; @@ -72,8 +72,10 @@ class FicksLawImplementation +template class FouriersLawImplementation; /*! @@ -42,7 +42,7 @@ class FouriersLawImplementation; * \brief Specialization of Fourier's Law for the staggered free flow method. */ template -class FouriersLawImplementation +class FouriersLawImplementation { using Scalar = GetPropType; using GridGeometry = GetPropType; @@ -54,8 +54,9 @@ class FouriersLawImplementation using Indices = typename GetPropType::Indices; public: + using DiscretizationMethod = DiscretizationMethods::Staggered; // state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::staggered; + static constexpr DiscretizationMethod discMethod{}; //! state the type for the corresponding cache //! We don't cache anything for this law diff --git a/dumux/flux/staggered/freeflow/maxwellstefanslaw.hh b/dumux/flux/staggered/freeflow/maxwellstefanslaw.hh index d74deb7523..d6408f7893 100644 --- a/dumux/flux/staggered/freeflow/maxwellstefanslaw.hh +++ b/dumux/flux/staggered/freeflow/maxwellstefanslaw.hh @@ -38,7 +38,7 @@ namespace Dumux { // forward declaration -template +template class MaxwellStefansLawImplementation; /*! @@ -46,7 +46,7 @@ class MaxwellStefansLawImplementation; * \brief Specialization of Maxwell Stefan's Law for the Staggered method. */ template -class MaxwellStefansLawImplementation +class MaxwellStefansLawImplementation { using Scalar = GetPropType; using Problem = GetPropType; @@ -75,8 +75,10 @@ class MaxwellStefansLawImplementation }; // forward declaration -template +template class FicksLawImplementation; /*! @@ -116,8 +116,8 @@ struct IsFicksLaw : public std::false_type {}; * \brief This structs indicates that Fick's law is used for diffusion. * \tparam DiffLaw The diffusion law. */ -template -struct IsFicksLaw> : public std::true_type {}; +template +struct IsFicksLaw> : public std::true_type {}; /*! * \ingroup StokesDarcyCoupling @@ -194,11 +194,11 @@ struct IndexHelper }; //! forward declare -template +template class DarcysLawImplementation; //! forward declare -template +template class ForchheimersLawImplementation; @@ -241,8 +241,8 @@ class StokesDarcyCouplingDataImplementationBase static constexpr auto darcyIdx = CouplingManager::darcyIdx; using AdvectionType = GetPropType, Properties::AdvectionType>; - using DarcysLaw = DarcysLawImplementation, GridGeometry::discMethod>; - using ForchheimersLaw = ForchheimersLawImplementation, GridGeometry::discMethod>; + using DarcysLaw = DarcysLawImplementation, typename GridGeometry::DiscretizationMethod>; + using ForchheimersLaw = ForchheimersLawImplementation, typename GridGeometry::DiscretizationMethod>; static constexpr bool adapterUsed = ModelTraits::numFluidPhases() > 1; using IndexHelper = Dumux::IndexHelper, adapterUsed>; diff --git a/dumux/multidomain/facet/box/fickslaw.hh b/dumux/multidomain/facet/box/fickslaw.hh index 6ae5704709..075aa5f175 100644 --- a/dumux/multidomain/facet/box/fickslaw.hh +++ b/dumux/multidomain/facet/box/fickslaw.hh @@ -49,9 +49,9 @@ namespace Dumux { */ template class BoxFacetCouplingFicksLaw -: public FicksLawImplementation +: public FicksLawImplementation { - using ParentType = FicksLawImplementation; + using ParentType = FicksLawImplementation; using GridGeometry = GetPropType; using FVElementGeometry = typename GridGeometry::LocalView; diff --git a/dumux/multidomain/facet/box/fourierslaw.hh b/dumux/multidomain/facet/box/fourierslaw.hh index e492a8b3d7..a6363228c3 100644 --- a/dumux/multidomain/facet/box/fourierslaw.hh +++ b/dumux/multidomain/facet/box/fourierslaw.hh @@ -50,9 +50,9 @@ namespace Dumux { */ template class BoxFacetCouplingFouriersLaw -: public FouriersLawImplementation +: public FouriersLawImplementation { - using ParentType = FouriersLawImplementation; + using ParentType = FouriersLawImplementation; using Scalar = GetPropType; using GridGeometry = GetPropType; diff --git a/dumux/multidomain/facet/cellcentered/tpfa/darcyslaw.hh b/dumux/multidomain/facet/cellcentered/tpfa/darcyslaw.hh index 937c76b9a3..05c4ec5d7a 100644 --- a/dumux/multidomain/facet/cellcentered/tpfa/darcyslaw.hh +++ b/dumux/multidomain/facet/cellcentered/tpfa/darcyslaw.hh @@ -155,7 +155,8 @@ class CCTpfaFacetCouplingDarcysLawImpl; //! export the type used to store transmissibilities @@ -428,7 +429,8 @@ class CCTpfaFacetCouplingDarcysLawImpl; //! export the type used to store transmissibilities diff --git a/dumux/multidomain/facet/cellcentered/tpfa/fickslaw.hh b/dumux/multidomain/facet/cellcentered/tpfa/fickslaw.hh index e009f41b12..f56365cb5e 100644 --- a/dumux/multidomain/facet/cellcentered/tpfa/fickslaw.hh +++ b/dumux/multidomain/facet/cellcentered/tpfa/fickslaw.hh @@ -67,10 +67,10 @@ using CCTpfaFacetCouplingFicksLaw = */ template class CCTpfaFacetCouplingFicksLawImpl -: public FicksLawImplementation +: public FicksLawImplementation { using Implementation = CCTpfaFacetCouplingFicksLawImpl; - using ParentType = FicksLawImplementation; + using ParentType = FicksLawImplementation; using GridGeometry = GetPropType; using FVElementGeometry = typename GridGeometry::LocalView; @@ -150,8 +150,9 @@ public: //! export the type for the corresponding cache using Cache = FacetCouplingFicksLawCache; + using DiscretizationMethod = DiscretizationMethods::CCTpfa; //! state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + static constexpr DiscretizationMethod discMethod{}; //! Return the reference system static constexpr ReferenceSystemFormulation referenceSystemFormulation() @@ -306,10 +307,10 @@ public: */ template class CCTpfaFacetCouplingFicksLawImpl -: public FicksLawImplementation +: public FicksLawImplementation { using Implementation = CCTpfaFacetCouplingFicksLawImpl; - using ParentType = FicksLawImplementation; + using ParentType = FicksLawImplementation; using GridGeometry = GetPropType; using FVElementGeometry = typename GridGeometry::LocalView; @@ -384,8 +385,9 @@ public: //! export the type for the corresponding cache using Cache = FacetCouplingFicksLawCache; + using DiscretizationMethod = DiscretizationMethods::CCTpfa; //! state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + static constexpr DiscretizationMethod discMethod{}; //! Return the reference system static constexpr ReferenceSystemFormulation referenceSystemFormulation() diff --git a/dumux/multidomain/facet/cellcentered/tpfa/fourierslaw.hh b/dumux/multidomain/facet/cellcentered/tpfa/fourierslaw.hh index 6e43c638be..4c979da2c2 100644 --- a/dumux/multidomain/facet/cellcentered/tpfa/fourierslaw.hh +++ b/dumux/multidomain/facet/cellcentered/tpfa/fourierslaw.hh @@ -64,10 +64,10 @@ using CCTpfaFacetCouplingFouriersLaw = */ template class CCTpfaFacetCouplingFouriersLawImpl -: public FouriersLawImplementation +: public FouriersLawImplementation { using Implementation = CCTpfaFacetCouplingFouriersLawImpl; - using ParentType = FouriersLawImplementation; + using ParentType = FouriersLawImplementation; using Scalar = GetPropType; using GridGeometry = GetPropType; @@ -137,7 +137,8 @@ public: using Cache = FacetCouplingFouriersLawCache; //! state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + using DiscretizationMethod = DiscretizationMethods::CCTpfa; + static constexpr DiscretizationMethod discMethod{}; //! Compute the conductive heat flux template< class Problem, class ElementVolumeVariables, class ElementFluxVarsCache > @@ -270,10 +271,10 @@ public: */ template class CCTpfaFacetCouplingFouriersLawImpl -: public FouriersLawImplementation +: public FouriersLawImplementation { using Implementation = CCTpfaFacetCouplingFouriersLawImpl; - using ParentType = FouriersLawImplementation; + using ParentType = FouriersLawImplementation; using Scalar = GetPropType; using GridGeometry = GetPropType; @@ -338,7 +339,8 @@ public: using Cache = FacetCouplingFouriersLawCache; //! state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + using DiscretizationMethod = DiscretizationMethods::CCTpfa; + static constexpr DiscretizationMethod discMethod{}; //! Compute the conductive heat flux template< class Problem, class ElementVolumeVariables, class ElementFluxVarsCache > -- GitLab From 463b5abd700ea4019e5667b85aec455b39a28d6c Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 14:29:49 +0200 Subject: [PATCH 04/26] [discmethod] Use discretization tags for Hookeslaw --- dumux/flux/box/hookeslaw.hh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dumux/flux/box/hookeslaw.hh b/dumux/flux/box/hookeslaw.hh index e7dfe83832..f750acd26f 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 { using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace; @@ -61,7 +61,10 @@ public: //! export the type used for force vectors using ForceVector = typename StressTensor::row_type; //! 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 Returns the force (in Newton) acting on a sub-control volume face. -- GitLab From a7213ba2287e7450dc10dd72c9fb9cffcd6521ba Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 14:30:40 +0200 Subject: [PATCH 05/26] [discmethod] Use discretization tags in EffectiveStressLaw --- dumux/flux/box/effectivestresslaw.hh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dumux/flux/box/effectivestresslaw.hh b/dumux/flux/box/effectivestresslaw.hh index 629ef693e2..3d27b0c193 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. -- GitLab From 23d6e8088c5fbe0c26bd10238a5bc97984e73853 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 1 Oct 2021 16:21:08 +0200 Subject: [PATCH 06/26] [discmethod] Use discretization tags for ProblemTraits and update call sites --- dumux/common/typetraits/problem.hh | 4 ++-- dumux/discretization/box.hh | 2 +- dumux/discretization/ccmpfa.hh | 2 +- dumux/discretization/cctpfa.hh | 2 +- dumux/discretization/fcstaggered.hh | 2 +- dumux/discretization/staggered.hh | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dumux/common/typetraits/problem.hh b/dumux/common/typetraits/problem.hh index 0131254abd..64570dea8d 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 7ec91488a9..59669c347f 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/ccmpfa.hh b/dumux/discretization/ccmpfa.hh index 2d0e9e1182..fbd738fae0 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 0735de0923..3447dc2c94 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/fcstaggered.hh b/dumux/discretization/fcstaggered.hh index c950aec44e..6de37e6114 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/staggered.hh b/dumux/discretization/staggered.hh index b5bb134527..3caccbd7a0 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())>; -- GitLab From dd2ea0d673b251498171646ecc8b11370305fddd Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 1 Oct 2021 19:35:19 +0200 Subject: [PATCH 07/26] [discmethod] Use discretization tags for CheckOverlapSize and update call sites --- dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh | 2 +- dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh | 4 ++-- dumux/discretization/checkoverlapsize.hh | 8 ++++---- .../facecentered/staggered/fvgridgeometry.hh | 4 ++-- dumux/discretization/fem/fegridgeometry.hh | 2 +- dumux/discretization/staggered/fvgridgeometry.hh | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh index 050e64142a..7ea6b01127 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."); } diff --git a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh index 80f6442203..8c5e6c6702 100644 --- a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh @@ -126,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."); @@ -433,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 68243af089..cbea9b76a7 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/fvgridgeometry.hh b/dumux/discretization/facecentered/staggered/fvgridgeometry.hh index d76b73b76b..9c289fd046 100644 --- a/dumux/discretization/facecentered/staggered/fvgridgeometry.hh +++ b/dumux/discretization/facecentered/staggered/fvgridgeometry.hh @@ -140,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."); @@ -591,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/fem/fegridgeometry.hh b/dumux/discretization/fem/fegridgeometry.hh index 5a99a1f334..8f00843a1b 100644 --- a/dumux/discretization/fem/fegridgeometry.hh +++ b/dumux/discretization/fem/fegridgeometry.hh @@ -88,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/staggered/fvgridgeometry.hh b/dumux/discretization/staggered/fvgridgeometry.hh index 1aea7a1b96..9e14e91c27 100644 --- a/dumux/discretization/staggered/fvgridgeometry.hh +++ b/dumux/discretization/staggered/fvgridgeometry.hh @@ -244,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."); @@ -545,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."); -- GitLab From 1b22e8b0454231ce44566a0894fd016ca9bf0aad Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 14:34:50 +0200 Subject: [PATCH 08/26] [discmethod] Use discretization tags for internal local types in FVAssembler --- dumux/assembly/fvassembler.hh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dumux/assembly/fvassembler.hh b/dumux/assembly/fvassembler.hh index 567fe82745..e1a6614341 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 -- GitLab From 5d7d87758fc1b574965db5f5910283d2fd6d2e00 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 14:35:51 +0200 Subject: [PATCH 09/26] [discmethod] Use discretization tags in PartialReassembler --- dumux/assembly/partialreassembler.hh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dumux/assembly/partialreassembler.hh b/dumux/assembly/partialreassembler.hh index de2099e710..3ac1966a1c 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: -- GitLab From 9c3fd5f8049b2fb8b8f297994698c56e68d80b81 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 14:43:34 +0200 Subject: [PATCH 10/26] [discmethod] Use discretization tags for FluxStencil and FunctionSpaceBasis --- dumux/discretization/fluxstencil.hh | 6 +++--- dumux/discretization/functionspacebasis.hh | 15 +++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dumux/discretization/fluxstencil.hh b/dumux/discretization/fluxstencil.hh index f671e143b3..d49fdf39b3 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 dc7cad7fb9..ab43af0cbb 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 -- GitLab From 78d622c79a4f22af90c8fe79167dbc28fef3f9b6 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Sat, 2 Oct 2021 21:33:23 +0200 Subject: [PATCH 11/26] [discmethod] Use discretizations tags for UpwindScheme --- dumux/flux/upwindscheme.hh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dumux/flux/upwindscheme.hh b/dumux/flux/upwindscheme.hh index 93d92021a0..1ccdcd052b 100644 --- a/dumux/flux/upwindscheme.hh +++ b/dumux/flux/upwindscheme.hh @@ -30,7 +30,7 @@ namespace Dumux { //! Forward declaration of the upwind scheme implementation -template +template class UpwindSchemeImpl; /*! @@ -39,7 +39,7 @@ class UpwindSchemeImpl; * This depends on the chosen discretization method. */ template -using UpwindScheme = UpwindSchemeImpl; +using UpwindScheme = UpwindSchemeImpl; namespace Detail { @@ -69,7 +69,7 @@ Scalar upwindSchemeMultiplier(const ElemVolVars& elemVolVars, //! Upwind scheme for the box method (uses the standard scheme) template -class UpwindSchemeImpl +class UpwindSchemeImpl { public: //! applies a simple upwind scheme to the precalculated advective flux @@ -104,7 +104,7 @@ public: //! Upwind scheme for the cell-centered tpfa scheme template -class UpwindSchemeImpl +class UpwindSchemeImpl { using GridView = typename GridGeometry::GridView; static constexpr int dim = GridView::dimension; @@ -205,8 +205,8 @@ public: //! Upwind scheme for cell-centered mpfa schemes template -class UpwindSchemeImpl -: public UpwindSchemeImpl {}; +class UpwindSchemeImpl +: public UpwindSchemeImpl {}; } // end namespace Dumux -- GitLab From 0b506cb3f08cc55fcc0aa3ae3728aac78dd5b1d2 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Sun, 3 Oct 2021 10:05:15 +0200 Subject: [PATCH 12/26] [discmethod] Use and export discretiztaion tags in StationaryVelocityField --- dumux/flux/stationaryvelocityfield.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dumux/flux/stationaryvelocityfield.hh b/dumux/flux/stationaryvelocityfield.hh index 4f04257adb..f6bab51bda 100644 --- a/dumux/flux/stationaryvelocityfield.hh +++ b/dumux/flux/stationaryvelocityfield.hh @@ -43,8 +43,9 @@ template class StationaryVelocityField { public: + using DiscretizationMethod = DiscretizationMethods::None; //! state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::none; + static constexpr DiscretizationMethod discMethod{}; //! state the type for the corresponding cache using Cache = FluxVariablesCaching::EmptyAdvectionCache; -- GitLab From 2b580033bf0d8832c595a39987088395bb64cf29 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 14:50:36 +0200 Subject: [PATCH 13/26] [discmethod] Use discretiztaion tags in compositional --- dumux/freeflow/compositional/fluxvariables.hh | 4 ++-- dumux/freeflow/compositional/localresidual.hh | 4 ++-- dumux/freeflow/compositional/staggered/fluxvariables.hh | 4 ++-- dumux/freeflow/compositional/staggered/localresidual.hh | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dumux/freeflow/compositional/fluxvariables.hh b/dumux/freeflow/compositional/fluxvariables.hh index 7d1fadbbd7..da91e4b381 100644 --- a/dumux/freeflow/compositional/fluxvariables.hh +++ b/dumux/freeflow/compositional/fluxvariables.hh @@ -30,7 +30,7 @@ namespace Dumux { // forward declaration -template +template class FreeflowNCFluxVariablesImpl; /*! @@ -41,7 +41,7 @@ class FreeflowNCFluxVariablesImpl; * \note Not all specializations are currently implemented */ template -using FreeflowNCFluxVariables = FreeflowNCFluxVariablesImpl::discMethod>; +using FreeflowNCFluxVariables = FreeflowNCFluxVariablesImpl::DiscretizationMethod>; } // end namespace diff --git a/dumux/freeflow/compositional/localresidual.hh b/dumux/freeflow/compositional/localresidual.hh index 67dcf0b9e1..c8d18e593f 100644 --- a/dumux/freeflow/compositional/localresidual.hh +++ b/dumux/freeflow/compositional/localresidual.hh @@ -32,7 +32,7 @@ namespace Dumux { // forward declaration -template +template class FreeflowNCResidualImpl; /*! @@ -43,7 +43,7 @@ class FreeflowNCResidualImpl; * \note Not all specializations are currently implemented */ template -using FreeflowNCResidual = FreeflowNCResidualImpl::discMethod>; +using FreeflowNCResidual = FreeflowNCResidualImpl::DiscretizationMethod>; } diff --git a/dumux/freeflow/compositional/staggered/fluxvariables.hh b/dumux/freeflow/compositional/staggered/fluxvariables.hh index 82e7bb90be..b6c3db8f51 100644 --- a/dumux/freeflow/compositional/staggered/fluxvariables.hh +++ b/dumux/freeflow/compositional/staggered/fluxvariables.hh @@ -39,11 +39,11 @@ namespace Dumux { */ // forward declaration -template +template class FreeflowNCFluxVariablesImpl; template -class FreeflowNCFluxVariablesImpl +class FreeflowNCFluxVariablesImpl : public NavierStokesFluxVariables { using ParentType = NavierStokesFluxVariables; diff --git a/dumux/freeflow/compositional/staggered/localresidual.hh b/dumux/freeflow/compositional/staggered/localresidual.hh index 72422ed5ad..11036077c9 100644 --- a/dumux/freeflow/compositional/staggered/localresidual.hh +++ b/dumux/freeflow/compositional/staggered/localresidual.hh @@ -36,11 +36,11 @@ namespace Dumux { */ // forward declaration -template +template class FreeflowNCResidualImpl; template -class FreeflowNCResidualImpl +class FreeflowNCResidualImpl : public NavierStokesResidual { using ParentType = NavierStokesResidual; -- GitLab From 4c9ecc17e992565a39627e041a102c3689c59bed Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Sun, 3 Oct 2021 13:51:04 +0200 Subject: [PATCH 14/26] [disc][freeflow][navierstokes] Use discretization tag instead of enum as template argument. --- dumux/freeflow/navierstokes/fluxvariables.hh | 4 ++-- dumux/freeflow/navierstokes/localresidual.hh | 4 ++-- dumux/freeflow/navierstokes/problem.hh | 22 +++++++++---------- .../scalarfluxvariablescachefiller.hh | 6 ++--- .../navierstokes/staggered/fluxvariables.hh | 4 ++-- .../navierstokes/staggered/localresidual.hh | 4 ++-- dumux/freeflow/navierstokes/velocityoutput.hh | 2 +- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/dumux/freeflow/navierstokes/fluxvariables.hh b/dumux/freeflow/navierstokes/fluxvariables.hh index 326854f29c..b301780db5 100644 --- a/dumux/freeflow/navierstokes/fluxvariables.hh +++ b/dumux/freeflow/navierstokes/fluxvariables.hh @@ -31,7 +31,7 @@ namespace Dumux { // forward declaration -template +template class NavierStokesFluxVariablesImpl; /*! @@ -42,7 +42,7 @@ class NavierStokesFluxVariablesImpl; * \note Not all specializations are currently implemented */ template -using NavierStokesFluxVariables = NavierStokesFluxVariablesImpl::discMethod>; +using NavierStokesFluxVariables = NavierStokesFluxVariablesImpl::DiscretizationMethod>; } // end namespace diff --git a/dumux/freeflow/navierstokes/localresidual.hh b/dumux/freeflow/navierstokes/localresidual.hh index f8305acca1..21941a319d 100644 --- a/dumux/freeflow/navierstokes/localresidual.hh +++ b/dumux/freeflow/navierstokes/localresidual.hh @@ -31,7 +31,7 @@ namespace Dumux { // forward declaration -template +template class NavierStokesResidualImpl; /*! @@ -42,7 +42,7 @@ class NavierStokesResidualImpl; * \note Not all specializations are currently implemented */ template -using NavierStokesResidual = NavierStokesResidualImpl::discMethod>; +using NavierStokesResidual = NavierStokesResidualImpl::DiscretizationMethod>; } // end namespace Dumux diff --git a/dumux/freeflow/navierstokes/problem.hh b/dumux/freeflow/navierstokes/problem.hh index d6832349bd..533c8e53e6 100644 --- a/dumux/freeflow/navierstokes/problem.hh +++ b/dumux/freeflow/navierstokes/problem.hh @@ -35,12 +35,11 @@ namespace Dumux { //! The implementation is specialized for the different discretizations -template -struct NavierStokesParentProblemImpl; +template struct NavierStokesParentProblemImpl; // compatibility with old-style Navier-Stokes models template -struct NavierStokesParentProblemImpl +struct NavierStokesParentProblemImpl { using type = StaggeredFVProblem; }; @@ -48,14 +47,14 @@ struct NavierStokesParentProblemImpl //! The actual NavierStokesParentProblem template using NavierStokesParentProblem = typename NavierStokesParentProblemImpl< - TypeTag, GetPropType::discMethod + TypeTag, typename GetPropType::DiscretizationMethod >::type; -template +template class NavierStokesProblemImpl; template -class NavierStokesProblemImpl +class NavierStokesProblemImpl : public FVProblem { using ParentType = FVProblem; @@ -537,7 +536,7 @@ private: }; template -class NavierStokesProblemImpl +class NavierStokesProblemImpl : public FVProblem { using ParentType = FVProblem; @@ -663,7 +662,6 @@ private: std::shared_ptr couplingManager_; }; - /*! * \ingroup NavierStokesModel * \brief Navier-Stokes problem base class. @@ -672,7 +670,7 @@ private: * Includes a specialized method used only by the staggered grid discretization. */ template -class NavierStokesProblemImpl +class NavierStokesProblemImpl : public NavierStokesParentProblem { using ParentType = NavierStokesParentProblem; @@ -757,7 +755,7 @@ public: //! Applys the initial face solution (velocities on the faces). Specialization for staggered grid discretization. template - typename std::enable_if::type + typename std::enable_if::type applyInitialFaceSolution(SolutionVector& sol, const SubControlVolumeFace& scvf, const PrimaryVariables& initSol) const @@ -789,7 +787,7 @@ public: //! Convenience function for staggered grid implementation. template - typename std::enable_if::type + typename std::enable_if::type pseudo3DWallFriction(const SubControlVolumeFace& scvf, const ElementVolumeVariables& elemVolVars, const ElementFaceVariables& elemFaceVars, @@ -903,7 +901,7 @@ private: */ template using NavierStokesProblem = NavierStokesProblemImpl< - TypeTag, GetPropType::discMethod + TypeTag, typename GetPropType::DiscretizationMethod >; } // end namespace Dumux diff --git a/dumux/freeflow/navierstokes/scalarfluxvariablescachefiller.hh b/dumux/freeflow/navierstokes/scalarfluxvariablescachefiller.hh index d764a3d139..8689633c59 100644 --- a/dumux/freeflow/navierstokes/scalarfluxvariablescachefiller.hh +++ b/dumux/freeflow/navierstokes/scalarfluxvariablescachefiller.hh @@ -35,7 +35,7 @@ namespace Dumux { // forward declaration -template +template class FreeFlowScalarFluxVariablesCacheFillerImplementation; /*! @@ -45,11 +45,11 @@ class FreeFlowScalarFluxVariablesCacheFillerImplementation; * Helps filling the flux variables cache depending several policies */ template -using FreeFlowScalarFluxVariablesCacheFiller = FreeFlowScalarFluxVariablesCacheFillerImplementation::GridGeometry::discMethod>; +using FreeFlowScalarFluxVariablesCacheFiller = FreeFlowScalarFluxVariablesCacheFillerImplementation::GridGeometry::DiscretizationMethod>; //! Specialization of the flux variables cache filler for the cell centered tpfa method template -class FreeFlowScalarFluxVariablesCacheFillerImplementation +class FreeFlowScalarFluxVariablesCacheFillerImplementation { using GridGeometry = typename ProblemTraits::GridGeometry; using GridView = typename GridGeometry::GridView; diff --git a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh index 6e042670a3..ee37bcae1e 100644 --- a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh +++ b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh @@ -49,11 +49,11 @@ namespace Dumux { */ // forward declaration -template +template class NavierStokesFluxVariablesImpl; template -class NavierStokesFluxVariablesImpl +class NavierStokesFluxVariablesImpl : public FluxVariablesBase, typename GetPropType::LocalView, typename GetPropType::LocalView, diff --git a/dumux/freeflow/navierstokes/staggered/localresidual.hh b/dumux/freeflow/navierstokes/staggered/localresidual.hh index 2e68a79bf5..f76c8072d3 100644 --- a/dumux/freeflow/navierstokes/staggered/localresidual.hh +++ b/dumux/freeflow/navierstokes/staggered/localresidual.hh @@ -48,11 +48,11 @@ static constexpr bool isRotationalExtrusion> = t */ // forward declaration -template +template class NavierStokesResidualImpl; template -class NavierStokesResidualImpl +class NavierStokesResidualImpl : public StaggeredLocalResidual { using ParentType = StaggeredLocalResidual; diff --git a/dumux/freeflow/navierstokes/velocityoutput.hh b/dumux/freeflow/navierstokes/velocityoutput.hh index dfeb06e8ce..9d4e7aba05 100644 --- a/dumux/freeflow/navierstokes/velocityoutput.hh +++ b/dumux/freeflow/navierstokes/velocityoutput.hh @@ -77,7 +77,7 @@ public: { using CouplingManager = std::decay_t; using MomGG = std::decay_t().problem(CouplingManager::freeFlowMomentumIndex).gridGeometry())>; - if constexpr (MomGG::discMethod == DiscretizationMethod::fcstaggered) + if constexpr (MomGG::discMethod == DiscretizationMethods::fcstaggered) calculateVelocityForStaggeredGrid_(velocity, element, fvGeometry, elemVolVars); } -- GitLab From b4fd449e0a93be0c6fcae27b8446c252bfabb4aa Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 14:55:57 +0200 Subject: [PATCH 15/26] [disc][freeflow][nonisothermal] Use discretization tag instead of enum as template argument. --- dumux/freeflow/nonisothermal/localresidual.hh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dumux/freeflow/nonisothermal/localresidual.hh b/dumux/freeflow/nonisothermal/localresidual.hh index 1a681c5ddd..2a5bc519a9 100644 --- a/dumux/freeflow/nonisothermal/localresidual.hh +++ b/dumux/freeflow/nonisothermal/localresidual.hh @@ -30,7 +30,7 @@ namespace Dumux { // forward declaration -template +template class FreeFlowEnergyLocalResidualImplementation; /*! @@ -42,15 +42,15 @@ template; /*! * \ingroup FreeflowNIModel * \brief Specialization for isothermal models, does nothing */ -template -class FreeFlowEnergyLocalResidualImplementation +template +class FreeFlowEnergyLocalResidualImplementation { public: @@ -72,7 +72,7 @@ public: template class FreeFlowEnergyLocalResidualImplementation { using Element = typename GridGeometry::GridView::template Codim<0>::Entity; @@ -124,16 +124,16 @@ public: template class FreeFlowEnergyLocalResidualImplementation : public FreeFlowEnergyLocalResidualImplementation { using ParentType = FreeFlowEnergyLocalResidualImplementation; using Element = typename GridGeometry::GridView::template Codim<0>::Entity; using FVElementGeometry = typename GridGeometry::LocalView; -- GitLab From d433528110864fe39485496a69ccf3dfb50d04ca Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 14:58:10 +0200 Subject: [PATCH 16/26] [disc][freeflow][rans] Use discretization tag instead of enum as template argument. --- dumux/freeflow/rans/oneeq/fluxvariables.hh | 4 ++-- dumux/freeflow/rans/oneeq/localresidual.hh | 4 ++-- dumux/freeflow/rans/oneeq/staggered/fluxvariables.hh | 4 ++-- dumux/freeflow/rans/oneeq/staggered/localresidual.hh | 4 ++-- dumux/freeflow/rans/twoeq/kepsilon/fluxvariables.hh | 4 ++-- dumux/freeflow/rans/twoeq/kepsilon/localresidual.hh | 4 ++-- dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh | 4 ++-- dumux/freeflow/rans/twoeq/kepsilon/staggered/localresidual.hh | 4 ++-- dumux/freeflow/rans/twoeq/komega/fluxvariables.hh | 4 ++-- dumux/freeflow/rans/twoeq/komega/localresidual.hh | 4 ++-- dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh | 4 ++-- dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh | 4 ++-- dumux/freeflow/rans/twoeq/lowrekepsilon/fluxvariables.hh | 4 ++-- dumux/freeflow/rans/twoeq/lowrekepsilon/localresidual.hh | 4 ++-- .../rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh | 4 ++-- .../rans/twoeq/lowrekepsilon/staggered/localresidual.hh | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/dumux/freeflow/rans/oneeq/fluxvariables.hh b/dumux/freeflow/rans/oneeq/fluxvariables.hh index feefc3478c..991aaca7be 100644 --- a/dumux/freeflow/rans/oneeq/fluxvariables.hh +++ b/dumux/freeflow/rans/oneeq/fluxvariables.hh @@ -31,7 +31,7 @@ namespace Dumux { // forward declaration -template +template class OneEqFluxVariablesImpl; /*! @@ -42,7 +42,7 @@ class OneEqFluxVariablesImpl; * \note Not all specializations are currently implemented */ template -using OneEqFluxVariables = OneEqFluxVariablesImpl::discMethod>; +using OneEqFluxVariables = OneEqFluxVariablesImpl::DiscretizationMethod>; } // end namespace diff --git a/dumux/freeflow/rans/oneeq/localresidual.hh b/dumux/freeflow/rans/oneeq/localresidual.hh index 322ed7af8b..7acf702f3f 100644 --- a/dumux/freeflow/rans/oneeq/localresidual.hh +++ b/dumux/freeflow/rans/oneeq/localresidual.hh @@ -32,7 +32,7 @@ namespace Dumux { // forward declaration -template +template class OneEqResidualImpl; /*! @@ -43,7 +43,7 @@ class OneEqResidualImpl; * \note Not all specializations are currently implemented */ template -using OneEqResidual = OneEqResidualImpl::discMethod>; +using OneEqResidual = OneEqResidualImpl::DiscretizationMethod>; } // end namespace Dumux diff --git a/dumux/freeflow/rans/oneeq/staggered/fluxvariables.hh b/dumux/freeflow/rans/oneeq/staggered/fluxvariables.hh index 5e52fa700b..8b18e0d18a 100644 --- a/dumux/freeflow/rans/oneeq/staggered/fluxvariables.hh +++ b/dumux/freeflow/rans/oneeq/staggered/fluxvariables.hh @@ -41,11 +41,11 @@ namespace Dumux { */ // forward declaration -template +template class OneEqFluxVariablesImpl; template -class OneEqFluxVariablesImpl +class OneEqFluxVariablesImpl : public BaseFluxVariables { using ParentType = BaseFluxVariables; diff --git a/dumux/freeflow/rans/oneeq/staggered/localresidual.hh b/dumux/freeflow/rans/oneeq/staggered/localresidual.hh index 4ab2930b26..38b5305ae7 100644 --- a/dumux/freeflow/rans/oneeq/staggered/localresidual.hh +++ b/dumux/freeflow/rans/oneeq/staggered/localresidual.hh @@ -38,11 +38,11 @@ namespace Dumux { */ // forward declaration -template +template class OneEqResidualImpl; template -class OneEqResidualImpl +class OneEqResidualImpl : public BaseLocalResidual { using ParentType = BaseLocalResidual; diff --git a/dumux/freeflow/rans/twoeq/kepsilon/fluxvariables.hh b/dumux/freeflow/rans/twoeq/kepsilon/fluxvariables.hh index b85b74364c..7e6df30f11 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/fluxvariables.hh @@ -30,7 +30,7 @@ namespace Dumux { // forward declaration -template +template class KEpsilonFluxVariablesImpl; /*! @@ -41,7 +41,7 @@ class KEpsilonFluxVariablesImpl; * \note Not all specializations are currently implemented */ template -using KEpsilonFluxVariables = KEpsilonFluxVariablesImpl::discMethod>; +using KEpsilonFluxVariables = KEpsilonFluxVariablesImpl::DiscretizationMethod>; } // end namespace diff --git a/dumux/freeflow/rans/twoeq/kepsilon/localresidual.hh b/dumux/freeflow/rans/twoeq/kepsilon/localresidual.hh index 0983a47e84..841bdb5f72 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/localresidual.hh @@ -32,7 +32,7 @@ namespace Dumux { // forward declaration -template +template class KEpsilonResidualImpl; /*! @@ -43,7 +43,7 @@ class KEpsilonResidualImpl; * \note Not all specializations are currently implemented */ template -using KEpsilonResidual = KEpsilonResidualImpl::discMethod>; +using KEpsilonResidual = KEpsilonResidualImpl::DiscretizationMethod>; } diff --git a/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh b/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh index 85fc3c9269..1598488733 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh @@ -41,11 +41,11 @@ namespace Dumux { */ // forward declaration -template +template class KEpsilonFluxVariablesImpl; template -class KEpsilonFluxVariablesImpl +class KEpsilonFluxVariablesImpl : public BaseFluxVariables { using ParentType = BaseFluxVariables; diff --git a/dumux/freeflow/rans/twoeq/kepsilon/staggered/localresidual.hh b/dumux/freeflow/rans/twoeq/kepsilon/staggered/localresidual.hh index df600f9226..6634756ec2 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/staggered/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/staggered/localresidual.hh @@ -37,11 +37,11 @@ namespace Dumux { */ // forward declaration -template +template class KEpsilonResidualImpl; template -class KEpsilonResidualImpl +class KEpsilonResidualImpl : public BaseLocalResidual { using ParentType = BaseLocalResidual; diff --git a/dumux/freeflow/rans/twoeq/komega/fluxvariables.hh b/dumux/freeflow/rans/twoeq/komega/fluxvariables.hh index daf9175c6f..7804c0f1e8 100644 --- a/dumux/freeflow/rans/twoeq/komega/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/komega/fluxvariables.hh @@ -30,7 +30,7 @@ namespace Dumux { // forward declaration -template +template class KOmegaFluxVariablesImpl; /*! @@ -41,7 +41,7 @@ class KOmegaFluxVariablesImpl; * \note Not all specializations are currently implemented */ template -using KOmegaFluxVariables = KOmegaFluxVariablesImpl::discMethod>; +using KOmegaFluxVariables = KOmegaFluxVariablesImpl::DiscretizationMethod>; } // end namespace diff --git a/dumux/freeflow/rans/twoeq/komega/localresidual.hh b/dumux/freeflow/rans/twoeq/komega/localresidual.hh index 04809447a2..41b199be9e 100644 --- a/dumux/freeflow/rans/twoeq/komega/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/komega/localresidual.hh @@ -32,7 +32,7 @@ namespace Dumux { // forward declaration -template +template class KOmegaResidualImpl; /*! @@ -43,7 +43,7 @@ class KOmegaResidualImpl; * \note Not all specializations are currently implemented */ template -using KOmegaResidual = KOmegaResidualImpl::discMethod>; +using KOmegaResidual = KOmegaResidualImpl::DiscretizationMethod>; } diff --git a/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh b/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh index ea1b0c6b87..e8b86e24b2 100644 --- a/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh @@ -40,11 +40,11 @@ namespace Dumux { */ // forward declaration -template +template class KOmegaFluxVariablesImpl; template -class KOmegaFluxVariablesImpl +class KOmegaFluxVariablesImpl : public BaseFluxVariables { using ParentType = BaseFluxVariables; diff --git a/dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh b/dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh index 4fc020e1bc..e950228f8a 100644 --- a/dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh @@ -37,11 +37,11 @@ namespace Dumux { */ // forward declaration -template +template class KOmegaResidualImpl; template -class KOmegaResidualImpl +class KOmegaResidualImpl : public BaseLocalResidual { using ParentType = BaseLocalResidual; diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/fluxvariables.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/fluxvariables.hh index d7a7a63a3b..7505f51bd1 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/fluxvariables.hh @@ -30,7 +30,7 @@ namespace Dumux { // forward declaration -template +template class LowReKEpsilonFluxVariablesImpl; /*! @@ -41,7 +41,7 @@ class LowReKEpsilonFluxVariablesImpl; * \note Not all specializations are currently implemented */ template -using LowReKEpsilonFluxVariables = LowReKEpsilonFluxVariablesImpl::discMethod>; +using LowReKEpsilonFluxVariables = LowReKEpsilonFluxVariablesImpl::DiscretizationMethod>; } // end namespace diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/localresidual.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/localresidual.hh index 1fcd19f5cf..94627f9f59 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/localresidual.hh @@ -32,7 +32,7 @@ namespace Dumux { // forward declaration -template +template class LowReKEpsilonResidualImpl; /*! @@ -43,7 +43,7 @@ class LowReKEpsilonResidualImpl; * \note Not all specializations are currently implemented */ template -using LowReKEpsilonResidual = LowReKEpsilonResidualImpl::discMethod>; +using LowReKEpsilonResidual = LowReKEpsilonResidualImpl::DiscretizationMethod>; } diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh index 4ce64ab70d..b6aa6f9086 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh @@ -40,11 +40,11 @@ namespace Dumux { */ // forward declaration -template +template class LowReKEpsilonFluxVariablesImpl; template -class LowReKEpsilonFluxVariablesImpl +class LowReKEpsilonFluxVariablesImpl : public BaseFluxVariables { using ParentType = BaseFluxVariables; diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/localresidual.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/localresidual.hh index 1c692aa425..6b46e33d86 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/localresidual.hh @@ -37,11 +37,11 @@ namespace Dumux { */ // forward declaration -template +template class LowReKEpsilonResidualImpl; template -class LowReKEpsilonResidualImpl +class LowReKEpsilonResidualImpl : public BaseLocalResidual { using ParentType = BaseLocalResidual; -- GitLab From 8da46c5f3b960111b705e3cb49ffe2ff523a4d79 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 15:00:29 +0200 Subject: [PATCH 17/26] [disc][geomechanics] Use discretization tag instead of enum as template argument. --- dumux/geomechanics/stressvariablescache.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dumux/geomechanics/stressvariablescache.hh b/dumux/geomechanics/stressvariablescache.hh index f32d48abe6..0ad92c6e01 100644 --- a/dumux/geomechanics/stressvariablescache.hh +++ b/dumux/geomechanics/stressvariablescache.hh @@ -37,18 +37,18 @@ namespace Dumux { * \brief The stress variables cache classes for models involving geomechanics. * Store data required for stress calculation. */ -template< class Scalar, class GridGeometry, DiscretizationMethod dm = GridGeometry::discMethod > +template< class Scalar, class GridGeometry, class DiscretizationMethod = typename GridGeometry::DiscretizationMethod > class StressVariablesCache; //! We only store discretization-related quantities for the box method. template< class Scalar, class GridGeometry > -class StressVariablesCache +class StressVariablesCache : public BoxFluxVariablesCache< Scalar, GridGeometry > {}; // specialization for the cell centered tpfa method template< class Scalar, class GridGeometry > -class StressVariablesCache +class StressVariablesCache : public FluxVariablesCaching::_EmptyCache { public: @@ -76,8 +76,8 @@ public: // specialization for the cell centered mpfa method template< class Scalar, class GridGeometry > -class StressVariablesCache -: public StressVariablesCache +class StressVariablesCache +: public StressVariablesCache {}; } // end namespace Dumux -- GitLab From 206047ad4e3621ff2700160d13632a484bc53b99 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 15:02:49 +0200 Subject: [PATCH 18/26] [disc][linear] Use discretization tag instead of enum as template argument. --- dumux/linear/linearsolvertraits.hh | 18 +++++++++--------- test/linear/test_linearsolver.cc | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dumux/linear/linearsolvertraits.hh b/dumux/linear/linearsolvertraits.hh index 99eca749c1..146e63b40c 100644 --- a/dumux/linear/linearsolvertraits.hh +++ b/dumux/linear/linearsolvertraits.hh @@ -37,12 +37,12 @@ namespace Dumux { //! The implementation is specialized for the different discretizations -template +template struct LinearSolverTraitsImpl; //! The type traits required for using the IstlFactoryBackend template -using LinearSolverTraits = LinearSolverTraitsImpl; +using LinearSolverTraits = LinearSolverTraitsImpl; //! sequential solver traits template @@ -109,7 +109,7 @@ struct LinearSolverTraitsBase //! Box: use overlapping or non-overlapping model depending on the grid template -struct LinearSolverTraitsImpl +struct LinearSolverTraitsImpl : public LinearSolverTraitsBase { using DofMapper = typename GridGeometry::VertexMapper; @@ -124,7 +124,7 @@ struct LinearSolverTraitsImpl //! Cell-centered tpfa: use overlapping model template -struct LinearSolverTraitsImpl +struct LinearSolverTraitsImpl : public LinearSolverTraitsBase { using DofMapper = typename GridGeometry::ElementMapper; @@ -139,7 +139,7 @@ struct LinearSolverTraitsImpl //! Face-centered staggered: use overlapping model template -struct LinearSolverTraitsImpl +struct LinearSolverTraitsImpl : public LinearSolverTraitsBase { class DofMapper @@ -180,13 +180,13 @@ struct LinearSolverTraitsImpl //! Cell-centered mpfa: use overlapping model template -struct LinearSolverTraitsImpl -: public LinearSolverTraitsImpl {}; +struct LinearSolverTraitsImpl +: public LinearSolverTraitsImpl {}; //! staggered: use overlapping model template -struct LinearSolverTraitsImpl -: public LinearSolverTraitsImpl {}; +struct LinearSolverTraitsImpl +: public LinearSolverTraitsImpl {}; } // end namespace Dumux diff --git a/test/linear/test_linearsolver.cc b/test/linear/test_linearsolver.cc index 0893455a19..67e51b9111 100644 --- a/test/linear/test_linearsolver.cc +++ b/test/linear/test_linearsolver.cc @@ -31,7 +31,8 @@ struct MockGridGeometry using GridView = Dune::YaspGrid<2>::LeafGridView; using DofMapper = Dune::MultipleCodimMultipleGeomTypeMapper; using VertexMapper = Dune::MultipleCodimMultipleGeomTypeMapper; - static constexpr auto discMethod = DiscretizationMethod::box; + using DiscretizationMethod = DiscretizationMethods::Box; + static constexpr DiscretizationMethod discMethod{}; }; template -- GitLab From e2bd2cd8a57ce7dcc166d9f0013a6e5e7e57dd15 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Wed, 20 Oct 2021 09:55:50 +0200 Subject: [PATCH 19/26] [disc][multidomain][facet] Use discretization tag instead of enum as template argument. --- dumux/multidomain/facet/box/couplingmanager.hh | 2 +- dumux/multidomain/facet/box/couplingmapper.hh | 6 +++--- .../facet/cellcentered/mpfa/couplingmanager.hh | 8 ++++---- .../multidomain/facet/cellcentered/mpfa/couplingmapper.hh | 6 +++--- .../facet/cellcentered/tpfa/couplingmanager.hh | 4 ++-- .../multidomain/facet/cellcentered/tpfa/couplingmapper.hh | 6 +++--- dumux/multidomain/facet/couplingmanager.hh | 4 ++-- dumux/multidomain/facet/couplingmapper.hh | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dumux/multidomain/facet/box/couplingmanager.hh b/dumux/multidomain/facet/box/couplingmanager.hh index 760f830bdd..58b8b15d54 100644 --- a/dumux/multidomain/facet/box/couplingmanager.hh +++ b/dumux/multidomain/facet/box/couplingmanager.hh @@ -48,7 +48,7 @@ namespace Dumux { * \tparam lowDimDomainId The domain id of the lower-dimensional problem */ template -class FacetCouplingManager +class FacetCouplingManager : public virtual CouplingManager< MDTraits > { using ParentType = CouplingManager< MDTraits >; diff --git a/dumux/multidomain/facet/box/couplingmapper.hh b/dumux/multidomain/facet/box/couplingmapper.hh index 2ea12b3a9b..a7d4ecb59e 100644 --- a/dumux/multidomain/facet/box/couplingmapper.hh +++ b/dumux/multidomain/facet/box/couplingmapper.hh @@ -44,7 +44,7 @@ namespace Dumux { * \tparam lowDimId The domain id of the lower-dimensional problem */ template -class FacetCouplingMapper +class FacetCouplingMapper : public virtual FacetCouplingMapperBase { using ParentType = FacetCouplingMapperBase; @@ -188,7 +188,7 @@ public: // add each dof in the low dim element to coupling stencil of the bulk element auto& bulkData = this->couplingMap_(bulkGridId, facetGridId)[bulkElemIdx]; - const auto lowDimElementDofs = LowDimFVG::discMethod == DiscretizationMethod::box + const auto lowDimElementDofs = LowDimFVG::discMethod == DiscretizationMethods::box ? this->extractNodalDofs_(lowDimElement, lowDimFvGridGeometry) : std::vector({lowDimElemIdx}); @@ -228,7 +228,7 @@ public: std::for_each(lowDimCouplingData.begin(), lowDimCouplingData.end(), makeStencilUnique); // bulk coupling stencil is only non-unique if box is used - if (LowDimFVG::discMethod == DiscretizationMethod::box) + if (LowDimFVG::discMethod == DiscretizationMethods::box) { auto& bulkCouplingData = this->couplingMap_(bulkGridId, facetGridId); std::for_each(bulkCouplingData.begin(), bulkCouplingData.end(), makeStencilUnique); diff --git a/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh b/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh index d0826800c2..55e420cb06 100644 --- a/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh +++ b/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh @@ -52,10 +52,10 @@ namespace Dumux { * \tparam lowDimDomainId The domain id of the lower-dimensional problem */ template -class FacetCouplingManager -: public FacetCouplingManager +class FacetCouplingManager +: public FacetCouplingManager { - using ParentType = FacetCouplingManager; + using ParentType = FacetCouplingManager; // domain id instances using BulkIdType = typename MDTraits::template SubDomain::Index; @@ -89,7 +89,7 @@ class FacetCouplingManager(); static constexpr auto lowDimGridId = CouplingMapper::template gridId(); - static constexpr bool lowDimUsesBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool lowDimUsesBox = GridGeometry::discMethod == DiscretizationMethods::box; public: diff --git a/dumux/multidomain/facet/cellcentered/mpfa/couplingmapper.hh b/dumux/multidomain/facet/cellcentered/mpfa/couplingmapper.hh index 3ce2b844b1..d1b14615f2 100644 --- a/dumux/multidomain/facet/cellcentered/mpfa/couplingmapper.hh +++ b/dumux/multidomain/facet/cellcentered/mpfa/couplingmapper.hh @@ -46,7 +46,7 @@ namespace Dumux { * \tparam lowDimId The index of the facet grid within the hierarchy of grids */ template -class FacetCouplingMapper +class FacetCouplingMapper : public virtual FacetCouplingMapperBase { using ParentType = FacetCouplingMapperBase; @@ -150,7 +150,7 @@ public: // add each dof in the low dim element to coupling stencil of the bulk element and vice versa auto& bulkData = this->couplingMap_(bulkGridId, facetGridId)[bulkElemIdx]; - const auto lowDimElementDofs = LowDimFVG::discMethod == DiscretizationMethod::box + const auto lowDimElementDofs = LowDimFVG::discMethod == DiscretizationMethods::box ? this->extractNodalDofs_(lowDimElement, lowDimFvGridGeometry) : std::vector( {lowDimElemIdx} ); @@ -161,7 +161,7 @@ public: // sort the scvfs according to the corners of the low dim element if box is used // that allows identifying which scvf flux enters which low dim scv later - if (LowDimFVG::discMethod == DiscretizationMethod::box) + if (LowDimFVG::discMethod == DiscretizationMethods::box) { const auto copy = embeddedScvfIndices; diff --git a/dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh b/dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh index b1962df82d..12ac45738a 100644 --- a/dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh +++ b/dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh @@ -49,7 +49,7 @@ namespace Dumux { * \tparam lowDimDomainId The domain id of the lower-dimensional problem */ template -class FacetCouplingManager +class FacetCouplingManager : public virtual CouplingManager< MDTraits > { using ParentType = CouplingManager< MDTraits >; @@ -98,7 +98,7 @@ class FacetCouplingManager(); static constexpr auto lowDimGridId = CouplingMapper::template gridId(); - static constexpr bool lowDimUsesBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool lowDimUsesBox = GridGeometry::discMethod == DiscretizationMethods::box; /*! * \brief The coupling context of the bulk domain. Contains all data of the lower- diff --git a/dumux/multidomain/facet/cellcentered/tpfa/couplingmapper.hh b/dumux/multidomain/facet/cellcentered/tpfa/couplingmapper.hh index 37bc2ec147..b9654486b9 100644 --- a/dumux/multidomain/facet/cellcentered/tpfa/couplingmapper.hh +++ b/dumux/multidomain/facet/cellcentered/tpfa/couplingmapper.hh @@ -45,7 +45,7 @@ namespace Dumux { * \tparam lowDimId The index of the facet grid within the hierarchy of grids */ template -class FacetCouplingMapper +class FacetCouplingMapper : public virtual FacetCouplingMapperBase { using ParentType = FacetCouplingMapperBase; @@ -128,7 +128,7 @@ public: // add each dof in the low dim element to coupling stencil of the bulk element auto& bulkData = this->couplingMap_(bulkGridId, facetGridId)[bulkElemIdx]; - const auto lowDimElementDofs = LowDimFVG::discMethod == DiscretizationMethod::box + const auto lowDimElementDofs = LowDimFVG::discMethod == DiscretizationMethods::box ? this->extractNodalDofs_(lowDimElement, lowDimFvGridGeometry) : std::vector( {lowDimElemIdx} ); @@ -154,7 +154,7 @@ public: ParentType::update_(bulkFvGridGeometry, lowDimFvGridGeometry, embeddings, addCouplingEntryPolicy); // coupling stencils might not be unique if box is used in lowdim domain - if (LowDimFVG::discMethod == DiscretizationMethod::box) + if (LowDimFVG::discMethod == DiscretizationMethods::box) { auto makeStencilUnique = [] (auto& data) { diff --git a/dumux/multidomain/facet/couplingmanager.hh b/dumux/multidomain/facet/couplingmanager.hh index 9f60d0a043..d173c9b5e7 100644 --- a/dumux/multidomain/facet/couplingmanager.hh +++ b/dumux/multidomain/facet/couplingmanager.hh @@ -91,7 +91,7 @@ template< class MDTraits, class CouplingMapper, std::size_t bulkDomainId = 0, std::size_t lowDimDomainId = 1, - DiscretizationMethod bulkDM = GetPropType::TypeTag, Properties::GridGeometry>::discMethod > + class DiscretizationMethod = typename GetPropType::TypeTag, Properties::GridGeometry>::DiscretizationMethod > class FacetCouplingManager; /*! @@ -148,7 +148,7 @@ class FacetCouplingThreeDomainManager // helper function to check if a domain uses mpfa template static constexpr bool usesMpfa(Dune::index_constant domainId) - { return GridGeometry::discMethod == DiscretizationMethod::ccmpfa; } + { return GridGeometry::discMethod == DiscretizationMethods::ccmpfa; } public: //! types used for coupling stencils diff --git a/dumux/multidomain/facet/couplingmapper.hh b/dumux/multidomain/facet/couplingmapper.hh index 844e8bccb3..c65fe498fb 100644 --- a/dumux/multidomain/facet/couplingmapper.hh +++ b/dumux/multidomain/facet/couplingmapper.hh @@ -48,7 +48,7 @@ template< class BulkFVG, class LowDimFVG, std::size_t bulkId = 0, std::size_t lowDimId = 1, - DiscretizationMethod bulkDM = BulkFVG::discMethod > + class DiscretizationMethod = typename BulkFVG::DiscretizationMethod > class FacetCouplingMapper; /*! -- GitLab From c6ceef74480cd79ee59c2d1bd6e06c24deea9f16 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 15:17:29 +0200 Subject: [PATCH 20/26] [disc][porousmediumflow] Use discretization tag instead of enum as template argument. --- dumux/flux/forchheimerslaw_fwd.hh | 2 +- dumux/porousmediumflow/fluxvariablescache.hh | 10 +++++----- dumux/porousmediumflow/fluxvariablescachefiller.hh | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dumux/flux/forchheimerslaw_fwd.hh b/dumux/flux/forchheimerslaw_fwd.hh index 9e45d2165e..7459908e0f 100644 --- a/dumux/flux/forchheimerslaw_fwd.hh +++ b/dumux/flux/forchheimerslaw_fwd.hh @@ -40,7 +40,7 @@ class ForchheimersLawImplementation static_assert( GetPropType::discMethod == DiscretizationMethods::cctpfa || GetPropType::discMethod == DiscretizationMethods::box, - "Forchheimer only implemented for cctpfa or box!") + "Forchheimer only implemented for cctpfa or box!" ); }; diff --git a/dumux/porousmediumflow/fluxvariablescache.hh b/dumux/porousmediumflow/fluxvariablescache.hh index 892d251b17..6a00418fc5 100644 --- a/dumux/porousmediumflow/fluxvariablescache.hh +++ b/dumux/porousmediumflow/fluxvariablescache.hh @@ -32,7 +32,7 @@ namespace Dumux { // forward declaration -template +template class PorousMediumFluxVariablesCacheImplementation; /////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -50,12 +50,12 @@ class PorousMediumFluxVariablesCacheImplementation; * cache class are provided for different combinations of processes. */ template -using PorousMediumFluxVariablesCache = PorousMediumFluxVariablesCacheImplementation::discMethod>; +using PorousMediumFluxVariablesCache = PorousMediumFluxVariablesCacheImplementation::DiscretizationMethod>; //! We only store discretization-related quantities for the box method. Thus, we need no //! physics-dependent specialization and simply inherit from the physics-independent implementation. template -class PorousMediumFluxVariablesCacheImplementation +class PorousMediumFluxVariablesCacheImplementation : public BoxFluxVariablesCache, GetPropType> { public: @@ -77,7 +77,7 @@ template class EnergyCacheChooser : public GetProp // specialization for the cell centered tpfa method template -class PorousMediumFluxVariablesCacheImplementation +class PorousMediumFluxVariablesCacheImplementation : public AdvectionCacheChooser::enableAdvection()> , public DiffusionCacheChooser::enableMolecularDiffusion()> , public EnergyCacheChooser::enableEnergyBalance()> @@ -90,7 +90,7 @@ public: //! Specialization of the flux variables cache for the cell centered finite volume mpfa scheme. //! Stores data which is commonly used by all the different types of processes. template -class PorousMediumFluxVariablesCacheImplementation +class PorousMediumFluxVariablesCacheImplementation : public AdvectionCacheChooser::enableAdvection()> , public DiffusionCacheChooser::enableMolecularDiffusion()> , public EnergyCacheChooser::enableEnergyBalance()> diff --git a/dumux/porousmediumflow/fluxvariablescachefiller.hh b/dumux/porousmediumflow/fluxvariablescachefiller.hh index c84a239b0c..16948db4d1 100644 --- a/dumux/porousmediumflow/fluxvariablescachefiller.hh +++ b/dumux/porousmediumflow/fluxvariablescachefiller.hh @@ -35,7 +35,7 @@ namespace Dumux { // forward declaration -template +template class PorousMediumFluxVariablesCacheFillerImplementation; /*! @@ -45,11 +45,11 @@ class PorousMediumFluxVariablesCacheFillerImplementation; * Helps filling the flux variables cache depending several policies */ template -using PorousMediumFluxVariablesCacheFiller = PorousMediumFluxVariablesCacheFillerImplementation::discMethod>; +using PorousMediumFluxVariablesCacheFiller = PorousMediumFluxVariablesCacheFillerImplementation::DiscretizationMethod>; //! Specialization of the flux variables cache filler for the cell centered tpfa method template -class PorousMediumFluxVariablesCacheFillerImplementation +class PorousMediumFluxVariablesCacheFillerImplementation { using ModelTraits = GetPropType; using Problem = GetPropType; @@ -188,7 +188,7 @@ private: //! Specialization of the flux variables cache filler for the cell centered mpfa method template -class PorousMediumFluxVariablesCacheFillerImplementation +class PorousMediumFluxVariablesCacheFillerImplementation { using ModelTraits = GetPropType; using Problem = GetPropType; -- GitLab From e4a65c5649641e5da31727436da28d0bd45b6c22 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Mon, 27 Sep 2021 11:06:20 +0200 Subject: [PATCH 21/26] [disc][dumux] Use discretization tag instead of enum for comparisons. --- dumux/adaptive/initializationindicator.hh | 2 +- dumux/assembly/fclocalassembler.hh | 6 +++--- dumux/assembly/fvlocalresidual.hh | 4 ++-- dumux/assembly/initialsolution.hh | 4 ++-- dumux/assembly/jacobianpattern.hh | 12 ++++++------ dumux/common/fvproblem.hh | 4 ++-- dumux/common/pointsource.hh | 2 +- dumux/discretization/box/elementsolution.hh | 4 ++-- .../discretization/box/scvftoscvboundarytypes.hh | 4 ++-- .../cellcentered/elementsolution.hh | 16 ++++++++-------- .../facecentered/staggered/elementsolution.hh | 6 +++--- .../discretization/staggered/elementsolution.hh | 2 +- .../freeflow/navierstokes/momentum/fluxhelper.hh | 4 ++-- .../navierstokes/momentum/localresidual.hh | 2 +- .../momentum/velocityreconstruction.hh | 2 +- dumux/freeflow/rans/problem.hh | 2 +- .../geomechanics/poroelastic/couplingmanager.hh | 6 +++--- dumux/io/loadsolution.hh | 8 ++++---- dumux/io/vtkoutputmodule.hh | 2 +- .../electrochemistry/electrochemistry.hh | 2 +- .../electrochemistry/electrochemistryni.hh | 2 +- .../boundary/darcydarcy/couplingmanager.hh | 2 +- .../boundary/darcydarcy/couplingmapper.hh | 2 +- .../ffmomentumpm/couplingmapper.hh | 4 ++-- .../boundary/stokesdarcy/couplingmapper.hh | 4 ++-- dumux/multidomain/couplingjacobianpattern.hh | 12 ++++++------ .../embedded/couplingmanager1d3d_average.hh | 2 +- .../embedded/couplingmanager1d3d_kernel.hh | 2 +- .../embedded/couplingmanager1d3d_projection.hh | 2 +- .../embedded/couplingmanager1d3d_surface.hh | 2 +- .../multidomain/embedded/couplingmanagerbase.hh | 4 ++-- .../embedded/extendedsourcestencil.hh | 2 +- .../embedded/integrationpointsource.hh | 2 +- dumux/multidomain/embedded/pointsourcedata.hh | 4 ++-- dumux/multidomain/facet/box/couplingmanager.hh | 2 +- dumux/multidomain/fvassembler.hh | 4 ++-- dumux/multidomain/staggeredcouplingmanager.hh | 4 ++-- dumux/nonlinear/newtonconvergencewriter.hh | 4 ++-- .../staggerednewtonconvergencewriter.hh | 2 +- .../1p/incompressiblelocalresidual.hh | 10 +++++----- .../porousmediumflow/2p/boxmaterialinterfaces.hh | 2 +- dumux/porousmediumflow/2p/griddatatransfer.hh | 2 +- .../2p/incompressiblelocalresidual.hh | 4 ++-- dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh | 2 +- .../compositional/primaryvariableswitch.hh | 10 +++++----- .../porousmediumflow/fluxvariablescachefiller.hh | 6 +++--- .../nonequilibrium/gridvariables.hh | 2 +- dumux/porousmediumflow/richards/localresidual.hh | 4 ++-- dumux/porousmediumflow/tracer/localresidual.hh | 6 +++--- dumux/porousmediumflow/velocity.hh | 4 ++-- dumux/porousmediumflow/velocityoutput.hh | 2 +- dumux/python/common/fvproblem.hh | 2 +- dumux/python/porousmediumflow/problem.hh | 2 +- test/multidomain/facet/1p_1p/analytical/main.cc | 8 ++++---- test/multidomain/facet/1p_1p/threedomain/main.cc | 4 ++-- test/multidomain/facet/1pnc_1pnc/main.cc | 2 +- .../facet/test_facetcouplingmapper.cc | 4 ++-- test/multidomain/facet/tracer_tracer/main.cc | 8 ++++---- .../facet/tracer_tracer/spatialparams_tracer.hh | 2 +- .../1p/convergence/discretesolution/main.cc | 2 +- test/porousmediumflow/1p/incompressible/main.cc | 6 +++--- test/porousmediumflow/1p/network1d3d/problem.hh | 2 +- test/porousmediumflow/1p/nonisothermal/main.cc | 2 +- .../1pnc/1p2c/isothermal/problem.hh | 2 +- .../1pncmin/nonisothermal/problem.hh | 2 +- test/porousmediumflow/2p/adaptive/problem.hh | 2 +- .../2p/incompressible/spatialparams.hh | 2 +- .../2p2c/chemicalnonequilibrium/problem.hh | 2 +- test/porousmediumflow/2pnc/fuelcell/problem.hh | 2 +- .../2pncmin/isothermal/problem.hh | 2 +- .../2pncmin/nonisothermal/problem.hh | 2 +- test/porousmediumflow/co2/problem.hh | 2 +- .../mpnc/2p2ccomparison/problem.hh | 2 +- 73 files changed, 137 insertions(+), 137 deletions(-) diff --git a/dumux/adaptive/initializationindicator.hh b/dumux/adaptive/initializationindicator.hh index 20b90ab003..555edde9b5 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 c9d7dc1f81..c58f85ba12 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/fvlocalresidual.hh b/dumux/assembly/fvlocalresidual.hh index 471ab2ed97..41a7c5f479 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 dc8bf7ebf3..4054253e0c 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 2dd733cef3..e28de66b28 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/common/fvproblem.hh b/dumux/common/fvproblem.hh index b81375dca7..7f53a85ae0 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 3eda1766f3..eaf3b3f6bd 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/discretization/box/elementsolution.hh b/dumux/discretization/box/elementsolution.hh index caf00f7fd8..c11c145582 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/scvftoscvboundarytypes.hh b/dumux/discretization/box/scvftoscvboundarytypes.hh index 12ec51306d..d4b540a9fb 100644 --- a/dumux/discretization/box/scvftoscvboundarytypes.hh +++ b/dumux/discretization/box/scvftoscvboundarytypes.hh @@ -44,7 +44,7 @@ public: void computeBoundaryTypes(const Problem& problem) { // only do something for box - if (discMethod == DiscretizationMethod::box) + if (discMethod == 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 (discMethod == DiscretizationMethods::box) return scvBoundaryTypes[scv.dofIndex()]; else DUNE_THROW(Dune::InvalidStateException, "Only use this for the box discretization!"); diff --git a/dumux/discretization/cellcentered/elementsolution.hh b/dumux/discretization/cellcentered/elementsolution.hh index 5aabd0934e..c8b23c16c7 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/facecentered/staggered/elementsolution.hh b/dumux/discretization/facecentered/staggered/elementsolution.hh index 535e632f43..05936fee71 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/staggered/elementsolution.hh b/dumux/discretization/staggered/elementsolution.hh index ebb23bf2a6..330745749d 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/freeflow/navierstokes/momentum/fluxhelper.hh b/dumux/freeflow/navierstokes/momentum/fluxhelper.hh index 85b2277220..0382053f9f 100644 --- a/dumux/freeflow/navierstokes/momentum/fluxhelper.hh +++ b/dumux/freeflow/navierstokes/momentum/fluxhelper.hh @@ -62,7 +62,7 @@ struct NavierStokesMomentumBoundaryFluxHelper const bool zeroNormalVelocityGradient = true) { // TODO density upwinding? - static_assert(FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::fcstaggered); + static_assert(FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::fcstaggered); using NumEqVector = typename Problem::Traits::NumEqVector; constexpr std::size_t dim = static_cast(FVElementGeometry::GridGeometry::GridView::dimension); static_assert( @@ -213,7 +213,7 @@ struct NavierStokesMomentumBoundaryFluxHelper const ElementFluxVariablesCache& elemFluxVarsCache, const TangentialVelocityGradient& tangentialVelocityGradient = TangentialVelocityGradient(0.0)) { - static_assert(FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::fcstaggered); + static_assert(FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::fcstaggered); using NumEqVector = typename Problem::Traits::NumEqVector; constexpr std::size_t dim = static_cast(FVElementGeometry::GridGeometry::GridView::dimension); static_assert( diff --git a/dumux/freeflow/navierstokes/momentum/localresidual.hh b/dumux/freeflow/navierstokes/momentum/localresidual.hh index 5db4a54c62..6b50f1c3b5 100644 --- a/dumux/freeflow/navierstokes/momentum/localresidual.hh +++ b/dumux/freeflow/navierstokes/momentum/localresidual.hh @@ -211,7 +211,7 @@ public: const ElementFluxVariablesCache& elemFluxVarsCache, const SubControlVolumeFace& scvf) const { - static_assert(FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::fcstaggered); // TODO overload this method for different discretizations + static_assert(FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::fcstaggered); // TODO overload this method for different discretizations static_assert( std::decay_t "The grid types of the two sub-problems have to be equal!"); //! this coupling manager is for cc - box only - static_assert(GridGeometry::discMethod == DiscretizationMethod::box, + static_assert(GridGeometry::discMethod == DiscretizationMethods::box, "Poro-mechanical problem must be discretized with the box scheme for this coupling manager!"); - static_assert(GridGeometry::discMethod == DiscretizationMethod::cctpfa || - GridGeometry::discMethod == DiscretizationMethod::ccmpfa, + static_assert(GridGeometry::discMethod == DiscretizationMethods::cctpfa || + GridGeometry::discMethod == DiscretizationMethods::ccmpfa, "Porous medium flow problem must be discretized with a cell-centered scheme for this coupling manager!"); //! this does not work for enabled grid volume variables caching (update of local view in context has no effect) diff --git a/dumux/io/loadsolution.hh b/dumux/io/loadsolution.hh index cdf9ad60c7..0a022cdc3b 100644 --- a/dumux/io/loadsolution.hh +++ b/dumux/io/loadsolution.hh @@ -151,7 +151,7 @@ auto loadSolutionFromVtkFile(SolutionVector& sol, } } // for staggered face data (which is written out as VTK point data) we just read in the vector - else if (dataType == VTKReader::DataType::pointData && GridGeometry::discMethod == DiscretizationMethod::staggered) + else if (dataType == VTKReader::DataType::pointData && GridGeometry::discMethod == DiscretizationMethods::staggered) { if (sol.size() != vec.size()) DUNE_THROW(Dune::InvalidStateException, "Solution size (" << sol.size() << ") does not match input size (" << vec.size() << ")!"); @@ -333,19 +333,19 @@ void loadSolution(SolutionVector& sol, const GridGeometry& gridGeometry) { const auto extension = fileName.substr(fileName.find_last_of(".") + 1); - auto dataType = GridGeometry::discMethod == DiscretizationMethod::box ? + auto dataType = GridGeometry::discMethod == DiscretizationMethods::box ? VTKReader::DataType::pointData : VTKReader::DataType::cellData; if (extension == "vtu" || extension == "vtp") { - if (GridGeometry::discMethod == DiscretizationMethod::staggered && extension == "vtp") + if (GridGeometry::discMethod == DiscretizationMethods::staggered && extension == "vtp") dataType = VTKReader::DataType::pointData; loadSolutionFromVtkFile(sol, fileName, targetPvNameFunc, gridGeometry, dataType); } else if (extension == "pvtu" || extension == "pvtp") { - if (GridGeometry::discMethod == DiscretizationMethod::staggered) + if (GridGeometry::discMethod == DiscretizationMethods::staggered) DUNE_THROW(Dune::NotImplemented, "reading staggered solution from a parallel vtk file"); loadSolutionFromVtkFile(sol, fileName, targetPvNameFunc, gridGeometry, dataType); diff --git a/dumux/io/vtkoutputmodule.hh b/dumux/io/vtkoutputmodule.hh index 30600dc5a2..21fda6a349 100644 --- a/dumux/io/vtkoutputmodule.hh +++ b/dumux/io/vtkoutputmodule.hh @@ -321,7 +321,7 @@ class VtkOutputModule : public VtkOutputModuleBase::Entity; using VolVarsVector = Dune::FieldVector; - static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; static constexpr int dofCodim = isBox ? dim : 0; struct VolVarScalarDataInfo { std::function get; std::string name; Dumux::Vtk::Precision precision_; }; diff --git a/dumux/material/chemistry/electrochemistry/electrochemistry.hh b/dumux/material/chemistry/electrochemistry/electrochemistry.hh index 9fe071ef33..f2ef6d149a 100644 --- a/dumux/material/chemistry/electrochemistry/electrochemistry.hh +++ b/dumux/material/chemistry/electrochemistry/electrochemistry.hh @@ -75,7 +75,7 @@ class ElectroChemistry }; using GridView = typename GridGeometry::GridView; - static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; using GlobalPosition = typename Dune::FieldVector; public: diff --git a/dumux/material/chemistry/electrochemistry/electrochemistryni.hh b/dumux/material/chemistry/electrochemistry/electrochemistryni.hh index d4d31de82e..507f6532bb 100644 --- a/dumux/material/chemistry/electrochemistry/electrochemistryni.hh +++ b/dumux/material/chemistry/electrochemistry/electrochemistryni.hh @@ -51,7 +51,7 @@ class ElectroChemistryNI : public ElectroChemistry; using CellVector = typename Dune::FieldVector; diff --git a/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh b/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh index 6f9cf6d820..56b18bc5ac 100644 --- a/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh +++ b/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh @@ -74,7 +74,7 @@ class DarcyDarcyBoundaryCouplingManager template static constexpr bool isCCTpfa() - { return GridGeometry::discMethod == DiscretizationMethod::cctpfa; } + { return GridGeometry::discMethod == DiscretizationMethods::cctpfa; } using CouplingStencil = std::vector; public: diff --git a/dumux/multidomain/boundary/darcydarcy/couplingmapper.hh b/dumux/multidomain/boundary/darcydarcy/couplingmapper.hh index 527ffd0d32..cbaf16b480 100644 --- a/dumux/multidomain/boundary/darcydarcy/couplingmapper.hh +++ b/dumux/multidomain/boundary/darcydarcy/couplingmapper.hh @@ -60,7 +60,7 @@ class DarcyDarcyBoundaryCouplingMapper template static constexpr bool isCCTpfa() - { return GridGeometry::discMethod == DiscretizationMethod::cctpfa; } + { return GridGeometry::discMethod == DiscretizationMethods::cctpfa; } struct ScvfInfo { diff --git a/dumux/multidomain/boundary/freeflowporousmedium/ffmomentumpm/couplingmapper.hh b/dumux/multidomain/boundary/freeflowporousmedium/ffmomentumpm/couplingmapper.hh index 59f15ea138..8a5643e919 100644 --- a/dumux/multidomain/boundary/freeflowporousmedium/ffmomentumpm/couplingmapper.hh +++ b/dumux/multidomain/boundary/freeflowporousmedium/ffmomentumpm/couplingmapper.hh @@ -61,11 +61,11 @@ class FreeFlowMomentumPorousMediumCouplingMapper template static constexpr bool isFcStaggered() - { return GridGeometry::discMethod == DiscretizationMethod::fcstaggered; } + { return GridGeometry::discMethod == DiscretizationMethods::fcstaggered; } template static constexpr bool isCCTpfa() - { return GridGeometry::discMethod == DiscretizationMethod::cctpfa; } + { return GridGeometry::discMethod == DiscretizationMethods::cctpfa; } struct ScvfInfoPM { diff --git a/dumux/multidomain/boundary/stokesdarcy/couplingmapper.hh b/dumux/multidomain/boundary/stokesdarcy/couplingmapper.hh index 680e1bba6f..1d38fbbdf8 100644 --- a/dumux/multidomain/boundary/stokesdarcy/couplingmapper.hh +++ b/dumux/multidomain/boundary/stokesdarcy/couplingmapper.hh @@ -62,10 +62,10 @@ public: const auto& stokesFvGridGeometry = couplingManager.problem(CouplingManager::stokesIdx).gridGeometry(); const auto& darcyFvGridGeometry = couplingManager.problem(CouplingManager::darcyIdx).gridGeometry(); - static_assert(std::decay_t::discMethod == DiscretizationMethod::staggered, + static_assert(std::decay_t::discMethod == DiscretizationMethods::staggered, "The free flow domain must use the staggered discretization"); - static_assert(std::decay_t::discMethod == DiscretizationMethod::cctpfa, + static_assert(std::decay_t::discMethod == DiscretizationMethods::cctpfa, "The Darcy domain must use the CCTpfa discretization"); isCoupledDarcyScvf_.resize(darcyFvGridGeometry.numScvf(), false); diff --git a/dumux/multidomain/couplingjacobianpattern.hh b/dumux/multidomain/couplingjacobianpattern.hh index 51d6291255..ce4e654f4a 100644 --- a/dumux/multidomain/couplingjacobianpattern.hh +++ b/dumux/multidomain/couplingjacobianpattern.hh @@ -37,8 +37,8 @@ namespace Dumux { * for cell-centered schemes */ template = 0> + typename std::enable_if_t<( (GridGeometryI::discMethod == DiscretizationMethods::cctpfa) + || (GridGeometryI::discMethod == DiscretizationMethods::ccmpfa) ), int> = 0> Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager, Dune::index_constant domainI, const GridGeometryI& gridGeometryI, @@ -75,7 +75,7 @@ Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingM * for the box scheme */ template = 0> + typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethods::box), int> = 0> Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager, Dune::index_constant domainI, const GridGeometryI& gridGeometryI, @@ -116,7 +116,7 @@ Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingM * for the staggered scheme (degrees of freedom on cell centers) */ template = 0> Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager, Dune::index_constant domainI, @@ -142,7 +142,7 @@ Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingM * for the staggered scheme (degrees of freedom on faces) */ template = 0> Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager, Dune::index_constant domainI, @@ -175,7 +175,7 @@ Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingM * for the staggered scheme (degrees of freedom on cell centers) */ template = 0> + typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethods::fcstaggered), int> = 0> Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager, Dune::index_constant domainI, const GridGeometryI& gridGeometryI, diff --git a/dumux/multidomain/embedded/couplingmanager1d3d_average.hh b/dumux/multidomain/embedded/couplingmanager1d3d_average.hh index 26b61fd4cb..3592983e95 100644 --- a/dumux/multidomain/embedded/couplingmanager1d3d_average.hh +++ b/dumux/multidomain/embedded/couplingmanager1d3d_average.hh @@ -87,7 +87,7 @@ class Embedded1d3dCouplingManager template static constexpr bool isBox() - { return GridGeometry::discMethod == DiscretizationMethod::box; } + { return GridGeometry::discMethod == DiscretizationMethods::box; } public: diff --git a/dumux/multidomain/embedded/couplingmanager1d3d_kernel.hh b/dumux/multidomain/embedded/couplingmanager1d3d_kernel.hh index d64de37a39..ab52f2d373 100644 --- a/dumux/multidomain/embedded/couplingmanager1d3d_kernel.hh +++ b/dumux/multidomain/embedded/couplingmanager1d3d_kernel.hh @@ -85,7 +85,7 @@ class Embedded1d3dCouplingManager template static constexpr bool isBox() - { return GridGeometry::discMethod == DiscretizationMethod::box; } + { return GridGeometry::discMethod == DiscretizationMethods::box; } static_assert(!isBox() && !isBox(), "The kernel coupling method is only implemented for the tpfa method"); static_assert(Dune::Capabilities::isCartesian::Grid>::v, "The kernel coupling method is only implemented for structured grids"); diff --git a/dumux/multidomain/embedded/couplingmanager1d3d_projection.hh b/dumux/multidomain/embedded/couplingmanager1d3d_projection.hh index 315bd0690f..d3eebf8652 100644 --- a/dumux/multidomain/embedded/couplingmanager1d3d_projection.hh +++ b/dumux/multidomain/embedded/couplingmanager1d3d_projection.hh @@ -355,7 +355,7 @@ class Embedded1d3dCouplingManager static constexpr bool isBox() - { return GridGeometry::discMethod == DiscretizationMethod::box; } + { return GridGeometry::discMethod == DiscretizationMethods::box; } using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/dumux/multidomain/embedded/couplingmanager1d3d_surface.hh b/dumux/multidomain/embedded/couplingmanager1d3d_surface.hh index dc8de7fbcb..78aa3f0db0 100644 --- a/dumux/multidomain/embedded/couplingmanager1d3d_surface.hh +++ b/dumux/multidomain/embedded/couplingmanager1d3d_surface.hh @@ -86,7 +86,7 @@ class Embedded1d3dCouplingManager template static constexpr bool isBox() - { return GridGeometry::discMethod == DiscretizationMethod::box; } + { return GridGeometry::discMethod == DiscretizationMethods::box; } enum { bulkDim = GridView::dimension, diff --git a/dumux/multidomain/embedded/couplingmanagerbase.hh b/dumux/multidomain/embedded/couplingmanagerbase.hh index b1cd9c4b72..a8c9d7e5da 100644 --- a/dumux/multidomain/embedded/couplingmanagerbase.hh +++ b/dumux/multidomain/embedded/couplingmanagerbase.hh @@ -102,7 +102,7 @@ class EmbeddedCouplingManagerBase template static constexpr bool isBox() - { return GridGeometry::discMethod == DiscretizationMethod::box; } + { return GridGeometry::discMethod == DiscretizationMethods::box; } using GlobalPosition = typename Element::Geometry::GlobalCoordinate; using GlueType = MultiDomainGlue, GridView, ElementMapper, ElementMapper>; @@ -463,7 +463,7 @@ protected: template void getShapeValues(Dune::index_constant domainI, const FVGG& gridGeometry, const Geometry& geo, const GlobalPosition& globalPos, ShapeValues& shapeValues) { - if constexpr (FVGG::discMethod == DiscretizationMethod::box) + if constexpr (FVGG::discMethod == DiscretizationMethods::box) { const auto ipLocal = geo.local(globalPos); const auto& localBasis = this->problem(domainI).gridGeometry().feCache().get(geo.type()).localBasis(); diff --git a/dumux/multidomain/embedded/extendedsourcestencil.hh b/dumux/multidomain/embedded/extendedsourcestencil.hh index 6a80947f99..1ee46bddc0 100644 --- a/dumux/multidomain/embedded/extendedsourcestencil.hh +++ b/dumux/multidomain/embedded/extendedsourcestencil.hh @@ -57,7 +57,7 @@ class ExtendedSourceStencil template static constexpr bool isBox() - { return GridGeometry::discMethod == DiscretizationMethod::box; } + { return GridGeometry::discMethod == DiscretizationMethods::box; } public: /*! * \brief extend the jacobian pattern of the diagonal block of domain i diff --git a/dumux/multidomain/embedded/integrationpointsource.hh b/dumux/multidomain/embedded/integrationpointsource.hh index 4a87930779..eb29423a91 100644 --- a/dumux/multidomain/embedded/integrationpointsource.hh +++ b/dumux/multidomain/embedded/integrationpointsource.hh @@ -123,7 +123,7 @@ public: { // get the index of the element in which the point source falls const auto eIdx = source.elementIndex(); - if constexpr (GridGeometry::discMethod == DiscretizationMethod::box) + if constexpr (GridGeometry::discMethod == DiscretizationMethods::box) { auto fvGeometry = localView(gridGeometry); // check in which subcontrolvolume(s) we are diff --git a/dumux/multidomain/embedded/pointsourcedata.hh b/dumux/multidomain/embedded/pointsourcedata.hh index d6cbab2964..e3a85dbe40 100644 --- a/dumux/multidomain/embedded/pointsourcedata.hh +++ b/dumux/multidomain/embedded/pointsourcedata.hh @@ -56,7 +56,7 @@ class PointSourceData template static constexpr bool isBox() - { return GridGeometry::discMethod == DiscretizationMethod::box; } + { return GridGeometry::discMethod == DiscretizationMethods::box; } public: void addBulkInterpolation(const ShapeValues& shapeValues, @@ -165,7 +165,7 @@ class PointSourceDataCircleAverage : public PointSourceData template static constexpr bool isBox() - { return GridGeometry::discMethod == DiscretizationMethod::box; } + { return GridGeometry::discMethod == DiscretizationMethods::box; } public: PointSourceDataCircleAverage() : enableBulkCircleInterpolation_(false) {} diff --git a/dumux/multidomain/facet/box/couplingmanager.hh b/dumux/multidomain/facet/box/couplingmanager.hh index 58b8b15d54..0f8066ad72 100644 --- a/dumux/multidomain/facet/box/couplingmanager.hh +++ b/dumux/multidomain/facet/box/couplingmanager.hh @@ -90,7 +90,7 @@ class FacetCouplingManager(); static constexpr auto lowDimGridId = CouplingMapper::template gridId(); - static constexpr bool lowDimUsesBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool lowDimUsesBox = GridGeometry::discMethod == DiscretizationMethods::box; /*! * \brief The coupling context of the bulk domain. Contains all data of the lower- diff --git a/dumux/multidomain/fvassembler.hh b/dumux/multidomain/fvassembler.hh index 8f88cc3d37..873c803e93 100644 --- a/dumux/multidomain/fvassembler.hh +++ b/dumux/multidomain/fvassembler.hh @@ -253,7 +253,7 @@ public: if (gridView.comm().size() > 1 && gridView.overlapSize(0) == 0) { - if constexpr (GridGeometry::discMethod == DiscretizationMethod::box) + if constexpr (GridGeometry::discMethod == DiscretizationMethods::box) { using GV = typename GridGeometry::GridView; using DM = typename GridGeometry::VertexMapper; @@ -558,7 +558,7 @@ private: template void enforcePeriodicConstraints_(Dune::index_constant domainI, JacRow& jacRow, Sol& res, const GG& gridGeometry, const Sol& curSol) { - if constexpr (GG::discMethod == DiscretizationMethod::box || GG::discMethod == DiscretizationMethod::fcstaggered) + if constexpr (GG::discMethod == DiscretizationMethods::box || GG::discMethod == DiscretizationMethods::fcstaggered) { for (const auto& m : gridGeometry.periodicVertexMap()) { diff --git a/dumux/multidomain/staggeredcouplingmanager.hh b/dumux/multidomain/staggeredcouplingmanager.hh index 87bc571b01..3bb5fefdde 100644 --- a/dumux/multidomain/staggeredcouplingmanager.hh +++ b/dumux/multidomain/staggeredcouplingmanager.hh @@ -186,7 +186,7 @@ public: * \brief return the numeric epsilon used for deflecting primary variables of coupled domain i. * \note specialization for non-staggered schemes */ - template::discMethod != DiscretizationMethod::staggered), int> = 0> + template::discMethod != DiscretizationMethods::staggered), int> = 0> decltype(auto) numericEpsilon(Dune::index_constant id, const std::string& paramGroup) const { @@ -197,7 +197,7 @@ public: * \brief return the numeric epsilon used for deflecting primary variables of coupled domain i. * \note specialization for non-staggered schemes */ - template::discMethod == DiscretizationMethod::staggered), int> = 0> + template::discMethod == DiscretizationMethods::staggered), int> = 0> decltype(auto) numericEpsilon(Dune::index_constant, const std::string& paramGroup) const { diff --git a/dumux/nonlinear/newtonconvergencewriter.hh b/dumux/nonlinear/newtonconvergencewriter.hh index cadf82de45..960446bfee 100644 --- a/dumux/nonlinear/newtonconvergencewriter.hh +++ b/dumux/nonlinear/newtonconvergencewriter.hh @@ -57,7 +57,7 @@ class NewtonConvergenceWriter : public ConvergenceWriterInterface::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - static_assert(GridGeometry::discMethod == DiscretizationMethod::staggered, + static_assert(GridGeometry::discMethod == DiscretizationMethods::staggered, "This convergence writer does only work for the staggered method, use the NewtonConvergenceWriter instead"); public: /*! diff --git a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh index 184fffe068..58b8295958 100644 --- a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh +++ b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh @@ -84,7 +84,7 @@ public: //! Flux derivatives for the cell-centered tpfa scheme template - std::enable_if_t::discMethod == DiscretizationMethod::cctpfa, void> + std::enable_if_t::discMethod == DiscretizationMethods::cctpfa, void> addFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, @@ -137,7 +137,7 @@ public: //! Flux derivatives for the cell-centered mpfa scheme template - std::enable_if_t::discMethod == DiscretizationMethod::ccmpfa, void> + std::enable_if_t::discMethod == DiscretizationMethods::ccmpfa, void> addFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, @@ -174,7 +174,7 @@ public: //! Flux derivatives for the box scheme 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, @@ -212,7 +212,7 @@ public: //! Dirichlet flux derivatives for the cell-centered tpfa scheme template - std::enable_if_t::discMethod == DiscretizationMethod::cctpfa, void> + std::enable_if_t::discMethod == DiscretizationMethods::cctpfa, void> addCCDirichletFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, @@ -232,7 +232,7 @@ public: //! Dirichlet flux derivatives for the cell-centered mpfa scheme template - std::enable_if_t::discMethod == DiscretizationMethod::ccmpfa, void> + std::enable_if_t::discMethod == DiscretizationMethods::ccmpfa, void> addCCDirichletFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, diff --git a/dumux/porousmediumflow/2p/boxmaterialinterfaces.hh b/dumux/porousmediumflow/2p/boxmaterialinterfaces.hh index ea021f19ba..69a75ce3d0 100644 --- a/dumux/porousmediumflow/2p/boxmaterialinterfaces.hh +++ b/dumux/porousmediumflow/2p/boxmaterialinterfaces.hh @@ -69,7 +69,7 @@ public: const SolutionVector& x) { // make sure this is only called for geometries of the box method! - if (GridGeometry::discMethod != DiscretizationMethod::box) + if (GridGeometry::discMethod != DiscretizationMethods::box) DUNE_THROW(Dune::InvalidStateException, "Determination of the interface material parameters with " "this class only makes sense when using the box method!"); diff --git a/dumux/porousmediumflow/2p/griddatatransfer.hh b/dumux/porousmediumflow/2p/griddatatransfer.hh index ae38682188..7dc206f8d1 100644 --- a/dumux/porousmediumflow/2p/griddatatransfer.hh +++ b/dumux/porousmediumflow/2p/griddatatransfer.hh @@ -81,7 +81,7 @@ class TwoPGridDataTransfer : public GridDataTransfer::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GetPropType::discMethod == DiscretizationMethods::box; // saturation primary variable index enum { saturationIdx = Indices::saturationIdx }; diff --git a/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh b/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh index 66fa5b3f79..659f70db00 100644 --- a/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh +++ b/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh @@ -147,7 +147,7 @@ public: * \param scvf The sub control volume face */ template - std::enable_if_t::discMethod == DiscretizationMethod::cctpfa, void> + std::enable_if_t::discMethod == DiscretizationMethods::cctpfa, void> addFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, @@ -266,7 +266,7 @@ public: * \param scvf The sub control volume face */ 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/porousmediumflow/boxdfm/vtkoutputmodule.hh b/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh index d4b527da95..a7efead19c 100644 --- a/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh +++ b/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh @@ -80,7 +80,7 @@ class BoxDfmVtkOutputModule : public VtkOutputModule 1, "Box-Dfm output only works for dim > 1"); static_assert(FractureGrid::dimension == int(dim-1), "Fracture grid must be of codimension one!"); static_assert(FractureGrid::dimensionworld == int(dimWorld), "Fracture grid has to has the same coordinate dimension!"); - static_assert(GridGeometry::discMethod == DiscretizationMethod::box, "Box-Dfm output module can only be used with the box scheme!"); + static_assert(GridGeometry::discMethod == DiscretizationMethods::box, "Box-Dfm output module can only be used with the box scheme!"); public: //! The constructor diff --git a/dumux/porousmediumflow/compositional/primaryvariableswitch.hh b/dumux/porousmediumflow/compositional/primaryvariableswitch.hh index 2af0fbf749..5049349d11 100644 --- a/dumux/porousmediumflow/compositional/primaryvariableswitch.hh +++ b/dumux/porousmediumflow/compositional/primaryvariableswitch.hh @@ -184,7 +184,7 @@ public: const SolutionVector& sol) { if constexpr (GridVariables::GridFluxVariablesCache::cachingEnabled - && GridVariables::GridGeometry::discMethod != DiscretizationMethod::box) + && GridVariables::GridGeometry::discMethod != DiscretizationMethods::box) { // update the flux variables if global caching is enabled const auto dofIdxGlobal = gridGeometry.dofMapper().index(element); @@ -210,7 +210,7 @@ public: GridVariables& gridVariables, SolutionVector& sol) { - if constexpr (GridVariables::GridGeometry::discMethod == DiscretizationMethod::box || Problem::enableInternalDirichletConstraints()) + if constexpr (GridVariables::GridGeometry::discMethod == DiscretizationMethods::box || Problem::enableInternalDirichletConstraints()) { std::vector stateChanged(sol.size(), false); std::size_t countChanged = 0; @@ -232,7 +232,7 @@ public: if (stateChanged[dofIdx]) continue; - if constexpr (GridVariables::GridGeometry::discMethod == DiscretizationMethod::box) + if constexpr (GridVariables::GridGeometry::discMethod == DiscretizationMethods::box) { if (gridGeometry.dofOnBoundary(dofIdx)) { @@ -328,7 +328,7 @@ protected: const Problem& problem) { // Dofs can be only constrained when using the Box method or when imposing internal Dirichlet constraints - if constexpr (Geometry::GridGeometry::discMethod != DiscretizationMethod::box && !Problem::enableInternalDirichletConstraints()) + if constexpr (Geometry::GridGeometry::discMethod != DiscretizationMethods::box && !Problem::enableInternalDirichletConstraints()) return false; // check for internally constrained Dofs @@ -347,7 +347,7 @@ protected: return true; // check for a Dirichlet BC when using the Box method - if constexpr (Geometry::GridGeometry::discMethod == DiscretizationMethod::box) + if constexpr (Geometry::GridGeometry::discMethod == DiscretizationMethods::box) { if (!fvGeometry.hasBoundaryScvf()) return false; diff --git a/dumux/porousmediumflow/fluxvariablescachefiller.hh b/dumux/porousmediumflow/fluxvariablescachefiller.hh index 16948db4d1..0c220608e8 100644 --- a/dumux/porousmediumflow/fluxvariablescachefiller.hh +++ b/dumux/porousmediumflow/fluxvariablescachefiller.hh @@ -531,7 +531,7 @@ private: if constexpr (advectionEnabled) { using AdvectionType = GetPropType; - if constexpr (AdvectionType::discMethod == DiscretizationMethod::ccmpfa) + if constexpr (AdvectionType::discMethod == DiscretizationMethods::ccmpfa) prepareAdvectionHandle_(iv, handle, forceUpdate); } @@ -539,7 +539,7 @@ private: if constexpr (diffusionEnabled) { using DiffusionType = GetPropType; - if constexpr (DiffusionType::discMethod == DiscretizationMethod::ccmpfa) + if constexpr (DiffusionType::discMethod == DiscretizationMethods::ccmpfa) prepareDiffusionHandles_(iv, handle, forceUpdate); } @@ -547,7 +547,7 @@ private: if constexpr (heatConductionEnabled) { using HeatConductionType = GetPropType; - if constexpr (HeatConductionType::discMethod == DiscretizationMethod::ccmpfa) + if constexpr (HeatConductionType::discMethod == DiscretizationMethods::ccmpfa) prepareHeatConductionHandle_(iv, handle, forceUpdate); } } diff --git a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh index d73498b836..0d469d9337 100644 --- a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh +++ b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh @@ -58,7 +58,7 @@ class NonEquilibriumGridVariables static constexpr auto dim = ParentType::GridGeometry::GridView::dimension; // Grid and world dimension static constexpr auto dimWorld = ParentType::GridGeometry::GridView::dimensionworld; static constexpr int numPhases = ParentType::VolumeVariables::numFluidPhases(); - static constexpr bool isBox = ParentType::GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = ParentType::GridGeometry::discMethod == DiscretizationMethods::box; public: //! Export the type used for scalar values diff --git a/dumux/porousmediumflow/richards/localresidual.hh b/dumux/porousmediumflow/richards/localresidual.hh index 6e8302f553..8f8b691c28 100644 --- a/dumux/porousmediumflow/richards/localresidual.hh +++ b/dumux/porousmediumflow/richards/localresidual.hh @@ -254,7 +254,7 @@ public: * \param scvf The sub control volume face */ template - std::enable_if_t::discMethod == DiscretizationMethod::cctpfa, void> + std::enable_if_t::discMethod == DiscretizationMethods::cctpfa, void> addFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, @@ -330,7 +330,7 @@ public: * \param scvf The sub control volume face */ 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/porousmediumflow/tracer/localresidual.hh b/dumux/porousmediumflow/tracer/localresidual.hh index 717401ec70..dd4d416378 100644 --- a/dumux/porousmediumflow/tracer/localresidual.hh +++ b/dumux/porousmediumflow/tracer/localresidual.hh @@ -237,7 +237,7 @@ public: } 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, @@ -246,7 +246,7 @@ public: const ElementFluxVariablesCache& elemFluxVarsCache, const SubControlVolumeFace& scvf) const { - if constexpr (FVElementGeometry::GridGeometry::discMethod != DiscretizationMethod::cctpfa) + if constexpr (FVElementGeometry::GridGeometry::discMethod != DiscretizationMethods::cctpfa) DUNE_THROW(Dune::NotImplemented, "Analytic flux differentiation only implemented for tpfa"); // advective term: we do the same for all tracer components @@ -299,7 +299,7 @@ public: } 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/porousmediumflow/velocity.hh b/dumux/porousmediumflow/velocity.hh index 86ed6728f9..5b91e765de 100644 --- a/dumux/porousmediumflow/velocity.hh +++ b/dumux/porousmediumflow/velocity.hh @@ -85,7 +85,7 @@ class PorousMediumFlowVelocity static constexpr int dim = GridView::dimension; static constexpr int dimWorld = GridView::dimensionworld; - static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; static constexpr int dofCodim = isBox ? dim : 0; static constexpr bool stationaryVelocityField = FluxTraits::hasStationaryVelocityField(); @@ -234,7 +234,7 @@ public: // For the number of scvfs per facet (mpfa) we simply obtain the number of // corners of the first facet as prisms/pyramids are not supported here anyway // -> for prisms/pyramids the number of scvfs would differ from facet to facet - static constexpr bool isMpfa = GridGeometry::discMethod == DiscretizationMethod::ccmpfa; + static constexpr bool isMpfa = GridGeometry::discMethod == DiscretizationMethods::ccmpfa; const int numScvfsPerFace = isMpfa ? element.template subEntity<1>(0).geometry().corners() : 1; if (fvGeometry.numScvf() != element.subEntities(1)*numScvfsPerFace) diff --git a/dumux/porousmediumflow/velocityoutput.hh b/dumux/porousmediumflow/velocityoutput.hh index a3319b14e8..161ea07c33 100644 --- a/dumux/porousmediumflow/velocityoutput.hh +++ b/dumux/porousmediumflow/velocityoutput.hh @@ -59,7 +59,7 @@ class PorousMediumFlowVelocityOutput : public VelocityOutput static constexpr int dim = GridView::dimension; static constexpr int dimWorld = GridView::dimensionworld; - static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; static constexpr int dofCodim = isBox ? dim : 0; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/dumux/python/common/fvproblem.hh b/dumux/python/common/fvproblem.hh index 21e6904314..86eb699bc1 100644 --- a/dumux/python/common/fvproblem.hh +++ b/dumux/python/common/fvproblem.hh @@ -55,7 +55,7 @@ public: using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; static constexpr std::size_t numEq = static_cast(PrimaryVariables::dimension); using BoundaryTypes = Dumux::BoundaryTypes; diff --git a/dumux/python/porousmediumflow/problem.hh b/dumux/python/porousmediumflow/problem.hh index 30c72f3b40..245bf11a9c 100644 --- a/dumux/python/porousmediumflow/problem.hh +++ b/dumux/python/porousmediumflow/problem.hh @@ -51,7 +51,7 @@ public: using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; static constexpr std::size_t numEq = static_cast(PrimaryVariables::dimension); using BoundaryTypes = Dumux::BoundaryTypes; diff --git a/test/multidomain/facet/1p_1p/analytical/main.cc b/test/multidomain/facet/1p_1p/analytical/main.cc index 469735bbaf..e242b4967f 100644 --- a/test/multidomain/facet/1p_1p/analytical/main.cc +++ b/test/multidomain/facet/1p_1p/analytical/main.cc @@ -133,7 +133,7 @@ auto makeBulkFVGridGeometry(const GridManager& gridManager, * we have to create additional faces on interior boundaries, which are not * created in the standard scheme. */ - if constexpr (BulkGridGeometry::discMethod == Dumux::DiscretizationMethod::box) + if constexpr (BulkGridGeometry::discMethod == Dumux::DiscretizationMethods::box) { using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); @@ -233,7 +233,7 @@ int main(int argc, char** argv) lowDimGridVariables->init(x[lowDimId]); // intialize the vtk output modulell - const auto bulkDM = BulkFVGridGeometry::discMethod == DiscretizationMethod::box ? Dune::VTK::nonconforming : Dune::VTK::conforming; + const auto bulkDM = BulkFVGridGeometry::discMethod == DiscretizationMethods::box ? Dune::VTK::nonconforming : Dune::VTK::conforming; using BulkSolutionVector = std::decay_t; using LowDimSolutionVector = std::decay_t; VtkOutputModule bulkVtkWriter(*bulkGridVariables, x[bulkId], bulkProblem->name(), "Bulk", bulkDM); @@ -257,7 +257,7 @@ int main(int argc, char** argv) for (const auto& element : elements(bulkFvGridGeometry->gridView())) { - if (BulkFVGridGeometry::discMethod == DiscretizationMethod::box) + if (BulkFVGridGeometry::discMethod == DiscretizationMethods::box) for (int i = 0; i < element.geometry().corners(); ++i) bulkExact[ bulkFvGridGeometry->vertexMapper().subIndex(element, i, BulkGrid::dimension) ] = bulkProblem->exact( element.template subEntity(i).geometry().center() ); @@ -267,7 +267,7 @@ int main(int argc, char** argv) for (const auto& element : elements(lowDimFvGridGeometry->gridView())) { - if (LowDimFVGridGeometry::discMethod == DiscretizationMethod::box) + if (LowDimFVGridGeometry::discMethod == DiscretizationMethods::box) for (int i = 0; i < element.geometry().corners(); ++i) lowDimExact[ lowDimFvGridGeometry->vertexMapper().subIndex(element, i, LowDimGrid::dimension) ] = lowDimProblem->exact( element.template subEntity(i).geometry().center() ); diff --git a/test/multidomain/facet/1p_1p/threedomain/main.cc b/test/multidomain/facet/1p_1p/threedomain/main.cc index 054d80c018..90d5bab4af 100644 --- a/test/multidomain/facet/1p_1p/threedomain/main.cc +++ b/test/multidomain/facet/1p_1p/threedomain/main.cc @@ -59,7 +59,7 @@ namespace Dumux { template< class GridGeometry, class GridManager, class LowDimGridView, - std::enable_if_t = 0 > + std::enable_if_t = 0 > void updateFVGridGeometry(GridGeometry& gridGeometry, const GridManager& gridManager, const LowDimGridView& lowDimGridView) @@ -76,7 +76,7 @@ void updateFVGridGeometry(GridGeometry& gridGeometry, template< class GridGeometry, class GridManager, class LowDimGridView, - std::enable_if_t = 0 > + std::enable_if_t = 0 > void updateFVGridGeometry(GridGeometry& gridGeometry, const GridManager& gridManager, const LowDimGridView& lowDimGridView) diff --git a/test/multidomain/facet/1pnc_1pnc/main.cc b/test/multidomain/facet/1pnc_1pnc/main.cc index ef93d5c560..fd905ba855 100644 --- a/test/multidomain/facet/1pnc_1pnc/main.cc +++ b/test/multidomain/facet/1pnc_1pnc/main.cc @@ -63,7 +63,7 @@ auto makeBulkFVGridGeometry(const GridManager& gridManager, * we have to create additional faces on interior boundaries, which are not * created in the standard scheme. */ - if constexpr (BulkGridGeometry::discMethod == Dumux::DiscretizationMethod::box) + if constexpr (BulkGridGeometry::discMethod == Dumux::DiscretizationMethods::box) { using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); diff --git a/test/multidomain/facet/test_facetcouplingmapper.cc b/test/multidomain/facet/test_facetcouplingmapper.cc index 7da8cae385..9ff55156a1 100644 --- a/test/multidomain/facet/test_facetcouplingmapper.cc +++ b/test/multidomain/facet/test_facetcouplingmapper.cc @@ -113,7 +113,7 @@ auto makeBulkFVGridGeometry(const GridManager& gridManager, * we have to create additional faces on interior boundaries, which are not * created in the standard scheme. */ - if constexpr (BulkGridGeometry::discMethod == Dumux::DiscretizationMethod::box) + if constexpr (BulkGridGeometry::discMethod == Dumux::DiscretizationMethods::box) { using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); @@ -226,7 +226,7 @@ int main (int argc, char *argv[]) const auto lowDimElemDofIndices = [&] () { std::vector< typename FacetGridView::IndexSet::IndexType > dofIndices; - if (FacetFVGridGeometry::discMethod == Dumux::DiscretizationMethod::cctpfa) + if (FacetFVGridGeometry::discMethod == Dumux::DiscretizationMethods::cctpfa) dofIndices.push_back(lowDimElemIdx); else for (int i = 0; i < lowDimGeom.corners(); ++i) diff --git a/test/multidomain/facet/tracer_tracer/main.cc b/test/multidomain/facet/tracer_tracer/main.cc index 2e3b863e5b..e64f9e1b5c 100644 --- a/test/multidomain/facet/tracer_tracer/main.cc +++ b/test/multidomain/facet/tracer_tracer/main.cc @@ -68,7 +68,7 @@ auto makeBulkFVGridGeometry(const GridManager& gridManager, * we have to create additional faces on interior boundaries, which are not * created in the standard scheme. */ - if constexpr (BulkGridGeometry::discMethod == Dumux::DiscretizationMethod::box) + if constexpr (BulkGridGeometry::discMethod == Dumux::DiscretizationMethods::box) { using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); @@ -91,7 +91,7 @@ void computeVolumeFluxes(Storage& volumeFluxes, const Sol& sol, Dune::index_constant domainId) { - static constexpr bool isBox = GV::GridGeometry::discMethod == Dumux::DiscretizationMethod::box; + static constexpr bool isBox = GV::GridGeometry::discMethod == Dumux::DiscretizationMethods::box; // resize depending on the scheme if (!isBox) volumeFluxes.assign(gridGeometry.numScvf(), {0.0}); @@ -242,7 +242,7 @@ int main(int argc, char** argv) lowDimGridVariables->init(x[lowDimId]); // intialize the vtk output module - const auto bulkDM = BulkFVGridGeometry::discMethod == DiscretizationMethod::box ? Dune::VTK::nonconforming : Dune::VTK::conforming; + const auto bulkDM = BulkFVGridGeometry::discMethod == DiscretizationMethods::box ? Dune::VTK::nonconforming : Dune::VTK::conforming; using BulkSolutionVector = std::decay_t; using LowDimSolutionVector = std::decay_t; VtkOutputModule bulkVtkWriter(*bulkGridVariables, x[bulkId], bulkProblem->name(), "Bulk.OneP", bulkDM); @@ -336,7 +336,7 @@ int main(int argc, char** argv) lowDimGridVariables->init(x[lowDimId]); // intialize the vtk output modules - const auto bulkDM = BulkFVGridGeometry::discMethod == DiscretizationMethod::box ? Dune::VTK::nonconforming : Dune::VTK::conforming; + const auto bulkDM = BulkFVGridGeometry::discMethod == DiscretizationMethods::box ? Dune::VTK::nonconforming : Dune::VTK::conforming; using BulkSolutionVector = std::decay_t; using LowDimSolutionVector = std::decay_t; VtkOutputModule bulkVtkWriter(*bulkGridVariables, x[bulkId], bulkProblem->name(), "Bulk.Tracer", bulkDM); diff --git a/test/multidomain/facet/tracer_tracer/spatialparams_tracer.hh b/test/multidomain/facet/tracer_tracer/spatialparams_tracer.hh index a1472f565e..7a19e008fe 100644 --- a/test/multidomain/facet/tracer_tracer/spatialparams_tracer.hh +++ b/test/multidomain/facet/tracer_tracer/spatialparams_tracer.hh @@ -47,7 +47,7 @@ class TracerSpatialParams using ParentType = FVSpatialParamsOneP>; - static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; static constexpr int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Dune::FieldVector; diff --git a/test/porousmediumflow/1p/convergence/discretesolution/main.cc b/test/porousmediumflow/1p/convergence/discretesolution/main.cc index 0205eedb68..d3a77e7e13 100644 --- a/test/porousmediumflow/1p/convergence/discretesolution/main.cc +++ b/test/porousmediumflow/1p/convergence/discretesolution/main.cc @@ -50,7 +50,7 @@ int main(int argc, char** argv) using namespace Dumux; using TypeTag = Properties::TTag::TYPETAG; static constexpr auto dm = GetPropType::discMethod; - static constexpr bool isBox = dm == DiscretizationMethod::box; + static constexpr bool isBox = dm == DiscretizationMethods::box; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); diff --git a/test/porousmediumflow/1p/incompressible/main.cc b/test/porousmediumflow/1p/incompressible/main.cc index 90a767ad93..111dc5a7bf 100644 --- a/test/porousmediumflow/1p/incompressible/main.cc +++ b/test/porousmediumflow/1p/incompressible/main.cc @@ -54,7 +54,7 @@ //! Function to write out the scv-wise velocities (overload for mpfa) template = 0> + std::enable_if_t = 0> void writeMpfaVelocities(const GridGeometry& gridGeometry, const GridVariables& gridVariables, const Sol& x) @@ -70,7 +70,7 @@ void writeMpfaVelocities(const GridGeometry& gridGeometry, //! Function to write out the scv-wise velocities (overload for NOT mpfa) template = 0> + std::enable_if_t = 0> void writeMpfaVelocities(const GridGeometry& gridGeometry, const GridVariables& gridVariables, const Sol& x) @@ -161,7 +161,7 @@ int main(int argc, char** argv) using VelocityVector = typename VelocityOutput::VelocityVector; VelocityVector velocity; - constexpr bool isBox = GridGeometry::discMethod == Dumux::DiscretizationMethod::box; + constexpr bool isBox = GridGeometry::discMethod == Dumux::DiscretizationMethods::box; constexpr int dimWorld = GridGeometry::GridView::dimensionworld; const auto numCells = leafGridView.size(0); const auto numDofs = gridGeometry->numDofs(); diff --git a/test/porousmediumflow/1p/network1d3d/problem.hh b/test/porousmediumflow/1p/network1d3d/problem.hh index 0a84bb476e..379fe54ca4 100644 --- a/test/porousmediumflow/1p/network1d3d/problem.hh +++ b/test/porousmediumflow/1p/network1d3d/problem.hh @@ -73,7 +73,7 @@ class TubesTestProblem : public PorousMediumFlowProblem using SubControlVolume = typename FVElementGeometry::SubControlVolume; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - enum { isBox = GetPropType::discMethod == DiscretizationMethod::box }; + enum { isBox = GetPropType::discMethod == DiscretizationMethods::box }; public: TubesTestProblem(std::shared_ptr gridGeometry) diff --git a/test/porousmediumflow/1p/nonisothermal/main.cc b/test/porousmediumflow/1p/nonisothermal/main.cc index 74b658e8b8..509764ae40 100644 --- a/test/porousmediumflow/1p/nonisothermal/main.cc +++ b/test/porousmediumflow/1p/nonisothermal/main.cc @@ -112,7 +112,7 @@ int main(int argc, char** argv) // the problem (initial and boundary conditions) using Problem = GetPropType; - const std::string paramGroup = GridGeometry::discMethod == DiscretizationMethod::ccmpfa ? "MpfaTest" : ""; + const std::string paramGroup = GridGeometry::discMethod == DiscretizationMethods::ccmpfa ? "MpfaTest" : ""; auto problem = std::make_shared(gridGeometry, paramGroup); // get some time loop parameters diff --git a/test/porousmediumflow/1pnc/1p2c/isothermal/problem.hh b/test/porousmediumflow/1pnc/1p2c/isothermal/problem.hh index 7a399a5635..3c95865ef7 100644 --- a/test/porousmediumflow/1pnc/1p2c/isothermal/problem.hh +++ b/test/porousmediumflow/1pnc/1p2c/isothermal/problem.hh @@ -101,7 +101,7 @@ class OnePTwoCTestProblem : public PorousMediumFlowProblem //! Property that defines whether mole or mass fractions are used static constexpr bool useMoles = getPropValue(); - static const bool isBox = GetPropType::discMethod == DiscretizationMethod::box; + static const bool isBox = GetPropType::discMethod == DiscretizationMethods::box; static const int dimWorld = GridView::dimensionworld; using GlobalPosition = typename SubControlVolumeFace::GlobalPosition; diff --git a/test/porousmediumflow/1pncmin/nonisothermal/problem.hh b/test/porousmediumflow/1pncmin/nonisothermal/problem.hh index 4fc0b961fe..db672e12be 100644 --- a/test/porousmediumflow/1pncmin/nonisothermal/problem.hh +++ b/test/porousmediumflow/1pncmin/nonisothermal/problem.hh @@ -117,7 +117,7 @@ public: boundaryVaporMoleFrac_ = getParam("Problem.BoundaryMoleFraction"); boundaryTemperature_ = getParam("Problem.BoundaryTemperature"); - unsigned int codim = GetPropType::discMethod == DiscretizationMethod::box ? dim : 0; + unsigned int codim = GetPropType::discMethod == DiscretizationMethods::box ? dim : 0; permeability_.resize(gridGeometry->gridView().size(codim)); porosity_.resize(gridGeometry->gridView().size(codim)); reactionRate_.resize(gridGeometry->gridView().size(codim)); diff --git a/test/porousmediumflow/2p/adaptive/problem.hh b/test/porousmediumflow/2p/adaptive/problem.hh index 78753253ac..bb5a1b49c4 100644 --- a/test/porousmediumflow/2p/adaptive/problem.hh +++ b/test/porousmediumflow/2p/adaptive/problem.hh @@ -47,7 +47,7 @@ class TwoPTestProblemAdaptive : public TwoPTestProblem using PrimaryVariables = GetPropType; using GridGeometry = GetPropType; - static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; public: TwoPTestProblemAdaptive(std::shared_ptr gridGeometry) diff --git a/test/porousmediumflow/2p/incompressible/spatialparams.hh b/test/porousmediumflow/2p/incompressible/spatialparams.hh index fdb750dcb2..b5cf628e9d 100644 --- a/test/porousmediumflow/2p/incompressible/spatialparams.hh +++ b/test/porousmediumflow/2p/incompressible/spatialparams.hh @@ -137,7 +137,7 @@ public: template void updateMaterialInterfaces(const SolutionVector& x) { - if (GridGeometry::discMethod == DiscretizationMethod::box) + if (GridGeometry::discMethod == DiscretizationMethods::box) materialInterfaces_ = std::make_unique(this->gridGeometry(), *this, x); } diff --git a/test/porousmediumflow/2p2c/chemicalnonequilibrium/problem.hh b/test/porousmediumflow/2p2c/chemicalnonequilibrium/problem.hh index 154d691cff..28d64f12a9 100644 --- a/test/porousmediumflow/2p2c/chemicalnonequilibrium/problem.hh +++ b/test/porousmediumflow/2p2c/chemicalnonequilibrium/problem.hh @@ -69,7 +69,7 @@ class TwoPTwoCChemicalNonequilibriumProblem : public PorousMediumFlowProblem gridGeometry) diff --git a/test/porousmediumflow/2pnc/fuelcell/problem.hh b/test/porousmediumflow/2pnc/fuelcell/problem.hh index d43297e672..54415b9462 100644 --- a/test/porousmediumflow/2pnc/fuelcell/problem.hh +++ b/test/porousmediumflow/2pnc/fuelcell/problem.hh @@ -74,7 +74,7 @@ class FuelCellProblem : public PorousMediumFlowProblem #endif static constexpr int dim = GridView::dimension; static constexpr int dimWorld = GridView::dimensionworld; - static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; using GlobalPosition = typename SubControlVolume::GlobalPosition; enum { dofCodim = isBox ? dim : 0 }; diff --git a/test/porousmediumflow/2pncmin/isothermal/problem.hh b/test/porousmediumflow/2pncmin/isothermal/problem.hh index fc608bacb6..d0a22787e6 100644 --- a/test/porousmediumflow/2pncmin/isothermal/problem.hh +++ b/test/porousmediumflow/2pncmin/isothermal/problem.hh @@ -142,7 +142,7 @@ public: temperatureHigh_ = getParam("FluidSystem.TemperatureHigh"); name_ = getParam("Problem.Name"); - unsigned int codim = GetPropType::discMethod == DiscretizationMethod::box ? dim : 0; + unsigned int codim = GetPropType::discMethod == DiscretizationMethods::box ? dim : 0; permeability_.resize(gridGeometry->gridView().size(codim)); FluidSystem::init(/*Tmin=*/temperatureLow_, diff --git a/test/porousmediumflow/2pncmin/nonisothermal/problem.hh b/test/porousmediumflow/2pncmin/nonisothermal/problem.hh index e662966c18..7719df63e7 100644 --- a/test/porousmediumflow/2pncmin/nonisothermal/problem.hh +++ b/test/porousmediumflow/2pncmin/nonisothermal/problem.hh @@ -147,7 +147,7 @@ public: initGasSaturation_ = getParam("Problem.InitialGasSaturation"); initSalinity_ = getParam("Problem.InitialSalinity"); - unsigned int codim = GetPropType::discMethod == DiscretizationMethod::box ? dim : 0; + unsigned int codim = GetPropType::discMethod == DiscretizationMethods::box ? dim : 0; permeability_.resize(gridGeometry->gridView().size(codim)); FluidSystem::init(/*Tmin=*/temperatureLow_, diff --git a/test/porousmediumflow/co2/problem.hh b/test/porousmediumflow/co2/problem.hh index 3e6db0df59..f3633e74e2 100644 --- a/test/porousmediumflow/co2/problem.hh +++ b/test/porousmediumflow/co2/problem.hh @@ -129,7 +129,7 @@ class HeterogeneousProblem : public PorousMediumFlowProblem // the discretization method we are using static constexpr auto discMethod = GetPropType::discMethod; - static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; // world dimension to access gravity vector static constexpr int dimWorld = GridView::dimensionworld; diff --git a/test/porousmediumflow/mpnc/2p2ccomparison/problem.hh b/test/porousmediumflow/mpnc/2p2ccomparison/problem.hh index 034f6fed05..f419ef311d 100644 --- a/test/porousmediumflow/mpnc/2p2ccomparison/problem.hh +++ b/test/porousmediumflow/mpnc/2p2ccomparison/problem.hh @@ -75,7 +75,7 @@ class MPNCComparisonProblem using GlobalPosition = typename SubControlVolumeFace::GlobalPosition; using PhaseVector = Dune::FieldVector; - static constexpr bool isBox = GetPropType::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GetPropType::discMethod == DiscretizationMethods::box; public: MPNCComparisonProblem(std::shared_ptr gridGeometry) -- GitLab From 7df47c93d80243b399c849ca40a639f984cc7299 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 15:11:53 +0200 Subject: [PATCH 22/26] [disc][multidomain] Use discretization tag instead of enum as template argument. --- dumux/multidomain/fvassembler.hh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dumux/multidomain/fvassembler.hh b/dumux/multidomain/fvassembler.hh index 873c803e93..329729be59 100644 --- a/dumux/multidomain/fvassembler.hh +++ b/dumux/multidomain/fvassembler.hh @@ -104,41 +104,41 @@ private: using TimeLoop = TimeLoopBase; using ThisType = MultiDomainFVAssembler; - template + template struct SubDomainAssemblerType; template - struct SubDomainAssemblerType + struct SubDomainAssemblerType { using type = SubDomainCCLocalAssembler, ThisType, diffMethod, isImplicit()>; }; template - struct SubDomainAssemblerType + struct SubDomainAssemblerType { using type = SubDomainCCLocalAssembler, ThisType, diffMethod, isImplicit()>; }; template - struct SubDomainAssemblerType + struct SubDomainAssemblerType { using type = SubDomainBoxLocalAssembler, ThisType, diffMethod, isImplicit()>; }; template - struct SubDomainAssemblerType + struct SubDomainAssemblerType { using type = SubDomainStaggeredLocalAssembler, ThisType, diffMethod, isImplicit()>; }; template - struct SubDomainAssemblerType + struct SubDomainAssemblerType { using type = SubDomainFaceCenteredLocalAssembler, ThisType, diffMethod, isImplicit()>; }; template - using SubDomainAssembler = typename SubDomainAssemblerType::discMethod, id>::type; + using SubDomainAssembler = typename SubDomainAssemblerType::DiscretizationMethod, id>::type; public: -- GitLab From ed5e9bccf846c031d9c6431ab9fc7cb6e6addbd8 Mon Sep 17 00:00:00 2001 From: Ivan Buntic Date: Fri, 17 Sep 2021 15:15:42 +0200 Subject: [PATCH 23/26] [disc][porousmediumflow][porenetwork][2p] Use discretization tag instead of enum as template argument. --- dumux/porenetwork/2p/model.hh | 4 ++-- dumux/porousmediumflow/2p/model.hh | 5 ++--- dumux/porousmediumflow/2p/saturationreconstruction.hh | 4 ++-- dumux/porousmediumflow/2p2c/model.hh | 8 ++++---- dumux/porousmediumflow/2pnc/model.hh | 4 ++-- dumux/porousmediumflow/2pncmin/model.hh | 4 ++-- dumux/porousmediumflow/co2/model.hh | 4 ++-- 7 files changed, 16 insertions(+), 17 deletions(-) diff --git a/dumux/porenetwork/2p/model.hh b/dumux/porenetwork/2p/model.hh index 16591c003b..dc62bdea76 100644 --- a/dumux/porenetwork/2p/model.hh +++ b/dumux/porenetwork/2p/model.hh @@ -108,7 +108,7 @@ private: using MT = GetPropType; using PT = typename GetPropType::PermeabilityType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of non-wetting phase saturations using SR = TwoPScvSaturationReconstruction; @@ -196,7 +196,7 @@ private: using SST = GetPropType; using MT = GetPropType; using PT = typename GetPropType::PermeabilityType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of non-wetting phase saturations using SR = Dumux::TwoPScvSaturationReconstruction; diff --git a/dumux/porousmediumflow/2p/model.hh b/dumux/porousmediumflow/2p/model.hh index da5b73bd5c..861af18674 100644 --- a/dumux/porousmediumflow/2p/model.hh +++ b/dumux/porousmediumflow/2p/model.hh @@ -179,8 +179,7 @@ private: using SST = GetPropType; using MT = GetPropType; using PT = typename GetPropType::PermeabilityType; - - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction; @@ -221,7 +220,7 @@ private: using SST = GetPropType; using MT = GetPropType; using PT = typename GetPropType::PermeabilityType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction; diff --git a/dumux/porousmediumflow/2p/saturationreconstruction.hh b/dumux/porousmediumflow/2p/saturationreconstruction.hh index 7a94627486..1ca95906d8 100644 --- a/dumux/porousmediumflow/2p/saturationreconstruction.hh +++ b/dumux/porousmediumflow/2p/saturationreconstruction.hh @@ -38,7 +38,7 @@ namespace Dumux { * freedom lie on material interfaces. There the nonwetting phase saturation is * generally discontinuous. */ -template +template class TwoPScvSaturationReconstruction { public: @@ -67,7 +67,7 @@ public: //! Specialization for the box scheme with the interface solver enabled template<> -class TwoPScvSaturationReconstruction +class TwoPScvSaturationReconstruction { public: /*! diff --git a/dumux/porousmediumflow/2p2c/model.hh b/dumux/porousmediumflow/2p2c/model.hh index 1c7e87633c..b5128343d3 100644 --- a/dumux/porousmediumflow/2p2c/model.hh +++ b/dumux/porousmediumflow/2p2c/model.hh @@ -144,7 +144,7 @@ private: using SST = GetPropType; using PT = typename GetPropType::PermeabilityType; using MT = GetPropType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); static_assert(FSY::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p2c model!"); static_assert(FSY::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p2c model!"); @@ -195,7 +195,7 @@ private: using SST = GetPropType; using PT = typename GetPropType::PermeabilityType; using MT = GetPropType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction; @@ -298,7 +298,7 @@ private: using SST = GetPropType; using PT = typename GetPropType::PermeabilityType; using MT = GetPropType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction; @@ -368,7 +368,7 @@ private: using SST = GetPropType; using MT = GetPropType; using PT = typename GetPropType::PermeabilityType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction; diff --git a/dumux/porousmediumflow/2pnc/model.hh b/dumux/porousmediumflow/2pnc/model.hh index bc16441281..ea496490a7 100644 --- a/dumux/porousmediumflow/2pnc/model.hh +++ b/dumux/porousmediumflow/2pnc/model.hh @@ -173,7 +173,7 @@ private: using SST = GetPropType; using PT = typename GetPropType::PermeabilityType; using MT = GetPropType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction; @@ -271,7 +271,7 @@ private: using SST = GetPropType; using PT = typename GetPropType::PermeabilityType; using MT = GetPropType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction; diff --git a/dumux/porousmediumflow/2pncmin/model.hh b/dumux/porousmediumflow/2pncmin/model.hh index 3a73d713b7..9b76c16e99 100644 --- a/dumux/porousmediumflow/2pncmin/model.hh +++ b/dumux/porousmediumflow/2pncmin/model.hh @@ -136,7 +136,7 @@ private: using SST = GetPropType; using PT = typename GetPropType::PermeabilityType; using MT = GetPropType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction; @@ -212,7 +212,7 @@ private: using SST = GetPropType; using PT = typename GetPropType::PermeabilityType; using MT = GetPropType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction; diff --git a/dumux/porousmediumflow/co2/model.hh b/dumux/porousmediumflow/co2/model.hh index bc48834f91..79be63bace 100644 --- a/dumux/porousmediumflow/co2/model.hh +++ b/dumux/porousmediumflow/co2/model.hh @@ -69,7 +69,7 @@ private: using SST = GetPropType; using PT = typename GetPropType::PermeabilityType; using MT = GetPropType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction; @@ -99,7 +99,7 @@ private: using SST = GetPropType; using PT = typename GetPropType::PermeabilityType; using MT = GetPropType; - static constexpr auto DM = GetPropType::discMethod; + using DM = typename GetPropType::DiscretizationMethod; static constexpr bool enableIS = getPropValue(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction; -- GitLab From 04ac52fb8bd751a4a0cdde2c34af9c0067fbebd7 Mon Sep 17 00:00:00 2001 From: --global Date: Thu, 21 Oct 2021 14:35:59 +0200 Subject: [PATCH 24/26] [disc][porousmediumflow][co2] Use discretization tag instead of enum as template argument. --- dumux/discretization/box/scvftoscvboundarytypes.hh | 6 +++--- test/porousmediumflow/co2/problem.hh | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dumux/discretization/box/scvftoscvboundarytypes.hh b/dumux/discretization/box/scvftoscvboundarytypes.hh index d4b540a9fb..857d4f1b18 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 == DiscretizationMethods::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 == DiscretizationMethods::box) + if (DiscretizationMethod{} == DiscretizationMethods::box) return scvBoundaryTypes[scv.dofIndex()]; else DUNE_THROW(Dune::InvalidStateException, "Only use this for the box discretization!"); diff --git a/test/porousmediumflow/co2/problem.hh b/test/porousmediumflow/co2/problem.hh index f3633e74e2..95ec669e2f 100644 --- a/test/porousmediumflow/co2/problem.hh +++ b/test/porousmediumflow/co2/problem.hh @@ -128,7 +128,8 @@ class HeterogeneousProblem : public PorousMediumFlowProblem static constexpr bool useMoles = ModelTraits::useMoles(); // the discretization method we are using - static constexpr auto discMethod = GetPropType::discMethod; + using DiscretizationMethod = DiscretizationMethods::Box; + static constexpr DiscretizationMethod discMethod{}; static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; // world dimension to access gravity vector @@ -445,7 +446,7 @@ private: // vtk output std::vector vtkKxx_, vtkPorosity_, vtkBoxVolume_, vtkTemperature_; - ScvfToScvBoundaryTypes scvfToScvBoundaryTypes_; + ScvfToScvBoundaryTypes scvfToScvBoundaryTypes_; }; } // end namespace Dumux -- GitLab From 88c2267b7f856e2453784aa1465138ab22698eea Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Tue, 26 Oct 2021 14:59:31 +0200 Subject: [PATCH 25/26] [discmethod] Add changelog entry for discretization tags --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e64eddb1ae..cee528531c 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) -- GitLab From b181b832c394489e578426072d26b2e3daa1fc8d Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Tue, 26 Oct 2021 17:54:01 +0200 Subject: [PATCH 26/26] [python] Expect discretization tags instead of the deprecated enum --- dumux/python/discretization/gridgeometry.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dumux/python/discretization/gridgeometry.hh b/dumux/python/discretization/gridgeometry.hh index da63fefee9..31e4f40275 100644 --- a/dumux/python/discretization/gridgeometry.hh +++ b/dumux/python/discretization/gridgeometry.hh @@ -152,7 +152,7 @@ void registerGridGeometry(pybind11::handle scope, pybind11::class_