diff --git a/CHANGELOG.md b/CHANGELOG.md index e64eddb1ae76096b6f1625cd738c1e8915140300..cee528531cbbdab46c9fc0e76a8dfe543838ce52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,14 @@ Differences Between DuMu<sup>x</sup> 3.5 and DuMu<sup>x</sup> 3.4 ### Improvements and Enhancements +- __Discretization tags__: We introduced tags in the namespace `DiscretizationMethods` (with s) for each discretization method. + These tags replace the `enum class DiscretizationMethod`. Tags have several advantages over the enum. Each tag is a named type + (see `dumux/common/tag.hh`) so they can for example be used in tag dispatch. Moreover specializing with tags is extensible. + For example we specialize the template `DarcysLawImplementation` for each discretization. When using the enum no new discretization + methods can be added without changing `enum class DiscretizationMethod`. With tags you can make your own tag and specialize a + class for that tag. This means new discretization methods can be developed in a modular fashion. The introduction of tags + involves a couple of non-backwards-compatible changes, mostly in implementation classes that shouldn't affect most users (see below). + - __Geometry__: - Add implementation of sphere and bounding sphere approximation algorithms - Add distance queries for Point->BoundingBoxTree @@ -48,10 +56,14 @@ for (const auto& element : elements(gridGeometry.gridView())) - __Coupling managers__: The coupling managers now store shared_ptrs of the subdomain solutions to be able to manage memory outside. There is compatibility interface that is deprecated but it won't allow for assignments of the form `this->curSol() = sol;` since curSol returns a MultiTypeVector of references. If assignment is needed for some reason, use a hybrid loop over all subdomain indices. - __ShallowWaterViscousFlux__: The template argument `PrimaryVariables` has been removed without deprecation. It was not needed. +- __Discretization tags__: The following classes have changed from a template argument of type `DiscretizationMethod` (an `enum`) to + class type template arguments and are now specialized for tags: `TwoPScvSaturationReconstruction`, `ScvfToScvBoundaryTypes`, `ProblemTraits`, `FluxStencil`, `EffectiveStressLaw`, `HookesLaw`, `FacetCouplingManager`, `FacetCouplingMapper`. Moreover this affects the following helper classes: `IsFicksLaw`, `CheckOverlapSize`, `PartialReassemblerEngine`, `SubDomainAssemblerType`. Finally, this change has been made for many implementation classes. These should not have been used directly anyway, so we do not explicitly list them here. Examples are `DarcysLawImplementation`, `LinearSolverTraitsImpl`. See !2844 for more details. + If you face a compiler error from these changes, contact us. Most like the solution is to simply try replacing occurrences of `DiscretizationMethod` with the corresponding tag from `DiscretizationMethods`, or types `DiscretizationMethod` in template arguments by generic `class`. ### Deprecated properties/classes/functions/files, to be removed after 3.5: - `update()` functions of grid geometries, which do not receive the `gridView`, are deprecated, use `update(gridView)` instead. +- `enum class DiscretizationMethod` and associated functions, to be replaced by tags ### New experimental features (possibly subject to backwards-incompatible changes in the future) diff --git a/dumux/adaptive/initializationindicator.hh b/dumux/adaptive/initializationindicator.hh index 20b90ab00392c6520edf8bb50cfbfec06f596427..555edde9b550ac81e4a119ebe353a61ece5cbb51 100644 --- a/dumux/adaptive/initializationindicator.hh +++ b/dumux/adaptive/initializationindicator.hh @@ -52,7 +52,7 @@ class GridAdaptInitializationIndicator using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; - static constexpr bool isBox = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethods::box; public: diff --git a/dumux/assembly/fclocalassembler.hh b/dumux/assembly/fclocalassembler.hh index c9d7dc1f81acf31a2bd13b158ce6aa6f20d84c9a..c58f85ba126bd267cf080a3f8b6bf8e3865e92eb 100644 --- a/dumux/assembly/fclocalassembler.hh +++ b/dumux/assembly/fclocalassembler.hh @@ -477,7 +477,7 @@ public: } // also consider lateral faces outside the own element for face-centered staggered schemes - if constexpr (GridGeometry::discMethod == DiscretizationMethod::fcstaggered) + if constexpr (GridGeometry::discMethod == DiscretizationMethods::fcstaggered) { if (scvf.isLateral()) { @@ -509,7 +509,7 @@ public: } // also consider lateral faces outside the own element for face-centered staggered schemes - if constexpr (GridGeometry::discMethod == DiscretizationMethod::fcstaggered) + if constexpr (GridGeometry::discMethod == DiscretizationMethods::fcstaggered) { if (scvf.isLateral()) { @@ -549,7 +549,7 @@ public: } // also consider lateral faces outside the own element for face-centered staggered schemes - if constexpr (GridGeometry::discMethod == DiscretizationMethod::fcstaggered) + if constexpr (GridGeometry::discMethod == DiscretizationMethods::fcstaggered) { // treat normal/parallel scvs for parallel runs TODO description, put in function if (problem.gridGeometry().gridView().comm().size() > 1 && element.partitionType() == Dune::InteriorEntity) diff --git a/dumux/assembly/fvassembler.hh b/dumux/assembly/fvassembler.hh index 567fe8274589ab61673a8cfd0193d41286b546ef..e1a6614341bb27bd5395915b5825a435e12d8857 100644 --- a/dumux/assembly/fvassembler.hh +++ b/dumux/assembly/fvassembler.hh @@ -41,32 +41,32 @@ namespace Dumux::Detail { -template<DiscretizationMethod diffMethod> +template<class DiscretizationMethod> struct LocalAssemblerChooser; template<> -struct LocalAssemblerChooser<DiscretizationMethod::box> +struct LocalAssemblerChooser<DiscretizationMethods::Box> { template<class TypeTag, class Impl, DiffMethod diffMethod, bool isImplicit> using type = BoxLocalAssembler<TypeTag, Impl, diffMethod, isImplicit>; }; template<> -struct LocalAssemblerChooser<DiscretizationMethod::ccmpfa> +struct LocalAssemblerChooser<DiscretizationMethods::CCMpfa> { template<class TypeTag, class Impl, DiffMethod diffMethod, bool isImplicit> using type = CCLocalAssembler<TypeTag, Impl, diffMethod, isImplicit>; }; template<> -struct LocalAssemblerChooser<DiscretizationMethod::cctpfa> +struct LocalAssemblerChooser<DiscretizationMethods::CCTpfa> { template<class TypeTag, class Impl, DiffMethod diffMethod, bool isImplicit> using type = CCLocalAssembler<TypeTag, Impl, diffMethod, isImplicit>; }; template<> -struct LocalAssemblerChooser<DiscretizationMethod::fcstaggered> +struct LocalAssemblerChooser<DiscretizationMethods::FCStaggered> { template<class TypeTag, class Impl, DiffMethod diffMethod, bool isImplicit> using type = FaceCenteredLocalAssembler<TypeTag, Impl, diffMethod, isImplicit>; @@ -74,7 +74,7 @@ struct LocalAssemblerChooser<DiscretizationMethod::fcstaggered> template<class TypeTag, class Impl, DiffMethod diffMethod, bool isImplicit> using LocalAssemblerChooser_t = typename LocalAssemblerChooser< - GetPropType<TypeTag, Properties::GridGeometry>::discMethod + typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod >::template type<TypeTag, Impl, diffMethod, isImplicit>; } // end namespace Dumux::Detail @@ -98,7 +98,7 @@ class FVAssembler using TimeLoop = TimeLoopBase<GetPropType<TypeTag, Properties::Scalar>>; using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; - static constexpr bool isBox = GridGeo::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GridGeo::discMethod == DiscretizationMethods::box; using ThisType = FVAssembler<TypeTag, diffMethod, isImplicit>; using LocalAssembler = typename Detail::LocalAssemblerChooser_t<TypeTag, ThisType, diffMethod, isImplicit>; @@ -450,7 +450,7 @@ private: DUNE_THROW(NumericalProblem, "A process did not succeed in linearizing the system"); } - template<class GG> std::enable_if_t<GG::discMethod == DiscretizationMethod::box, void> + template<class GG> std::enable_if_t<GG::discMethod == DiscretizationMethods::box, void> enforcePeriodicConstraints_(JacobianMatrix& jac, SolutionVector& res, const SolutionVector& curSol, const GG& gridGeometry) { for (const auto& m : gridGeometry.periodicVertexMap()) @@ -471,7 +471,7 @@ private: } } - template<class GG> std::enable_if_t<GG::discMethod != DiscretizationMethod::box, void> + template<class GG> std::enable_if_t<GG::discMethod != DiscretizationMethods::box, void> enforcePeriodicConstraints_(JacobianMatrix& jac, SolutionVector& res, const SolutionVector& curSol, const GG& gridGeometry) {} //! pointer to the problem to be solved diff --git a/dumux/assembly/fvlocalresidual.hh b/dumux/assembly/fvlocalresidual.hh index 471ab2ed972cea0b2a6068d1110cf79e8a0279a9..41a7c5f47946cf9c81c08f769a5cd7b9cf6948f3 100644 --- a/dumux/assembly/fvlocalresidual.hh +++ b/dumux/assembly/fvlocalresidual.hh @@ -423,7 +423,7 @@ public: //! Compute the derivative of the flux residual template<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod != DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::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<class JacobianMatrix, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethods::box, void> addFluxDerivatives(JacobianMatrix& A, const Problem& problem, const Element& element, diff --git a/dumux/assembly/initialsolution.hh b/dumux/assembly/initialsolution.hh index dc8bf7ebf3a04615577efcac8d7c40de4c726cd6..4054253e0c3f29af95e895b3a407f9cd75053ad8 100644 --- a/dumux/assembly/initialsolution.hh +++ b/dumux/assembly/initialsolution.hh @@ -43,7 +43,7 @@ void assembleInitialSolution(SolutionVector& sol, const Problem& problem) using GridGeometry = std::decay_t<decltype(gg)>; // box method - if constexpr (GridGeometry::discMethod == DiscretizationMethod::box) + if constexpr (GridGeometry::discMethod == DiscretizationMethods::box) { constexpr int dim = GridGeometry::GridView::dimension; const auto numDofs = gg.vertexMapper().size(); @@ -79,7 +79,7 @@ void assembleInitialSolution(SolutionVector& sol, const Problem& problem) } // staggered methods - else if constexpr (GridGeometry::discMethod == DiscretizationMethod::staggered) + else if constexpr (GridGeometry::discMethod == DiscretizationMethods::staggered) { problem.applyInitialSolution(sol); } diff --git a/dumux/assembly/jacobianpattern.hh b/dumux/assembly/jacobianpattern.hh index 2dd733cef371086cb3a9fe36955f6e7bc2516ded..e28de66b28af5c4f7f35d6bc93e7b61ec43cabcb 100644 --- a/dumux/assembly/jacobianpattern.hh +++ b/dumux/assembly/jacobianpattern.hh @@ -35,7 +35,7 @@ namespace Dumux { * \brief Helper function to generate Jacobian pattern for the box method */ template<bool isImplicit, class GridGeometry, - typename std::enable_if_t<(GridGeometry::discMethod == DiscretizationMethod::box), int> = 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<bool isImplicit, class GridGeometry, - typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethod::cctpfa) - || (GridGeometry::discMethod == DiscretizationMethod::ccmpfa) ), int> = 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<bool isImplicit, class GridGeometry, - typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethod::staggered) ), int> = 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<bool isImplicit, class GridGeometry, - typename std::enable_if_t<(GridGeometry::discMethod == DiscretizationMethod::fem), int> = 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<bool isImplicit, class GridGeometry, - typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethod::fcstaggered) ), int> = 0> + typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethods::fcstaggered) ), int> = 0> Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry) { // resize the jacobian and the residual diff --git a/dumux/assembly/partialreassembler.hh b/dumux/assembly/partialreassembler.hh index de2099e710ced5c0781125df70a3fe492bd70fe9..3ac1966a1cd21863484865c5e0c4bf1c2934a0ae 100644 --- a/dumux/assembly/partialreassembler.hh +++ b/dumux/assembly/partialreassembler.hh @@ -70,7 +70,7 @@ public: }; //! the partial reassembler engine specialized for discretization methods -template<class Assembler, DiscretizationMethod discMethod> +template<class Assembler, class DiscretizationMethod> class PartialReassemblerEngine { public: @@ -98,7 +98,7 @@ public: * \brief The partial reassembler engine specialized for the box method */ template<class Assembler> -class PartialReassemblerEngine<Assembler, DiscretizationMethod::box> +class PartialReassemblerEngine<Assembler, DiscretizationMethods::Box> { 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 Assembler> -class PartialReassemblerEngine<Assembler, DiscretizationMethod::cctpfa> +class PartialReassemblerEngine<Assembler, DiscretizationMethods::CCTpfa> { 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 Assembler> -class PartialReassemblerEngine<Assembler, DiscretizationMethod::ccmpfa> -: public PartialReassemblerEngine<Assembler, DiscretizationMethod::cctpfa> +class PartialReassemblerEngine<Assembler, DiscretizationMethods::CCMpfa> +: public PartialReassemblerEngine<Assembler, DiscretizationMethods::CCTpfa> { - using ParentType = PartialReassemblerEngine<Assembler, DiscretizationMethod::cctpfa>; + using ParentType = PartialReassemblerEngine<Assembler, DiscretizationMethods::CCTpfa>; 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<Assembler, discMethod>; + using DiscretizationMethod = typename GridGeometry::DiscretizationMethod; + using Engine = PartialReassemblerEngine<Assembler, DiscretizationMethod>; public: diff --git a/dumux/common/fvproblem.hh b/dumux/common/fvproblem.hh index b81375dca7b05a028d76825f2a1937d6f8f6ceb9..7f53a85ae08d03cde982b8b983cbab2d689a7d29 100644 --- a/dumux/common/fvproblem.hh +++ b/dumux/common/fvproblem.hh @@ -71,8 +71,8 @@ class FVProblem using PointSourceMap = std::map< std::pair<std::size_t, std::size_t>, std::vector<PointSource> >; - 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<TypeTag, Properties::Scalar>; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; diff --git a/dumux/common/pointsource.hh b/dumux/common/pointsource.hh index 3eda1766f34c5603eaab2b30464e9f2f4b48dc0b..eaf3b3f6bd901c2b07a52964bdb3fcf9b63ed353 100644 --- a/dumux/common/pointsource.hh +++ b/dumux/common/pointsource.hh @@ -301,7 +301,7 @@ public: // split the source values equally among all concerned entities source.setEmbeddings(entities.size()*source.embeddings()); - if constexpr (GridGeometry::discMethod == DiscretizationMethod::box) + if constexpr (GridGeometry::discMethod == DiscretizationMethods::box) { // loop over all concerned elements auto fvGeometry = localView(gridGeometry); diff --git a/dumux/common/typetraits/problem.hh b/dumux/common/typetraits/problem.hh index 0131254abd3831b190cb0ac61025ca26c5a5c4a3..64570dea8df19811f2e425faf554f5eae50ef4d9 100644 --- a/dumux/common/typetraits/problem.hh +++ b/dumux/common/typetraits/problem.hh @@ -31,7 +31,7 @@ namespace Dumux { // forward declare namespace Detail { -template<class Problem, DiscretizationMethod dm> +template<class Problem, class DiscretizationMethod> struct ProblemTraits; } // end namespace Detail @@ -43,7 +43,7 @@ template<class Problem> struct ProblemTraits { using GridGeometry = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>; - using BoundaryTypes = typename Detail::template ProblemTraits<Problem, GridGeometry::discMethod>::BoundaryTypes; + using BoundaryTypes = typename Detail::template ProblemTraits<Problem, typename GridGeometry::DiscretizationMethod>::BoundaryTypes; }; } // end namespace Dumux diff --git a/dumux/discretization/box.hh b/dumux/discretization/box.hh index 7ec91488a925c62821935a6e1e1500617adbddf2..59669c347fddb697440a5f6fb3896d474e42741c 100644 --- a/dumux/discretization/box.hh +++ b/dumux/discretization/box.hh @@ -110,7 +110,7 @@ struct BaseLocalResidual<TypeTag, TTag::BoxModel> { using type = BoxLocalResidua namespace Detail { template<class Problem> -struct ProblemTraits<Problem, DiscretizationMethod::box> +struct ProblemTraits<Problem, DiscretizationMethods::Box> { private: using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>; diff --git a/dumux/discretization/box/elementsolution.hh b/dumux/discretization/box/elementsolution.hh index caf00f7fd8595172fcbfbd729ecbce4f6c468bf5..c11c145582f05a57d8d4fded5086ad8214af68a1 100644 --- a/dumux/discretization/box/elementsolution.hh +++ b/dumux/discretization/box/elementsolution.hh @@ -116,7 +116,7 @@ private: */ template<class Element, class SolutionVector, class GridGeometry> auto elementSolution(const Element& element, const SolutionVector& sol, const GridGeometry& gg) --> std::enable_if_t<GridGeometry::discMethod == DiscretizationMethod::box, +-> std::enable_if_t<GridGeometry::discMethod == DiscretizationMethods::box, BoxElementSolution<typename GridGeometry::LocalView, std::decay_t<decltype(std::declval<SolutionVector>()[0])>> > @@ -131,7 +131,7 @@ auto elementSolution(const Element& element, const SolutionVector& sol, const Gr */ template<class Element, class ElementVolumeVariables, class FVElementGeometry> auto elementSolution(const Element& element, const ElementVolumeVariables& elemVolVars, const FVElementGeometry& gg) --> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::box, +-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::box, BoxElementSolution<FVElementGeometry, typename ElementVolumeVariables::VolumeVariables::PrimaryVariables>> { diff --git a/dumux/discretization/box/fvgridgeometry.hh b/dumux/discretization/box/fvgridgeometry.hh index 95938a6bd58a8f31eb59b11a72b17943db1afe07..d2ea779d43f3dc72460848e50539000529e59309 100644 --- a/dumux/discretization/box/fvgridgeometry.hh +++ b/dumux/discretization/box/fvgridgeometry.hh @@ -97,8 +97,9 @@ class BoxFVGridGeometry<Scalar, GV, true, Traits> 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<ThisType, true>; @@ -385,8 +386,9 @@ class BoxFVGridGeometry<Scalar, GV, false, Traits> 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<ThisType, false>; diff --git a/dumux/discretization/box/scvftoscvboundarytypes.hh b/dumux/discretization/box/scvftoscvboundarytypes.hh index 12ec51306d6d21532ef0c317815f1470df918009..857d4f1b180e28009a401dca2ac954e80ff93b9b 100644 --- a/dumux/discretization/box/scvftoscvboundarytypes.hh +++ b/dumux/discretization/box/scvftoscvboundarytypes.hh @@ -34,7 +34,7 @@ namespace Dumux { * \ingroup BoxDiscretization * \brief Convert intersection boundary types to vertex boundary types */ -template<class BoundaryTypes, DiscretizationMethod discMethod> +template<class BoundaryTypes, class DiscretizationMethod> class ScvfToScvBoundaryTypes { public: @@ -44,7 +44,7 @@ public: void computeBoundaryTypes(const Problem& problem) { // only do something for box - if (discMethod == DiscretizationMethod::box) + if (DiscretizationMethod{} == DiscretizationMethods::box) { const auto& gridGeometry = problem.gridGeometry(); scvBoundaryTypes.resize(gridGeometry.vertexMapper().size()); @@ -81,7 +81,7 @@ public: template<class SubControlVolume> const BoundaryTypes& boundaryTypes(const SubControlVolume& scv) const { - if (discMethod == DiscretizationMethod::box) + if (DiscretizationMethod{} == DiscretizationMethods::box) return scvBoundaryTypes[scv.dofIndex()]; else DUNE_THROW(Dune::InvalidStateException, "Only use this for the box discretization!"); diff --git a/dumux/discretization/ccmpfa.hh b/dumux/discretization/ccmpfa.hh index 2d0e9e1182b9a77653aadadc668a7db71f1424c3..fbd738fae081515383a353a380995cc49e22e468 100644 --- a/dumux/discretization/ccmpfa.hh +++ b/dumux/discretization/ccmpfa.hh @@ -163,7 +163,7 @@ struct BaseLocalResidual<TypeTag, TTag::CCMpfaModel> { using type = CCLocalResid namespace Detail { template<class Problem> -struct ProblemTraits<Problem, DiscretizationMethod::ccmpfa> +struct ProblemTraits<Problem, DiscretizationMethods::CCMpfa> { private: using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>; diff --git a/dumux/discretization/cctpfa.hh b/dumux/discretization/cctpfa.hh index 0735de0923d6340b25a5a285b3d58018b5ac3270..3447dc2c942b18fbddfb266bcde2e61d1a8c6706 100644 --- a/dumux/discretization/cctpfa.hh +++ b/dumux/discretization/cctpfa.hh @@ -99,7 +99,7 @@ struct BaseLocalResidual<TypeTag, TTag::CCTpfaModel> { using type = CCLocalResid namespace Detail { template<class Problem> -struct ProblemTraits<Problem, DiscretizationMethod::cctpfa> +struct ProblemTraits<Problem, DiscretizationMethods::CCTpfa> { private: using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>; diff --git a/dumux/discretization/cellcentered/elementsolution.hh b/dumux/discretization/cellcentered/elementsolution.hh index 5aabd0934e329694e58a65ba5ab512c42e05089d..c8b23c16c79ef0567f5313bf04a4ea08cfec21cf 100644 --- a/dumux/discretization/cellcentered/elementsolution.hh +++ b/dumux/discretization/cellcentered/elementsolution.hh @@ -111,8 +111,8 @@ private: */ template<class Element, class SolutionVector, class GridGeometry> auto elementSolution(const Element& element, const SolutionVector& sol, const GridGeometry& gg) --> std::enable_if_t<GridGeometry::discMethod == DiscretizationMethod::cctpfa || - GridGeometry::discMethod == DiscretizationMethod::ccmpfa, +-> std::enable_if_t<GridGeometry::discMethod == DiscretizationMethods::cctpfa || + GridGeometry::discMethod == DiscretizationMethods::ccmpfa, CCElementSolution<typename GridGeometry::LocalView, std::decay_t<decltype(std::declval<SolutionVector>()[0])>> > @@ -127,8 +127,8 @@ auto elementSolution(const Element& element, const SolutionVector& sol, const Gr */ template<class Element, class ElementVolumeVariables, class FVElementGeometry> auto elementSolution(const Element& element, const ElementVolumeVariables& elemVolVars, const FVElementGeometry& gg) --> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::cctpfa || - FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::ccmpfa, +-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::cctpfa || + FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::ccmpfa, CCElementSolution<FVElementGeometry, typename ElementVolumeVariables::VolumeVariables::PrimaryVariables>> { using PrimaryVariables = typename ElementVolumeVariables::VolumeVariables::PrimaryVariables; @@ -142,8 +142,8 @@ auto elementSolution(const Element& element, const ElementVolumeVariables& elemV */ template<class FVElementGeometry, class PrimaryVariables> auto elementSolution(PrimaryVariables&& priVars) --> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::cctpfa || - FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::ccmpfa, +-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::cctpfa || + FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::ccmpfa, CCElementSolution<FVElementGeometry, PrimaryVariables>> { return CCElementSolution<FVElementGeometry, PrimaryVariables>(std::move(priVars)); @@ -156,8 +156,8 @@ auto elementSolution(PrimaryVariables&& priVars) */ template<class FVElementGeometry, class PrimaryVariables> auto elementSolution(const PrimaryVariables& priVars) --> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::cctpfa || - FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::ccmpfa, +-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::cctpfa || + FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::ccmpfa, CCElementSolution<FVElementGeometry, PrimaryVariables>> { return CCElementSolution<FVElementGeometry, PrimaryVariables>(priVars); diff --git a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh index f29ba01a9175f47102a3947d0e002118d1ae1439..7ea6b01127727f5ef19da75f162c9a3adb7c815b 100644 --- a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh @@ -56,7 +56,7 @@ template<class GridView> void checkOverlapSizeCCMpfa(const GridView& gridView) { // Check if the overlap size is what we expect - if (!CheckOverlapSize<DiscretizationMethod::ccmpfa>::isValid(gridView)) + if (!CheckOverlapSize<DiscretizationMethods::CCMpfa>::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<ThisType>; //! 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<ThisType>; //! export the discretization method this geometry belongs to - static constexpr DiscretizationMethod discMethod = DiscretizationMethod::ccmpfa; + using DiscretizationMethod = DiscretizationMethods::CCMpfa; + static constexpr DiscretizationMethod discMethod{}; //! The maximum admissible stencil size (used for static memory allocation during assembly) static constexpr int maxElementStencilSize = Traits::maxElementStencilSize; diff --git a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh index 538031d5f49b63b829def74a8fbb8aaee110c6a1..8c5e6c670238188b8870963878c4d7663419ec1b 100644 --- a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh @@ -112,7 +112,8 @@ public: using DofMapper = typename Traits::ElementMapper; //! export the discretization method this geometry belongs to - static constexpr DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + using DiscretizationMethod = DiscretizationMethods::CCTpfa; + static constexpr DiscretizationMethod discMethod{}; //! The maximum admissible stencil size (used for static memory allocation during assembly) static constexpr int maxElementStencilSize = LocalView::maxNumElementScvfs*Traits::maxNumScvfNeighbors + 1; @@ -125,7 +126,7 @@ public: : ParentType(gridView) { // Check if the overlap size is what we expect - if (!CheckOverlapSize<DiscretizationMethod::cctpfa>::isValid(gridView)) + if (!CheckOverlapSize<DiscretizationMethod>::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<DiscretizationMethod::cctpfa>::isValid(gridView)) + if (!CheckOverlapSize<DiscretizationMethod>::isValid(gridView)) DUNE_THROW(Dune::InvalidStateException, "The cctpfa discretization method needs at least an overlap of 1 for parallel computations. " << " Set the parameter \"Grid.Overlap\" in the input file."); diff --git a/dumux/discretization/checkoverlapsize.hh b/dumux/discretization/checkoverlapsize.hh index 68243af08991de74be20cbd280bc9bcb85174d10..cbea9b76a7b66fbc0341456e1b3e332749a81b32 100644 --- a/dumux/discretization/checkoverlapsize.hh +++ b/dumux/discretization/checkoverlapsize.hh @@ -35,7 +35,7 @@ namespace Dumux { * \note for sequential grids every overlap is fine * \note specialize this for your discretization method if the default doesn't apply */ -template<DiscretizationMethod discMethod> +template<class DiscretizationMethod> struct CheckOverlapSize { template<class GridView> @@ -45,7 +45,7 @@ struct CheckOverlapSize //! specialization for the box method which requires an overlap size of 0 template<> -struct CheckOverlapSize<DiscretizationMethod::box> +struct CheckOverlapSize<DiscretizationMethods::Box> { template<class GridView> static bool isValid(const GridView& gridView) noexcept @@ -55,7 +55,7 @@ struct CheckOverlapSize<DiscretizationMethod::box> //! 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<DiscretizationMethod::fem> +struct CheckOverlapSize<DiscretizationMethods::FEM> { template<class FEBasis> static bool isValid(const FEBasis& feBasis) noexcept @@ -64,7 +64,7 @@ struct CheckOverlapSize<DiscretizationMethod::fem> // fc staggered requires an overlap of exactly 1 template<> -struct CheckOverlapSize<DiscretizationMethod::fcstaggered> +struct CheckOverlapSize<DiscretizationMethods::FCStaggered> { template<class GridView> static bool isValid(const GridView& gridView) noexcept diff --git a/dumux/discretization/facecentered/staggered/elementsolution.hh b/dumux/discretization/facecentered/staggered/elementsolution.hh index 535e632f4390467d6e9b1873642ff0e69f9bfdb8..05936fee71f52b62e4dc29d17788728055d97577 100644 --- a/dumux/discretization/facecentered/staggered/elementsolution.hh +++ b/dumux/discretization/facecentered/staggered/elementsolution.hh @@ -129,7 +129,7 @@ private: template<class Element, class SolutionVector, class GridGeometry> 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<decltype(std::declval<SolutionVector>()[0])> @@ -144,7 +144,7 @@ auto elementSolution(const Element& element, const SolutionVector& sol, const Gr template<class Element, class ElementVolumeVariables, class FVElementGeometry> 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<class FVElementGeometry, class PrimaryVariables> auto elementSolution(PrimaryVariables&& priVars) -> std::enable_if_t< - FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::fcstaggered, + FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::fcstaggered, FaceCenteredStaggeredElementSolution< FVElementGeometry, std::decay_t<PrimaryVariables> diff --git a/dumux/discretization/facecentered/staggered/fvgridgeometry.hh b/dumux/discretization/facecentered/staggered/fvgridgeometry.hh index 18af7159e96a1d63d70189f4e7ae20ffaff2c0fb..9c289fd046fef5aaee0426225685983a31bcfb71 100644 --- a/dumux/discretization/facecentered/staggered/fvgridgeometry.hh +++ b/dumux/discretization/facecentered/staggered/fvgridgeometry.hh @@ -115,8 +115,10 @@ class FaceCenteredStaggeredFVGridGeometry<GV, true, Traits> 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<DiscretizationMethod::fcstaggered>::isValid(gridView)) + if (!CheckOverlapSize<DiscretizationMethod>::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<GV, false, Traits> + 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<DiscretizationMethod::fcstaggered>::isValid(gridView)) + if (!CheckOverlapSize<DiscretizationMethod>::isValid(gridView)) DUNE_THROW(Dune::InvalidStateException, "The staggered discretization method needs at least an overlap of 1 for parallel computations. " << " Set the parameter \"Grid.Overlap\" in the input file."); diff --git a/dumux/discretization/fcstaggered.hh b/dumux/discretization/fcstaggered.hh index c950aec44e7cbf3339ff77cd1377b632e786b866..6de37e6114c1bcef7748a788d37c8fe238d3cd5f 100644 --- a/dumux/discretization/fcstaggered.hh +++ b/dumux/discretization/fcstaggered.hh @@ -118,7 +118,7 @@ public: namespace Dumux::Detail { template<class Problem> -struct ProblemTraits<Problem, DiscretizationMethod::fcstaggered> +struct ProblemTraits<Problem, DiscretizationMethods::FCStaggered> { private: using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>; diff --git a/dumux/discretization/fem/fegridgeometry.hh b/dumux/discretization/fem/fegridgeometry.hh index fff2242c474e9650a11f55a7e8ea632c2c6de92b..8f00843a1b75eeaf355cd0db6e602287546f27e6 100644 --- a/dumux/discretization/fem/fegridgeometry.hh +++ b/dumux/discretization/fem/fegridgeometry.hh @@ -69,8 +69,9 @@ class FEGridGeometry using LocalIndexType = typename IndexTraits<typename FEB::GridView>::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<DiscretizationMethod::fem>::isValid(*feBasis)) + if (!CheckOverlapSize<DiscretizationMethod>::isValid(*feBasis)) DUNE_THROW(Dune::InvalidStateException, "The finite element discretization method only works with zero overlap for parallel computations. " << " Set the parameter \"Grid.Overlap\" in the input file."); } diff --git a/dumux/discretization/fluxstencil.hh b/dumux/discretization/fluxstencil.hh index f671e143b3621aefc4d5eaa476a3afe8931b60fd..d49fdf39b351fb56c0c1b09520856b3cda58c550 100644 --- a/dumux/discretization/fluxstencil.hh +++ b/dumux/discretization/fluxstencil.hh @@ -41,7 +41,7 @@ namespace Dumux { * since we use the flux stencil for matrix and assembly. This might lead to some zeros stored * in the matrix. */ -template<class FVElementGeometry, DiscretizationMethod discMethod = FVElementGeometry::GridGeometry::discMethod> +template<class FVElementGeometry, class DiscretizationMethod = typename FVElementGeometry::GridGeometry::DiscretizationMethod> class FluxStencil; /* @@ -50,7 +50,7 @@ class FluxStencil; * \tparam FVElementGeometry The local view on the finite volume grid geometry */ template<class FVElementGeometry> -class FluxStencil<FVElementGeometry, DiscretizationMethod::cctpfa> +class FluxStencil<FVElementGeometry, DiscretizationMethods::CCTpfa> { 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 FVElementGeometry> -class FluxStencil<FVElementGeometry, DiscretizationMethod::ccmpfa> +class FluxStencil<FVElementGeometry, DiscretizationMethods::CCMpfa> { using GridGeometry = typename FVElementGeometry::GridGeometry; using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace; diff --git a/dumux/discretization/functionspacebasis.hh b/dumux/discretization/functionspacebasis.hh index dc7cad7fb970d9a1123d61d1ec69b98d11b5bbfe..ab43af0cbbe0b16551ffb77ef5dcc0141ff56057 100644 --- a/dumux/discretization/functionspacebasis.hh +++ b/dumux/discretization/functionspacebasis.hh @@ -40,8 +40,7 @@ namespace Dumux { * scheme underlying a grid geometry class. Specializations * of the traits for different schemes are provided below. */ -template< class GridGeometry, - DiscretizationMethod dm = GridGeometry::discMethod > +template< class GridGeometry, class DiscretizationMethod = typename GridGeometry::DiscretizationMethod > struct FunctionSpaceBasisTraits; /*! @@ -49,7 +48,7 @@ struct FunctionSpaceBasisTraits; * \brief Creates a Dune::Functions object of the underlying basis * of a discretization scheme that is not finite elements. */ -template<class GridGeometry, std::enable_if_t<GridGeometry::discMethod != DiscretizationMethod::fem, int> = 0> +template<class GridGeometry, std::enable_if_t<GridGeometry::discMethod != DiscretizationMethods::fem, int> = 0> typename FunctionSpaceBasisTraits<GridGeometry>::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<class GridGeometry, std::enable_if_t<GridGeometry::discMethod == DiscretizationMethod::fem, int> = 0> +template<class GridGeometry, std::enable_if_t<GridGeometry::discMethod == DiscretizationMethods::fem, int> = 0> const typename FunctionSpaceBasisTraits<GridGeometry>::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<GridGeometry, DiscretizationMethod::box> +struct FunctionSpaceBasisTraits<GridGeometry, DiscretizationMethods::Box> { using GlobalBasis = Dune::Functions::LagrangeBasis<typename GridGeometry::GridView, /*order*/1>; }; //! Traits specialization: cc schemes use lagrange bases of order 0 template< class GridGeometry > -struct FunctionSpaceBasisTraits<GridGeometry, DiscretizationMethod::cctpfa> +struct FunctionSpaceBasisTraits<GridGeometry, DiscretizationMethods::CCTpfa> { using GlobalBasis = Dune::Functions::LagrangeBasis<typename GridGeometry::GridView, /*order*/0>; }; //! Traits specialization: cc schemes use lagrange bases of order 0 template< class GridGeometry > -struct FunctionSpaceBasisTraits<GridGeometry, DiscretizationMethod::ccmpfa> +struct FunctionSpaceBasisTraits<GridGeometry, DiscretizationMethods::CCMpfa> { using GlobalBasis = Dune::Functions::LagrangeBasis<typename GridGeometry::GridView, /*order*/0>; }; //! Traits specialization: fem defines its basis template< class GridGeometry > -struct FunctionSpaceBasisTraits<GridGeometry, DiscretizationMethod::fem> +struct FunctionSpaceBasisTraits<GridGeometry, DiscretizationMethods::FEM> { using GlobalBasis = typename GridGeometry::FEBasis; }; } // end namespace Dumux diff --git a/dumux/discretization/method.hh b/dumux/discretization/method.hh index 255c0061fa880b582f57651f0c377c836dd5c59e..8da080bdd7691c7cf1771c2231f21ecf79ef8fbd 100644 --- a/dumux/discretization/method.hh +++ b/dumux/discretization/method.hh @@ -27,6 +27,8 @@ #include <ostream> #include <string> +#include <dumux/common/tag.hh> + namespace Dumux { /*! @@ -41,10 +43,112 @@ enum class DiscretizationMethod none, box, cctpfa, ccmpfa, staggered, fem, fcstaggered }; + +namespace DiscretizationMethods { + +struct CCTpfa : public Utility::Tag<CCTpfa> { + 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<CCMpfa> { + 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<Box> { + 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<Staggered> { + 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<FEM> { + 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<FCStaggered> { + 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<None> { + static std::string name() { return "none"; } + + //conversion operator + [[deprecated("Conversion to enum is deprecated. Will be removed after 3.5. Use tags.")]] + constexpr operator DiscretizationMethod() const + { + return DiscretizationMethod::none; + } +}; + + +inline constexpr CCTpfa cctpfa{}; +inline constexpr CCMpfa ccmpfa{}; +inline constexpr Box box{}; +inline constexpr Staggered staggered{}; +inline constexpr FEM fem{}; +inline constexpr FCStaggered fcstaggered{}; +inline constexpr None none{}; + +} // end namespace DiscretizationMethods + /*! * \brief Convert discretization method to string * \ingroup Discretization */ +[[deprecated("Use discretization tags and their name attribute. Will be removed after 3.5")]] inline std::string toString(DiscretizationMethod m) { switch (m) @@ -63,8 +167,24 @@ inline std::string toString(DiscretizationMethod m) * \brief Write discretization method to stream * \ingroup Discretization */ +[[deprecated("Use discretization tags which also support operator <<. Will be removed after 3.5")]] inline std::ostream& operator<<(std::ostream& stream, DiscretizationMethod m) -{ stream << toString(m); return stream; } +{ + // get rid of deprecation warning in the transition period + const auto toStringImpl = [](DiscretizationMethod m){ + switch (m) + { + case DiscretizationMethod::box: return "box"; + case DiscretizationMethod::cctpfa: return "cctpfa"; + case DiscretizationMethod::ccmpfa: return "ccmpfa"; + case DiscretizationMethod::fcstaggered: return "fcstaggered"; + case DiscretizationMethod::fem: return "fem"; + case DiscretizationMethod::staggered: return "staggered"; + default: return "none"; + } + }; + stream << toStringImpl(m); return stream; +} } // end namespace Dumux diff --git a/dumux/discretization/porenetwork/gridgeometry.hh b/dumux/discretization/porenetwork/gridgeometry.hh index ee3407341f38b4f77b784aa38526bab0255a5e60..990f17e95a94c2b051a0b14064f8fa62a8c8b183 100644 --- a/dumux/discretization/porenetwork/gridgeometry.hh +++ b/dumux/discretization/porenetwork/gridgeometry.hh @@ -510,8 +510,9 @@ class GridGeometry<Scalar, GV, true, Traits> 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<ThisType, true>; @@ -726,8 +727,9 @@ class GridGeometry<Scalar, GV, false, Traits> 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<ThisType, false>; diff --git a/dumux/discretization/staggered.hh b/dumux/discretization/staggered.hh index b5bb1345270574823f10b752b3ae74531d3a8886..3caccbd7a0a0735b32b452bf2e734dcd4265e4ac 100644 --- a/dumux/discretization/staggered.hh +++ b/dumux/discretization/staggered.hh @@ -200,7 +200,7 @@ public: namespace Detail { template<class Problem> -struct ProblemTraits<Problem, DiscretizationMethod::staggered> +struct ProblemTraits<Problem, DiscretizationMethods::Staggered> { private: using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>; diff --git a/dumux/discretization/staggered/elementsolution.hh b/dumux/discretization/staggered/elementsolution.hh index ebb23bf2a6d5d736e78e18f6eec3e171616e7414..330745749daf769e9c9576928a01d8d32964fa09 100644 --- a/dumux/discretization/staggered/elementsolution.hh +++ b/dumux/discretization/staggered/elementsolution.hh @@ -60,7 +60,7 @@ using StaggeredElementSolution = Dune::BlockVector<PrimaryVariables>; */ template<class FVElementGeometry, class PrimaryVariables> auto elementSolution(PrimaryVariables&& priVars) --> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::staggered, +-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::staggered, StaggeredElementSolution<PrimaryVariables>> { return StaggeredElementSolution<PrimaryVariables>({std::move(priVars)}); diff --git a/dumux/discretization/staggered/fvgridgeometry.hh b/dumux/discretization/staggered/fvgridgeometry.hh index ca051c30715da487b84f2b8a60050ac321fb2cc5..9e14e91c272262006372f6f057470a2fe52c2d46 100644 --- a/dumux/discretization/staggered/fvgridgeometry.hh +++ b/dumux/discretization/staggered/fvgridgeometry.hh @@ -50,7 +50,11 @@ public: //! export the GridView type and the discretization method using GridView = typename ActualGridGeometry::GridView; - static constexpr DiscretizationMethod discMethod = DiscretizationMethod::staggered; + + //! export the discretization method this geometry belongs to + using DiscretizationMethod = DiscretizationMethods::Staggered; + static constexpr DiscretizationMethod discMethod{}; + using LocalView = typename ActualGridGeometry::LocalView; /*! @@ -196,8 +200,10 @@ public: //! export the traits using Traits = typename T::PublicTraits; - //! export discretization method - static constexpr DiscretizationMethod discMethod = DiscretizationMethod::staggered; + //! export the discretization method this geometry belongs to + using DiscretizationMethod = DiscretizationMethods::Staggered; + static constexpr DiscretizationMethod discMethod{}; + static constexpr int upwindSchemeOrder = T::upwindSchemeOrder; static constexpr bool useHigherOrder = upwindSchemeOrder > 1; static constexpr bool cachingEnabled = true; @@ -238,7 +244,7 @@ public: , intersectionMapper_(gridView) { // Check if the overlap size is what we expect - if (!CheckOverlapSize<DiscretizationMethod::staggered>::isValid(gridView)) + if (!CheckOverlapSize<DiscretizationMethod>::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<DiscretizationMethod::staggered>::isValid(gridView)) + if (!CheckOverlapSize<DiscretizationMethod>::isValid(gridView)) DUNE_THROW(Dune::InvalidStateException, "The staggered discretization method needs at least an overlap of 1 for parallel computations. " << " Set the parameter \"Grid.Overlap\" in the input file."); diff --git a/dumux/flux/box/darcyslaw.hh b/dumux/flux/box/darcyslaw.hh index 0c011f5d1d8454bd831e281a3eb2a0bb4b197a2f..a1326195e31839e3725ce92242ced0086b24ad44 100644 --- a/dumux/flux/box/darcyslaw.hh +++ b/dumux/flux/box/darcyslaw.hh @@ -37,7 +37,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class DarcysLawImplementation; // forward declaration @@ -49,7 +49,7 @@ class BoxDarcysLaw; * \brief Specialization of Darcy's Law for the box method. */ template<class TypeTag> -class DarcysLawImplementation<TypeTag, DiscretizationMethod::box> +class DarcysLawImplementation<TypeTag, DiscretizationMethods::Box> : public BoxDarcysLaw<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::GridGeometry>> { }; diff --git a/dumux/flux/box/effectivestresslaw.hh b/dumux/flux/box/effectivestresslaw.hh index 629ef693e2eb65c3098a8d1f218c3c1ee1f68621..3d27b0c19378828b5d47999fa5a848c7705d61b8 100644 --- a/dumux/flux/box/effectivestresslaw.hh +++ b/dumux/flux/box/effectivestresslaw.hh @@ -39,7 +39,7 @@ namespace Dumux { * \tparam GridGeometry the finite volume grid geometry */ template<class StressType, class GridGeometry> -class EffectiveStressLaw<StressType, GridGeometry, DiscretizationMethod::box> +class EffectiveStressLaw<StressType, GridGeometry, typename GridGeometry::DiscretizationMethod> { using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; @@ -51,7 +51,7 @@ class EffectiveStressLaw<StressType, GridGeometry, DiscretizationMethod::box> static constexpr int dim = GridView::dimension; static constexpr int dimWorld = GridView::dimensionworld; static_assert(dim == dimWorld, "EffectiveStressLaw not implemented for network/surface grids"); - static_assert(StressType::discMethod == DiscretizationMethod::box, "The provided stress type must be specialized for the box scheme"); + static_assert(StressType::discMethod == DiscretizationMethods::box, "The provided stress type must be specialized for the box scheme"); public: //! export the type used for scalar values @@ -61,7 +61,10 @@ public: //! export the type used for force vectors using ForceVector = typename StressType::ForceVector; //! state the discretization method this implementation belongs to - static constexpr DiscretizationMethod discMethod = DiscretizationMethod::box; + + using DiscretizationMethod = DiscretizationMethods::Box; + // state the discretization method this implementation belongs to + static constexpr DiscretizationMethod discMethod{}; /*! * \brief Computes the force (in Newton) acting on a sub-control volume face. diff --git a/dumux/flux/box/fickslaw.hh b/dumux/flux/box/fickslaw.hh index 61b7a17b268fd9ee2d71c8006d714a8d0452eb89..0349e2549cab98b22f64b3412b803f72fc6b5f04 100644 --- a/dumux/flux/box/fickslaw.hh +++ b/dumux/flux/box/fickslaw.hh @@ -39,7 +39,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod, ReferenceSystemFormulation referenceSystem> +template<class TypeTag, class DiscretizationMethod, ReferenceSystemFormulation referenceSystem> class FicksLawImplementation; /*! @@ -47,7 +47,7 @@ class FicksLawImplementation; * \brief Specialization of Fick's Law for the box method. */ template <class TypeTag, ReferenceSystemFormulation referenceSystem> -class FicksLawImplementation<TypeTag, DiscretizationMethod::box, referenceSystem> +class FicksLawImplementation<TypeTag, DiscretizationMethods::Box, referenceSystem> { using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; diff --git a/dumux/flux/box/forchheimerslaw.hh b/dumux/flux/box/forchheimerslaw.hh index eee7bb7b327835ff76dc7f782ecc2cb657050b40..0ce29b5f0e92c4d60659a4668d6c9e27cb699c0a 100644 --- a/dumux/flux/box/forchheimerslaw.hh +++ b/dumux/flux/box/forchheimerslaw.hh @@ -39,7 +39,7 @@ namespace Dumux { // forward declarations -template<class TypeTag, class ForchheimerVelocity, DiscretizationMethod discMethod> +template<class TypeTag, class ForchheimerVelocity, class DiscretizationMethod> class ForchheimersLawImplementation; /*! @@ -59,7 +59,7 @@ class BoxForchheimersLaw; * \brief Forchheimer's law for box scheme */ template <class TypeTag, class ForchheimerVelocity> -class ForchheimersLawImplementation<TypeTag, ForchheimerVelocity, DiscretizationMethod::box> +class ForchheimersLawImplementation<TypeTag, ForchheimerVelocity, DiscretizationMethods::Box> : public BoxForchheimersLaw<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::GridGeometry>, ForchheimerVelocity> @@ -88,8 +88,9 @@ public: //! state the scalar type of the law using Scalar = ScalarType; + using DiscretizationMethod = DiscretizationMethods::Box; //! state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::box; + static constexpr DiscretizationMethod discMethod{}; /*! \brief Compute the advective flux of a phase across * the given sub-control volume face using the Forchheimer equation. diff --git a/dumux/flux/box/fourierslaw.hh b/dumux/flux/box/fourierslaw.hh index 988f87024ba23808b4cc5e06c73b294f4845006e..6a825e69464a0a4ec4a5fb42a94c06651202bab1 100644 --- a/dumux/flux/box/fourierslaw.hh +++ b/dumux/flux/box/fourierslaw.hh @@ -33,7 +33,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class FouriersLawImplementation; /*! @@ -41,7 +41,7 @@ class FouriersLawImplementation; * \brief Specialization of Fourier's Law for the box method. */ template <class TypeTag> -class FouriersLawImplementation<TypeTag, DiscretizationMethod::box> +class FouriersLawImplementation<TypeTag, DiscretizationMethods::Box> { using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; diff --git a/dumux/flux/box/fourierslawnonequilibrium.hh b/dumux/flux/box/fourierslawnonequilibrium.hh index 40bf51f39aef1038576543180a6a6e864454e53f..22ea175d80443dd893be1e4722cb37f87ba2f2db 100644 --- a/dumux/flux/box/fourierslawnonequilibrium.hh +++ b/dumux/flux/box/fourierslawnonequilibrium.hh @@ -36,7 +36,7 @@ namespace Dumux { // forward declaration -template <class TypeTag, DiscretizationMethod discMethod> +template <class TypeTag, class DiscretizationMethod> class FouriersLawNonEquilibriumImplementation; /*! @@ -44,7 +44,7 @@ class FouriersLawNonEquilibriumImplementation; * \brief Specialization of Fourier's Law for the box method for thermal nonequilibrium models. */ template <class TypeTag> -class FouriersLawNonEquilibriumImplementation<TypeTag, DiscretizationMethod::box> +class FouriersLawNonEquilibriumImplementation<TypeTag, DiscretizationMethods::Box> { using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; diff --git a/dumux/flux/box/hookeslaw.hh b/dumux/flux/box/hookeslaw.hh index e7dfe838321cd666573bddac73aaeadae9b5f2e7..f750acd26f406ce194ac6f516d49a8773decaeea 100644 --- a/dumux/flux/box/hookeslaw.hh +++ b/dumux/flux/box/hookeslaw.hh @@ -40,7 +40,7 @@ namespace Dumux { * \tparam GridGeometry the grid geometry */ template<class ScalarType, class GridGeometry> -class HookesLaw<ScalarType, GridGeometry, DiscretizationMethod::box> +class HookesLaw<ScalarType, GridGeometry, typename GridGeometry::DiscretizationMethod> { 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. diff --git a/dumux/flux/box/maxwellstefanslaw.hh b/dumux/flux/box/maxwellstefanslaw.hh index 76b2b5b583eec0b405a467fb924ffbfd5d32cc30..fa2a845e9a7109e87200e7986ef7230c177cba63 100644 --- a/dumux/flux/box/maxwellstefanslaw.hh +++ b/dumux/flux/box/maxwellstefanslaw.hh @@ -40,7 +40,7 @@ namespace Dumux { // forward declaration -template <class TypeTag, DiscretizationMethod discMethod, ReferenceSystemFormulation referenceSystem> +template <class TypeTag, class DiscretizationMethod, ReferenceSystemFormulation referenceSystem> class MaxwellStefansLawImplementation; /*! @@ -48,7 +48,7 @@ class MaxwellStefansLawImplementation; * \brief Specialization of Maxwell Stefan's Law for the Box method. */ template <class TypeTag, ReferenceSystemFormulation referenceSystem> -class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::box, referenceSystem> +class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethods::Box, referenceSystem> { using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; diff --git a/dumux/flux/ccmpfa/darcyslaw.hh b/dumux/flux/ccmpfa/darcyslaw.hh index 97a5a3a2d87afbd2fa80c96fa26652c896941e55..9627f8e7ac44b34bd55507ab1b5198c903bfadef 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<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class DarcysLawImplementation; /*! @@ -44,7 +44,7 @@ class DarcysLawImplementation; * with multi-point flux approximation. */ template<class TypeTag> -class DarcysLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> +class DarcysLawImplementation<TypeTag, DiscretizationMethods::CCMpfa> { using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; @@ -151,8 +151,9 @@ class DarcysLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> }; 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 0e13b4eebcb836c108ce9aecf0b828efc94bb5e2..071a9b2e230db1a355d1791c9020477b4d792887 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<class TypeTag, DiscretizationMethod discMethod, ReferenceSystemFormulation referenceSystem> +template<class TypeTag, class DiscretizationMethod, ReferenceSystemFormulation referenceSystem> 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 TypeTag, ReferenceSystemFormulation referenceSystem> -class FicksLawImplementation<TypeTag, DiscretizationMethod::ccmpfa, referenceSystem> +class FicksLawImplementation<TypeTag, DiscretizationMethods::CCMpfa, referenceSystem> { using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; @@ -162,8 +162,9 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::ccmpfa, referenceSys }; public: + using DiscretizationMethod = DiscretizationMethods::CCMpfa; // state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::ccmpfa; + static constexpr DiscretizationMethod discMethod{}; //return the reference system static constexpr ReferenceSystemFormulation referenceSystemFormulation() diff --git a/dumux/flux/ccmpfa/fourierslaw.hh b/dumux/flux/ccmpfa/fourierslaw.hh index 55fe8dbd46080d2d949a01e2790ae07d481a3c38..c094d4abed78a36fd396328877160887171a8319 100644 --- a/dumux/flux/ccmpfa/fourierslaw.hh +++ b/dumux/flux/ccmpfa/fourierslaw.hh @@ -33,7 +33,7 @@ namespace Dumux { //! forward declaration of the method-specific implementation -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> 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 TypeTag> -class FouriersLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> +class FouriersLawImplementation<TypeTag, DiscretizationMethods::CCMpfa> { using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; @@ -148,8 +148,9 @@ class FouriersLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> }; 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 98e6bc3f7a9c74b6ed64ffceace972c4ce4d2dc1..fa9b7eb164d3e07f112da1952d70c41352ff40bd 100644 --- a/dumux/flux/cctpfa/darcyslaw.hh +++ b/dumux/flux/cctpfa/darcyslaw.hh @@ -35,7 +35,7 @@ namespace Dumux { // forward declarations -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> 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 TypeTag> -class DarcysLawImplementation<TypeTag, DiscretizationMethod::cctpfa> +class DarcysLawImplementation<TypeTag, DiscretizationMethods::CCTpfa> : public CCTpfaDarcysLaw<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::GridGeometry>, (GetPropType<TypeTag, Properties::GridGeometry>::GridView::dimension < GetPropType<TypeTag, Properties::GridGeometry>::GridView::dimensionworld)> @@ -145,8 +145,9 @@ class CCTpfaDarcysLaw<ScalarType, GridGeometry, /*isNetwork*/ false> //! 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<ThisType, GridGeometry>; @@ -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<ThisType, GridGeometry>; diff --git a/dumux/flux/cctpfa/fickslaw.hh b/dumux/flux/cctpfa/fickslaw.hh index 29c1aa8ea5641f7dd2b87f67145a32fd81616952..7876e600e10a2c092cf7cba2eb4f0f0024d1aa86 100644 --- a/dumux/flux/cctpfa/fickslaw.hh +++ b/dumux/flux/cctpfa/fickslaw.hh @@ -39,7 +39,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod, ReferenceSystemFormulation referenceSystem> +template<class TypeTag, class DiscretizationMethod, ReferenceSystemFormulation referenceSystem> 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 TypeTag, ReferenceSystemFormulation referenceSystem> -class FicksLawImplementation<TypeTag, DiscretizationMethod::cctpfa, referenceSystem> +class FicksLawImplementation<TypeTag, DiscretizationMethods::CCTpfa, referenceSystem> { - using Implementation = FicksLawImplementation<TypeTag, DiscretizationMethod::cctpfa, referenceSystem>; + using Implementation = FicksLawImplementation<TypeTag, DiscretizationMethods::CCTpfa, referenceSystem>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; @@ -117,8 +117,10 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::cctpfa, referenceSys }; 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/cctpfa/forchheimerslaw.hh b/dumux/flux/cctpfa/forchheimerslaw.hh index ccc07f448e7efa74f7e630c0d5ad3feea9c460b8..7e1065254d36b73fb6d62bda8c381e74bb6a1a8b 100644 --- a/dumux/flux/cctpfa/forchheimerslaw.hh +++ b/dumux/flux/cctpfa/forchheimerslaw.hh @@ -39,7 +39,7 @@ namespace Dumux { // forward declarations -template<class TypeTag, class ForchheimerVelocity, DiscretizationMethod discMethod> +template<class TypeTag, class ForchheimerVelocity, class DiscretizationMethod> 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 TypeTag, class ForchheimerVelocity> -class ForchheimersLawImplementation<TypeTag, ForchheimerVelocity, DiscretizationMethod::cctpfa> +class ForchheimersLawImplementation<TypeTag, ForchheimerVelocity, DiscretizationMethods::CCTpfa> : public CCTpfaForchheimersLaw<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::GridGeometry>, ForchheimerVelocity, @@ -157,8 +157,9 @@ class CCTpfaForchheimersLaw<ScalarType, GridGeometry, ForchheimerVelocity, /*isN //! 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 = TpfaForchheimersLawCache<ThisType, GridGeometry>; diff --git a/dumux/flux/cctpfa/fourierslaw.hh b/dumux/flux/cctpfa/fourierslaw.hh index 90fa112ac94a112037a00600cd9c365f7957a89b..ac3b95b99cd5c2b2440d963fe3bbf0ab1b8d9889 100644 --- a/dumux/flux/cctpfa/fourierslaw.hh +++ b/dumux/flux/cctpfa/fourierslaw.hh @@ -34,7 +34,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> 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 TypeTag> -class FouriersLawImplementation<TypeTag, DiscretizationMethod::cctpfa> +class FouriersLawImplementation<TypeTag, DiscretizationMethods::CCTpfa> { - using Implementation = FouriersLawImplementation<TypeTag, DiscretizationMethod::cctpfa>; + using Implementation = FouriersLawImplementation<TypeTag, DiscretizationMethods::CCTpfa>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; @@ -103,8 +103,9 @@ class FouriersLawImplementation<TypeTag, DiscretizationMethod::cctpfa> }; 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 cf0dc419c7ecfe3fc6398a84d92e936ee26e4c1f..a2ddb1e83d8db26a494b14825936567240d26660 100644 --- a/dumux/flux/cctpfa/fourierslawnonequilibrium.hh +++ b/dumux/flux/cctpfa/fourierslawnonequilibrium.hh @@ -33,7 +33,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> 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 TypeTag> -class FouriersLawNonEquilibriumImplementation<TypeTag, DiscretizationMethod::cctpfa> +class FouriersLawNonEquilibriumImplementation<TypeTag, DiscretizationMethods::CCTpfa> { - using Implementation = FouriersLawNonEquilibriumImplementation<TypeTag, DiscretizationMethod::cctpfa>; + using Implementation = FouriersLawNonEquilibriumImplementation<TypeTag, DiscretizationMethods::CCTpfa>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; @@ -66,8 +66,9 @@ class FouriersLawNonEquilibriumImplementation<TypeTag, DiscretizationMethod::cct static constexpr auto sPhaseIdx = ModelTraits::numFluidPhases(); public: + using DiscretizationMethod = DiscretizationMethods::CCTpfa; //! state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + static constexpr DiscretizationMethod discMethod{}; using Cache = FluxVariablesCaching::EmptyHeatConductionCache; diff --git a/dumux/flux/cctpfa/maxwellstefanslaw.hh b/dumux/flux/cctpfa/maxwellstefanslaw.hh index 87b3fd4717b0a6e69db2633229219068aa3b94cb..89f3a1a48a61850a5f84341a24eec32c20edf1aa 100644 --- a/dumux/flux/cctpfa/maxwellstefanslaw.hh +++ b/dumux/flux/cctpfa/maxwellstefanslaw.hh @@ -40,7 +40,7 @@ namespace Dumux { // forward declaration -template <class TypeTag, DiscretizationMethod discMethod, ReferenceSystemFormulation referenceSystem> +template <class TypeTag, class DiscretizationMethod, ReferenceSystemFormulation referenceSystem> class MaxwellStefansLawImplementation; /*! @@ -48,7 +48,7 @@ class MaxwellStefansLawImplementation; * \brief Specialization of Maxwell Stefan's Law for the CCTpfa method. */ template <class TypeTag, ReferenceSystemFormulation referenceSystem> -class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::cctpfa, referenceSystem > +class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethods::CCTpfa, referenceSystem > { using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; @@ -78,8 +78,10 @@ class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::cctpfa, ref using ReducedComponentMatrix = Dune::FieldMatrix<Scalar, numComponents-1, numComponents-1>; 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 9cba7efb4f19fca6af8b270dbe9bd32579184ff3..f69444c70212d1a3b7bf1e64c921f28e74306ab7 100644 --- a/dumux/flux/darcyslaw_fwd.hh +++ b/dumux/flux/darcyslaw_fwd.hh @@ -33,7 +33,7 @@ namespace Dumux { // declaration of primary template -template <class TypeTag, DiscretizationMethod discMethod> +template <class TypeTag, class DiscretizationMethod> class DarcysLawImplementation; /*! @@ -43,7 +43,7 @@ class DarcysLawImplementation; * These specializations are found in the headers included below. */ template <class TypeTag> -using DarcysLaw = DarcysLawImplementation<TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using DarcysLaw = DarcysLawImplementation<TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } // end namespace Dumux diff --git a/dumux/flux/effectivestresslaw_fwd.hh b/dumux/flux/effectivestresslaw_fwd.hh index 75e66af3e307fce9f031bad623572af9927b014b..9b2092081d550fc5d494a4b1cecc0a96676d0b3c 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 <class StressType, class GridGeometry, DiscretizationMethod dm = GridGeometry::discMethod> +template <class StressType, class GridGeometry, class DiscretizationMethod = typename GridGeometry::DiscretizationMethod> class EffectiveStressLaw; } // end namespace Dumux diff --git a/dumux/flux/fickslaw_fwd.hh b/dumux/flux/fickslaw_fwd.hh index 265c964c03004205a1bceabef2f79f461873ae43..8264f2c6c5b8a1dd7ee694eb939b8f1ffd119840 100644 --- a/dumux/flux/fickslaw_fwd.hh +++ b/dumux/flux/fickslaw_fwd.hh @@ -34,7 +34,7 @@ namespace Dumux { // declaration of primary template -template <class TypeTag, DiscretizationMethod discMethod, ReferenceSystemFormulation referenceSystem> +template <class TypeTag, class DiscretizationMethod, ReferenceSystemFormulation referenceSystem> class FicksLawImplementation; /*! @@ -42,7 +42,7 @@ class FicksLawImplementation; * \brief Evaluates the diffusive mass flux according to Fick's law */ template <class TypeTag, ReferenceSystemFormulation referenceSystem = ReferenceSystemFormulation::massAveraged> -using FicksLaw = FicksLawImplementation<TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod, referenceSystem>; +using FicksLaw = FicksLawImplementation<TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod, referenceSystem>; } // end namespace Dumux diff --git a/dumux/flux/forchheimerslaw_fwd.hh b/dumux/flux/forchheimerslaw_fwd.hh index fe008ed2ffa765e96147b7c6a03b12222a46d219..7459908e0fb1f9816f13754b7bd924c2ff415677 100644 --- a/dumux/flux/forchheimerslaw_fwd.hh +++ b/dumux/flux/forchheimerslaw_fwd.hh @@ -34,11 +34,12 @@ namespace Dumux { // definition of primary template -template <class TypeTag, class VelocityLaw, DiscretizationMethod discMethod> +template <class TypeTag, class VelocityLaw, class DiscretizationMethod> class ForchheimersLawImplementation { static_assert( - discMethod == DiscretizationMethod::cctpfa || discMethod == DiscretizationMethod::box, + GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethods::cctpfa || + GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethods::box, "Forchheimer only implemented for cctpfa or box!" ); }; @@ -57,7 +58,7 @@ using ForchheimersLaw = ForchheimersLawImplementation< GetPropType<TypeTag, Properties::GridGeometry>, GetPropType<TypeTag, Properties::FluxVariables> >, - GetPropType<TypeTag, Properties::GridGeometry>::discMethod + typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod >; } // end namespace Dumux diff --git a/dumux/flux/fourierslaw_fwd.hh b/dumux/flux/fourierslaw_fwd.hh index 1658102bfa92d39423d33d82ece65204658459f4..ef6da70c5570b009f7b6a88457b70c1493489e3b 100644 --- a/dumux/flux/fourierslaw_fwd.hh +++ b/dumux/flux/fourierslaw_fwd.hh @@ -32,7 +32,7 @@ namespace Dumux { // declaration of primary template -template <class TypeTag, DiscretizationMethod discMethod> +template <class TypeTag, class DiscretizationMethod> class FouriersLawImplementation; /*! @@ -40,7 +40,7 @@ class FouriersLawImplementation; * \brief Evaluates the heat conduction flux according to Fouriers's law */ template <class TypeTag> -using FouriersLaw = FouriersLawImplementation<TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using FouriersLaw = FouriersLawImplementation<TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } // end namespace Dumux diff --git a/dumux/flux/fourierslawnonequilibrium_fwd.hh b/dumux/flux/fourierslawnonequilibrium_fwd.hh index a940df1c0d4246f65e250347bf2f95e9a8316f57..77969c91d2d1f6c78b6f653c23ddd5a8a2a10669 100644 --- a/dumux/flux/fourierslawnonequilibrium_fwd.hh +++ b/dumux/flux/fourierslawnonequilibrium_fwd.hh @@ -31,7 +31,7 @@ namespace Dumux { // forward declaration -template <class TypeTag, DiscretizationMethod discMethod> +template <class TypeTag, class DiscretizationMethod> class FouriersLawNonEquilibriumImplementation; /*! @@ -39,7 +39,7 @@ class FouriersLawNonEquilibriumImplementation; * \brief Evaluates the heat conduction flux according to Fouriers's law */ template <class TypeTag> -using FouriersLawNonEquilibrium = FouriersLawNonEquilibriumImplementation<TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using FouriersLawNonEquilibrium = FouriersLawNonEquilibriumImplementation<TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } // end namespace Dumux diff --git a/dumux/flux/hookeslaw_fwd.hh b/dumux/flux/hookeslaw_fwd.hh index 2ee6c30c7ad8c85826c97be4d7c286b5516db698..e3cc7c4982575904e50aea2126601c84cbb59676 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 <class Scalar, class GridGeometry, DiscretizationMethod dm = GridGeometry::discMethod> +template <class Scalar, class GridGeometry, class DiscretizationMethod = typename GridGeometry::DiscretizationMethod> class HookesLaw; } // end namespace Dumux diff --git a/dumux/flux/maxwellstefanslaw_fwd.hh b/dumux/flux/maxwellstefanslaw_fwd.hh index fad0ea05a8935cc5e3d954f362127aa30938ce17..f320dd1aa8bae1a2e2873cf0d2757b376dd6ac07 100644 --- a/dumux/flux/maxwellstefanslaw_fwd.hh +++ b/dumux/flux/maxwellstefanslaw_fwd.hh @@ -32,7 +32,7 @@ namespace Dumux { // forward declaration -template <class TypeTag, DiscretizationMethod discMethod, ReferenceSystemFormulation referenceSystem> +template <class TypeTag, class DiscretizationMethod, ReferenceSystemFormulation referenceSystem> class MaxwellStefansLawImplementation; /*! @@ -40,7 +40,7 @@ class MaxwellStefansLawImplementation; * \brief Evaluates the diffusive mass flux according to Maxwell Stefan's law */ template <class TypeTag, ReferenceSystemFormulation referenceSystem = ReferenceSystemFormulation::massAveraged> -using MaxwellStefansLaw = MaxwellStefansLawImplementation<TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod, referenceSystem>; +using MaxwellStefansLaw = MaxwellStefansLawImplementation<TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod, referenceSystem>; } // end namespace Dumux diff --git a/dumux/flux/staggered/freeflow/fickslaw.hh b/dumux/flux/staggered/freeflow/fickslaw.hh index a1a36d25ae7f758df2bb91ef11acb0dac4452af9..146b025e1147b29e612dcb4b7fd9f3cc73a58135 100644 --- a/dumux/flux/staggered/freeflow/fickslaw.hh +++ b/dumux/flux/staggered/freeflow/fickslaw.hh @@ -42,7 +42,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod, ReferenceSystemFormulation referenceSystem> +template<class TypeTag, class DiscretizationMethod, ReferenceSystemFormulation referenceSystem> class FicksLawImplementation; /*! @@ -50,7 +50,7 @@ class FicksLawImplementation; * \brief Specialization of Fick's Law for the staggered free flow method. */ template <class TypeTag, ReferenceSystemFormulation referenceSystem> -class FicksLawImplementation<TypeTag, DiscretizationMethod::staggered, referenceSystem> +class FicksLawImplementation<TypeTag, DiscretizationMethods::Staggered, referenceSystem> { using Scalar = GetPropType<TypeTag, Properties::Scalar>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; @@ -72,8 +72,10 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::staggered, reference static_assert(ModelTraits::numFluidPhases() == 1, "Only one phase supported!"); public: + using DiscretizationMethod = DiscretizationMethods::Staggered; // state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::staggered; + static constexpr DiscretizationMethod discMethod{}; + //return the reference system static constexpr ReferenceSystemFormulation referenceSystemFormulation() { return referenceSystem; } diff --git a/dumux/flux/staggered/freeflow/fourierslaw.hh b/dumux/flux/staggered/freeflow/fourierslaw.hh index 578777bda0751d287e8e7693171b308bd524eb9b..1221ec07c1674065d305e775aa9e53da13ed41b6 100644 --- a/dumux/flux/staggered/freeflow/fourierslaw.hh +++ b/dumux/flux/staggered/freeflow/fourierslaw.hh @@ -34,7 +34,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class FouriersLawImplementation; /*! @@ -42,7 +42,7 @@ class FouriersLawImplementation; * \brief Specialization of Fourier's Law for the staggered free flow method. */ template <class TypeTag> -class FouriersLawImplementation<TypeTag, DiscretizationMethod::staggered> +class FouriersLawImplementation<TypeTag, DiscretizationMethods::Staggered> { using Scalar = GetPropType<TypeTag, Properties::Scalar>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; @@ -54,8 +54,9 @@ class FouriersLawImplementation<TypeTag, DiscretizationMethod::staggered> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::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 d74deb75234d4300dc7b79fc1e8f618704710d7a..d6408f78930a02e9d68cfe80a23ef9175446d173 100644 --- a/dumux/flux/staggered/freeflow/maxwellstefanslaw.hh +++ b/dumux/flux/staggered/freeflow/maxwellstefanslaw.hh @@ -38,7 +38,7 @@ namespace Dumux { // forward declaration -template <class TypeTag, DiscretizationMethod discMethod, ReferenceSystemFormulation referenceSystem> +template <class TypeTag, class DiscretizationMethod, ReferenceSystemFormulation referenceSystem> class MaxwellStefansLawImplementation; /*! @@ -46,7 +46,7 @@ class MaxwellStefansLawImplementation; * \brief Specialization of Maxwell Stefan's Law for the Staggered method. */ template <class TypeTag, ReferenceSystemFormulation referenceSystem> -class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::staggered, referenceSystem> +class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethods::Staggered, referenceSystem> { using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; @@ -75,8 +75,10 @@ class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::staggered, static_assert(referenceSystem == ReferenceSystemFormulation::massAveraged, "only the mass averaged reference system is supported for the Maxwell-Stefan formulation"); public: + using DiscretizationMethod = DiscretizationMethods::Staggered; // state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::staggered; + static constexpr DiscretizationMethod discMethod{}; + //return the reference system static constexpr ReferenceSystemFormulation referenceSystemFormulation() { return referenceSystem; } diff --git a/dumux/flux/stationaryvelocityfield.hh b/dumux/flux/stationaryvelocityfield.hh index 4f04257adb6e1b2258d9223168e1b37d9e943098..f6bab51bda800c5d4147f8819b48f96d9b4e98db 100644 --- a/dumux/flux/stationaryvelocityfield.hh +++ b/dumux/flux/stationaryvelocityfield.hh @@ -43,8 +43,9 @@ template <class Scalar> 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; diff --git a/dumux/flux/upwindscheme.hh b/dumux/flux/upwindscheme.hh index 93d92021a03154c9f2f2436fa7b82c24738ac1cc..1ccdcd052bdcc3a9cce84587c1a7a407f9faff65 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<class GridGeometry, DiscretizationMethod discMethod> +template<class GridGeometry, class DiscretizationMethod> class UpwindSchemeImpl; /*! @@ -39,7 +39,7 @@ class UpwindSchemeImpl; * This depends on the chosen discretization method. */ template<class GridGeometry> -using UpwindScheme = UpwindSchemeImpl<GridGeometry, GridGeometry::discMethod>; +using UpwindScheme = UpwindSchemeImpl<GridGeometry, typename GridGeometry::DiscretizationMethod>; namespace Detail { @@ -69,7 +69,7 @@ Scalar upwindSchemeMultiplier(const ElemVolVars& elemVolVars, //! Upwind scheme for the box method (uses the standard scheme) template<class GridGeometry> -class UpwindSchemeImpl<GridGeometry, DiscretizationMethod::box> +class UpwindSchemeImpl<GridGeometry, DiscretizationMethods::Box> { 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 GridGeometry> -class UpwindSchemeImpl<GridGeometry, DiscretizationMethod::cctpfa> +class UpwindSchemeImpl<GridGeometry, DiscretizationMethods::CCTpfa> { 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 GridGeometry> -class UpwindSchemeImpl<GridGeometry, DiscretizationMethod::ccmpfa> -: public UpwindSchemeImpl<GridGeometry, DiscretizationMethod::cctpfa> {}; +class UpwindSchemeImpl<GridGeometry, DiscretizationMethods::CCMpfa> +: public UpwindSchemeImpl<GridGeometry, DiscretizationMethods::CCTpfa> {}; } // end namespace Dumux diff --git a/dumux/freeflow/compositional/fluxvariables.hh b/dumux/freeflow/compositional/fluxvariables.hh index 7d1fadbbd769980fb0aab918fbec5d070d1ebf15..da91e4b3819af2ecd6a7d477caa57a23151be615 100644 --- a/dumux/freeflow/compositional/fluxvariables.hh +++ b/dumux/freeflow/compositional/fluxvariables.hh @@ -30,7 +30,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class FreeflowNCFluxVariablesImpl; /*! @@ -41,7 +41,7 @@ class FreeflowNCFluxVariablesImpl; * \note Not all specializations are currently implemented */ template<class TypeTag> -using FreeflowNCFluxVariables = FreeflowNCFluxVariablesImpl<TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using FreeflowNCFluxVariables = FreeflowNCFluxVariablesImpl<TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } // end namespace diff --git a/dumux/freeflow/compositional/localresidual.hh b/dumux/freeflow/compositional/localresidual.hh index 67dcf0b9e1f24c4ddea7c27b906c8c886baa9a54..c8d18e593f63fb1b2abc3986a3fdb862812c1f49 100644 --- a/dumux/freeflow/compositional/localresidual.hh +++ b/dumux/freeflow/compositional/localresidual.hh @@ -32,7 +32,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class FreeflowNCResidualImpl; /*! @@ -43,7 +43,7 @@ class FreeflowNCResidualImpl; * \note Not all specializations are currently implemented */ template<class TypeTag> -using FreeflowNCResidual = FreeflowNCResidualImpl<TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using FreeflowNCResidual = FreeflowNCResidualImpl<TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } diff --git a/dumux/freeflow/compositional/staggered/fluxvariables.hh b/dumux/freeflow/compositional/staggered/fluxvariables.hh index 82e7bb90be8b5e723437b07a75e8903eb0168d8e..b6c3db8f517e7cb53177af4067e5d4d46e4c47dd 100644 --- a/dumux/freeflow/compositional/staggered/fluxvariables.hh +++ b/dumux/freeflow/compositional/staggered/fluxvariables.hh @@ -39,11 +39,11 @@ namespace Dumux { */ // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class FreeflowNCFluxVariablesImpl; template<class TypeTag> -class FreeflowNCFluxVariablesImpl<TypeTag, DiscretizationMethod::staggered> +class FreeflowNCFluxVariablesImpl<TypeTag, DiscretizationMethods::Staggered> : public NavierStokesFluxVariables<TypeTag> { using ParentType = NavierStokesFluxVariables<TypeTag>; diff --git a/dumux/freeflow/compositional/staggered/localresidual.hh b/dumux/freeflow/compositional/staggered/localresidual.hh index 72422ed5adc2ecbd3c815755ed3ff162c958a085..11036077c90083e50432c83d6bd23b2681d2aa4f 100644 --- a/dumux/freeflow/compositional/staggered/localresidual.hh +++ b/dumux/freeflow/compositional/staggered/localresidual.hh @@ -36,11 +36,11 @@ namespace Dumux { */ // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class FreeflowNCResidualImpl; template<class TypeTag> -class FreeflowNCResidualImpl<TypeTag, DiscretizationMethod::staggered> +class FreeflowNCResidualImpl<TypeTag, DiscretizationMethods::Staggered> : public NavierStokesResidual<TypeTag> { using ParentType = NavierStokesResidual<TypeTag>; diff --git a/dumux/freeflow/navierstokes/fluxvariables.hh b/dumux/freeflow/navierstokes/fluxvariables.hh index 326854f29ccf43704e77f1255fe16eaa6c2e2c7c..b301780db507aef8d68b3d871ab83e396cfa7c8c 100644 --- a/dumux/freeflow/navierstokes/fluxvariables.hh +++ b/dumux/freeflow/navierstokes/fluxvariables.hh @@ -31,7 +31,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class NavierStokesFluxVariablesImpl; /*! @@ -42,7 +42,7 @@ class NavierStokesFluxVariablesImpl; * \note Not all specializations are currently implemented */ template<class TypeTag> -using NavierStokesFluxVariables = NavierStokesFluxVariablesImpl<TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using NavierStokesFluxVariables = NavierStokesFluxVariablesImpl<TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } // end namespace diff --git a/dumux/freeflow/navierstokes/localresidual.hh b/dumux/freeflow/navierstokes/localresidual.hh index f8305acca18ae4e6653c69d5dd1b79b68709064b..21941a319d94f635e9aa5f2a5391248ec74b2fc4 100644 --- a/dumux/freeflow/navierstokes/localresidual.hh +++ b/dumux/freeflow/navierstokes/localresidual.hh @@ -31,7 +31,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class NavierStokesResidualImpl; /*! @@ -42,7 +42,7 @@ class NavierStokesResidualImpl; * \note Not all specializations are currently implemented */ template<class TypeTag> -using NavierStokesResidual = NavierStokesResidualImpl<TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using NavierStokesResidual = NavierStokesResidualImpl<TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } // end namespace Dumux diff --git a/dumux/freeflow/navierstokes/momentum/fluxhelper.hh b/dumux/freeflow/navierstokes/momentum/fluxhelper.hh index 85b22772207a323ca9e21e3af7dc739d94b2b4fd..0382053f9f29a882d1e08439032bee6fde3e26df 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<std::size_t>(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<std::size_t>(FVElementGeometry::GridGeometry::GridView::dimension); static_assert( diff --git a/dumux/freeflow/navierstokes/momentum/localresidual.hh b/dumux/freeflow/navierstokes/momentum/localresidual.hh index 5db4a54c6229d27f9ae6aa240f6967d9aadf7e22..6b50f1c3b5578f53403ae649479ac0c38a20d37c 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<decltype( problem.neumann(element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf) diff --git a/dumux/freeflow/navierstokes/momentum/velocityreconstruction.hh b/dumux/freeflow/navierstokes/momentum/velocityreconstruction.hh index 8f30a4daa633502efe4a798d46cbde8770694343..094a40d484033f19eafbb91da91d6f9b12d1d5b7 100644 --- a/dumux/freeflow/navierstokes/momentum/velocityreconstruction.hh +++ b/dumux/freeflow/navierstokes/momentum/velocityreconstruction.hh @@ -39,7 +39,7 @@ struct StaggeredVelocityReconstruction static auto cellCenterVelocity(const VelocityHelper& getFaceVelocity, const FVElementGeometry& fvGeometry) { - static_assert(FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::cctpfa); + static_assert(FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::cctpfa); using VelocityVector = typename FVElementGeometry::GridGeometry::GlobalCoordinate; VelocityVector result(0.0); diff --git a/dumux/freeflow/navierstokes/problem.hh b/dumux/freeflow/navierstokes/problem.hh index d6832349bd3de307d22f03878c7a455517d8c5d8..533c8e53e6d0ab443d6c48ec9cb4547510dea152 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<class TypeTag, DiscretizationMethod discMethod> -struct NavierStokesParentProblemImpl; +template<class TypeTag, class DiscretizationMethod> struct NavierStokesParentProblemImpl; // compatibility with old-style Navier-Stokes models template<class TypeTag> -struct NavierStokesParentProblemImpl<TypeTag, DiscretizationMethod::staggered> +struct NavierStokesParentProblemImpl<TypeTag, DiscretizationMethods::Staggered> { using type = StaggeredFVProblem<TypeTag>; }; @@ -48,14 +47,14 @@ struct NavierStokesParentProblemImpl<TypeTag, DiscretizationMethod::staggered> //! The actual NavierStokesParentProblem template<class TypeTag> using NavierStokesParentProblem = typename NavierStokesParentProblemImpl< - TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod + TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod >::type; -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class NavierStokesProblemImpl; template<class TypeTag> -class NavierStokesProblemImpl<TypeTag, DiscretizationMethod::fcstaggered> +class NavierStokesProblemImpl<TypeTag, DiscretizationMethods::FCStaggered> : public FVProblem<TypeTag> { using ParentType = FVProblem<TypeTag>; @@ -537,7 +536,7 @@ private: }; template<class TypeTag> -class NavierStokesProblemImpl<TypeTag, DiscretizationMethod::cctpfa> +class NavierStokesProblemImpl<TypeTag, DiscretizationMethods::CCTpfa> : public FVProblem<TypeTag> { using ParentType = FVProblem<TypeTag>; @@ -663,7 +662,6 @@ private: std::shared_ptr<CouplingManager> 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 TypeTag> -class NavierStokesProblemImpl<TypeTag, DiscretizationMethod::staggered> +class NavierStokesProblemImpl<TypeTag, DiscretizationMethods::Staggered> : public NavierStokesParentProblem<TypeTag> { using ParentType = NavierStokesParentProblem<TypeTag>; @@ -757,7 +755,7 @@ public: //! Applys the initial face solution (velocities on the faces). Specialization for staggered grid discretization. template <class SolutionVector, class G = GridGeometry> - typename std::enable_if<G::discMethod == DiscretizationMethod::staggered, void>::type + typename std::enable_if<G::discMethod == DiscretizationMethods::staggered, void>::type applyInitialFaceSolution(SolutionVector& sol, const SubControlVolumeFace& scvf, const PrimaryVariables& initSol) const @@ -789,7 +787,7 @@ public: //! Convenience function for staggered grid implementation. template <class ElementVolumeVariables, class ElementFaceVariables, class G = GridGeometry> - typename std::enable_if<G::discMethod == DiscretizationMethod::staggered, Scalar>::type + typename std::enable_if<G::discMethod == DiscretizationMethods::staggered, Scalar>::type pseudo3DWallFriction(const SubControlVolumeFace& scvf, const ElementVolumeVariables& elemVolVars, const ElementFaceVariables& elemFaceVars, @@ -903,7 +901,7 @@ private: */ template<class TypeTag> using NavierStokesProblem = NavierStokesProblemImpl< - TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod + TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod >; } // end namespace Dumux diff --git a/dumux/freeflow/navierstokes/scalarfluxvariablescachefiller.hh b/dumux/freeflow/navierstokes/scalarfluxvariablescachefiller.hh index d764a3d139e99fb0daeaf4476feb104d2e3de2a8..8689633c5969468b9c59e6dce3a7a2a7ef6fadb5 100644 --- a/dumux/freeflow/navierstokes/scalarfluxvariablescachefiller.hh +++ b/dumux/freeflow/navierstokes/scalarfluxvariablescachefiller.hh @@ -35,7 +35,7 @@ namespace Dumux { // forward declaration -template<class Problem, class ModelTraits, bool diffusionIsSolDependent, bool heatConductionIsSolDependent, DiscretizationMethod discMethod> +template<class Problem, class ModelTraits, bool diffusionIsSolDependent, bool heatConductionIsSolDependent, class DiscretizationMethod> class FreeFlowScalarFluxVariablesCacheFillerImplementation; /*! @@ -45,11 +45,11 @@ class FreeFlowScalarFluxVariablesCacheFillerImplementation; * Helps filling the flux variables cache depending several policies */ template<class Problem, class ModelTraits, bool diffusionIsSolDependent, bool heatConductionIsSolDependent> -using FreeFlowScalarFluxVariablesCacheFiller = FreeFlowScalarFluxVariablesCacheFillerImplementation<Problem, ModelTraits, diffusionIsSolDependent, heatConductionIsSolDependent, ProblemTraits<Problem>::GridGeometry::discMethod>; +using FreeFlowScalarFluxVariablesCacheFiller = FreeFlowScalarFluxVariablesCacheFillerImplementation<Problem, ModelTraits, diffusionIsSolDependent, heatConductionIsSolDependent, typename ProblemTraits<Problem>::GridGeometry::DiscretizationMethod>; //! Specialization of the flux variables cache filler for the cell centered tpfa method template<class Problem, class ModelTraits, bool diffusionIsSolDependent, bool heatConductionIsSolDependent> -class FreeFlowScalarFluxVariablesCacheFillerImplementation<Problem, ModelTraits, diffusionIsSolDependent, heatConductionIsSolDependent, DiscretizationMethod::cctpfa> +class FreeFlowScalarFluxVariablesCacheFillerImplementation<Problem, ModelTraits, diffusionIsSolDependent, heatConductionIsSolDependent, DiscretizationMethods::CCTpfa> { using GridGeometry = typename ProblemTraits<Problem>::GridGeometry; using GridView = typename GridGeometry::GridView; diff --git a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh index 6e042670a310951af91f31d633a05957f589aa60..ee37bcae1efd50f97163349c840b5721a4e7b4de 100644 --- a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh +++ b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh @@ -49,11 +49,11 @@ namespace Dumux { */ // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class NavierStokesFluxVariablesImpl; template<class TypeTag> -class NavierStokesFluxVariablesImpl<TypeTag, DiscretizationMethod::staggered> +class NavierStokesFluxVariablesImpl<TypeTag, DiscretizationMethods::Staggered> : public FluxVariablesBase<GetPropType<TypeTag, Properties::Problem>, typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView, typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView, diff --git a/dumux/freeflow/navierstokes/staggered/localresidual.hh b/dumux/freeflow/navierstokes/staggered/localresidual.hh index 2e68a79bf58792ad69a42385b2119a9a1910a883..f76c8072d34951f02c6f6a4b33c97e85f3a77ec8 100644 --- a/dumux/freeflow/navierstokes/staggered/localresidual.hh +++ b/dumux/freeflow/navierstokes/staggered/localresidual.hh @@ -48,11 +48,11 @@ static constexpr bool isRotationalExtrusion<RotationalExtrusion<radialAxis>> = t */ // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class NavierStokesResidualImpl; template<class TypeTag> -class NavierStokesResidualImpl<TypeTag, DiscretizationMethod::staggered> +class NavierStokesResidualImpl<TypeTag, DiscretizationMethods::Staggered> : public StaggeredLocalResidual<TypeTag> { using ParentType = StaggeredLocalResidual<TypeTag>; diff --git a/dumux/freeflow/navierstokes/velocityoutput.hh b/dumux/freeflow/navierstokes/velocityoutput.hh index dfeb06e8ce714d0774aa7cefd800ca9596bc3d21..9d4e7aba05c68fe6faa34a74815bc4159b9f242f 100644 --- a/dumux/freeflow/navierstokes/velocityoutput.hh +++ b/dumux/freeflow/navierstokes/velocityoutput.hh @@ -77,7 +77,7 @@ public: { using CouplingManager = std::decay_t<decltype(elemVolVars.gridVolVars().problem().couplingManager())>; using MomGG = std::decay_t<decltype(std::declval<CouplingManager>().problem(CouplingManager::freeFlowMomentumIndex).gridGeometry())>; - if constexpr (MomGG::discMethod == DiscretizationMethod::fcstaggered) + if constexpr (MomGG::discMethod == DiscretizationMethods::fcstaggered) calculateVelocityForStaggeredGrid_(velocity, element, fvGeometry, elemVolVars); } diff --git a/dumux/freeflow/nonisothermal/localresidual.hh b/dumux/freeflow/nonisothermal/localresidual.hh index 1a681c5ddd4f61c2b22ae4cd06e2ed8aa45682c5..2a5bc519a9f89bfd75ec4158ab6ca2e4f4ecda0c 100644 --- a/dumux/freeflow/nonisothermal/localresidual.hh +++ b/dumux/freeflow/nonisothermal/localresidual.hh @@ -30,7 +30,7 @@ namespace Dumux { // forward declaration -template<class GridGeometry, class FluxVariables, DiscretizationMethod discMethod, bool enableEneryBalance, bool isCompositional> +template<class GridGeometry, class FluxVariables, class DiscretizationMethod, bool enableEneryBalance, bool isCompositional> class FreeFlowEnergyLocalResidualImplementation; /*! @@ -42,15 +42,15 @@ template<class GridGeometry, class FluxVariables, bool enableEneryBalance, bool using FreeFlowEnergyLocalResidual = FreeFlowEnergyLocalResidualImplementation<GridGeometry, FluxVariables, - GridGeometry::discMethod, + typename GridGeometry::DiscretizationMethod, enableEneryBalance, isCompositional>; /*! * \ingroup FreeflowNIModel * \brief Specialization for isothermal models, does nothing */ -template<class GridGeometry, class FluxVariables, DiscretizationMethod discMethod, bool isCompositional> -class FreeFlowEnergyLocalResidualImplementation<GridGeometry, FluxVariables, discMethod, false, isCompositional> +template<class GridGeometry, class FluxVariables, class DiscretizationMethod, bool isCompositional> +class FreeFlowEnergyLocalResidualImplementation<GridGeometry, FluxVariables, DiscretizationMethod, false, isCompositional> { public: @@ -72,7 +72,7 @@ public: template<class GridGeometry, class FluxVariables> class FreeFlowEnergyLocalResidualImplementation<GridGeometry, FluxVariables, - DiscretizationMethod::staggered, + DiscretizationMethods::Staggered, true, false> { using Element = typename GridGeometry::GridView::template Codim<0>::Entity; @@ -124,16 +124,16 @@ public: template<class GridGeometry, class FluxVariables> class FreeFlowEnergyLocalResidualImplementation<GridGeometry, FluxVariables, - DiscretizationMethod::staggered, + DiscretizationMethods::Staggered, true, true> : public FreeFlowEnergyLocalResidualImplementation<GridGeometry, FluxVariables, - DiscretizationMethod::staggered, + DiscretizationMethods::Staggered, true, false> { using ParentType = FreeFlowEnergyLocalResidualImplementation<GridGeometry, FluxVariables, - DiscretizationMethod::staggered, + DiscretizationMethods::Staggered, true, false>; using Element = typename GridGeometry::GridView::template Codim<0>::Entity; using FVElementGeometry = typename GridGeometry::LocalView; diff --git a/dumux/freeflow/rans/oneeq/fluxvariables.hh b/dumux/freeflow/rans/oneeq/fluxvariables.hh index feefc3478c80eb8f8e820d37573a6cc24db91df6..991aaca7be4e138ead406d77398ae6f54e942c81 100644 --- a/dumux/freeflow/rans/oneeq/fluxvariables.hh +++ b/dumux/freeflow/rans/oneeq/fluxvariables.hh @@ -31,7 +31,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, class BaseFluxVariables, DiscretizationMethod discMethod> +template<class TypeTag, class BaseFluxVariables, class DiscretizationMethod> class OneEqFluxVariablesImpl; /*! @@ -42,7 +42,7 @@ class OneEqFluxVariablesImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseFluxVariables> -using OneEqFluxVariables = OneEqFluxVariablesImpl<TypeTag, BaseFluxVariables, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using OneEqFluxVariables = OneEqFluxVariablesImpl<TypeTag, BaseFluxVariables, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } // end namespace diff --git a/dumux/freeflow/rans/oneeq/localresidual.hh b/dumux/freeflow/rans/oneeq/localresidual.hh index 322ed7af8bd8157279e29b7e80bfc89f865ca6ed..7acf702f3f290b188e261cff04bfcb9b9b683a17 100644 --- a/dumux/freeflow/rans/oneeq/localresidual.hh +++ b/dumux/freeflow/rans/oneeq/localresidual.hh @@ -32,7 +32,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, class BaseLocalResidual, DiscretizationMethod discMethod> +template<class TypeTag, class BaseLocalResidual, class DiscretizationMethod> class OneEqResidualImpl; /*! @@ -43,7 +43,7 @@ class OneEqResidualImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseLocalResidual> -using OneEqResidual = OneEqResidualImpl<TypeTag, BaseLocalResidual, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using OneEqResidual = OneEqResidualImpl<TypeTag, BaseLocalResidual, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } // end namespace Dumux diff --git a/dumux/freeflow/rans/oneeq/staggered/fluxvariables.hh b/dumux/freeflow/rans/oneeq/staggered/fluxvariables.hh index 5e52fa700bdbc405f0c4bf662327a8d8062e441c..8b18e0d18aa253f96bf07105741dc886a0bd6ee0 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<class TypeTag, class BaseFluxVariables, DiscretizationMethod discMethod> +template<class TypeTag, class BaseFluxVariables, class DiscretizationMethod> class OneEqFluxVariablesImpl; template<class TypeTag, class BaseFluxVariables> -class OneEqFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethod::staggered> +class OneEqFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethods::Staggered> : public BaseFluxVariables { using ParentType = BaseFluxVariables; diff --git a/dumux/freeflow/rans/oneeq/staggered/localresidual.hh b/dumux/freeflow/rans/oneeq/staggered/localresidual.hh index 4ab2930b2641201bf8350ce4ddb9c26952145f21..38b5305ae75a219c0b6ca2dd409bd195fab0e7cc 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<class TypeTag, class BaseLocalResidual, DiscretizationMethod discMethod> +template<class TypeTag, class BaseLocalResidual, class DiscretizationMethod> class OneEqResidualImpl; template<class TypeTag, class BaseLocalResidual> -class OneEqResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod::staggered> +class OneEqResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethods::Staggered> : public BaseLocalResidual { using ParentType = BaseLocalResidual; diff --git a/dumux/freeflow/rans/problem.hh b/dumux/freeflow/rans/problem.hh index 9e08345c41b2e4283ebb33773a741ddb44230a49..4f3e74346af273eeb2433b63938b3cff07327b85 100644 --- a/dumux/freeflow/rans/problem.hh +++ b/dumux/freeflow/rans/problem.hh @@ -414,7 +414,7 @@ private: void storeWallElementAndDirectionIndex_(const WallData& wallData) { // The wall Direction Index is used for flat quadrilateral channel problems only - if (!(GridGeometry::discMethod == DiscretizationMethod::staggered)) + if (!(GridGeometry::discMethod == DiscretizationMethods::staggered)) DUNE_THROW(Dune::NotImplemented, "The wall direction Index can only be calculated for quadrilateral structured grids"); // If isFlatWallBounded, the corresonding wall element is stored for each element diff --git a/dumux/freeflow/rans/twoeq/kepsilon/fluxvariables.hh b/dumux/freeflow/rans/twoeq/kepsilon/fluxvariables.hh index b85b74364cdeedee55b96f38244ea690380f658f..7e6df30f11dd3af9478a2e0d580c9ee7d7e3c26c 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<class TypeTag, class BaseFluxVariables, DiscretizationMethod discMethod> +template<class TypeTag, class BaseFluxVariables, class DiscretizationMethod> class KEpsilonFluxVariablesImpl; /*! @@ -41,7 +41,7 @@ class KEpsilonFluxVariablesImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseFluxVariables> -using KEpsilonFluxVariables = KEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using KEpsilonFluxVariables = KEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } // end namespace diff --git a/dumux/freeflow/rans/twoeq/kepsilon/localresidual.hh b/dumux/freeflow/rans/twoeq/kepsilon/localresidual.hh index 0983a47e842c2c45cca8fb3c7962ec83e3e52474..841bdb5f7221c7d555143e4eba235d1e93310451 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<class TypeTag, class BaseLocalResidual, DiscretizationMethod discMethod> +template<class TypeTag, class BaseLocalResidual, class DiscretizationMethod> class KEpsilonResidualImpl; /*! @@ -43,7 +43,7 @@ class KEpsilonResidualImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseLocalResidual> -using KEpsilonResidual = KEpsilonResidualImpl<TypeTag, BaseLocalResidual, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using KEpsilonResidual = KEpsilonResidualImpl<TypeTag, BaseLocalResidual, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } diff --git a/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh b/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh index 85fc3c92692170de99a7cf19fcbced5e9f02b35c..1598488733b2736cb9745a49c202fea20ccf3dd2 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<class TypeTag, class BaseFluxVariables, DiscretizationMethod discMethod> +template<class TypeTag, class BaseFluxVariables, class DiscretizationMethod> class KEpsilonFluxVariablesImpl; template<class TypeTag, class BaseFluxVariables> -class KEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethod::staggered> +class KEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethods::Staggered> : 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 df600f9226ae98518835ee4c4cb8555b2a781e76..6634756ec24688bb2a053a61e51c6c1b322f7448 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<class TypeTag, class BaseLocalResidual, DiscretizationMethod discMethod> +template<class TypeTag, class BaseLocalResidual, class DiscretizationMethod> class KEpsilonResidualImpl; template<class TypeTag, class BaseLocalResidual> -class KEpsilonResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod::staggered> +class KEpsilonResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethods::Staggered> : public BaseLocalResidual { using ParentType = BaseLocalResidual; diff --git a/dumux/freeflow/rans/twoeq/komega/fluxvariables.hh b/dumux/freeflow/rans/twoeq/komega/fluxvariables.hh index daf9175c6f27e8a7f9c85994999a3e13349a4438..7804c0f1e87c318bce005f2a6f813c0c31827099 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<class TypeTag, class BaseFluxVariables, DiscretizationMethod discMethod> +template<class TypeTag, class BaseFluxVariables, class DiscretizationMethod> class KOmegaFluxVariablesImpl; /*! @@ -41,7 +41,7 @@ class KOmegaFluxVariablesImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseFluxVariables> -using KOmegaFluxVariables = KOmegaFluxVariablesImpl<TypeTag, BaseFluxVariables, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using KOmegaFluxVariables = KOmegaFluxVariablesImpl<TypeTag, BaseFluxVariables, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } // end namespace diff --git a/dumux/freeflow/rans/twoeq/komega/localresidual.hh b/dumux/freeflow/rans/twoeq/komega/localresidual.hh index 04809447a2400d73594cfa68ddafe9c37e00cec6..41b199be9ed6f9c79ce6c6cc8b9155fc590c8b55 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<class TypeTag, class BaseLocalResidual, DiscretizationMethod discMethod> +template<class TypeTag, class BaseLocalResidual, class DiscretizationMethod> class KOmegaResidualImpl; /*! @@ -43,7 +43,7 @@ class KOmegaResidualImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseLocalResidual> -using KOmegaResidual = KOmegaResidualImpl<TypeTag, BaseLocalResidual, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using KOmegaResidual = KOmegaResidualImpl<TypeTag, BaseLocalResidual, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } diff --git a/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh b/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh index ea1b0c6b87bda0a0a0da8b824826513ad2f1b85f..e8b86e24b2370f756985bb332d8335e278083bd2 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<class TypeTag, class BaseFluxVariables, DiscretizationMethod discMethod> +template<class TypeTag, class BaseFluxVariables, class DiscretizationMethod> class KOmegaFluxVariablesImpl; template<class TypeTag, class BaseFluxVariables> -class KOmegaFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethod::staggered> +class KOmegaFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethods::Staggered> : 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 4fc020e1bce399a737ac2305676b0f9ad1b819b3..e950228f8a6f00010d9cf5512bd03ea62f9c409e 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<class TypeTag, class BaseLocalResidual, DiscretizationMethod discMethod> +template<class TypeTag, class BaseLocalResidual, class DiscretizationMethod> class KOmegaResidualImpl; template<class TypeTag, class BaseLocalResidual> -class KOmegaResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod::staggered> +class KOmegaResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethods::Staggered> : public BaseLocalResidual { using ParentType = BaseLocalResidual; diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/fluxvariables.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/fluxvariables.hh index d7a7a63a3b2f7f83391859e4cb91ee7622b22129..7505f51bd1d9a66028e2b3770c5b0dfaf8aa4eec 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<class TypeTag, class BaseFluxVariables, DiscretizationMethod discMethod> +template<class TypeTag, class BaseFluxVariables, class DiscretizationMethod> class LowReKEpsilonFluxVariablesImpl; /*! @@ -41,7 +41,7 @@ class LowReKEpsilonFluxVariablesImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseFluxVariables> -using LowReKEpsilonFluxVariables = LowReKEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using LowReKEpsilonFluxVariables = LowReKEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } // end namespace diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/localresidual.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/localresidual.hh index 1fcd19f5cfdff65114dc3481cc721078d6c5766e..94627f9f596145ce09166bf89e316fea8c63d440 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<class TypeTag, class BaseLocalResidual, DiscretizationMethod discMethod> +template<class TypeTag, class BaseLocalResidual, class DiscretizationMethod> class LowReKEpsilonResidualImpl; /*! @@ -43,7 +43,7 @@ class LowReKEpsilonResidualImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseLocalResidual> -using LowReKEpsilonResidual = LowReKEpsilonResidualImpl<TypeTag, BaseLocalResidual, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using LowReKEpsilonResidual = LowReKEpsilonResidualImpl<TypeTag, BaseLocalResidual, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; } diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh index 4ce64ab70d272e896d2f1a9a9c6b77aefffefae2..b6aa6f908622b3ad96f759c8b0a7f85c48aef9e0 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<class TypeTag, class BaseFluxVariables, DiscretizationMethod discMethod> +template<class TypeTag, class BaseFluxVariables, class DiscretizationMethod> class LowReKEpsilonFluxVariablesImpl; template<class TypeTag, class BaseFluxVariables> -class LowReKEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethod::staggered> +class LowReKEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethods::Staggered> : 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 1c692aa425236fa03f22e0a32c5dc2b256c2d7ef..6b46e33d86eccbe7a918b4d31231881fc9059e89 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<class TypeTag, class BaseLocalResidual, DiscretizationMethod discMethod> +template<class TypeTag, class BaseLocalResidual, class DiscretizationMethod> class LowReKEpsilonResidualImpl; template<class TypeTag, class BaseLocalResidual> -class LowReKEpsilonResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod::staggered> +class LowReKEpsilonResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethods::Staggered> : public BaseLocalResidual { using ParentType = BaseLocalResidual; diff --git a/dumux/geomechanics/poroelastic/couplingmanager.hh b/dumux/geomechanics/poroelastic/couplingmanager.hh index 084df8b78b0cce60356b45d39dee77367dc8a4ae..1b6e60bb161205b0439ba39766f03b058a336d0e 100644 --- a/dumux/geomechanics/poroelastic/couplingmanager.hh +++ b/dumux/geomechanics/poroelastic/couplingmanager.hh @@ -79,11 +79,11 @@ class PoroMechanicsCouplingManager : public virtual CouplingManager< MDTraits > "The grid types of the two sub-problems have to be equal!"); //! this coupling manager is for cc - box only - static_assert(GridGeometry<PoroMechId>::discMethod == DiscretizationMethod::box, + static_assert(GridGeometry<PoroMechId>::discMethod == DiscretizationMethods::box, "Poro-mechanical problem must be discretized with the box scheme for this coupling manager!"); - static_assert(GridGeometry<PMFlowId>::discMethod == DiscretizationMethod::cctpfa || - GridGeometry<PMFlowId>::discMethod == DiscretizationMethod::ccmpfa, + static_assert(GridGeometry<PMFlowId>::discMethod == DiscretizationMethods::cctpfa || + GridGeometry<PMFlowId>::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/geomechanics/stressvariablescache.hh b/dumux/geomechanics/stressvariablescache.hh index f32d48abe6617133228938194e5a24cc1bd52a58..0ad92c6e01af5bb7033f2ec72d8e2e5d5c799d20 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<Scalar, GridGeometry, DiscretizationMethod::box> +class StressVariablesCache<Scalar, GridGeometry, DiscretizationMethods::Box> : public BoxFluxVariablesCache< Scalar, GridGeometry > {}; // specialization for the cell centered tpfa method template< class Scalar, class GridGeometry > -class StressVariablesCache<Scalar, GridGeometry, DiscretizationMethod::cctpfa> +class StressVariablesCache<Scalar, GridGeometry, DiscretizationMethods::CCTpfa> : public FluxVariablesCaching::_EmptyCache { public: @@ -76,8 +76,8 @@ public: // specialization for the cell centered mpfa method template< class Scalar, class GridGeometry > -class StressVariablesCache<Scalar, GridGeometry, DiscretizationMethod::ccmpfa> -: public StressVariablesCache<Scalar, GridGeometry, DiscretizationMethod::cctpfa> +class StressVariablesCache<Scalar, GridGeometry, DiscretizationMethods::CCMpfa> +: public StressVariablesCache<Scalar, GridGeometry, DiscretizationMethods::CCTpfa> {}; } // end namespace Dumux diff --git a/dumux/io/loadsolution.hh b/dumux/io/loadsolution.hh index cdf9ad60c7e64a4ba4e314fdad5ced17205119c2..0a022cdc3bdb4a1bdff35ed0b59c329b65fb3a7c 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 30600dc5a24b9d7a1f19ead01e12326ceee09e2e..21fda6a349d8764ff435b7deb83472d47cf5e773 100644 --- a/dumux/io/vtkoutputmodule.hh +++ b/dumux/io/vtkoutputmodule.hh @@ -321,7 +321,7 @@ class VtkOutputModule : public VtkOutputModuleBase<typename GridVariables::GridG using Element = typename GridView::template Codim<0>::Entity; using VolVarsVector = Dune::FieldVector<Scalar, dimWorld>; - 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<Scalar(const VV&)> get; std::string name; Dumux::Vtk::Precision precision_; }; diff --git a/dumux/linear/linearsolvertraits.hh b/dumux/linear/linearsolvertraits.hh index 99eca749c190a7dae29a9f473dd0a876e1fc5997..146e63b40c12484f80ea3de5e37e287056311ff6 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<class GridGeometry, DiscretizationMethod discMethod> +template<class GridGeometry, class DiscretizationMethod> struct LinearSolverTraitsImpl; //! The type traits required for using the IstlFactoryBackend template<class GridGeometry> -using LinearSolverTraits = LinearSolverTraitsImpl<GridGeometry, GridGeometry::discMethod>; +using LinearSolverTraits = LinearSolverTraitsImpl<GridGeometry, typename GridGeometry::DiscretizationMethod>; //! sequential solver traits template<class MType, class VType> @@ -109,7 +109,7 @@ struct LinearSolverTraitsBase //! Box: use overlapping or non-overlapping model depending on the grid template<class GridGeometry> -struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethod::box> +struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethods::Box> : public LinearSolverTraitsBase<GridGeometry> { using DofMapper = typename GridGeometry::VertexMapper; @@ -124,7 +124,7 @@ struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethod::box> //! Cell-centered tpfa: use overlapping model template<class GridGeometry> -struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethod::cctpfa> +struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethods::CCTpfa> : public LinearSolverTraitsBase<GridGeometry> { using DofMapper = typename GridGeometry::ElementMapper; @@ -139,7 +139,7 @@ struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethod::cctpfa> //! Face-centered staggered: use overlapping model template<class GridGeometry> -struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethod::fcstaggered> +struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethods::FCStaggered> : public LinearSolverTraitsBase<GridGeometry> { class DofMapper @@ -180,13 +180,13 @@ struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethod::fcstaggered> //! Cell-centered mpfa: use overlapping model template<class GridGeometry> -struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethod::ccmpfa> -: public LinearSolverTraitsImpl<GridGeometry, DiscretizationMethod::cctpfa> {}; +struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethods::CCMpfa> +: public LinearSolverTraitsImpl<GridGeometry, DiscretizationMethods::CCTpfa> {}; //! staggered: use overlapping model template<class GridGeometry> -struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethod::staggered> -: public LinearSolverTraitsImpl<GridGeometry, DiscretizationMethod::cctpfa> {}; +struct LinearSolverTraitsImpl<GridGeometry, DiscretizationMethods::Staggered> +: public LinearSolverTraitsImpl<GridGeometry, DiscretizationMethods::CCTpfa> {}; } // end namespace Dumux diff --git a/dumux/material/chemistry/electrochemistry/electrochemistry.hh b/dumux/material/chemistry/electrochemistry/electrochemistry.hh index 9fe071ef33330c67a8e7a3ada4f52a24a321b957..f2ef6d149a4282b8cf7fc5996f013475d6eafaec 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<typename GridView::ctype, GridView::dimensionworld>; public: diff --git a/dumux/material/chemistry/electrochemistry/electrochemistryni.hh b/dumux/material/chemistry/electrochemistry/electrochemistryni.hh index d4d31de82eb6e089e27a442cccfac2320c67480d..507f6532bb3c999bbcdf345a401f765e8e0fd994 100644 --- a/dumux/material/chemistry/electrochemistry/electrochemistryni.hh +++ b/dumux/material/chemistry/electrochemistry/electrochemistryni.hh @@ -51,7 +51,7 @@ class ElectroChemistryNI : public ElectroChemistry<Scalar, Indices, FluidSystem, }; 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<typename GridView::ctype, GridView::dimensionworld>; using CellVector = typename Dune::FieldVector<typename GridView::ctype, GridView::dimension>; diff --git a/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh b/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh index 6f9cf6d820910f6c4d4b06920705051c97db93e2..56b18bc5ac3191e63a6d97c033295c2d5e8e14e7 100644 --- a/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh +++ b/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh @@ -74,7 +74,7 @@ class DarcyDarcyBoundaryCouplingManager template<std::size_t i> static constexpr bool isCCTpfa() - { return GridGeometry<i>::discMethod == DiscretizationMethod::cctpfa; } + { return GridGeometry<i>::discMethod == DiscretizationMethods::cctpfa; } using CouplingStencil = std::vector<std::size_t>; public: diff --git a/dumux/multidomain/boundary/darcydarcy/couplingmapper.hh b/dumux/multidomain/boundary/darcydarcy/couplingmapper.hh index 527ffd0d32c2e52fe0536e33b5b1f54e060bf8f1..cbaf16b480173ee161c3f62bf6b9af5a4856e1c7 100644 --- a/dumux/multidomain/boundary/darcydarcy/couplingmapper.hh +++ b/dumux/multidomain/boundary/darcydarcy/couplingmapper.hh @@ -60,7 +60,7 @@ class DarcyDarcyBoundaryCouplingMapper template<std::size_t i> static constexpr bool isCCTpfa() - { return GridGeometry<i>::discMethod == DiscretizationMethod::cctpfa; } + { return GridGeometry<i>::discMethod == DiscretizationMethods::cctpfa; } struct ScvfInfo { diff --git a/dumux/multidomain/boundary/freeflowporousmedium/ffmomentumpm/couplingmapper.hh b/dumux/multidomain/boundary/freeflowporousmedium/ffmomentumpm/couplingmapper.hh index 59f15ea1385dbc547c749a1c8bb77f76b9d6c162..8a5643e919919c53a687aab298e023f61869cac1 100644 --- a/dumux/multidomain/boundary/freeflowporousmedium/ffmomentumpm/couplingmapper.hh +++ b/dumux/multidomain/boundary/freeflowporousmedium/ffmomentumpm/couplingmapper.hh @@ -61,11 +61,11 @@ class FreeFlowMomentumPorousMediumCouplingMapper template<std::size_t i> static constexpr bool isFcStaggered() - { return GridGeometry<i>::discMethod == DiscretizationMethod::fcstaggered; } + { return GridGeometry<i>::discMethod == DiscretizationMethods::fcstaggered; } template<std::size_t i> static constexpr bool isCCTpfa() - { return GridGeometry<i>::discMethod == DiscretizationMethod::cctpfa; } + { return GridGeometry<i>::discMethod == DiscretizationMethods::cctpfa; } struct ScvfInfoPM { diff --git a/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh b/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh index a4afec061fa211a6ee35338d0109621601d47c7d..25f6a562a4047df4a4fd14fb59ec438b849802a4 100644 --- a/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh +++ b/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh @@ -100,7 +100,7 @@ struct IsSameFluidSystem<FS, FS> }; // forward declaration -template <class TypeTag, DiscretizationMethod discMethod, ReferenceSystemFormulation referenceSystem> +template <class TypeTag, class DiscretizationMethod, ReferenceSystemFormulation referenceSystem> 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<class T, DiscretizationMethod discMethod, ReferenceSystemFormulation referenceSystem> -struct IsFicksLaw<FicksLawImplementation<T, discMethod, referenceSystem>> : public std::true_type {}; +template<class T, class DiscretizationMethod, ReferenceSystemFormulation referenceSystem> +struct IsFicksLaw<FicksLawImplementation<T, DiscretizationMethod, referenceSystem>> : public std::true_type {}; /*! * \ingroup StokesDarcyCoupling @@ -194,11 +194,11 @@ struct IndexHelper<stokesIdx, darcyIdx, FFFS, true> }; //! forward declare -template <class TypeTag, DiscretizationMethod discMethod> +template <class TypeTag, class DiscretizationMethod> class DarcysLawImplementation; //! forward declare -template <class TypeTag, DiscretizationMethod discMethod> +template <class TypeTag, class DiscretizationMethod> class ForchheimersLawImplementation; @@ -241,8 +241,8 @@ class StokesDarcyCouplingDataImplementationBase static constexpr auto darcyIdx = CouplingManager::darcyIdx; using AdvectionType = GetPropType<SubDomainTypeTag<darcyIdx>, Properties::AdvectionType>; - using DarcysLaw = DarcysLawImplementation<SubDomainTypeTag<darcyIdx>, GridGeometry<darcyIdx>::discMethod>; - using ForchheimersLaw = ForchheimersLawImplementation<SubDomainTypeTag<darcyIdx>, GridGeometry<darcyIdx>::discMethod>; + using DarcysLaw = DarcysLawImplementation<SubDomainTypeTag<darcyIdx>, typename GridGeometry<darcyIdx>::DiscretizationMethod>; + using ForchheimersLaw = ForchheimersLawImplementation<SubDomainTypeTag<darcyIdx>, typename GridGeometry<darcyIdx>::DiscretizationMethod>; static constexpr bool adapterUsed = ModelTraits<darcyIdx>::numFluidPhases() > 1; using IndexHelper = Dumux::IndexHelper<stokesIdx, darcyIdx, FluidSystem<stokesIdx>, adapterUsed>; diff --git a/dumux/multidomain/boundary/stokesdarcy/couplingmapper.hh b/dumux/multidomain/boundary/stokesdarcy/couplingmapper.hh index 680e1bba6fea04c281ae1afda5ab768fed68b41a..1d38fbbdf887c5b95fefa614b45fc0b82e665927 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<decltype(stokesFvGridGeometry)>::discMethod == DiscretizationMethod::staggered, + static_assert(std::decay_t<decltype(stokesFvGridGeometry)>::discMethod == DiscretizationMethods::staggered, "The free flow domain must use the staggered discretization"); - static_assert(std::decay_t<decltype(darcyFvGridGeometry)>::discMethod == DiscretizationMethod::cctpfa, + static_assert(std::decay_t<decltype(darcyFvGridGeometry)>::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 51d6291255364c10daaefaa91773c0a4410fe0b3..ce4e654f4a7722964a2ae0468b8bd2ed87c30ef5 100644 --- a/dumux/multidomain/couplingjacobianpattern.hh +++ b/dumux/multidomain/couplingjacobianpattern.hh @@ -37,8 +37,8 @@ namespace Dumux { * for cell-centered schemes */ template<bool isImplicit, class CouplingManager, class GridGeometryI, class GridGeometryJ, std::size_t i, std::size_t j, - typename std::enable_if_t<( (GridGeometryI::discMethod == DiscretizationMethod::cctpfa) - || (GridGeometryI::discMethod == DiscretizationMethod::ccmpfa) ), int> = 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<i> domainI, const GridGeometryI& gridGeometryI, @@ -75,7 +75,7 @@ Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingM * for the box scheme */ template<bool isImplicit, class CouplingManager, class GridGeometryI, class GridGeometryJ, std::size_t i, std::size_t j, - typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethod::box), int> = 0> + typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethods::box), int> = 0> Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager, Dune::index_constant<i> 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<bool isImplicit, class CouplingManager, class GridGeometryI, class GridGeometryJ, std::size_t i, std::size_t j, - typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethod::staggered && + typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethods::staggered && GridGeometryI::isCellCenter()), int> = 0> Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager, Dune::index_constant<i> domainI, @@ -142,7 +142,7 @@ Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingM * for the staggered scheme (degrees of freedom on faces) */ template<bool isImplicit, class CouplingManager, class GridGeometryI, class GridGeometryJ, std::size_t i, std::size_t j, - typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethod::staggered && + typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethods::staggered && GridGeometryI::isFace()), int> = 0> Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager, Dune::index_constant<i> domainI, @@ -175,7 +175,7 @@ Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingM * for the staggered scheme (degrees of freedom on cell centers) */ template<bool isImplicit, class CouplingManager, class GridGeometryI, class GridGeometryJ, std::size_t i, std::size_t j, - typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethod::fcstaggered), int> = 0> + typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethods::fcstaggered), int> = 0> Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager, Dune::index_constant<i> domainI, const GridGeometryI& gridGeometryI, diff --git a/dumux/multidomain/embedded/couplingmanager1d3d_average.hh b/dumux/multidomain/embedded/couplingmanager1d3d_average.hh index 26b61fd4cba0ef9c988072989e47bde28463eb7d..3592983e95b8a0c4cb854d663af85017f4fbfa0d 100644 --- a/dumux/multidomain/embedded/couplingmanager1d3d_average.hh +++ b/dumux/multidomain/embedded/couplingmanager1d3d_average.hh @@ -87,7 +87,7 @@ class Embedded1d3dCouplingManager<MDTraits, Embedded1d3dCouplingMode::Average> template<std::size_t id> static constexpr bool isBox() - { return GridGeometry<id>::discMethod == DiscretizationMethod::box; } + { return GridGeometry<id>::discMethod == DiscretizationMethods::box; } public: diff --git a/dumux/multidomain/embedded/couplingmanager1d3d_kernel.hh b/dumux/multidomain/embedded/couplingmanager1d3d_kernel.hh index d64de37a39e23bb58d6dcc7d185ad35d3b2c4b5c..ab52f2d373c3a9770ba2c72159d33fe91c302ebe 100644 --- a/dumux/multidomain/embedded/couplingmanager1d3d_kernel.hh +++ b/dumux/multidomain/embedded/couplingmanager1d3d_kernel.hh @@ -85,7 +85,7 @@ class Embedded1d3dCouplingManager<MDTraits, Embedded1d3dCouplingMode::Kernel> template<std::size_t id> static constexpr bool isBox() - { return GridGeometry<id>::discMethod == DiscretizationMethod::box; } + { return GridGeometry<id>::discMethod == DiscretizationMethods::box; } static_assert(!isBox<bulkIdx>() && !isBox<lowDimIdx>(), "The kernel coupling method is only implemented for the tpfa method"); static_assert(Dune::Capabilities::isCartesian<typename GridView<bulkIdx>::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 315bd0690f16e3c96fea79574cf1f2b90dda3d9d..d3eebf86525ee86d4f04ffae0602a837f35e0d1d 100644 --- a/dumux/multidomain/embedded/couplingmanager1d3d_projection.hh +++ b/dumux/multidomain/embedded/couplingmanager1d3d_projection.hh @@ -355,7 +355,7 @@ class Embedded1d3dCouplingManager<MDTraits, Embedded1d3dCouplingMode::Projection template<std::size_t id> static constexpr bool isBox() - { return GridGeometry<id>::discMethod == DiscretizationMethod::box; } + { return GridGeometry<id>::discMethod == DiscretizationMethods::box; } using GlobalPosition = typename Element<bulkIdx>::Geometry::GlobalCoordinate; diff --git a/dumux/multidomain/embedded/couplingmanager1d3d_surface.hh b/dumux/multidomain/embedded/couplingmanager1d3d_surface.hh index dc8de7fbcb4b443d6a78c0d98252672cec1ef04a..78aa3f0db00d069930c6c7be4a79a2116e72e3e5 100644 --- a/dumux/multidomain/embedded/couplingmanager1d3d_surface.hh +++ b/dumux/multidomain/embedded/couplingmanager1d3d_surface.hh @@ -86,7 +86,7 @@ class Embedded1d3dCouplingManager<MDTraits, Embedded1d3dCouplingMode::Surface> template<std::size_t id> static constexpr bool isBox() - { return GridGeometry<id>::discMethod == DiscretizationMethod::box; } + { return GridGeometry<id>::discMethod == DiscretizationMethods::box; } enum { bulkDim = GridView<bulkIdx>::dimension, diff --git a/dumux/multidomain/embedded/couplingmanagerbase.hh b/dumux/multidomain/embedded/couplingmanagerbase.hh index b1cd9c4b723764465e17ee62bc85f5f405623203..a8c9d7e5dae5ab866fd5f4bbcf8e5bae372fc2d3 100644 --- a/dumux/multidomain/embedded/couplingmanagerbase.hh +++ b/dumux/multidomain/embedded/couplingmanagerbase.hh @@ -102,7 +102,7 @@ class EmbeddedCouplingManagerBase template<std::size_t id> static constexpr bool isBox() - { return GridGeometry<id>::discMethod == DiscretizationMethod::box; } + { return GridGeometry<id>::discMethod == DiscretizationMethods::box; } using GlobalPosition = typename Element<bulkIdx>::Geometry::GlobalCoordinate; using GlueType = MultiDomainGlue<GridView<bulkIdx>, GridView<lowDimIdx>, ElementMapper<bulkIdx>, ElementMapper<lowDimIdx>>; @@ -463,7 +463,7 @@ protected: template<std::size_t i, class FVGG, class Geometry, class ShapeValues> void getShapeValues(Dune::index_constant<i> 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 6a80947f99f4af397a876f36be46cdfef73536e6..1ee46bddc017dfcabd126d29c45994d32b65eaf6 100644 --- a/dumux/multidomain/embedded/extendedsourcestencil.hh +++ b/dumux/multidomain/embedded/extendedsourcestencil.hh @@ -57,7 +57,7 @@ class ExtendedSourceStencil template<std::size_t id> static constexpr bool isBox() - { return GridGeometry<id>::discMethod == DiscretizationMethod::box; } + { return GridGeometry<id>::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 4a8793077963d130a9bbe3e4988d4d5093929898..eb29423a918185483c05d3765b6251a06ef19442 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 d6cbab29645e1b3d5ef5b44645309c76a9820c3f..e3a85dbe40f7b5c2d649fb28da44736bb1896c3d 100644 --- a/dumux/multidomain/embedded/pointsourcedata.hh +++ b/dumux/multidomain/embedded/pointsourcedata.hh @@ -56,7 +56,7 @@ class PointSourceData template<std::size_t id> static constexpr bool isBox() - { return GridGeometry<id>::discMethod == DiscretizationMethod::box; } + { return GridGeometry<id>::discMethod == DiscretizationMethods::box; } public: void addBulkInterpolation(const ShapeValues& shapeValues, @@ -165,7 +165,7 @@ class PointSourceDataCircleAverage : public PointSourceData<MDTraits> template<std::size_t id> static constexpr bool isBox() - { return GridGeometry<id>::discMethod == DiscretizationMethod::box; } + { return GridGeometry<id>::discMethod == DiscretizationMethods::box; } public: PointSourceDataCircleAverage() : enableBulkCircleInterpolation_(false) {} diff --git a/dumux/multidomain/facet/box/couplingmanager.hh b/dumux/multidomain/facet/box/couplingmanager.hh index 760f830bddb673f75187077c21865ed820a8dae5..0f8066ad726cbb187ff2db62aba0a7f5276d4d56 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 MDTraits, class CouplingMapper, std::size_t bulkDomainId, std::size_t lowDimDomainId> -class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::box> +class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::Box> : public virtual CouplingManager< MDTraits > { using ParentType = CouplingManager< MDTraits >; @@ -90,7 +90,7 @@ class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainI static constexpr auto bulkGridId = CouplingMapper::template gridId<bulkDim>(); static constexpr auto lowDimGridId = CouplingMapper::template gridId<lowDimDim>(); - static constexpr bool lowDimUsesBox = GridGeometry<lowDimId>::discMethod == DiscretizationMethod::box; + static constexpr bool lowDimUsesBox = GridGeometry<lowDimId>::discMethod == DiscretizationMethods::box; /*! * \brief The coupling context of the bulk domain. Contains all data of the lower- diff --git a/dumux/multidomain/facet/box/couplingmapper.hh b/dumux/multidomain/facet/box/couplingmapper.hh index 2ea12b3a9b302535f72ba700196b8d7f3bb5c3a8..a7d4ecb59edfa8920e813e01f1b1fbe1897f498f 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 BulkFVG, class LowDimFVG, std::size_t bulkId, std::size_t lowDimId> -class FacetCouplingMapper<BulkFVG, LowDimFVG, bulkId, lowDimId, DiscretizationMethod::box> +class FacetCouplingMapper<BulkFVG, LowDimFVG, bulkId, lowDimId, DiscretizationMethods::Box> : public virtual FacetCouplingMapperBase<BulkFVG, LowDimFVG, bulkId, lowDimId> { using ParentType = FacetCouplingMapperBase<BulkFVG, LowDimFVG, bulkId, lowDimId>; @@ -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<LowDimIndexType>({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/box/fickslaw.hh b/dumux/multidomain/facet/box/fickslaw.hh index 6ae5704709e0ab406bd5ab7d7b20017a7dc72f55..075aa5f17520f2a376f3c15a8ab073f600c57121 100644 --- a/dumux/multidomain/facet/box/fickslaw.hh +++ b/dumux/multidomain/facet/box/fickslaw.hh @@ -49,9 +49,9 @@ namespace Dumux { */ template<class TypeTag, ReferenceSystemFormulation referenceSystem = ReferenceSystemFormulation::massAveraged> class BoxFacetCouplingFicksLaw -: public FicksLawImplementation<TypeTag, DiscretizationMethod::box, referenceSystem> +: public FicksLawImplementation<TypeTag, DiscretizationMethods::Box, referenceSystem> { - using ParentType = FicksLawImplementation<TypeTag, DiscretizationMethod::box, referenceSystem>; + using ParentType = FicksLawImplementation<TypeTag, DiscretizationMethods::Box, referenceSystem>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using FVElementGeometry = typename GridGeometry::LocalView; diff --git a/dumux/multidomain/facet/box/fourierslaw.hh b/dumux/multidomain/facet/box/fourierslaw.hh index e492a8b3d733d2d78c1003cdd039cf0118b8929b..a6363228c35c4ab4448f953534fe9227a5e43ccc 100644 --- a/dumux/multidomain/facet/box/fourierslaw.hh +++ b/dumux/multidomain/facet/box/fourierslaw.hh @@ -50,9 +50,9 @@ namespace Dumux { */ template<class TypeTag> class BoxFacetCouplingFouriersLaw -: public FouriersLawImplementation<TypeTag, DiscretizationMethod::box> +: public FouriersLawImplementation<TypeTag, DiscretizationMethods::Box> { - using ParentType = FouriersLawImplementation<TypeTag, DiscretizationMethod::box>; + using ParentType = FouriersLawImplementation<TypeTag, DiscretizationMethods::Box>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; diff --git a/dumux/multidomain/facet/box/fvgridgeometry.hh b/dumux/multidomain/facet/box/fvgridgeometry.hh index deff0e2f51b51405a28a1465f0d6f3b67e079477..d6b087a68a670173ea345ed99fe95818f2de442c 100644 --- a/dumux/multidomain/facet/box/fvgridgeometry.hh +++ b/dumux/multidomain/facet/box/fvgridgeometry.hh @@ -109,8 +109,9 @@ class BoxFacetCouplingFVGridGeometry<Scalar, GV, true, Traits> using GeometryHelper = BoxGeometryHelper<GV, dim, typename Traits::SubControlVolume, 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<ThisType, true>; @@ -422,8 +423,9 @@ class BoxFacetCouplingFVGridGeometry<Scalar, GV, false, Traits> 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<ThisType, false>; diff --git a/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh b/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh index d0826800c2cc91099adfa97657ec90a76c18ce9e..55e420cb0622d67bcb0323a49bd5b78f26f4aab9 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 MDTraits, class CouplingMapper, std::size_t bulkDomainId, std::size_t lowDimDomainId> -class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::ccmpfa> -: public FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::cctpfa> +class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCMpfa> +: public FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa> { - using ParentType = FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::cctpfa>; + using ParentType = FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa>; // domain id instances using BulkIdType = typename MDTraits::template SubDomain<bulkDomainId>::Index; @@ -89,7 +89,7 @@ class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainI static constexpr auto bulkGridId = CouplingMapper::template gridId<bulkDim>(); static constexpr auto lowDimGridId = CouplingMapper::template gridId<lowDimDim>(); - static constexpr bool lowDimUsesBox = GridGeometry<lowDimId>::discMethod == DiscretizationMethod::box; + static constexpr bool lowDimUsesBox = GridGeometry<lowDimId>::discMethod == DiscretizationMethods::box; public: diff --git a/dumux/multidomain/facet/cellcentered/mpfa/couplingmapper.hh b/dumux/multidomain/facet/cellcentered/mpfa/couplingmapper.hh index 3ce2b844b1365acd2b76410615ee1db411c041ad..d1b14615f2ea0d8744aa7543cbde61b84d98eb7d 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 BulkFVG, class LowDimFVG, std::size_t bulkId, std::size_t lowDimId> -class FacetCouplingMapper<BulkFVG, LowDimFVG, bulkId, lowDimId, DiscretizationMethod::ccmpfa> +class FacetCouplingMapper<BulkFVG, LowDimFVG, bulkId, lowDimId, DiscretizationMethods::CCMpfa> : public virtual FacetCouplingMapperBase<BulkFVG, LowDimFVG, bulkId, lowDimId> { using ParentType = FacetCouplingMapperBase<BulkFVG, LowDimFVG, bulkId, lowDimId>; @@ -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<LowDimIndexType>( {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 b1962df82d94929be9686d164f72a732159c9550..12ac45738a8a84ed410bbe7ea3bff52235d2c7ac 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 MDTraits, class CouplingMapper, std::size_t bulkDomainId, std::size_t lowDimDomainId> -class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::cctpfa> +class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa> : public virtual CouplingManager< MDTraits > { using ParentType = CouplingManager< MDTraits >; @@ -98,7 +98,7 @@ class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainI static constexpr auto bulkGridId = CouplingMapper::template gridId<bulkDim>(); static constexpr auto lowDimGridId = CouplingMapper::template gridId<lowDimDim>(); - static constexpr bool lowDimUsesBox = GridGeometry<lowDimId>::discMethod == DiscretizationMethod::box; + static constexpr bool lowDimUsesBox = GridGeometry<lowDimId>::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 37bc2ec1471288877cc9a725d7dad64bd67ef101..b9654486b9cce31b14b625da82589002c832f80b 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 BulkFVG, class LowDimFVG, std::size_t bulkId, std::size_t lowDimId> -class FacetCouplingMapper<BulkFVG, LowDimFVG, bulkId, lowDimId, DiscretizationMethod::cctpfa> +class FacetCouplingMapper<BulkFVG, LowDimFVG, bulkId, lowDimId, DiscretizationMethods::CCTpfa> : public virtual FacetCouplingMapperBase<BulkFVG, LowDimFVG, bulkId, lowDimId> { using ParentType = FacetCouplingMapperBase<BulkFVG, LowDimFVG, bulkId, lowDimId>; @@ -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<LowDimIndexType>( {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/cellcentered/tpfa/darcyslaw.hh b/dumux/multidomain/facet/cellcentered/tpfa/darcyslaw.hh index 937c76b9a344204df9d6ad625ab350c68b536956..05c4ec5d7abb274ae2604eda9af6ccbfd265baec 100644 --- a/dumux/multidomain/facet/cellcentered/tpfa/darcyslaw.hh +++ b/dumux/multidomain/facet/cellcentered/tpfa/darcyslaw.hh @@ -155,7 +155,8 @@ class CCTpfaFacetCouplingDarcysLawImpl<ScalarType, GridGeometry, /*isNetwork*/fa //! state the scalar type of the law using Scalar = ScalarType; //! export the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + using DiscretizationMethod = DiscretizationMethods::CCTpfa; + static constexpr DiscretizationMethod discMethod{}; //! export the type for the corresponding cache using Cache = CCTpfaFacetCouplingDarcysLawCache<ThisType, GridGeometry, /*isNetwork*/false>; //! export the type used to store transmissibilities @@ -428,7 +429,8 @@ class CCTpfaFacetCouplingDarcysLawImpl<ScalarType, GridGeometry, /*isNetwork*/tr //! state the scalar type of the law using Scalar = ScalarType; //! state the discretization method this implementation belongs to - static const DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + using DiscretizationMethod = DiscretizationMethods::CCTpfa; + static constexpr DiscretizationMethod discMethod{}; //! state the type for the corresponding cache using Cache = CCTpfaFacetCouplingDarcysLawCache<ThisType, GridGeometry, /*isNetwork*/true>; //! 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 e009f41b12401a59929f2d71a0a88988f57dfb6e..f56365cb5e5347557f0588b544f0ce5b49cfabf1 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 TypeTag, ReferenceSystemFormulation referenceSystem> class CCTpfaFacetCouplingFicksLawImpl<TypeTag, referenceSystem, /*isNetwork*/false> -: public FicksLawImplementation<TypeTag, DiscretizationMethod::cctpfa, referenceSystem> +: public FicksLawImplementation<TypeTag, DiscretizationMethods::CCTpfa, referenceSystem> { using Implementation = CCTpfaFacetCouplingFicksLawImpl<TypeTag, referenceSystem, false>; - using ParentType = FicksLawImplementation<TypeTag, DiscretizationMethod::cctpfa, referenceSystem>; + using ParentType = FicksLawImplementation<TypeTag, DiscretizationMethods::CCTpfa, referenceSystem>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; 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 TypeTag, ReferenceSystemFormulation referenceSystem> class CCTpfaFacetCouplingFicksLawImpl<TypeTag, referenceSystem, /*isNetwork*/true> -: public FicksLawImplementation<TypeTag, DiscretizationMethod::cctpfa, referenceSystem> +: public FicksLawImplementation<TypeTag, DiscretizationMethods::CCTpfa, referenceSystem> { using Implementation = CCTpfaFacetCouplingFicksLawImpl<TypeTag, referenceSystem, true>; - using ParentType = FicksLawImplementation<TypeTag, DiscretizationMethod::cctpfa, referenceSystem>; + using ParentType = FicksLawImplementation<TypeTag, DiscretizationMethods::CCTpfa, referenceSystem>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; 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 6e43c638be04d57de0f6d65139e056f6b629f580..4c979da2c29d307c6993360c4d08f88966597fbb 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 TypeTag> class CCTpfaFacetCouplingFouriersLawImpl<TypeTag, /*isNetwork*/false> -: public FouriersLawImplementation<TypeTag, DiscretizationMethod::cctpfa> +: public FouriersLawImplementation<TypeTag, DiscretizationMethods::CCTpfa> { using Implementation = CCTpfaFacetCouplingFouriersLawImpl<TypeTag, false>; - using ParentType = FouriersLawImplementation<TypeTag, DiscretizationMethod::cctpfa>; + using ParentType = FouriersLawImplementation<TypeTag, DiscretizationMethods::CCTpfa>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; @@ -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 TypeTag> class CCTpfaFacetCouplingFouriersLawImpl<TypeTag, /*isNetwork*/true> -: public FouriersLawImplementation<TypeTag, DiscretizationMethod::cctpfa> +: public FouriersLawImplementation<TypeTag, DiscretizationMethods::CCTpfa> { using Implementation = CCTpfaFacetCouplingFouriersLawImpl<TypeTag, true>; - using ParentType = FouriersLawImplementation<TypeTag, DiscretizationMethod::cctpfa>; + using ParentType = FouriersLawImplementation<TypeTag, DiscretizationMethods::CCTpfa>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; @@ -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 > diff --git a/dumux/multidomain/facet/couplingmanager.hh b/dumux/multidomain/facet/couplingmanager.hh index 9f60d0a04319985b445420fef2fb8dc7ffc47f09..d173c9b5e725afc8273f5bd6965f6ea30df6b0b6 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<typename MDTraits::template SubDomain<bulkDomainId>::TypeTag, Properties::GridGeometry>::discMethod > + class DiscretizationMethod = typename GetPropType<typename MDTraits::template SubDomain<bulkDomainId>::TypeTag, Properties::GridGeometry>::DiscretizationMethod > class FacetCouplingManager; /*! @@ -148,7 +148,7 @@ class FacetCouplingThreeDomainManager // helper function to check if a domain uses mpfa template<std::size_t id> static constexpr bool usesMpfa(Dune::index_constant<id> domainId) - { return GridGeometry<domainId>::discMethod == DiscretizationMethod::ccmpfa; } + { return GridGeometry<domainId>::discMethod == DiscretizationMethods::ccmpfa; } public: //! types used for coupling stencils diff --git a/dumux/multidomain/facet/couplingmapper.hh b/dumux/multidomain/facet/couplingmapper.hh index 844e8bccb3ea78bd18a329505bcd9c3cf661df91..c65fe498fbd9983da093d2e2290713eba0588194 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; /*! diff --git a/dumux/multidomain/fvassembler.hh b/dumux/multidomain/fvassembler.hh index 8f88cc3d37a348de7ff8b82ce24e6a0f5fc9b381..329729be59df5ccbbbc696b255ca9288b0b5446c 100644 --- a/dumux/multidomain/fvassembler.hh +++ b/dumux/multidomain/fvassembler.hh @@ -104,41 +104,41 @@ private: using TimeLoop = TimeLoopBase<Scalar>; using ThisType = MultiDomainFVAssembler<MDTraits, CouplingManager, diffMethod, isImplicit()>; - template<DiscretizationMethod discMethod, std::size_t id> + template<class DiscretizationMethod, std::size_t id> struct SubDomainAssemblerType; template<std::size_t id> - struct SubDomainAssemblerType<DiscretizationMethod::cctpfa, id> + struct SubDomainAssemblerType<DiscretizationMethods::CCTpfa, id> { using type = SubDomainCCLocalAssembler<id, SubDomainTypeTag<id>, ThisType, diffMethod, isImplicit()>; }; template<std::size_t id> - struct SubDomainAssemblerType<DiscretizationMethod::ccmpfa, id> + struct SubDomainAssemblerType<DiscretizationMethods::CCMpfa, id> { using type = SubDomainCCLocalAssembler<id, SubDomainTypeTag<id>, ThisType, diffMethod, isImplicit()>; }; template<std::size_t id> - struct SubDomainAssemblerType<DiscretizationMethod::box, id> + struct SubDomainAssemblerType<DiscretizationMethods::Box, id> { using type = SubDomainBoxLocalAssembler<id, SubDomainTypeTag<id>, ThisType, diffMethod, isImplicit()>; }; template<std::size_t id> - struct SubDomainAssemblerType<DiscretizationMethod::staggered, id> + struct SubDomainAssemblerType<DiscretizationMethods::Staggered, id> { using type = SubDomainStaggeredLocalAssembler<id, SubDomainTypeTag<id>, ThisType, diffMethod, isImplicit()>; }; template<std::size_t id> - struct SubDomainAssemblerType<DiscretizationMethod::fcstaggered, id> + struct SubDomainAssemblerType<DiscretizationMethods::FCStaggered, id> { using type = SubDomainFaceCenteredLocalAssembler<id, SubDomainTypeTag<id>, ThisType, diffMethod, isImplicit()>; }; template<std::size_t id> - using SubDomainAssembler = typename SubDomainAssemblerType<GridGeometry<id>::discMethod, id>::type; + using SubDomainAssembler = typename SubDomainAssemblerType<typename GridGeometry<id>::DiscretizationMethod, id>::type; public: @@ -253,7 +253,7 @@ public: if (gridView.comm().size() > 1 && gridView.overlapSize(0) == 0) { - if constexpr (GridGeometry<domainId>::discMethod == DiscretizationMethod::box) + if constexpr (GridGeometry<domainId>::discMethod == DiscretizationMethods::box) { using GV = typename GridGeometry<domainId>::GridView; using DM = typename GridGeometry<domainId>::VertexMapper; @@ -558,7 +558,7 @@ private: template<std::size_t i, class JacRow, class Sol, class GG> void enforcePeriodicConstraints_(Dune::index_constant<i> 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 87bc571b011835cfa07ef6d4210e55f3e69f993d..3bb5fefddee8cb7ee5300a8a334da78b9078b4e4 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<std::size_t i, typename std::enable_if_t<(GridGeometry<i>::discMethod != DiscretizationMethod::staggered), int> = 0> + template<std::size_t i, typename std::enable_if_t<(GridGeometry<i>::discMethod != DiscretizationMethods::staggered), int> = 0> decltype(auto) numericEpsilon(Dune::index_constant<i> 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<std::size_t i, typename std::enable_if_t<(GridGeometry<i>::discMethod == DiscretizationMethod::staggered), int> = 0> + template<std::size_t i, typename std::enable_if_t<(GridGeometry<i>::discMethod == DiscretizationMethods::staggered), int> = 0> decltype(auto) numericEpsilon(Dune::index_constant<i>, const std::string& paramGroup) const { diff --git a/dumux/nonlinear/newtonconvergencewriter.hh b/dumux/nonlinear/newtonconvergencewriter.hh index cadf82de45baa1cb862b1d1768bf5ccb8c54bcd3..960446bfeef54f2d2921f3e2fcf6fd34aa766ee5 100644 --- a/dumux/nonlinear/newtonconvergencewriter.hh +++ b/dumux/nonlinear/newtonconvergencewriter.hh @@ -57,7 +57,7 @@ class NewtonConvergenceWriter : public ConvergenceWriterInterface<SolutionVector static constexpr auto numEq = SolutionVector::block_type::dimension; using Scalar = typename SolutionVector::block_type::value_type; - static_assert(GridGeometry::discMethod != DiscretizationMethod::staggered, + static_assert(GridGeometry::discMethod != DiscretizationMethods::staggered, "This convergence writer does not work for the staggered method, use the StaggeredNewtonConvergenceWriter instead"); public: /*! @@ -72,7 +72,7 @@ public: { resize(); - if (GridGeometry::discMethod == DiscretizationMethod::box) + if (GridGeometry::discMethod == DiscretizationMethods::box) { for (int eqIdx = 0; eqIdx < numEq; ++eqIdx) { diff --git a/dumux/nonlinear/staggerednewtonconvergencewriter.hh b/dumux/nonlinear/staggerednewtonconvergencewriter.hh index 251a6d53799180b522c930d120b0ad87b2cdff52..2e85f987e45c899e53ae8e7166848aa746cd145f 100644 --- a/dumux/nonlinear/staggerednewtonconvergencewriter.hh +++ b/dumux/nonlinear/staggerednewtonconvergencewriter.hh @@ -59,7 +59,7 @@ class StaggeredNewtonConvergenceWriter : public ConvergenceWriterInterface<Solut using Element = typename GridView::template Codim<0>::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/porenetwork/2p/model.hh b/dumux/porenetwork/2p/model.hh index 16591c003b4b0813a75e0586e7f5a3993b7dffeb..dc62bdea76e2691471d8a60fff450eae639e8aeb 100644 --- a/dumux/porenetwork/2p/model.hh +++ b/dumux/porenetwork/2p/model.hh @@ -108,7 +108,7 @@ private: using MT = GetPropType<TypeTag, Properties::ModelTraits>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of non-wetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; @@ -196,7 +196,7 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of non-wetting phase saturations using SR = Dumux::TwoPScvSaturationReconstruction<DM, enableIS>; diff --git a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh index 184fffe06813e17520a0dcb73076d3d5785f5255..58b8295958afde26185c56e05780bc0b40b154f1 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<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethod::cctpfa, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::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<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethod::ccmpfa, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::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<class JacobianMatrix, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::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<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethod::cctpfa, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::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<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethod::ccmpfa, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::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 ea021f19ba860dfaa0d9ec2734cb494d718effbb..69a75ce3d035e208c7e9b590bc6a995844bc370c 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 ae38682188dea2c2e816764e04b568250895c59d..7dc206f8d1a33eae397d99a10e8818c66085eaca 100644 --- a/dumux/porousmediumflow/2p/griddatatransfer.hh +++ b/dumux/porousmediumflow/2p/griddatatransfer.hh @@ -81,7 +81,7 @@ class TwoPGridDataTransfer : public GridDataTransfer<GetPropType<TypeTag, Proper static constexpr int dim = Grid::dimension; static constexpr int dimWorld = Grid::dimensionworld; - static constexpr bool isBox = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GetPropType<TypeTag, Properties::GridGeometry>::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 66fa5b3f791c645d553c8505ae6f2e5d66a9b8f2..659f70db00b9683a9a079163604771b5efbaf0f9 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<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethod::cctpfa, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::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<class JacobianMatrix, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethods::box, void> addFluxDerivatives(JacobianMatrix& A, const Problem& problem, const Element& element, diff --git a/dumux/porousmediumflow/2p/model.hh b/dumux/porousmediumflow/2p/model.hh index da5b73bd5c1c7d9e49d9c74eb67397693e53e943..861af18674af687532b9344aff9aa89cdeb7d90f 100644 --- a/dumux/porousmediumflow/2p/model.hh +++ b/dumux/porousmediumflow/2p/model.hh @@ -179,8 +179,7 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; - - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; @@ -221,7 +220,7 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; diff --git a/dumux/porousmediumflow/2p/saturationreconstruction.hh b/dumux/porousmediumflow/2p/saturationreconstruction.hh index 7a94627486ff4d541f523e2db2b43e3b367cb472..1ca95906d85f9b0b30f280823825428fadb86537 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<DiscretizationMethod M, bool enableReconstruction> +template<class DiscretizationMethod, bool enableReconstruction> class TwoPScvSaturationReconstruction { public: @@ -67,7 +67,7 @@ public: //! Specialization for the box scheme with the interface solver enabled template<> -class TwoPScvSaturationReconstruction<DiscretizationMethod::box, /*enableReconstruction*/true> +class TwoPScvSaturationReconstruction<DiscretizationMethods::Box, /*enableReconstruction*/true> { public: /*! diff --git a/dumux/porousmediumflow/2p2c/model.hh b/dumux/porousmediumflow/2p2c/model.hh index 1c7e87633cc33b02c6d0e05eb8108de0ac682898..b5128343d3db947adfcb8890f0873ceb4ccb1ea5 100644 --- a/dumux/porousmediumflow/2p2c/model.hh +++ b/dumux/porousmediumflow/2p2c/model.hh @@ -144,7 +144,7 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); 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<TypeTag, Properties::SolidState>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; @@ -298,7 +298,7 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; @@ -368,7 +368,7 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; diff --git a/dumux/porousmediumflow/2pnc/model.hh b/dumux/porousmediumflow/2pnc/model.hh index bc16441281972faa3c6ba034b547497807fe0507..ea496490a7f175d7689ea4520bab039907db7175 100644 --- a/dumux/porousmediumflow/2pnc/model.hh +++ b/dumux/porousmediumflow/2pnc/model.hh @@ -173,7 +173,7 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; @@ -271,7 +271,7 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; diff --git a/dumux/porousmediumflow/2pncmin/model.hh b/dumux/porousmediumflow/2pncmin/model.hh index 3a73d713b70ab1ff9c02d862bb4761356cd9a9d9..9b76c16e99f0d58516783ebad50334dd51a15c10 100644 --- a/dumux/porousmediumflow/2pncmin/model.hh +++ b/dumux/porousmediumflow/2pncmin/model.hh @@ -136,7 +136,7 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; @@ -212,7 +212,7 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; diff --git a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh index 16dd5b706c767b383041da5cacea35b25f5c2a98..5d99c297f54a74fb141504e397697ef09a8fdd72 100644 --- a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh +++ b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh @@ -115,8 +115,9 @@ class BoxDfmFVGridGeometry<Scalar, GV, true, Traits> 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<ThisType, true>; @@ -446,8 +447,9 @@ class BoxDfmFVGridGeometry<Scalar, GV, false, Traits> 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<ThisType, false>; diff --git a/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh b/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh index d4b527da95f66d8e51d52b8cc2d2b59962ed4293..a7efead19c21154a3d7fa725c77493589be15ddd 100644 --- a/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh +++ b/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh @@ -80,7 +80,7 @@ class BoxDfmVtkOutputModule : public VtkOutputModule<GridVariables, SolutionVect static_assert(dim > 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/co2/model.hh b/dumux/porousmediumflow/co2/model.hh index bc48834f91ed387439f31e80d5e2885501ddaf80..79be63baced5eb40ebce6e24bb0f5d8ec9634bf1 100644 --- a/dumux/porousmediumflow/co2/model.hh +++ b/dumux/porousmediumflow/co2/model.hh @@ -69,7 +69,7 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; @@ -99,7 +99,7 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr auto DM = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; + using DM = typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod; static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of nonwetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; diff --git a/dumux/porousmediumflow/compositional/primaryvariableswitch.hh b/dumux/porousmediumflow/compositional/primaryvariableswitch.hh index 2af0fbf74956dc831b285bc0ccc0247ac6ff6870..5049349d11d3bda3f511d9e4703ba31d7148aad4 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<bool> 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/fluxvariablescache.hh b/dumux/porousmediumflow/fluxvariablescache.hh index 892d251b17aadfb92cf7be2dab48de5c52b27430..6a00418fc55a0f4cb5d2204d5e0a38afbf348a1a 100644 --- a/dumux/porousmediumflow/fluxvariablescache.hh +++ b/dumux/porousmediumflow/fluxvariablescache.hh @@ -32,7 +32,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class PorousMediumFluxVariablesCacheImplementation; /////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -50,12 +50,12 @@ class PorousMediumFluxVariablesCacheImplementation; * cache class are provided for different combinations of processes. */ template<class TypeTag> -using PorousMediumFluxVariablesCache = PorousMediumFluxVariablesCacheImplementation<TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using PorousMediumFluxVariablesCache = PorousMediumFluxVariablesCacheImplementation<TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::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 TypeTag> -class PorousMediumFluxVariablesCacheImplementation<TypeTag, DiscretizationMethod::box> +class PorousMediumFluxVariablesCacheImplementation<TypeTag, DiscretizationMethods::Box> : public BoxFluxVariablesCache<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::GridGeometry>> { public: @@ -77,7 +77,7 @@ template<class TypeTag> class EnergyCacheChooser<TypeTag, true> : public GetProp // specialization for the cell centered tpfa method template<class TypeTag> -class PorousMediumFluxVariablesCacheImplementation<TypeTag, DiscretizationMethod::cctpfa> +class PorousMediumFluxVariablesCacheImplementation<TypeTag, DiscretizationMethods::CCTpfa> : public AdvectionCacheChooser<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableAdvection()> , public DiffusionCacheChooser<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableMolecularDiffusion()> , public EnergyCacheChooser<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::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 TypeTag> -class PorousMediumFluxVariablesCacheImplementation<TypeTag, DiscretizationMethod::ccmpfa> +class PorousMediumFluxVariablesCacheImplementation<TypeTag, DiscretizationMethods::CCMpfa> : public AdvectionCacheChooser<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableAdvection()> , public DiffusionCacheChooser<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableMolecularDiffusion()> , public EnergyCacheChooser<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableEnergyBalance()> diff --git a/dumux/porousmediumflow/fluxvariablescachefiller.hh b/dumux/porousmediumflow/fluxvariablescachefiller.hh index c84a239b0ca9d966d074af27cffa539d1ba526d1..0c220608e8e805bf01a218c26159868a5d18c37a 100644 --- a/dumux/porousmediumflow/fluxvariablescachefiller.hh +++ b/dumux/porousmediumflow/fluxvariablescachefiller.hh @@ -35,7 +35,7 @@ namespace Dumux { // forward declaration -template<class TypeTag, DiscretizationMethod discMethod> +template<class TypeTag, class DiscretizationMethod> class PorousMediumFluxVariablesCacheFillerImplementation; /*! @@ -45,11 +45,11 @@ class PorousMediumFluxVariablesCacheFillerImplementation; * Helps filling the flux variables cache depending several policies */ template<class TypeTag> -using PorousMediumFluxVariablesCacheFiller = PorousMediumFluxVariablesCacheFillerImplementation<TypeTag, GetPropType<TypeTag, Properties::GridGeometry>::discMethod>; +using PorousMediumFluxVariablesCacheFiller = PorousMediumFluxVariablesCacheFillerImplementation<TypeTag, typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod>; //! Specialization of the flux variables cache filler for the cell centered tpfa method template<class TypeTag> -class PorousMediumFluxVariablesCacheFillerImplementation<TypeTag, DiscretizationMethod::cctpfa> +class PorousMediumFluxVariablesCacheFillerImplementation<TypeTag, DiscretizationMethods::CCTpfa> { using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Problem = GetPropType<TypeTag, Properties::Problem>; @@ -188,7 +188,7 @@ private: //! Specialization of the flux variables cache filler for the cell centered mpfa method template<class TypeTag> -class PorousMediumFluxVariablesCacheFillerImplementation<TypeTag, DiscretizationMethod::ccmpfa> +class PorousMediumFluxVariablesCacheFillerImplementation<TypeTag, DiscretizationMethods::CCMpfa> { using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Problem = GetPropType<TypeTag, Properties::Problem>; @@ -531,7 +531,7 @@ private: if constexpr (advectionEnabled) { using AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>; - 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<TypeTag, Properties::MolecularDiffusionType>; - 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<TypeTag, Properties::HeatConductionType>; - 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 d73498b836465b715b5e5e86177efe596ee8dabf..0d469d9337718c34751c3fb3e6b7078b7c55a468 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 6e8302f553f88f0723ee5c7830129d055b4d9da3..8f8b691c28cc7faaf19aacf6782a850faef3fb72 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<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethod::cctpfa, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::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<class JacobianMatrix, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::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 717401ec70ed2f19bcb24d53b3b37fd151ff732e..dd4d416378b5e0daec4ca0a909c2c427e3b20ed9 100644 --- a/dumux/porousmediumflow/tracer/localresidual.hh +++ b/dumux/porousmediumflow/tracer/localresidual.hh @@ -237,7 +237,7 @@ public: } template<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod != DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::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<class JacobianMatrix, class T = TypeTag> - std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::GridGeometry>::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 86ed6728f9f3b3902f38fa535999ac87a4738b87..5b91e765de619f5aef60532a098b3404760cd235 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 a3319b14e86f0fb8e25b5c0f1c9ac086487f39d3..161ea07c337124f933065e31322b0708b9cc8d88 100644 --- a/dumux/porousmediumflow/velocityoutput.hh +++ b/dumux/porousmediumflow/velocityoutput.hh @@ -59,7 +59,7 @@ class PorousMediumFlowVelocityOutput : public VelocityOutput<GridVariables> 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 21e6904314289d94844d44cfc21ef630f9b54422..86eb699bc1375c887dc0975f9e23e8bcb2100c70 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<std::size_t>(PrimaryVariables::dimension); using BoundaryTypes = Dumux::BoundaryTypes<PrimaryVariables::dimension>; diff --git a/dumux/python/discretization/gridgeometry.hh b/dumux/python/discretization/gridgeometry.hh index da63fefee99642ceab2ae4665c14efaa15bb6336..31e4f40275232b785744755235a7946010ff00ac 100644 --- a/dumux/python/discretization/gridgeometry.hh +++ b/dumux/python/discretization/gridgeometry.hh @@ -152,7 +152,7 @@ void registerGridGeometry(pybind11::handle scope, pybind11::class_<GG, Options.. cls.def_property_readonly("gridView", &GG::gridView); cls.def_property_readonly_static("discMethod", [](const pybind11::object&){ - return toString(GG::discMethod); + return GG::discMethod.name(); }); cls.def_property_readonly("localView", [](GG& self){ diff --git a/dumux/python/porousmediumflow/problem.hh b/dumux/python/porousmediumflow/problem.hh index 30c72f3b405c489559dc6d940f453f5c24cf2061..245bf11a9c3afb68a0482cbc9cb84fb8664c40ad 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<std::size_t>(PrimaryVariables::dimension); using BoundaryTypes = Dumux::BoundaryTypes<PrimaryVariables::dimension>; diff --git a/test/linear/test_linearsolver.cc b/test/linear/test_linearsolver.cc index 0893455a19f4b9936d60a74523ffaae286c72b67..67e51b91115836d082cfcff7d01013ed334ec356 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<GridView>; using VertexMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>; - static constexpr auto discMethod = DiscretizationMethod::box; + using DiscretizationMethod = DiscretizationMethods::Box; + static constexpr DiscretizationMethod discMethod{}; }; template<class M, class X, class V> diff --git a/test/multidomain/facet/1p_1p/analytical/main.cc b/test/multidomain/facet/1p_1p/analytical/main.cc index 469735bbafe1a2c279e71c4e127d6080fbefb85f..e242b4967f123caacf424a63016386aadbaca279 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<typename GridManager::Embeddings>; 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<decltype(x[bulkId])>; using LowDimSolutionVector = std::decay_t<decltype(x[lowDimId])>; VtkOutputModule<BulkGridVariables, BulkSolutionVector> 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<BulkGrid::dimension>(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<LowDimGrid::dimension>(i).geometry().center() ); diff --git a/test/multidomain/facet/1p_1p/threedomain/main.cc b/test/multidomain/facet/1p_1p/threedomain/main.cc index 054d80c01879feb794618e2065ad404c9a041fd3..90d5bab4af6f6a6fcd85bd55faee523af27ec201 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<GridGeometry::discMethod == Dumux::DiscretizationMethod::box, int> = 0 > + std::enable_if_t<GridGeometry::discMethod == Dumux::DiscretizationMethods::box, int> = 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<GridGeometry::discMethod != Dumux::DiscretizationMethod::box, int> = 0 > + std::enable_if_t<GridGeometry::discMethod != Dumux::DiscretizationMethods::box, int> = 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 ef93d5c5603520881e93524e9e75e7ad57b4b626..fd905ba855adc00b939acde55def1ba4cc33f527 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<typename GridManager::Embeddings>; BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); diff --git a/test/multidomain/facet/test_facetcouplingmapper.cc b/test/multidomain/facet/test_facetcouplingmapper.cc index 7da8cae385a9b8417ff23f38b10ed412ed9fc16a..9ff55156a135fd534201303c9e090f628b561e22 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<typename GridManager::Embeddings>; 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 2e3b863e5b64827e2af0c196efe4f6ad978ba7e7..e64f9e1b5c1c5fda177ab2cdc3dc7e044b4f9cbc 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<typename GridManager::Embeddings>; BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); @@ -91,7 +91,7 @@ void computeVolumeFluxes(Storage& volumeFluxes, const Sol& sol, Dune::index_constant<id> 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<decltype(x[bulkId])>; using LowDimSolutionVector = std::decay_t<decltype(x[lowDimId])>; VtkOutputModule<BulkGridVariables, BulkSolutionVector> 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<decltype(x[bulkId])>; using LowDimSolutionVector = std::decay_t<decltype(x[lowDimId])>; VtkOutputModule<BulkGridVariables, BulkSolutionVector> 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 a1472f565e024e293dbf2235a2adb08fccbc991e..7a19e008fe55bcc835c9087a4356e9ed2646b8f2 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<GridGeometry, Scalar, TracerSpatialParams<GridGeometry, Scalar>>; - 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<Scalar, dimWorld>; diff --git a/test/porousmediumflow/1p/convergence/discretesolution/main.cc b/test/porousmediumflow/1p/convergence/discretesolution/main.cc index 0205eedb6881eb204d547c8b4e8426ab606c32c8..d3a77e7e13d8486c2563ebd35ebeeb41b7dbc788 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<TypeTag, Properties::GridGeometry>::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 90a767ad9311a718fe80b17f4317d27292e66c6d..111dc5a7bf4719b40e3eeace8f7e419184d815f8 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<class GridGeometry, class GridVariables, class Sol, - std::enable_if_t<GridGeometry::discMethod == Dumux::DiscretizationMethod::ccmpfa, int> = 0> + std::enable_if_t<GridGeometry::discMethod == Dumux::DiscretizationMethods::ccmpfa, int> = 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<class GridGeometry, class GridVariables, class Sol, - std::enable_if_t<GridGeometry::discMethod != Dumux::DiscretizationMethod::ccmpfa, int> = 0> + std::enable_if_t<GridGeometry::discMethod != Dumux::DiscretizationMethods::ccmpfa, int> = 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 0a84bb476efa7d4795e7276d1a7b88b817950c06..379fe54ca4eb11a9603fe3c1bf121937ac822681 100644 --- a/test/porousmediumflow/1p/network1d3d/problem.hh +++ b/test/porousmediumflow/1p/network1d3d/problem.hh @@ -73,7 +73,7 @@ class TubesTestProblem : public PorousMediumFlowProblem<TypeTag> using SubControlVolume = typename FVElementGeometry::SubControlVolume; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - enum { isBox = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethod::box }; + enum { isBox = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethods::box }; public: TubesTestProblem(std::shared_ptr<const GridGeometry> gridGeometry) diff --git a/test/porousmediumflow/1p/nonisothermal/main.cc b/test/porousmediumflow/1p/nonisothermal/main.cc index 74b658e8b880e210a1a5fe0bb9ff7d3cad759f04..509764ae409c481887dc2763c6e734c36067cdd2 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<TypeTag, Properties::Problem>; - const std::string paramGroup = GridGeometry::discMethod == DiscretizationMethod::ccmpfa ? "MpfaTest" : ""; + const std::string paramGroup = GridGeometry::discMethod == DiscretizationMethods::ccmpfa ? "MpfaTest" : ""; auto problem = std::make_shared<Problem>(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 7a399a5635b4e950baae2406d5ead5bef8d3ee65..3c95865ef720202113c039455cb1dbb1407c5b10 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<TypeTag> //! Property that defines whether mole or mass fractions are used static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); - static const bool isBox = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethod::box; + static const bool isBox = GetPropType<TypeTag, Properties::GridGeometry>::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 4fc0b961fe65d333065c3230dcbaf0475788c855..db672e12be1ae1f89a5fbca1d859ea3bf2131ae5 100644 --- a/test/porousmediumflow/1pncmin/nonisothermal/problem.hh +++ b/test/porousmediumflow/1pncmin/nonisothermal/problem.hh @@ -117,7 +117,7 @@ public: boundaryVaporMoleFrac_ = getParam<Scalar>("Problem.BoundaryMoleFraction"); boundaryTemperature_ = getParam<Scalar>("Problem.BoundaryTemperature"); - unsigned int codim = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethod::box ? dim : 0; + unsigned int codim = GetPropType<TypeTag, Properties::GridGeometry>::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 78753253ace4181c1cdcd7c88493e167e4865f37..bb5a1b49c4cf3d9c005d9bd5075966d6b7d62fa7 100644 --- a/test/porousmediumflow/2p/adaptive/problem.hh +++ b/test/porousmediumflow/2p/adaptive/problem.hh @@ -47,7 +47,7 @@ class TwoPTestProblemAdaptive : public TwoPTestProblem<TypeTag> using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; - static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; public: TwoPTestProblemAdaptive(std::shared_ptr<const GridGeometry> gridGeometry) diff --git a/test/porousmediumflow/2p/incompressible/spatialparams.hh b/test/porousmediumflow/2p/incompressible/spatialparams.hh index fdb750dcb2c7d3aa35d23757364e119b5d1a55e6..b5cf628e9dd6e67acac8b94a4d81d7ec71fb7a75 100644 --- a/test/porousmediumflow/2p/incompressible/spatialparams.hh +++ b/test/porousmediumflow/2p/incompressible/spatialparams.hh @@ -137,7 +137,7 @@ public: template<class SolutionVector> void updateMaterialInterfaces(const SolutionVector& x) { - if (GridGeometry::discMethod == DiscretizationMethod::box) + if (GridGeometry::discMethod == DiscretizationMethods::box) materialInterfaces_ = std::make_unique<MaterialInterfaces>(this->gridGeometry(), *this, x); } diff --git a/test/porousmediumflow/2p2c/chemicalnonequilibrium/problem.hh b/test/porousmediumflow/2p2c/chemicalnonequilibrium/problem.hh index 154d691cff67d8f0362505505fb086ee4d97f12c..28d64f12a908f798f536f3fdc601b6d113d92927 100644 --- a/test/porousmediumflow/2p2c/chemicalnonequilibrium/problem.hh +++ b/test/porousmediumflow/2p2c/chemicalnonequilibrium/problem.hh @@ -69,7 +69,7 @@ class TwoPTwoCChemicalNonequilibriumProblem : public PorousMediumFlowProblem<Typ 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; enum { dofCodim = isBox ? dim : 0 }; public: TwoPTwoCChemicalNonequilibriumProblem(std::shared_ptr<const GridGeometry> gridGeometry) diff --git a/test/porousmediumflow/2pnc/fuelcell/problem.hh b/test/porousmediumflow/2pnc/fuelcell/problem.hh index d43297e67269a3572c088e92ba0fe647fba24aee..54415b946293394bc17e0f453c15fa6f3310d014 100644 --- a/test/porousmediumflow/2pnc/fuelcell/problem.hh +++ b/test/porousmediumflow/2pnc/fuelcell/problem.hh @@ -74,7 +74,7 @@ class FuelCellProblem : public PorousMediumFlowProblem<TypeTag> #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 fc608bacb623a3344810621b4a344e3e30a3a4bd..d0a22787e692d5b2ef22ccdb6636d232a8ba86fa 100644 --- a/test/porousmediumflow/2pncmin/isothermal/problem.hh +++ b/test/porousmediumflow/2pncmin/isothermal/problem.hh @@ -142,7 +142,7 @@ public: temperatureHigh_ = getParam<Scalar>("FluidSystem.TemperatureHigh"); name_ = getParam<std::string>("Problem.Name"); - unsigned int codim = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethod::box ? dim : 0; + unsigned int codim = GetPropType<TypeTag, Properties::GridGeometry>::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 e662966c18dbb7f5193c9b7dc201364d24a8124e..7719df63e7df4219f824ad46c12cd3a558be2eea 100644 --- a/test/porousmediumflow/2pncmin/nonisothermal/problem.hh +++ b/test/porousmediumflow/2pncmin/nonisothermal/problem.hh @@ -147,7 +147,7 @@ public: initGasSaturation_ = getParam<Scalar>("Problem.InitialGasSaturation"); initSalinity_ = getParam<Scalar>("Problem.InitialSalinity"); - unsigned int codim = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethod::box ? dim : 0; + unsigned int codim = GetPropType<TypeTag, Properties::GridGeometry>::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 3e6db0df59f257f6aaea2fc6411cc2f3783fbd49..95ec669e2fa7043d4efa54e3736aacfc10500b3b 100644 --- a/test/porousmediumflow/co2/problem.hh +++ b/test/porousmediumflow/co2/problem.hh @@ -128,8 +128,9 @@ class HeterogeneousProblem : public PorousMediumFlowProblem<TypeTag> static constexpr bool useMoles = ModelTraits::useMoles(); // the discretization method we are using - static constexpr auto discMethod = GetPropType<TypeTag, Properties::GridGeometry>::discMethod; - static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box; + using DiscretizationMethod = DiscretizationMethods::Box; + static constexpr DiscretizationMethod discMethod{}; + static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box; // world dimension to access gravity vector static constexpr int dimWorld = GridView::dimensionworld; @@ -445,7 +446,7 @@ private: // vtk output std::vector<Scalar> vtkKxx_, vtkPorosity_, vtkBoxVolume_, vtkTemperature_; - ScvfToScvBoundaryTypes<BoundaryTypes, discMethod> scvfToScvBoundaryTypes_; + ScvfToScvBoundaryTypes<BoundaryTypes, DiscretizationMethod> scvfToScvBoundaryTypes_; }; } // end namespace Dumux diff --git a/test/porousmediumflow/mpnc/2p2ccomparison/problem.hh b/test/porousmediumflow/mpnc/2p2ccomparison/problem.hh index 034f6fed0565d916597c5f0ba492dfefedab3185..f419ef311d876f09abbf734af9d97cdcbff420ba 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<Scalar, numPhases>; - static constexpr bool isBox = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethods::box; public: MPNCComparisonProblem(std::shared_ptr<const GridGeometry> gridGeometry)