From 852970f1ff5edf50a973713bc74cf433e97f2ef5 Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Fri, 15 Dec 2017 15:56:10 +0100 Subject: [PATCH] Rename GridVariables -> FVGridVariables. Move to discretization/fvgridvariables.hh --- .../fvgridvariables.hh} | 19 +++++++++++-------- dumux/discretization/fvproperties.hh | 4 ++-- dumux/implicit/staggered/gridvariables.hh | 15 ++++++++------- 3 files changed, 21 insertions(+), 17 deletions(-) rename dumux/{implicit/gridvariables.hh => discretization/fvgridvariables.hh} (91%) diff --git a/dumux/implicit/gridvariables.hh b/dumux/discretization/fvgridvariables.hh similarity index 91% rename from dumux/implicit/gridvariables.hh rename to dumux/discretization/fvgridvariables.hh index 6b4b3f1bbc..5de07b9aae 100644 --- a/dumux/implicit/gridvariables.hh +++ b/dumux/discretization/fvgridvariables.hh @@ -20,18 +20,20 @@ * \file * \brief Class storing scv and scvf variables */ -#ifndef DUMUX_GRID_VARIABLES_HH -#define DUMUX_GRID_VARIABLES_HH +#ifndef DUMUX_FV_GRID_VARIABLES_HH +#define DUMUX_FV_GRID_VARIABLES_HH + +#include <memory> +#include <dumux/common/properties.hh> namespace Dumux { /*! - * \ingroup ImplicitModel * \brief Class storing scv and scvf variables */ template<class TypeTag> -class GridVariables +class FVGridVariables { using Problem = typename GET_PROP_TYPE(TypeTag, Problem); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); @@ -41,7 +43,8 @@ class GridVariables public: //! Constructor - GridVariables(std::shared_ptr<Problem> problem, std::shared_ptr<FVGridGeometry> fvGridGeometry) + FVGridVariables(std::shared_ptr<const Problem> problem, + std::shared_ptr<const FVGridGeometry> fvGridGeometry) : problem_(problem) , fvGridGeometry_(fvGridGeometry) , curGridVolVars_(*problem) @@ -118,8 +121,8 @@ public: { return prevGridVolVars_; } private: - std::shared_ptr<Problem> problem_; - std::shared_ptr<FVGridGeometry> fvGridGeometry_; + std::shared_ptr<const Problem> problem_; + std::shared_ptr<const FVGridGeometry> fvGridGeometry_; // the current and previous variables (primary and secondary variables) GridVolumeVariables curGridVolVars_; @@ -129,6 +132,6 @@ private: GridFluxVariablesCache gridFluxVarsCache_; }; -} // end namespace +} // end namespace Dumux #endif diff --git a/dumux/discretization/fvproperties.hh b/dumux/discretization/fvproperties.hh index 5bec9a9ecc..5db3a642e2 100644 --- a/dumux/discretization/fvproperties.hh +++ b/dumux/discretization/fvproperties.hh @@ -33,7 +33,7 @@ #include <dumux/common/properties/grid.hh> #include <dumux/common/boundarytypes.hh> -#include <dumux/implicit/gridvariables.hh> +#include <dumux/discretization/fvgridvariables.hh> namespace Dumux { @@ -43,7 +43,7 @@ namespace Properties NEW_TYPE_TAG(FiniteVolumeModel, INHERITS_FROM(GridProperties)); //! The grid variables -SET_TYPE_PROP(FiniteVolumeModel, GridVariables, GridVariables<TypeTag>); +SET_TYPE_PROP(FiniteVolumeModel, GridVariables, FVGridVariables<TypeTag>); //! The type of a solution for a whole element SET_TYPE_PROP(FiniteVolumeModel, ElementSolutionVector, Dune::BlockVector<typename GET_PROP_TYPE(TypeTag, PrimaryVariables)>); diff --git a/dumux/implicit/staggered/gridvariables.hh b/dumux/implicit/staggered/gridvariables.hh index 1140c791f1..b3630ec1eb 100644 --- a/dumux/implicit/staggered/gridvariables.hh +++ b/dumux/implicit/staggered/gridvariables.hh @@ -23,7 +23,8 @@ #ifndef DUMUX_STAGGERED_GRID_VARIABLES_HH #define DUMUX_STAGGERED_GRID_VARIABLES_HH -#include <dumux/implicit/gridvariables.hh> +#include <dumux/common/properties.hh> +#include <dumux/discretization/fvgridvariables.hh> namespace Dumux { @@ -33,9 +34,9 @@ namespace Dumux * \brief Class storing scv and scvf variables */ template<class TypeTag> -class StaggeredGridVariables : public GridVariables<TypeTag> +class StaggeredGridVariables : public FVGridVariables<TypeTag> { - using ParentType = GridVariables<TypeTag>; + using ParentType = FVGridVariables<TypeTag>; using Problem = typename GET_PROP_TYPE(TypeTag, Problem); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); using GridVolumeVariables = typename GET_PROP_TYPE(TypeTag, GlobalVolumeVariables); @@ -45,7 +46,8 @@ class StaggeredGridVariables : public GridVariables<TypeTag> public: //! Constructor - StaggeredGridVariables(std::shared_ptr<Problem> problem, std::shared_ptr<FVGridGeometry> fvGridGeometry) + StaggeredGridVariables(std::shared_ptr<const Problem> problem, + std::shared_ptr<const FVGridGeometry> fvGridGeometry) : ParentType(problem, fvGridGeometry) , fvGridGeometry_(fvGridGeometry) , curGridFaceVariables_(*problem) @@ -103,13 +105,12 @@ public: private: - std::shared_ptr<FVGridGeometry> fvGridGeometry_; + std::shared_ptr<const FVGridGeometry> fvGridGeometry_; GridFaceVariables curGridFaceVariables_; GridFaceVariables prevGridFaceVariables_; - }; -} // end namespace +} // end namespace Dumux #endif -- GitLab