diff --git a/dumux/assembly/staggeredfvassembler.hh b/dumux/assembly/staggeredfvassembler.hh index f9955bcbd2aabfe8f387c9e2c16bc9ca04411f47..710d42ef6b164002188a743f51782195507f2f24 100644 --- a/dumux/assembly/staggeredfvassembler.hh +++ b/dumux/assembly/staggeredfvassembler.hh @@ -56,14 +56,11 @@ class StaggeredFVAssembler using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); using TimeLoop = TimeLoopBase<typename GET_PROP_TYPE(TypeTag, Scalar)>; using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using LocalAssembler = StaggeredLocalAssembler<TypeTag, diffMethod, isImplicit>; static constexpr int dim = GridView::dimension; - - using LocalAssembler =StaggeredLocalAssembler<TypeTag, diffMethod, isImplicit>; - - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; + static constexpr auto cellCenterIdx = GET_PROP_TYPE(TypeTag, FVGridGeometry)::cellCenterIdx(); + static constexpr auto faceIdx = GET_PROP_TYPE(TypeTag, FVGridGeometry)::faceIdx(); using CCToCCMatrixBlock = typename GET_PROP(TypeTag, JacobianMatrix)::MatrixBlockCCToCC; using CCToFaceMatrixBlock = typename GET_PROP(TypeTag, JacobianMatrix)::MatrixBlockCCToFace; diff --git a/dumux/assembly/staggeredlocalassembler.hh b/dumux/assembly/staggeredlocalassembler.hh index 3241ac4ce969b9cf9c04cb40829b473e517cb852..1213bd150afc2e573aad32d7dbb2b586e965ec5d 100644 --- a/dumux/assembly/staggeredlocalassembler.hh +++ b/dumux/assembly/staggeredlocalassembler.hh @@ -98,6 +98,8 @@ class StaggeredLocalAssembler<TypeTag, static constexpr bool enableGridFluxVarsCache = GET_PROP_VALUE(TypeTag, EnableGridFluxVariablesCache); static constexpr auto faceOffset = GET_PROP_VALUE(TypeTag, NumEqCellCenter); + static constexpr auto cellCenterIdx = FVGridGeometry::cellCenterIdx(); + static constexpr auto faceIdx = FVGridGeometry::faceIdx(); public: @@ -110,10 +112,6 @@ public: const Element& element, const SolutionVector& curSol) { - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - // get some references for convenience const auto& problem = assembler.problem(); auto& localResidual = assembler.localResidual(); @@ -183,11 +181,6 @@ public: const Element& element, const SolutionVector& curSol) { - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - - // get some references for convenience const auto& problem = assembler.problem(); auto& localResidual = assembler.localResidual(); @@ -314,9 +307,6 @@ protected: JacobianMatrix& matrix, const NumCellCenterEqVector& ccResidual) { - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - const auto& problem = assembler.problem(); auto& localResidual = assembler.localResidual(); auto& gridVariables = assembler.gridVariables(); @@ -376,11 +366,6 @@ protected: JacobianMatrix& matrix, const NumCellCenterEqVector& ccResidual) { - // build derivatives with for cell center dofs w.r.t. face dofs - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - const auto& problem = assembler.problem(); auto& localResidual = assembler.localResidual(); auto& gridVariables = assembler.gridVariables(); @@ -440,10 +425,6 @@ protected: { for(auto&& scvf : scvfs(fvGeometry)) { - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - const auto& problem = assembler.problem(); auto& localResidual = assembler.localResidual(); auto& gridVariables = assembler.gridVariables(); @@ -505,9 +486,6 @@ protected: JacobianMatrix& matrix, const FaceSolutionVector& cachedResidual) { - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::FaceIdx faceIdx; - const auto& problem = assembler.problem(); auto& localResidual = assembler.localResidual(); const auto& connectivityMap = assembler.fvGridGeometry().connectivityMap(); @@ -612,7 +590,7 @@ protected: //! Helper function that returns an iterable range of primary variable indices. //! Specialization for cell center dofs. - static auto priVarIndices_(typename GET_PROP(TypeTag, DofTypeIndices)::CellCenterIdx) + static auto priVarIndices_(typename FVGridGeometry::DofTypeIndices::CellCenterIdx) { constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter); @@ -625,7 +603,7 @@ protected: //! Helper function that returns an iterable range of primary variable indices. //! Specialization for face dofs. - static auto priVarIndices_(typename GET_PROP(TypeTag, DofTypeIndices)::FaceIdx) + static auto priVarIndices_(typename FVGridGeometry::DofTypeIndices::FaceIdx) { constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter); constexpr auto numEqFace = GET_PROP_VALUE(TypeTag, NumEqFace); diff --git a/dumux/common/properties.hh b/dumux/common/properties.hh index f8dca5487c673dbd0d4b5b8847ae333763d08130..9c2b7bf1bc0e900a451b6be64616b50438af3c88 100644 --- a/dumux/common/properties.hh +++ b/dumux/common/properties.hh @@ -154,7 +154,6 @@ NEW_PROP_TAG(GridFaceVariables); //!< Global vector containing NEW_PROP_TAG(CellCenterPrimaryVariables); //!< The primary variables container type for cell-centered dofs NEW_PROP_TAG(FacePrimaryVariables); //!< The primary variables container type for face dofs NEW_PROP_TAG(IntersectionMapper); //!< Specifies the intersection mapper -NEW_PROP_TAG(DofTypeIndices); //!< Specifies index types for accessing the multi type block vectors/matrices NEW_PROP_TAG(StaggeredPrimaryVariables); //!< The hybrid primary variables container type NEW_PROP_TAG(BaseEpsilon); //!< A base epsilon for numerical differentiation, can contain multiple values NEW_PROP_TAG(FaceVariables); //!< Class containing local face-related data diff --git a/dumux/common/staggeredfvproblem.hh b/dumux/common/staggeredfvproblem.hh index 6484bd1721c24d0b19132392807f135a4cc084a3..7d68b6c00c3ee05dfe2570c3ea75b35bd2d2590b 100644 --- a/dumux/common/staggeredfvproblem.hh +++ b/dumux/common/staggeredfvproblem.hh @@ -160,7 +160,7 @@ protected: //! Helper function that returns an iterable range of primary variable indices. //! Specialization for cell center dofs. - static auto priVarIndices_(typename GET_PROP(TypeTag, DofTypeIndices)::CellCenterIdx) + static auto priVarIndices_(typename FVGridGeometry::DofTypeIndices::CellCenterIdx) { constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter); @@ -173,7 +173,7 @@ protected: //! Helper function that returns an iterable range of primary variable indices. //! Specialization for face dofs. - static auto priVarIndices_(typename GET_PROP(TypeTag, DofTypeIndices)::FaceIdx) + static auto priVarIndices_(typename FVGridGeometry::DofTypeIndices::FaceIdx) { constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter); constexpr auto numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq(); diff --git a/dumux/discretization/staggered/freeflow/fvgridgeometrytraits.hh b/dumux/discretization/staggered/freeflow/fvgridgeometrytraits.hh new file mode 100644 index 0000000000000000000000000000000000000000..29514118cb68b066a6d2f750aa2452578e153b27 --- /dev/null +++ b/dumux/discretization/staggered/freeflow/fvgridgeometrytraits.hh @@ -0,0 +1,64 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup StaggeredDiscretization + * \copydoc Dumux::StaggeredFreeFlowDefaultFVGridGeometryTraits + */ +#ifndef DUMUX_DISCRETIZATION_STAGGERED_FREEFLOW_FV_GRID_GEOMETRY_TRAITS +#define DUMUX_DISCRETIZATION_STAGGERED_FREEFLOW_FV_GRID_GEOMETRY_TRAITS + +#include <dumux/discretization/cellcentered/subcontrolvolume.hh> +#include <dumux/discretization/staggered/fvelementgeometry.hh> +#include <dumux/discretization/staggered/freeflow/subcontrolvolumeface.hh> + +#include "subcontrolvolumeface.hh" +#include "connectivitymap.hh" +#include "staggeredgeometryhelper.hh" + +namespace Dumux { + +/*! + * \ingroup StaggeredDiscretization + * \brief Default traits for the finite volume grid geometry. + */ +template<class GridView> +struct StaggeredFreeFlowDefaultFVGridGeometryTraits : public DefaultMapperTraits<GridView> +{ + using SubControlVolume = CCSubControlVolume<GridView>; + using SubControlVolumeFace = FreeFlowStaggeredSubControlVolumeFace<GridView>; + using IntersectionMapper = ConformingGridIntersectionMapper<GridView>; + using GeometryHelper = FreeFlowStaggeredGeometryHelper<GridView>; + + struct DofTypeIndices + { + using CellCenterIdx = Dune::index_constant<0>; + using FaceIdx = Dune::index_constant<1>; + }; + + template<class FVGridGeometry> + using ConnectivityMap = StaggeredFreeFlowConnectivityMap<FVGridGeometry>; + + template<class FVGridGeometry, bool cachingEnabled> + using LocalView = StaggeredFVElementGeometry<FVGridGeometry, cachingEnabled>; +}; + +} + +#endif diff --git a/dumux/discretization/staggered/freeflow/properties.hh b/dumux/discretization/staggered/freeflow/properties.hh index 22ba9f669d1918b0ffbd8f46cc29ac80b3b098f6..62a44bbac91317bc3621f889c8a708b54f3c8873 100644 --- a/dumux/discretization/staggered/freeflow/properties.hh +++ b/dumux/discretization/staggered/freeflow/properties.hh @@ -33,19 +33,13 @@ #include <dumux/common/defaultmappertraits.hh> #include <dumux/discretization/staggered/properties.hh> -#include <dumux/freeflow/properties.hh> - -#include <dumux/discretization/cellcentered/subcontrolvolume.hh> -#include <dumux/discretization/staggered/freeflow/subcontrolvolumeface.hh> #include <dumux/discretization/staggered/fvgridgeometry.hh> -#include <dumux/discretization/staggered/fvelementgeometry.hh> +#include <dumux/freeflow/properties.hh> -#include "subcontrolvolumeface.hh" -#include "connectivitymap.hh" #include "facevariables.hh" #include "boundarytypes.hh" #include "velocityoutput.hh" -#include "staggeredgeometryhelper.hh" +#include "fvgridgeometrytraits.hh" namespace Dumux { @@ -84,24 +78,8 @@ SET_PROP(StaggeredFreeFlowModel, FVGridGeometry) { private: using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using DofTypeIndicesType = typename GET_PROP(TypeTag, DofTypeIndices); + using Traits = StaggeredFreeFlowDefaultFVGridGeometryTraits<GridView>; static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableFVGridGeometryCache); - - struct Traits : public DefaultMapperTraits<GridView> - { - using SubControlVolume = CCSubControlVolume<GridView>; - using SubControlVolumeFace = FreeFlowStaggeredSubControlVolumeFace<GridView>; - using IntersectionMapper = ConformingGridIntersectionMapper<GridView>; - using GeometryHelper = FreeFlowStaggeredGeometryHelper<GridView>; - using DofTypeIndices = DofTypeIndicesType; - - template<class FVGridGeometry> - using ConnectivityMap = StaggeredFreeFlowConnectivityMap<FVGridGeometry>; - - template<class FVGridGeometry, bool enableCache> - using LocalView = StaggeredFVElementGeometry<FVGridGeometry, enableCache>; - }; - public: using type = StaggeredFVGridGeometry<GridView, enableCache, Traits>; }; diff --git a/dumux/discretization/staggered/fvgridgeometry.hh b/dumux/discretization/staggered/fvgridgeometry.hh index df4220f1985a570ba96b9c52feaa38ee591afe47..2c657875190d9fc9cde42fcaf474820010f99f22 100644 --- a/dumux/discretization/staggered/fvgridgeometry.hh +++ b/dumux/discretization/staggered/fvgridgeometry.hh @@ -35,9 +35,9 @@ namespace Dumux { * This builds up the sub control volumes and sub control volume faces * for each element. */ - template<class GridView, - bool enableFVGridGeometryCache, - class Traits> +template<class GridView, + bool cachingEnabled, + class Traits> class StaggeredFVGridGeometry; /*! diff --git a/dumux/discretization/staggered/properties.hh b/dumux/discretization/staggered/properties.hh index c765fe38ff5877a0f1b149a9ce89ffc0c8965c4b..a05602903685c4e909563823af82775d1b5ffa2c 100644 --- a/dumux/discretization/staggered/properties.hh +++ b/dumux/discretization/staggered/properties.hh @@ -130,13 +130,6 @@ SET_TYPE_PROP(StaggeredModel, ElementBoundaryTypes, CCElementBoundaryTypes); //! Set the BaseLocalResidual to StaggeredLocalResidual SET_TYPE_PROP(StaggeredModel, BaseLocalResidual, StaggeredLocalResidual<TypeTag>); -//! Definition of the indices for cell center and face dofs in the global solution vector -SET_PROP(StaggeredModel, DofTypeIndices) -{ - using CellCenterIdx = Dune::index_constant<0>; - using FaceIdx = Dune::index_constant<1>; -}; - //! The cell center primary variables SET_TYPE_PROP(StaggeredModel, CellCenterPrimaryVariables, diff --git a/dumux/freeflow/navierstokes/problem.hh b/dumux/freeflow/navierstokes/problem.hh index 21f97c699a834f8f985e3ffb3bf560d2b7429fa4..9d987984bdba9240ac40ad3933205145b47de0a3 100644 --- a/dumux/freeflow/navierstokes/problem.hh +++ b/dumux/freeflow/navierstokes/problem.hh @@ -124,9 +124,8 @@ public: const SubControlVolumeFace& scvf, const PrimaryVariables& initSol) const { - typename GET_PROP(TypeTag, DofTypeIndices)::FaceIdx faceIdx; const auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter); - sol[faceIdx][scvf.dofIndex()][numEqCellCenter] = initSol[Indices::velocity(scvf.directionIndex())]; + sol[FVGridGeometry::faceIdx()][scvf.dofIndex()][numEqCellCenter] = initSol[Indices::velocity(scvf.directionIndex())]; } private: diff --git a/dumux/freeflow/navierstokes/staggered/fluxoverplane.hh b/dumux/freeflow/navierstokes/staggered/fluxoverplane.hh index 0f0056e94706c3881af1104f092a288bf5e85fc6..cb1420e263a59d045d949bdfe93fc7aebe3ef82a 100644 --- a/dumux/freeflow/navierstokes/staggered/fluxoverplane.hh +++ b/dumux/freeflow/navierstokes/staggered/fluxoverplane.hh @@ -58,10 +58,6 @@ class FluxOverPlane using Indices = typename GET_PROP_TYPE(TypeTag, Indices); using Element = typename GridView::template Codim<0>::Entity; - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - enum { // Grid and world dimension dim = GridView::dimension, diff --git a/dumux/freeflow/rans/problem.hh b/dumux/freeflow/rans/problem.hh index 9e36b3141e76c0febb1bd8dfce9a79b16ee14865..06f5ec7108fb3a19c920f4fc37b491667d963a47 100644 --- a/dumux/freeflow/rans/problem.hh +++ b/dumux/freeflow/rans/problem.hh @@ -70,10 +70,6 @@ class RANSProblem : public NavierStokesProblem<TypeTag> using DimVector = Dune::FieldVector<Scalar, dim>; using DimMatrix = Dune::FieldMatrix<Scalar, dim, dim>; - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - public: //! The constructor sets the gravity, if desired by the user. RANSProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) @@ -232,7 +228,7 @@ public: for (auto&& scvf : scvfs(fvGeometry)) { const int dofIdxFace = scvf.dofIndex(); - const auto numericalSolutionFace = curSol[faceIdx][dofIdxFace][Indices::momentumBalanceIdx]; + const auto numericalSolutionFace = curSol[FVGridGeometry::faceIdx()][dofIdxFace][Indices::momentumBalanceIdx]; velocityTemp[scvf.directionIndex()] += numericalSolutionFace; } for (unsigned int dimIdx = 0; dimIdx < dim; ++dimIdx) @@ -288,7 +284,7 @@ public: for (auto&& scv : scvs(fvGeometry)) { const int dofIdx = scv.dofIndex(); - CellCenterPrimaryVariables priVars(curSol[cellCenterIdx][dofIdx]); + CellCenterPrimaryVariables priVars(curSol[FVGridGeometry::cellCenterIdx()][dofIdx]); auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars)); VolumeVariables volVars; volVars.update(elemSol, asImp_(), element, scv); diff --git a/dumux/freeflow/rans/zeroeq/problem.hh b/dumux/freeflow/rans/zeroeq/problem.hh index 177f92e2540d71ff087f2af121196858d316b7aa..6144277a31a6165fa859658b83d3a03d040b42b2 100644 --- a/dumux/freeflow/rans/zeroeq/problem.hh +++ b/dumux/freeflow/rans/zeroeq/problem.hh @@ -70,10 +70,6 @@ class ZeroEqProblem : public RANSProblem<TypeTag> using DimVector = Dune::FieldVector<Scalar, dim>; using DimMatrix = Dune::FieldMatrix<Scalar, dim, dim>; - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - public: //! The constructor sets the gravity, if desired by the user. ZeroEqProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) @@ -120,7 +116,7 @@ public: using std::exp; const int dofIdx = scv.dofIndex(); - CellCenterPrimaryVariables priVars(curSol[cellCenterIdx][dofIdx]); + CellCenterPrimaryVariables priVars(curSol[FVGridGeometry::cellCenterIdx()][dofIdx]); auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars)); VolumeVariables volVars; volVars.update(elemSol, asImp_(), element, scv); diff --git a/dumux/io/staggeredvtkoutputmodule.hh b/dumux/io/staggeredvtkoutputmodule.hh index 400b2cace7311e9b26e7139b57c5763af0220d04..266a2b508112cf68d1b1110945717fdc0ea7b232 100644 --- a/dumux/io/staggeredvtkoutputmodule.hh +++ b/dumux/io/staggeredvtkoutputmodule.hh @@ -64,10 +64,6 @@ class StaggeredVtkOutputModule : public VtkOutputModule<TypeTag, phaseIdxOffset> using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>; - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - struct FaceVarScalarDataInfo { std::function<Scalar(const FaceVariables&)> get; std::string name; }; struct FaceVarVectorDataInfo { std::function<GlobalPosition(const SubControlVolumeFace& scvf, const FaceVariables&)> get; std::string name; }; diff --git a/test/freeflow/navierstokes/angelitestproblem.hh b/test/freeflow/navierstokes/angelitestproblem.hh index 1bf48f17c8316f764a701c6fb334eb719ebdcf8e..69c8a21a9c372fb8edbab8688348177cb1d7cb3c 100644 --- a/test/freeflow/navierstokes/angelitestproblem.hh +++ b/test/freeflow/navierstokes/angelitestproblem.hh @@ -102,10 +102,6 @@ class AngeliTestProblem : public NavierStokesProblem<TypeTag> using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); using TimeLoopPtr = std::shared_ptr<TimeLoop<Scalar>>; - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - public: AngeliTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) : ParentType(fvGridGeometry), eps_(1e-6) @@ -269,7 +265,7 @@ public: const auto dofIdxCellCenter = scv.dofIndex(); const auto& posCellCenter = scv.dofPosition(); const auto analyticalSolutionCellCenter = dirichletAtPos(posCellCenter)[pressureIdx]; - const auto numericalSolutionCellCenter = curSol[cellCenterIdx][dofIdxCellCenter][pressureIdx]; + const auto numericalSolutionCellCenter = curSol[FVGridGeometry::cellCenterIdx()][dofIdxCellCenter][pressureIdx]; sumError[pressureIdx] += squaredDiff_(analyticalSolutionCellCenter, numericalSolutionCellCenter) * scv.volume(); sumReference[pressureIdx] += analyticalSolutionCellCenter * analyticalSolutionCellCenter * scv.volume(); totalVolume += scv.volume(); @@ -280,7 +276,7 @@ public: const int dofIdxFace = scvf.dofIndex(); const int dirIdx = scvf.directionIndex(); const auto analyticalSolutionFace = dirichletAtPos(scvf.center())[Indices::velocity(dirIdx)]; - const auto numericalSolutionFace = curSol[faceIdx][dofIdxFace][momentumBalanceIdx]; + const auto numericalSolutionFace = curSol[FVGridGeometry::faceIdx()][dofIdxFace][momentumBalanceIdx]; directionIndex[dofIdxFace] = dirIdx; errorVelocity[dofIdxFace] = squaredDiff_(analyticalSolutionFace, numericalSolutionFace); velocityReference[dofIdxFace] = squaredDiff_(analyticalSolutionFace, 0.0); diff --git a/test/freeflow/navierstokes/doneatestproblem.hh b/test/freeflow/navierstokes/doneatestproblem.hh index aa37532b29b9bd12f8c77072ff5dbd35bc7dac30..bcced08b37db337d0d384e5cbb196d22e5d7ae3b 100644 --- a/test/freeflow/navierstokes/doneatestproblem.hh +++ b/test/freeflow/navierstokes/doneatestproblem.hh @@ -107,10 +107,6 @@ class DoneaTestProblem : public NavierStokesProblem<TypeTag> using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - public: DoneaTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) : ParentType(fvGridGeometry), eps_(1e-6) @@ -289,7 +285,7 @@ public: const auto dofIdxCellCenter = scv.dofIndex(); const auto& posCellCenter = scv.dofPosition(); const auto analyticalSolutionCellCenter = analyticalSolution(posCellCenter)[pressureIdx]; - const auto numericalSolutionCellCenter = curSol[cellCenterIdx][dofIdxCellCenter][pressureIdx]; + const auto numericalSolutionCellCenter = curSol[FVGridGeometry::cellCenterIdx()][dofIdxCellCenter][pressureIdx]; sumError[pressureIdx] += squaredDiff_(analyticalSolutionCellCenter, numericalSolutionCellCenter) * scv.volume(); sumReference[pressureIdx] += analyticalSolutionCellCenter * analyticalSolutionCellCenter * scv.volume(); totalVolume += scv.volume(); @@ -300,7 +296,7 @@ public: const int dofIdxFace = scvf.dofIndex(); const int dirIdx = scvf.directionIndex(); const auto analyticalSolutionFace = analyticalSolution(scvf.center())[Indices::velocity(dirIdx)]; - const auto numericalSolutionFace = curSol[faceIdx][dofIdxFace][momentumBalanceIdx]; + const auto numericalSolutionFace = curSol[FVGridGeometry::faceIdx()][dofIdxFace][momentumBalanceIdx]; directionIndex[dofIdxFace] = dirIdx; errorVelocity[dofIdxFace] = squaredDiff_(analyticalSolutionFace, numericalSolutionFace); velocityReference[dofIdxFace] = squaredDiff_(analyticalSolutionFace, 0.0); diff --git a/test/freeflow/navierstokes/kovasznaytestproblem.hh b/test/freeflow/navierstokes/kovasznaytestproblem.hh index a48d460850db0a9c2f561984a3abb05f9cff3aa3..42e39273408323b0db3dd1014df6bde84325ffd5 100644 --- a/test/freeflow/navierstokes/kovasznaytestproblem.hh +++ b/test/freeflow/navierstokes/kovasznaytestproblem.hh @@ -100,10 +100,6 @@ class KovasznayTestProblem : public NavierStokesProblem<TypeTag> using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - public: KovasznayTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) : ParentType(fvGridGeometry), eps_(1e-6) @@ -278,7 +274,7 @@ public: const auto dofIdxCellCenter = scv.dofIndex(); const auto& posCellCenter = scv.dofPosition(); const auto analyticalSolutionCellCenter = dirichletAtPos(posCellCenter)[pressureIdx]; - const auto numericalSolutionCellCenter = curSol[cellCenterIdx][dofIdxCellCenter][pressureIdx]; + const auto numericalSolutionCellCenter = curSol[FVGridGeometry::cellCenterIdx()][dofIdxCellCenter][pressureIdx]; sumError[pressureIdx] += squaredDiff_(analyticalSolutionCellCenter, numericalSolutionCellCenter) * scv.volume(); sumReference[pressureIdx] += analyticalSolutionCellCenter * analyticalSolutionCellCenter * scv.volume(); totalVolume += scv.volume(); @@ -289,7 +285,7 @@ public: const int dofIdxFace = scvf.dofIndex(); const int dirIdx = scvf.directionIndex(); const auto analyticalSolutionFace = dirichletAtPos(scvf.center())[Indices::velocity(dirIdx)]; - const auto numericalSolutionFace = curSol[faceIdx][dofIdxFace][momentumBalanceIdx]; + const auto numericalSolutionFace = curSol[FVGridGeometry::faceIdx()][dofIdxFace][momentumBalanceIdx]; directionIndex[dofIdxFace] = dirIdx; errorVelocity[dofIdxFace] = squaredDiff_(analyticalSolutionFace, numericalSolutionFace); velocityReference[dofIdxFace] = squaredDiff_(analyticalSolutionFace, 0.0); diff --git a/test/freeflow/navierstokes/test_angeli.cc b/test/freeflow/navierstokes/test_angeli.cc index f03d587cc24a29e62abc095ff89390cc4406bf68..8ced7b487033e8b2d1f36cfeedcfa8b1eb522a48 100644 --- a/test/freeflow/navierstokes/test_angeli.cc +++ b/test/freeflow/navierstokes/test_angeli.cc @@ -139,14 +139,11 @@ int main(int argc, char** argv) try // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; - x[cellCenterIdx].resize(numDofsCellCenter); - x[faceIdx].resize(numDofsFace); + x[FVGridGeometry::cellCenterIdx()].resize(numDofsCellCenter); + x[FVGridGeometry::faceIdx()].resize(numDofsFace); problem->applyInitialSolution(x); auto xOld = x; diff --git a/test/freeflow/navierstokes/test_channel.cc b/test/freeflow/navierstokes/test_channel.cc index a8ed792f882d8ada5a16759c29d4c5d72a9c2c2a..1ac6b724a67d80c8e9ebf14c080486b9efe0308a 100644 --- a/test/freeflow/navierstokes/test_channel.cc +++ b/test/freeflow/navierstokes/test_channel.cc @@ -140,14 +140,11 @@ int main(int argc, char** argv) try // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; - x[cellCenterIdx].resize(numDofsCellCenter); - x[faceIdx].resize(numDofsFace); + x[FVGridGeometry::cellCenterIdx()].resize(numDofsCellCenter); + x[FVGridGeometry::faceIdx()].resize(numDofsFace); problem->applyInitialSolution(x); auto xOld = x; diff --git a/test/freeflow/navierstokes/test_closedsystem.cc b/test/freeflow/navierstokes/test_closedsystem.cc index a9a0f9146144f6c50ef835e52baf02ce915f515d..0fdd3bd631a8a7648fe9a84599b46f2621a31d40 100644 --- a/test/freeflow/navierstokes/test_closedsystem.cc +++ b/test/freeflow/navierstokes/test_closedsystem.cc @@ -122,14 +122,11 @@ int main(int argc, char** argv) try // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; - x[cellCenterIdx].resize(numDofsCellCenter); - x[faceIdx].resize(numDofsFace); + x[FVGridGeometry::cellCenterIdx()].resize(numDofsCellCenter); + x[FVGridGeometry::faceIdx()].resize(numDofsFace); problem->applyInitialSolution(x); auto xOld = x; diff --git a/test/freeflow/navierstokes/test_donea.cc b/test/freeflow/navierstokes/test_donea.cc index 22f2060dd62953a7c74470fbae2d73fc85b8de1a..acfc16266215fe0addeef62cfa8e26b69dcf8af6 100644 --- a/test/freeflow/navierstokes/test_donea.cc +++ b/test/freeflow/navierstokes/test_donea.cc @@ -124,14 +124,11 @@ int main(int argc, char** argv) try // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; - x[cellCenterIdx].resize(numDofsCellCenter); - x[faceIdx].resize(numDofsFace); + x[FVGridGeometry::cellCenterIdx()].resize(numDofsCellCenter); + x[FVGridGeometry::faceIdx()].resize(numDofsFace); // the grid variables using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); diff --git a/test/freeflow/navierstokes/test_kovasznay.cc b/test/freeflow/navierstokes/test_kovasznay.cc index fe78ec1ac4bb26cc1ba01893a577f66c6497353b..882aca078b467608847bdc292d2e325079bd6455 100644 --- a/test/freeflow/navierstokes/test_kovasznay.cc +++ b/test/freeflow/navierstokes/test_kovasznay.cc @@ -123,14 +123,11 @@ int main(int argc, char** argv) try // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; - x[cellCenterIdx].resize(numDofsCellCenter); - x[faceIdx].resize(numDofsFace); + x[FVGridGeometry::cellCenterIdx()].resize(numDofsCellCenter); + x[FVGridGeometry::faceIdx()].resize(numDofsFace); // the grid variables using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); diff --git a/test/freeflow/navierstokesnc/test_channel.cc b/test/freeflow/navierstokesnc/test_channel.cc index 4804fe67d8dcc6459eb925d8710188fad0e2b2ff..9198f5df82b599af9b7837ac1db0b8f30518ae17 100644 --- a/test/freeflow/navierstokesnc/test_channel.cc +++ b/test/freeflow/navierstokesnc/test_channel.cc @@ -138,14 +138,11 @@ int main(int argc, char** argv) try // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; - x[cellCenterIdx].resize(numDofsCellCenter); - x[faceIdx].resize(numDofsFace); + x[FVGridGeometry::cellCenterIdx()].resize(numDofsCellCenter); + x[FVGridGeometry::faceIdx()].resize(numDofsFace); problem->applyInitialSolution(x); auto xOld = x; diff --git a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc index 878279e13f86bd324dc201b874e7ede84a13dd78..614df58447027d2ccc0522e1f458c7d88acd1792 100644 --- a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc +++ b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc @@ -137,14 +137,11 @@ int main(int argc, char** argv) try // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; - x[cellCenterIdx].resize(numDofsCellCenter); - x[faceIdx].resize(numDofsFace); + x[FVGridGeometry::cellCenterIdx()].resize(numDofsCellCenter); + x[FVGridGeometry::faceIdx()].resize(numDofsFace); problem->applyInitialSolution(x); auto xOld = x; diff --git a/test/freeflow/navierstokesnc/test_msfreeflow.cc b/test/freeflow/navierstokesnc/test_msfreeflow.cc index 60dfb7cbafbb568304d5d0f5e68843e89123340f..88c23a75a6304f3901075b590db2183b2cb2b2cc 100644 --- a/test/freeflow/navierstokesnc/test_msfreeflow.cc +++ b/test/freeflow/navierstokesnc/test_msfreeflow.cc @@ -137,14 +137,11 @@ int main(int argc, char** argv) try // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; - x[cellCenterIdx].resize(numDofsCellCenter); - x[faceIdx].resize(numDofsFace); + x[FVGridGeometry::cellCenterIdx()].resize(numDofsCellCenter); + x[FVGridGeometry::faceIdx()].resize(numDofsFace); problem->applyInitialSolution(x); auto xOld = x; diff --git a/test/freeflow/rans/test_pipe_laufer.cc b/test/freeflow/rans/test_pipe_laufer.cc index 44145ade4ac862e6e8de08cbabe66194898a5fef..c017d6f1060c00dc67a6847c8720a549a5a40c7b 100644 --- a/test/freeflow/rans/test_pipe_laufer.cc +++ b/test/freeflow/rans/test_pipe_laufer.cc @@ -133,14 +133,11 @@ int main(int argc, char** argv) try // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; - x[cellCenterIdx].resize(numDofsCellCenter); - x[faceIdx].resize(numDofsFace); + x[FVGridGeometry::cellCenterIdx()].resize(numDofsCellCenter); + x[FVGridGeometry::faceIdx()].resize(numDofsFace); problem->applyInitialSolution(x); problem->updateStaticWallProperties(); problem->updateDynamicWallProperties(x); diff --git a/test/freeflow/ransnc/test_channel_zeroeq.cc b/test/freeflow/ransnc/test_channel_zeroeq.cc index b5ec7fb8b77df1438ab542144395b68a5603dab1..da76773a4e2b33670a271084d507e40d90259393 100644 --- a/test/freeflow/ransnc/test_channel_zeroeq.cc +++ b/test/freeflow/ransnc/test_channel_zeroeq.cc @@ -127,14 +127,11 @@ int main(int argc, char** argv) try // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; - x[cellCenterIdx].resize(numDofsCellCenter); - x[faceIdx].resize(numDofsFace); + x[FVGridGeometry::cellCenterIdx()].resize(numDofsCellCenter); + x[FVGridGeometry::faceIdx()].resize(numDofsFace); problem->applyInitialSolution(x); problem->updateStaticWallProperties(); problem->updateDynamicWallProperties(x);