From 91ea9d104e78f159524268dbb3af21f2e7b95b92 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de> Date: Sat, 10 Mar 2018 10:08:51 +0100 Subject: [PATCH] [staggered][freeflow] Remove TypeTag from FaceVariables --- .../staggered/freeflow/facevariables.hh | 27 +++++-------------- .../staggered/freeflow/properties.hh | 9 ++++++- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/dumux/discretization/staggered/freeflow/facevariables.hh b/dumux/discretization/staggered/freeflow/facevariables.hh index b84abd27c4..470ce0365e 100644 --- a/dumux/discretization/staggered/freeflow/facevariables.hh +++ b/dumux/discretization/staggered/freeflow/facevariables.hh @@ -24,8 +24,7 @@ #ifndef DUMUX_DISCRETIZATION_STAGGERED_FREEFLOW_FACEVARIABLES_HH #define DUMUX_DISCRETIZATION_STAGGERED_FREEFLOW_FACEVARIABLES_HH -#include <dune/common/fvector.hh> -#include <dumux/common/properties.hh> +#include <array> namespace Dumux { @@ -35,27 +34,14 @@ namespace Dumux * \brief The face variables class for free flow staggered grid models. * Contains all relevant velocities for the assembly of the momentum balance. */ -template<class TypeTag> +template<class FacePrimaryVariables, int dim> class StaggeredFaceVariables { - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - - static constexpr int dimWorld = GridView::dimensionworld; - static constexpr int numPairs = (dimWorld == 2) ? 2 : 4; - - using Element = typename GridView::template Codim<0>::Entity; - - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; + static constexpr int numPairs = (dim == 2) ? 2 : 4; + using Scalar = typename FacePrimaryVariables::block_type; public: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + /*! * \brief Partial update of the face variables. Only the face itself is considered. * @@ -76,7 +62,8 @@ public: * \param fvGeometry The finite-volume geometry * \param scvf The sub-control volume face of interest */ - template<class SolVector> + template<class SolVector, class Problem, class Element, + class FVElementGeometry, class SubControlVolumeFace> void update(const SolVector& faceSol, const Problem& problem, const Element& element, diff --git a/dumux/discretization/staggered/freeflow/properties.hh b/dumux/discretization/staggered/freeflow/properties.hh index f93ed8221e..3916d6576c 100644 --- a/dumux/discretization/staggered/freeflow/properties.hh +++ b/dumux/discretization/staggered/freeflow/properties.hh @@ -106,7 +106,14 @@ public: }; //! The variables living on the faces -SET_TYPE_PROP(StaggeredFreeFlowModel, FaceVariables, StaggeredFaceVariables<TypeTag>); +SET_PROP(StaggeredFreeFlowModel, FaceVariables) +{ +private: + using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); + using GridView = typename GET_PROP_TYPE(TypeTag, GridView); +public: + using type = StaggeredFaceVariables<FacePrimaryVariables, GridView::dimension>; +}; //! Boundary types at a single degree of freedom SET_PROP(StaggeredFreeFlowModel, BoundaryTypes) -- GitLab