From b1d309b39e048ed7c346eff9021fa624f5e37048 Mon Sep 17 00:00:00 2001 From: Ivan Buntic <st116086@stud.uni-stuttgart.de> Date: Tue, 26 Oct 2021 14:38:46 +0200 Subject: [PATCH] [disc] Use discretization tags in the grid geometries --- dumux/discretization/box/fvgridgeometry.hh | 10 +++++---- .../cellcentered/mpfa/fvgridgeometry.hh | 8 ++++--- .../cellcentered/tpfa/fvgridgeometry.hh | 10 +++++---- .../facecentered/staggered/fvgridgeometry.hh | 16 +++++++++----- dumux/discretization/fem/fegridgeometry.hh | 7 +++--- .../porenetwork/gridgeometry.hh | 10 +++++---- .../staggered/fvgridgeometry.hh | 22 +++++++++++++------ dumux/multidomain/facet/box/fvgridgeometry.hh | 10 +++++---- .../porousmediumflow/boxdfm/fvgridgeometry.hh | 10 +++++---- 9 files changed, 64 insertions(+), 39 deletions(-) diff --git a/dumux/discretization/box/fvgridgeometry.hh b/dumux/discretization/box/fvgridgeometry.hh index 95938a6bd5..d2ea779d43 100644 --- a/dumux/discretization/box/fvgridgeometry.hh +++ b/dumux/discretization/box/fvgridgeometry.hh @@ -97,8 +97,9 @@ class BoxFVGridGeometry<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/cellcentered/mpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh index f29ba01a91..050e64142a 100644 --- a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh @@ -56,7 +56,7 @@ template<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 538031d5f4..80f6442203 100644 --- a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh @@ -112,7 +112,8 @@ public: using DofMapper = typename Traits::ElementMapper; //! export the discretization method this geometry belongs to - static constexpr DiscretizationMethod discMethod = DiscretizationMethod::cctpfa; + using DiscretizationMethod = DiscretizationMethods::CCTpfa; + static constexpr DiscretizationMethod discMethod{}; //! The maximum admissible stencil size (used for static memory allocation during assembly) static constexpr int maxElementStencilSize = LocalView::maxNumElementScvfs*Traits::maxNumScvfNeighbors + 1; @@ -125,7 +126,7 @@ public: : ParentType(gridView) { // Check if the overlap size is what we expect - if (!CheckOverlapSize<DiscretizationMethod::cctpfa>::isValid(gridView)) + if (!CheckOverlapSize<DiscretizationMethods::cctpfa>::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<DiscretizationMethods::cctpfa>::isValid(gridView)) DUNE_THROW(Dune::InvalidStateException, "The cctpfa discretization method needs at least an overlap of 1 for parallel computations. " << " Set the parameter \"Grid.Overlap\" in the input file."); diff --git a/dumux/discretization/facecentered/staggered/fvgridgeometry.hh b/dumux/discretization/facecentered/staggered/fvgridgeometry.hh index 18af7159e9..d76b73b76b 100644 --- a/dumux/discretization/facecentered/staggered/fvgridgeometry.hh +++ b/dumux/discretization/facecentered/staggered/fvgridgeometry.hh @@ -115,8 +115,10 @@ class FaceCenteredStaggeredFVGridGeometry<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<DiscretizationMethods::fcstaggered>::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<DiscretizationMethods::fcstaggered>::isValid(gridView)) DUNE_THROW(Dune::InvalidStateException, "The staggered discretization method needs at least an overlap of 1 for parallel computations. " << " Set the parameter \"Grid.Overlap\" in the input file."); diff --git a/dumux/discretization/fem/fegridgeometry.hh b/dumux/discretization/fem/fegridgeometry.hh index fff2242c47..5a99a1f334 100644 --- a/dumux/discretization/fem/fegridgeometry.hh +++ b/dumux/discretization/fem/fegridgeometry.hh @@ -69,8 +69,9 @@ class FEGridGeometry using LocalIndexType = typename IndexTraits<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<DiscretizationMethods::fem>::isValid(*feBasis)) DUNE_THROW(Dune::InvalidStateException, "The finite element discretization method only works with zero overlap for parallel computations. " << " Set the parameter \"Grid.Overlap\" in the input file."); } diff --git a/dumux/discretization/porenetwork/gridgeometry.hh b/dumux/discretization/porenetwork/gridgeometry.hh index ee3407341f..990f17e95a 100644 --- a/dumux/discretization/porenetwork/gridgeometry.hh +++ b/dumux/discretization/porenetwork/gridgeometry.hh @@ -510,8 +510,9 @@ class GridGeometry<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/fvgridgeometry.hh b/dumux/discretization/staggered/fvgridgeometry.hh index ca051c3071..1aea7a1b96 100644 --- a/dumux/discretization/staggered/fvgridgeometry.hh +++ b/dumux/discretization/staggered/fvgridgeometry.hh @@ -50,7 +50,11 @@ public: //! export the GridView type and the discretization method using GridView = typename ActualGridGeometry::GridView; - static constexpr DiscretizationMethod discMethod = DiscretizationMethod::staggered; + + //! export the discretization method this geometry belongs to + using DiscretizationMethod = DiscretizationMethods::Staggered; + static constexpr DiscretizationMethod discMethod{}; + using LocalView = typename ActualGridGeometry::LocalView; /*! @@ -196,8 +200,10 @@ public: //! export the traits using Traits = typename T::PublicTraits; - //! export discretization method - static constexpr DiscretizationMethod discMethod = DiscretizationMethod::staggered; + //! export the discretization method this geometry belongs to + using DiscretizationMethod = DiscretizationMethods::Staggered; + static constexpr DiscretizationMethod discMethod{}; + static constexpr int upwindSchemeOrder = T::upwindSchemeOrder; static constexpr bool useHigherOrder = upwindSchemeOrder > 1; static constexpr bool cachingEnabled = true; @@ -238,7 +244,7 @@ public: , intersectionMapper_(gridView) { // Check if the overlap size is what we expect - if (!CheckOverlapSize<DiscretizationMethod::staggered>::isValid(gridView)) + if (!CheckOverlapSize<DiscretizationMethods::staggered>::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<DiscretizationMethods::staggered>::isValid(gridView)) DUNE_THROW(Dune::InvalidStateException, "The staggered discretization method needs at least an overlap of 1 for parallel computations. " << " Set the parameter \"Grid.Overlap\" in the input file."); diff --git a/dumux/multidomain/facet/box/fvgridgeometry.hh b/dumux/multidomain/facet/box/fvgridgeometry.hh index deff0e2f51..d6b087a68a 100644 --- a/dumux/multidomain/facet/box/fvgridgeometry.hh +++ b/dumux/multidomain/facet/box/fvgridgeometry.hh @@ -109,8 +109,9 @@ class BoxFacetCouplingFVGridGeometry<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/porousmediumflow/boxdfm/fvgridgeometry.hh b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh index 16dd5b706c..5d99c297f5 100644 --- a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh +++ b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh @@ -115,8 +115,9 @@ class BoxDfmFVGridGeometry<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>; -- GitLab