From 850c1a637bef04a70e8f05e29027aefbb831881f Mon Sep 17 00:00:00 2001 From: Katharina Heck <katharina.heck@iws.uni-stuttgart.de> Date: Thu, 8 Mar 2018 14:42:05 +0100 Subject: [PATCH] [1p] remove typtag in vtkoutput --- dumux/io/vtkoutputmodule.hh | 10 ++++++++-- dumux/porousmediumflow/1p/model.hh | 4 ++-- dumux/porousmediumflow/1p/vtkoutputfields.hh | 1 - 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dumux/io/vtkoutputmodule.hh b/dumux/io/vtkoutputmodule.hh index 1a5cf8fd80..73656b9d3e 100644 --- a/dumux/io/vtkoutputmodule.hh +++ b/dumux/io/vtkoutputmodule.hh @@ -253,6 +253,7 @@ public: const GridVariables& gridVariables, const SolutionVector& sol, const std::string& name, + const std::string& paramGroup = "", bool verbose = true, Dune::VTK::DataMode dm = Dune::VTK::conforming) : problem_(problem) @@ -260,11 +261,16 @@ public: , gridVariables_(gridVariables) , sol_(sol) , name_(name) + , paramGroup_(paramGroup) , verbose_(fvGridGeometry.gridView().comm().rank() == 0 && verbose) , writer_(std::make_shared<Dune::VTKWriter<GridView>>(fvGridGeometry.gridView(), dm)) , sequenceWriter_(writer_, name) {} + //! the parameter group for getting parameter from the parameter tree + const std::string& paramGroup() const + { return paramGroup_; } + ////////////////////////////////////////////////////////////////////////////////////////////// //! Methods to conveniently add primary and secondary variables upon initialization //! Do not call these methods after initialization i.e. _not_ within the time loop @@ -356,8 +362,7 @@ public: std::array<std::vector<GlobalPosition>, numPhases> velocity; // process rank - static const std::string modelParamGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); - static bool addProcessRank = getParamFromGroup<bool>(modelParamGroup, "Vtk.AddProcessRank"); + static bool addProcessRank = getParamFromGroup<bool>(paramGroup_, "Vtk.AddProcessRank"); std::vector<double> rank; // volume variable data @@ -540,6 +545,7 @@ private: const SolutionVector& sol_; std::string name_; + std::string paramGroup_; bool verbose_; std::shared_ptr<Dune::VTKWriter<GridView>> writer_; diff --git a/dumux/porousmediumflow/1p/model.hh b/dumux/porousmediumflow/1p/model.hh index a41f98ec1b..af4ca3b9c2 100644 --- a/dumux/porousmediumflow/1p/model.hh +++ b/dumux/porousmediumflow/1p/model.hh @@ -75,7 +75,7 @@ SET_BOOL_PROP(OneP, EnableAdvection, true); //!< The o SET_BOOL_PROP(OneP, EnableMolecularDiffusion, false); //!< The one-phase model has no molecular diffusion SET_BOOL_PROP(OneP, EnableEnergyBalance, false); //!< Isothermal model by default SET_TYPE_PROP(OneP, Indices, OnePIndices); //!< The indices required by the isothermal single-phase model -SET_TYPE_PROP(OneP, VtkOutputFields, OnePVtkOutputFields<TypeTag>); //!< Set the vtk output fields specific to this model +SET_TYPE_PROP(OneP, VtkOutputFields, OnePVtkOutputFields); //!< Set the vtk output fields specific to this model /*! * \brief The fluid state which is used by the volume variables to @@ -97,7 +97,7 @@ public: /////////////////////////////////////////////////////////////////////////// SET_INT_PROP(OnePNI, IsothermalNumEq, 1); //!< set number of equations of isothermal model SET_BOOL_PROP(OnePNI, EnableEnergyBalance, true); //!< we do solve for the energy balance here -SET_TYPE_PROP(OnePNI, IsothermalVtkOutputFields, OnePVtkOutputFields<TypeTag>); //!< the isothermal vtk output fields +SET_TYPE_PROP(OnePNI, IsothermalVtkOutputFields, OnePVtkOutputFields); //!< the isothermal vtk output fields SET_TYPE_PROP(OnePNI, IsothermalVolumeVariables, OnePVolumeVariables<TypeTag>); //!< Vol vars of the isothermal model SET_TYPE_PROP(OnePNI, IsothermalLocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< Local residual of the isothermal model SET_TYPE_PROP(OnePNI, IsothermalIndices, OnePIndices); //!< Indices of the isothermal model diff --git a/dumux/porousmediumflow/1p/vtkoutputfields.hh b/dumux/porousmediumflow/1p/vtkoutputfields.hh index 18aafde326..cc934cac2f 100644 --- a/dumux/porousmediumflow/1p/vtkoutputfields.hh +++ b/dumux/porousmediumflow/1p/vtkoutputfields.hh @@ -30,7 +30,6 @@ namespace Dumux { * \ingroup OnePModel * \brief Adds vtk output fields specific to the one phase model */ -template<class TypeTag> class OnePVtkOutputFields { public: -- GitLab