From d178f30c6e3effd0ffb0d02549ac6ed76157cb92 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de> Date: Tue, 30 Jan 2018 16:51:30 +0100 Subject: [PATCH] [assembly] Make some aliases public and introduce new methods * updateGridVariables * resetTimeStep --- dumux/assembly/fvassembler.hh | 26 +++++++++++++++++++++----- dumux/assembly/staggeredfvassembler.hh | 24 ++++++++++++++++++++---- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/dumux/assembly/fvassembler.hh b/dumux/assembly/fvassembler.hh index 7ea5dd824d..032bbe8b14 100644 --- a/dumux/assembly/fvassembler.hh +++ b/dumux/assembly/fvassembler.hh @@ -51,15 +51,12 @@ template<class TypeTag, DiffMethod diffMethod, bool isImplicit = true> class FVAssembler { using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); using Element = typename GridView::template Codim<0>::Entity; - using TimeLoop = TimeLoopBase<Scalar>; + using TimeLoop = TimeLoopBase<typename GET_PROP_TYPE(TypeTag, Scalar)>; + using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); static constexpr bool isBox = GET_PROP_VALUE(TypeTag, DiscretizationMethod) == DiscretizationMethods::Box; @@ -68,6 +65,9 @@ class FVAssembler CCLocalAssembler<TypeTag, ThisType, diffMethod, isImplicit>>; public: + using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); + using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); using ResidualType = SolutionVector; /*! @@ -300,6 +300,22 @@ public: LocalResidual localResidual() const { return LocalResidual(problem_.get(), timeLoop_.get()); } + /*! + * \brief Update the grid variables + */ + void updateGridVariables(const SolutionVector &cursol) + { + gridVariables().update(cursol); + } + + /*! + * \brief Reset the gridVariables + */ + void resetTimeStep(const SolutionVector &cursol) + { + gridVariables().resetTimeStep(cursol); + } + private: // reset the residual vector to 0.0 void resetResidual_() diff --git a/dumux/assembly/staggeredfvassembler.hh b/dumux/assembly/staggeredfvassembler.hh index 4b144c8801..f9955bcbd2 100644 --- a/dumux/assembly/staggeredfvassembler.hh +++ b/dumux/assembly/staggeredfvassembler.hh @@ -51,14 +51,11 @@ template<class TypeTag, DiffMethod diffMethod, bool isImplicit = true> class StaggeredFVAssembler { using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); + using TimeLoop = TimeLoopBase<typename GET_PROP_TYPE(TypeTag, Scalar)>; using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using TimeLoop = TimeLoopBase<Scalar>; static constexpr int dim = GridView::dimension; @@ -74,6 +71,9 @@ class StaggeredFVAssembler using FaceToCCMatrixBlock = typename GET_PROP(TypeTag, JacobianMatrix)::MatrixBlockFaceToCC; public: + using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); + using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); using ResidualType = SolutionVector; //! The constructor for stationary problems @@ -365,6 +365,22 @@ public: bool isStationaryProblem() const { return stationary_; } + /*! + * \brief Update the grid variables + */ + void updateGridVariables(const SolutionVector &cursol) + { + gridVariables().update(cursol); + } + + /*! + * \brief Reset the gridVariables + */ + void resetTimeStep(const SolutionVector &cursol) + { + gridVariables().resetTimeStep(cursol); + } + private: //! reset the residual to 0.0 void resetResidual_() -- GitLab