diff --git a/dumux/discretization/fvgridvariables.hh b/dumux/discretization/fvgridvariables.hh index ac7346c55fdbc27d90b70125de54ac00fdd4eb1d..73f81d913e580f085ae34280ca2ce7eb8e940e93 100644 --- a/dumux/discretization/fvgridvariables.hh +++ b/dumux/discretization/fvgridvariables.hh @@ -164,6 +164,10 @@ public: GridVolumeVariables& prevGridVolVars() { return prevGridVolVars_; } + //! return the finite volume grid geometry + const GridGeometry& fvGridGeometry() const + { return *fvGridGeometry_; } + protected: std::shared_ptr fvGridGeometry_; //!< pointer to the constant grid geometry diff --git a/dumux/discretization/staggered/freeflow/properties.hh b/dumux/discretization/staggered/freeflow/properties.hh index 74815ff2b28d0356886597fef356bf27746f8b6f..14c484bf72ec590c733fea8b6ed6611419ff640d 100644 --- a/dumux/discretization/staggered/freeflow/properties.hh +++ b/dumux/discretization/staggered/freeflow/properties.hh @@ -115,7 +115,9 @@ SET_PROP(StaggeredFreeFlowModel, BoundaryTypes) }; //! The velocity output -SET_TYPE_PROP(StaggeredFreeFlowModel, VelocityOutput, StaggeredFreeFlowVelocityOutput); +SET_TYPE_PROP(StaggeredFreeFlowModel, VelocityOutput, + StaggeredFreeFlowVelocityOutput); } // namespace Properties } // namespace Dumux diff --git a/dumux/discretization/staggered/freeflow/velocityoutput.hh b/dumux/discretization/staggered/freeflow/velocityoutput.hh index dff401d9d872ec09dd35a894d66f468e1839b488..57ad84f92112e3782560c270296960f0fc88e91e 100644 --- a/dumux/discretization/staggered/freeflow/velocityoutput.hh +++ b/dumux/discretization/staggered/freeflow/velocityoutput.hh @@ -24,80 +24,67 @@ #ifndef DUMUX_STAGGERED_FF_VELOCITYOUTPUT_HH #define DUMUX_STAGGERED_FF_VELOCITYOUTPUT_HH -#include -#include +#include #include -namespace Dumux -{ +namespace Dumux { /*! * \ingroup StaggeredDiscretization * \brief Velocity output for staggered free-flow models */ -template -class StaggeredFreeFlowVelocityOutput +template +class StaggeredFreeFlowVelocityOutput : public VelocityOutput { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - 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 SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - + using ParentType = VelocityOutput; + using FVGridGeometry = typename GridVariables::GridGeometry; + using Scalar = typename GridVariables::Scalar; + using FVElementGeometry = typename FVGridGeometry::LocalView; + using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; + using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView; + using GridVolumeVariables = typename GridVariables::GridVolumeVariables; + using VolumeVariables = typename GridVariables::VolumeVariables; + using FluidSystem = typename VolumeVariables::FluidSystem; + using GridView = typename FVGridGeometry::GridView; + // TODO: should be possible to get this somehow + using Problem = typename std::decay_t().problem())>; using Element = typename GridView::template Codim<0>::Entity; using CoordScalar = typename GridView::ctype; public: + using VelocityVector = typename ParentType::VelocityVector; + /*! * \brief Constructor initializes the static data with the initial solution. * - * \param problem The problem - * \param fvGridGeometry The fvGridGeometry * \param gridVariables The gridVariables * \param sol The solution vector */ - StaggeredFreeFlowVelocityOutput(const Problem& problem, - const FVGridGeometry& fvGridGeometry, - const GridVariables& gridVariables, - const SolutionVector& sol) - : problem_(problem) - , fvGridGeometry_(fvGridGeometry) - , gridVariables_(gridVariables) + StaggeredFreeFlowVelocityOutput(const GridVariables& gridVariables, const SolutionVector& sol) + : gridVariables_(gridVariables) , sol_(sol) { // check if velocity vectors shall be written to the VTK file - velocityOutput_ = getParamFromGroup(problem.paramGroup(), "Vtk.AddVelocity"); + // enable per default + enableOutput_ = getParamFromGroup(gridVariables.curGridVolVars().problem().paramGroup(), "Vtk.AddVelocity", true); } //! Returns whether to enable the velocity output or not - bool enableOutput() - { return velocityOutput_; } - - // returns the name of the phase for a given index - static std::string phaseName(int phaseIdx) - { return GET_PROP_TYPE(TypeTag, FluidSystem)::phaseName(phaseIdx); } + bool enableOutput() const override { return enableOutput_; } - // returns the number of phase velocities computed by this class - static constexpr int numPhaseVelocities() - { return GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(); } + //! returns the phase name of a given phase index + std::string phaseName(int phaseIdx) const override { return FluidSystem::phaseName(phaseIdx); } - //! Return the problem boundary types - auto problemBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const - { return problem_.boundaryTypes(element, scvf); } + //! returns the number of phases + int numPhases() const override { return VolumeVariables::numPhases(); } //! Calculate the velocities for the scvs in the element //! We assume the local containers to be bound to the complete stencil - template void calculateVelocity(VelocityVector& velocity, const ElementVolumeVariables& elemVolVars, const FVElementGeometry& fvGeometry, const Element& element, - int phaseIdx) + int phaseIdx) const override { auto elemFaceVars = localView(gridVariables_.curGridFaceVars()); elemFaceVars.bindElement(element, fvGeometry, sol_); @@ -114,11 +101,10 @@ public: } private: - const Problem& problem_; - const FVGridGeometry& fvGridGeometry_; const GridVariables& gridVariables_; const SolutionVector& sol_; - bool velocityOutput_; + + bool enableOutput_ = true; }; } // end namespace Dumux diff --git a/dumux/geomechanics/properties.hh b/dumux/geomechanics/properties.hh index 058df41039875633cb2bcc10a5a038c83d104fc3..1036c4467c3b4471d25fd66db0fbb66013b4207a 100644 --- a/dumux/geomechanics/properties.hh +++ b/dumux/geomechanics/properties.hh @@ -47,7 +47,7 @@ SET_TYPE_PROP(Geomechanics, FluxVariablesCache, StressVariablesCache< typename G typename GET_PROP_TYPE(TypeTag, FVGridGeometry) >); //! The (currently empty) velocity output -SET_TYPE_PROP(Geomechanics, VelocityOutput, GeomechanicsVelocityOutput); +SET_TYPE_PROP(Geomechanics, VelocityOutput, GeomechanicsVelocityOutput); //! The solid state must be inert SET_PROP(Geomechanics, SolidState) diff --git a/dumux/geomechanics/velocityoutput.hh b/dumux/geomechanics/velocityoutput.hh index a7687b19fbf563f58c1758bb6a33d1c66b150a8e..aff80b617504d7d6e1f4afd3ac7225455c647a6a 100644 --- a/dumux/geomechanics/velocityoutput.hh +++ b/dumux/geomechanics/velocityoutput.hh @@ -23,9 +23,9 @@ #ifndef DUMUX_GEOMECHANICS_VELOCITYOUTPUT_HH #define DUMUX_GEOMECHANICS_VELOCITYOUTPUT_HH -#include #include +#include namespace Dumux { @@ -36,29 +36,18 @@ namespace Dumux { * we simply define this here in order to be able to reuse the * VtkOutputModule which expects a VelocityOutput class. */ +template class GeomechanicsVelocityOutput +: public VelocityOutput { public: //! The constructor template< typename... Args > - GeomechanicsVelocityOutput(Args&&... args) {} - - //! Output is currently disabled (not implemented) - static constexpr bool enableOutput() - { return false; } - - //! There is always only one solid phase - static constexpr int numPhaseVelocities() - { return 1; } - - //! Returns the name of phase for which velocity is computed - static std::string phaseName(int phaseIdx) + GeomechanicsVelocityOutput(Args&&... args) { DUNE_THROW(Dune::NotImplemented, "Velocity output for geomechanical models."); } - //! Calculate the velocities for the scvs in the element - template< typename... Args > - void calculateVelocity(Args... args) - { DUNE_THROW(Dune::NotImplemented, "Velocity output for geomechanical models."); } + //! Output is currently disabled (not implemented) + bool enableOutput() const override { return false; } }; } // end namespace Dumux diff --git a/dumux/io/staggeredvtkoutputmodule.hh b/dumux/io/staggeredvtkoutputmodule.hh index cb298c205776a934b875f42ffc647bed7a9da619..6a3d839c66ed4771767134423cd0cff6ca23160d 100644 --- a/dumux/io/staggeredvtkoutputmodule.hh +++ b/dumux/io/staggeredvtkoutputmodule.hh @@ -29,6 +29,7 @@ #include #include #include +#include namespace Dumux { @@ -40,25 +41,21 @@ class PointCloudVtkWriter; * \brief A VTK output module to simplify writing dumux simulation data to VTK format * Specialization for staggered grids with dofs on faces. * - * \tparam TypeTag The TypeTag of the problem implementation - * \tparam phaseIdxOffset Used for single-phase problems to retrieve the right phase name + * \tparam GridVariables The grid variables + * \tparam SolutionVector The solution vector */ -template -class StaggeredVtkOutputModule : public VtkOutputModule +template +class StaggeredVtkOutputModule +: public VtkOutputModule { - friend class VtkOutputModule; - using ParentType = VtkOutputModule; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using FaceVariables = typename GET_PROP_TYPE(TypeTag, FaceVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using ParentType = VtkOutputModule; + using FVGridGeometry = typename GridVariables::GridGeometry; + using GridView = typename FVGridGeometry::GridView; + using Scalar = typename GridVariables::Scalar; + using FaceVariables = typename GridVariables::GridFaceVariables::FaceVariables; + using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - enum { dim = GridView::dimension }; using Element = typename GridView::template Codim<0>::Entity; @@ -85,26 +82,22 @@ class StaggeredVtkOutputModule : public VtkOutputModule public: - StaggeredVtkOutputModule(const Problem& problem, - const FVGridGeometry& fvGridGeometry, - const GridVariables& gridVariables, - const SolutionVector& sol, - const std::string& name, - const std::string& paramGroup = "", - Dune::VTK::DataMode dm = Dune::VTK::conforming, - bool verbose = true) - : ParentType(problem, fvGridGeometry, gridVariables, sol, name, paramGroup, dm, verbose) - , problem_(problem) - , gridGeom_(fvGridGeometry) - , gridVariables_(gridVariables) - , sol_(sol) + StaggeredVtkOutputModule(const GridVariables& gridVariables, + const SolutionVector& sol, + const std::string& name, + const std::string& paramGroup = "", + Dune::VTK::DataMode dm = Dune::VTK::conforming, + bool verbose = true) + : ParentType(gridVariables, sol, name, paramGroup, dm, verbose) , faceWriter_(std::make_shared>(coordinates_)) - , sequenceWriter_(faceWriter_, problem.name() + "-face", "","", - fvGridGeometry.gridView().comm().rank(), - fvGridGeometry.gridView().comm().size() ) + , sequenceWriter_(faceWriter_, name + "-face", "","", + gridVariables.curGridVolVars().problem().fvGridGeometry().gridView().comm().rank(), + gridVariables.curGridVolVars().problem().fvGridGeometry().gridView().comm().size() ) { - writeFaceVars_ = getParamFromGroup(problem.paramGroup(), "Vtk.WriteFaceData", false); + // enable velocity output per default + this->addVelocityOutput(std::make_shared>(gridVariables, sol)); + writeFaceVars_ = getParamFromGroup(paramGroup, "Vtk.WriteFaceData", false); coordinatesInitialized_ = false; } @@ -118,7 +111,7 @@ public: //! \param name The name of the vtk field void addFaceField(const std::vector& v, const std::string& name) { - if (v.size() == this->gridGeom_.gridView().size(1)) + if (v.size() == this->fvGridGeometry().gridView().size(1)) faceFieldScalarDataInfo_.emplace_back(v, name); else DUNE_THROW(Dune::RangeError, "Size mismatch of added field!"); @@ -129,7 +122,7 @@ public: //! \param name The name of the vtk field void addFaceField(const std::vector& v, const std::string& name) { - if (v.size() == this->gridGeom_.gridView().size(1)) + if (v.size() == this->fvGridGeometry().gridView().size(1)) faceFieldVectorDataInfo_.emplace_back(v, name); else DUNE_THROW(Dune::RangeError, "Size mismatch of added field!"); @@ -167,10 +160,10 @@ private: //! Update the coordinates (the face centers) void updateCoordinates_() { - coordinates_.resize(gridGeom_.numFaceDofs()); - for(auto&& facet : facets(gridGeom_.gridView())) + coordinates_.resize(this->fvGridGeometry().numFaceDofs()); + for(auto&& facet : facets(this->fvGridGeometry().gridView())) { - const int dofIdxGlobal = gridGeom_.gridView().indexSet().index(facet); + const int dofIdxGlobal = this->fvGridGeometry().gridView().indexSet().index(facet); coordinates_[dofIdxGlobal] = facet.geometry().center(); } coordinatesInitialized_ = true; @@ -180,7 +173,7 @@ private: //! \param time The current time void getFaceDataAndWrite_(const Scalar time) { - const auto numPoints = gridGeom_.numFaceDofs(); + const auto numPoints = this->fvGridGeometry().numFaceDofs(); // make sure not to iterate over the same dofs twice std::vector dofVisited(numPoints, false); @@ -199,15 +192,15 @@ private: if(!faceVarVectorDataInfo_.empty()) faceVarVectorData.resize(faceVarVectorDataInfo_.size(), std::vector(numPoints)); - for (const auto& element : elements(gridGeom_.gridView(), Dune::Partitions::interior)) + for (const auto& element : elements(this->fvGridGeometry().gridView(), Dune::Partitions::interior)) { - auto fvGeometry = localView(gridGeom_); - auto elemFaceVars = localView(gridVariables_.curGridFaceVars()); + auto fvGeometry = localView(this->fvGridGeometry()); + auto elemFaceVars = localView(this->gridVariables().curGridFaceVars()); if (!faceVarScalarDataInfo_.empty() || !faceVarVectorDataInfo_.empty()) { fvGeometry.bind(element); - elemFaceVars.bindElement(element, fvGeometry, sol_); + elemFaceVars.bindElement(element, fvGeometry, this->sol()); for (auto&& scvf : scvfs(fvGeometry)) { @@ -256,11 +249,6 @@ private: } - const Problem& problem_; - const FVGridGeometry& gridGeom_; - const GridVariables& gridVariables_; - const SolutionVector& sol_; - std::shared_ptr> faceWriter_; VTKSequenceWriter> sequenceWriter_; diff --git a/dumux/io/velocityoutput.hh b/dumux/io/velocityoutput.hh new file mode 100644 index 0000000000000000000000000000000000000000..7aec5fdc0874cd2df4a29d2348d31b8c6e16d2c9 --- /dev/null +++ b/dumux/io/velocityoutput.hh @@ -0,0 +1,79 @@ +// -*- 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 . * + *****************************************************************************/ +/*! + * \file + * + * \brief Default velocity output policy for porous media models + */ +#ifndef DUMUX_IO_VELOCITYOUTPUT_HH +#define DUMUX_IO_VELOCITYOUTPUT_HH + +#include + +#include +#include +#include + +namespace Dumux { + +/*! + * \brief Velocity output for implicit (porous media) models + */ +template +class VelocityOutput +{ + using Scalar = typename GridVariables::Scalar; + static constexpr int dimWorld = GridVariables::GridGeometry::GridView::dimensionworld; + using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView; + using FVElementGeometry = typename GridVariables::GridGeometry::LocalView; + using Element = typename GridVariables::GridGeometry::GridView::template Codim<0>::Entity; + +public: + using VelocityVector = std::vector>; + + /*! + * \brief Default constructor + */ + VelocityOutput() = default; + + //! virtual destructor + virtual ~VelocityOutput() {}; + + //! returns whether or not velocity output is enabled + virtual bool enableOutput() const { return false; } + + //! returns the phase name of a given phase index + virtual std::string phaseName(int phaseIdx) const { return "none"; } + + //! returns the number of phases + virtual int numPhases() const { return 0; } + + //! Calculate the velocities for the scvs in the element + //! We assume the local containers to be bound to the complete stencil + virtual void calculateVelocity(VelocityVector& velocity, + const ElementVolumeVariables& elemVolVars, + const FVElementGeometry& fvGeometry, + const Element& element, + int phaseIdx) const + {} +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/io/vtkoutputmodule.hh b/dumux/io/vtkoutputmodule.hh index dbf58ba2ae8d227a0d93d2d49577040f31fec09c..aaec3ce49329bbb8f7dcce5d021183b55dfe91a8 100644 --- a/dumux/io/vtkoutputmodule.hh +++ b/dumux/io/vtkoutputmodule.hh @@ -39,12 +39,13 @@ #include #include -#include #include #include #include +#include #include "vtkfunction.hh" +#include "velocityoutput.hh" namespace Dumux { @@ -52,23 +53,19 @@ namespace Dumux { * \ingroup InputOutput * \brief A VTK output module to simplify writing dumux simulation data to VTK format * - * \tparam TypeTag The TypeTag of the problem implementation - * \tparam phaseIdxOffset Used for single-phase problems to retrieve the right phase name + * \tparam GridVariables The grid variables + * \tparam SolutionVector The solution vector + * \tparam VelocityOutput The velocity output nodule * * Handles the output of scalar and vector fields to VTK formatted file for multiple * variables and timesteps. Certain predefined fields can be registered on * initialization and/or be turned on/off using the designated properties. Additionally * non-standardized scalar and vector fields can be added to the writer manually. */ -template +template class VtkOutputModule { - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); - static constexpr int numPhaseVelocities = VelocityOutput::numPhaseVelocities(); + using FVGridGeometry = typename GridVariables::GridGeometry; using VV = typename GridVariables::VolumeVariables; using Scalar = typename GridVariables::Scalar; @@ -82,7 +79,6 @@ class VtkOutputModule using Element = typename GridView::template Codim<0>::Entity; using VolVarsVector = Dune::FieldVector; - using VelocityVector = Dune::FieldVector; static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box; static constexpr int dofCodim = isBox ? dim : 0; @@ -91,6 +87,8 @@ class VtkOutputModule struct VolVarVectorDataInfo { std::function get; std::string name; }; using Field = Vtk::template Field; + using VelocityOutputType = Dumux::VelocityOutput; + public: //! export type of the volume variables for the outputfields using VolumeVariables = VV; @@ -101,24 +99,21 @@ public: element, vertex, automatic }; - VtkOutputModule(const Problem& problem, - const FVGridGeometry& fvGridGeometry, - const GridVariables& gridVariables, + VtkOutputModule(const GridVariables& gridVariables, const SolutionVector& sol, const std::string& name, const std::string& paramGroup = "", Dune::VTK::DataMode dm = Dune::VTK::conforming, bool verbose = true) - : problem_(problem) - , gridGeom_(fvGridGeometry) - , gridVariables_(gridVariables) + : gridVariables_(gridVariables) , sol_(sol) , name_(name) , paramGroup_(paramGroup) - , verbose_(fvGridGeometry.gridView().comm().rank() == 0 && verbose) + , verbose_(gridVariables.fvGridGeometry().gridView().comm().rank() == 0 && verbose) , dm_(dm) - , writer_(std::make_shared>(fvGridGeometry.gridView(), dm)) + , writer_(std::make_shared>(gridVariables.fvGridGeometry().gridView(), dm)) , sequenceWriter_(writer_, name) + , velocityOutput_(std::make_shared()) {} //! the parameter group for getting parameter from the parameter tree @@ -130,6 +125,15 @@ public: //! Do not call these methods after initialization i.e. _not_ within the time loop ////////////////////////////////////////////////////////////////////////////////////////////// + /*! + * \brief Add a velocity output policy + * + * \param velocityOutput the output policy + * \note the default policy does not add any velocity output + */ + void addVelocityOutput(std::shared_ptr velocityOutput) + { velocityOutput_ = velocityOutput; } + //! Output a scalar volume variable //! \param name The name of the vtk field //! \param f A function taking a VolumeVariables object and returning the desired scalar @@ -160,8 +164,8 @@ public: // Deduce the number of components from the given vector type const auto nComp = getNumberOfComponents_(v); - const auto numElemDofs = gridGeom_.elementMapper().size(); - const auto numVertexDofs = gridGeom_.vertexMapper().size(); + const auto numElemDofs = fvGridGeometry().elementMapper().size(); + const auto numVertexDofs = fvGridGeometry().vertexMapper().size(); // Automatically deduce the field type ... if(fieldType == FieldType::automatic) @@ -190,9 +194,9 @@ public: // add the appropriate field if (fieldType == FieldType::element) - fields_.emplace_back(gridGeom_.gridView(), gridGeom_.elementMapper(), v, name, nComp, 0); + fields_.emplace_back(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), v, name, nComp, 0); else - fields_.emplace_back(gridGeom_.gridView(), gridGeom_.vertexMapper(), v, name, nComp, dim); + fields_.emplace_back(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), v, name, nComp, dim); } ////////////////////////////////////////////////////////////////////////////////////////////// @@ -226,8 +230,8 @@ public: protected: // some return functions for differing implementations to use - const Problem& problem() const { return problem_; } - const FVGridGeometry& fvGridGeometry() const { return gridGeom_; } + const auto& problem() const { return gridVariables_.curGridVolVars().problem(); } + const FVGridGeometry& fvGridGeometry() const { return gridVariables_.fvGridGeometry(); } const GridVariables& gridVariables() const { return gridVariables_; } const SolutionVector& sol() const { return sol_; } @@ -242,6 +246,9 @@ protected: const std::vector& volVarVectorDataInfo() const { return volVarVectorDataInfo_; } const std::vector& fields() const { return fields_; } + using VelocityOutput = VelocityOutputType; + const VelocityOutput& velocityOutput() const { return *velocityOutput_; } + private: //! Assembles the fields and adds them to the writer (conforming output) @@ -252,8 +259,8 @@ private: ////////////////////////////////////////////////////////////// // instatiate the velocity output - VelocityOutput velocityOutput(problem_, gridGeom_, gridVariables_, sol_); - std::array, numPhaseVelocities> velocity; + using VelocityVector = typename VelocityOutput::VelocityVector; + std::vector velocity(velocityOutput_->numPhases()); // process rank static bool addProcessRank = getParamFromGroup(paramGroup_, "Vtk.AddProcessRank"); @@ -267,10 +274,10 @@ private: if (!volVarScalarDataInfo_.empty() || !volVarVectorDataInfo_.empty() || !fields_.empty() - || velocityOutput.enableOutput() + || velocityOutput_->enableOutput() || addProcessRank) { - const auto numCells = gridGeom_.gridView().size(0); + const auto numCells = fvGridGeometry().gridView().size(0); const auto numDofs = numDofs_(); // get fields for all volume variables @@ -279,9 +286,9 @@ private: if (!volVarVectorDataInfo_.empty()) volVarVectorData.resize(volVarVectorDataInfo_.size(), std::vector(numDofs)); - if (velocityOutput.enableOutput()) + if (velocityOutput_->enableOutput()) { - for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) { if(isBox && dim == 1) velocity[phaseIdx].resize(numCells); @@ -293,16 +300,16 @@ private: // maybe allocate space for the process rank if (addProcessRank) rank.resize(numCells); - for (const auto& element : elements(gridGeom_.gridView(), Dune::Partitions::interior)) + for (const auto& element : elements(fvGridGeometry().gridView(), Dune::Partitions::interior)) { - const auto eIdxGlobal = gridGeom_.elementMapper().index(element); + const auto eIdxGlobal = fvGridGeometry().elementMapper().index(element); - auto fvGeometry = localView(gridGeom_); + auto fvGeometry = localView(fvGridGeometry()); auto elemVolVars = localView(gridVariables_.curGridVolVars()); // If velocity output is enabled we need to bind to the whole stencil // otherwise element-local data is sufficient - if (velocityOutput.enableOutput()) + if (velocityOutput_->enableOutput()) { fvGeometry.bind(element); elemVolVars.bind(element, fvGeometry, sol_); @@ -332,13 +339,13 @@ private: } // velocity output - if (velocityOutput.enableOutput()) - for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) - velocityOutput.calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); + if (velocityOutput_->enableOutput()) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + velocityOutput_->calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); //! the rank if (addProcessRank) - rank[eIdxGlobal] = static_cast(gridGeom_.gridView().comm().rank()); + rank[eIdxGlobal] = static_cast(fvGridGeometry().gridView().comm().rank()); } ////////////////////////////////////////////////////////////// @@ -349,45 +356,45 @@ private: if (isBox) { for (std::size_t i = 0; i < volVarScalarDataInfo_.size(); ++i) - sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.vertexMapper(), volVarScalarData[i], + sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), volVarScalarData[i], volVarScalarDataInfo_[i].name, /*numComp*/1, /*codim*/dim).get() ); for (std::size_t i = 0; i < volVarVectorDataInfo_.size(); ++i) - sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.vertexMapper(), volVarVectorData[i], + sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), volVarVectorData[i], volVarVectorDataInfo_[i].name, /*numComp*/dimWorld, /*codim*/dim).get() ); } else { for (std::size_t i = 0; i < volVarScalarDataInfo_.size(); ++i) - sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), volVarScalarData[i], + sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), volVarScalarData[i], volVarScalarDataInfo_[i].name, /*numComp*/1, /*codim*/0).get() ); for (std::size_t i = 0; i < volVarVectorDataInfo_.size(); ++i) - sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), volVarVectorData[i], + sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), volVarVectorData[i], volVarVectorDataInfo_[i].name, /*numComp*/dimWorld, /*codim*/0).get() ); } // the velocity field - if (velocityOutput.enableOutput()) + if (velocityOutput_->enableOutput()) { if (isBox && dim > 1) { - for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) - sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.vertexMapper(), velocity[phaseIdx], - "velocity_" + velocityOutput.phaseName(phaseIdx+phaseIdxOffset) + " (m/s)", + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), velocity[phaseIdx], + "velocity_" + velocityOutput_->phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); } // cell-centered models else { - for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) - sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), velocity[phaseIdx], - "velocity_" + velocityOutput.phaseName(phaseIdx+phaseIdxOffset) + " (m/s)", + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), velocity[phaseIdx], + "velocity_" + velocityOutput_->phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/0).get() ); } } // the process rank if (addProcessRank) - sequenceWriter_.addCellData(Field(gridGeom_.gridView(), gridGeom_.elementMapper(), rank, "process rank", 1, 0).get()); + sequenceWriter_.addCellData(Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), rank, "process rank", 1, 0).get()); // also register additional (non-standardized) user fields if any for (auto&& field : fields_) @@ -422,9 +429,15 @@ private: //! (1) Assemble all variable fields and add to writer ////////////////////////////////////////////////////////////// - // instatiate the velocity output - VelocityOutput velocityOutput(problem_, gridGeom_, gridVariables_, sol_); - std::array, numPhaseVelocities> velocity; + // check the velocity output + bool enableVelocityOutput = getParamFromGroup(paramGroup_, "Vtk.AddVelocity"); + if (enableVelocityOutput == true && !velocityOutput_->enableOutput()) + std::cerr << "Warning! Velocity output was enabled in the input file" + << " but no velocity output policy was set for the VTK output module:" + << " There will be no velocity output." + << " Use the addVelocityOutput member function of the VTK output module." << std::endl; + using VelocityVector = typename VelocityOutput::VelocityVector; + std::vector velocity(velocityOutput_->numPhases()); // process rank static bool addProcessRank = getParamFromGroup(paramGroup_, "Vtk.AddProcessRank"); @@ -440,10 +453,10 @@ private: if (!volVarScalarDataInfo_.empty() || !volVarVectorDataInfo_.empty() || !fields_.empty() - || velocityOutput.enableOutput() + || velocityOutput_->enableOutput() || addProcessRank) { - const auto numCells = gridGeom_.gridView().size(0); + const auto numCells = fvGridGeometry().gridView().size(0); const auto numDofs = numDofs_(); // get fields for all volume variables @@ -452,9 +465,9 @@ private: if (!volVarVectorDataInfo_.empty()) volVarVectorData.resize(volVarVectorDataInfo_.size(), VectorDataContainer(numCells)); - if (velocityOutput.enableOutput()) + if (velocityOutput_->enableOutput()) { - for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) { if(isBox && dim == 1) velocity[phaseIdx].resize(numCells); @@ -466,12 +479,12 @@ private: // maybe allocate space for the process rank if (addProcessRank) rank.resize(numCells); - for (const auto& element : elements(gridGeom_.gridView(), Dune::Partitions::interior)) + for (const auto& element : elements(fvGridGeometry().gridView(), Dune::Partitions::interior)) { - const auto eIdxGlobal = gridGeom_.elementMapper().index(element); + const auto eIdxGlobal = fvGridGeometry().elementMapper().index(element); const auto numCorners = element.subEntities(dim); - auto fvGeometry = localView(gridGeom_); + auto fvGeometry = localView(fvGridGeometry()); auto elemVolVars = localView(gridVariables_.curGridVolVars()); // resize element-local data containers @@ -482,7 +495,7 @@ private: // If velocity output is enabled we need to bind to the whole stencil // otherwise element-local data is sufficient - if (velocityOutput.enableOutput()) + if (velocityOutput_->enableOutput()) { fvGeometry.bind(element); elemVolVars.bind(element, fvGeometry, sol_); @@ -511,13 +524,13 @@ private: } // velocity output - if (velocityOutput.enableOutput()) - for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) - velocityOutput.calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); + if (velocityOutput_->enableOutput()) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + velocityOutput_->calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); //! the rank if (addProcessRank) - rank[eIdxGlobal] = static_cast(gridGeom_.gridView().comm().rank()); + rank[eIdxGlobal] = static_cast(fvGridGeometry().gridView().comm().rank()); } ////////////////////////////////////////////////////////////// @@ -526,34 +539,34 @@ private: // volume variables if any for (std::size_t i = 0; i < volVarScalarDataInfo_.size(); ++i) - sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), volVarScalarData[i], + sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), volVarScalarData[i], volVarScalarDataInfo_[i].name, /*numComp*/1, /*codim*/dim, /*nonconforming*/dm_).get() ); for (std::size_t i = 0; i < volVarVectorDataInfo_.size(); ++i) - sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), volVarVectorData[i], + sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), volVarVectorData[i], volVarVectorDataInfo_[i].name, /*numComp*/dimWorld, /*codim*/dim, /*nonconforming*/dm_).get() ); // the velocity field - if (velocityOutput.enableOutput()) + if (velocityOutput_->enableOutput()) { // node-wise velocities if (dim > 1) - for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) - sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.vertexMapper(), velocity[phaseIdx], - "velocity_" + velocityOutput.phaseName(phaseIdx+phaseIdxOffset) + " (m/s)", + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), velocity[phaseIdx], + "velocity_" + velocityOutput_->phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); // cell-wise velocities else - for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) - sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), velocity[phaseIdx], - "velocity_" + velocityOutput.phaseName(phaseIdx+phaseIdxOffset) + " (m/s)", + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), velocity[phaseIdx], + "velocity_" + velocityOutput_->phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/0).get() ); } // the process rank if (addProcessRank) - sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), rank, "process rank", 1, 0).get() ); + sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), rank, "process rank", 1, 0).get() ); // also register additional (non-standardized) user fields if any for (auto&& field : fields_) @@ -587,10 +600,8 @@ private: std::size_t getNumberOfComponents_(const Vector& v) { return 1; } //! return the number of dofs, we only support vertex and cell data - std::size_t numDofs_() const { return dofCodim == dim ? gridGeom_.vertexMapper().size() : gridGeom_.elementMapper().size(); } + std::size_t numDofs_() const { return dofCodim == dim ? fvGridGeometry().vertexMapper().size() : fvGridGeometry().elementMapper().size(); } - const Problem& problem_; - const FVGridGeometry& gridGeom_; const GridVariables& gridVariables_; const SolutionVector& sol_; @@ -606,6 +617,7 @@ private: std::vector volVarVectorDataInfo_; //!< Registered volume variables (vector) std::vector fields_; //!< Registered scalar and vector fields + std::shared_ptr velocityOutput_; //!< The velocity output policy }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/3p/volumevariables.hh b/dumux/porousmediumflow/3p/volumevariables.hh index 55323cd62856066ff1cacde274c6750f0477774c..524fd4026e1c460e94eae3212dc3f04cbba8fddc 100644 --- a/dumux/porousmediumflow/3p/volumevariables.hh +++ b/dumux/porousmediumflow/3p/volumevariables.hh @@ -52,8 +52,6 @@ class ThreePVolumeVariables static constexpr int numFluidComps = ParentType::numComponents(); enum { - numPhases = Traits::ModelTraits::numPhases(), - wPhaseIdx = FS::wPhaseIdx, gPhaseIdx = FS::gPhaseIdx, nPhaseIdx = FS::nPhaseIdx, @@ -97,7 +95,7 @@ public: completeFluidState(elemSol, problem, element, scv, fluidState_, solidState_); // mobilities - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ParentType::numPhases(); ++phaseIdx) { mobility_[phaseIdx] = MaterialLaw::kr(materialParams, phaseIdx, fluidState_.saturation(wPhaseIdx), @@ -171,7 +169,7 @@ public: typename FluidSystem::ParameterCache paramCache; paramCache.updateAll(fluidState); - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ParentType::numPhases(); ++phaseIdx) { // compute and set the viscosity const Scalar mu = FluidSystem::viscosity(fluidState, paramCache, phaseIdx); @@ -274,7 +272,7 @@ protected: private: PermeabilityType permeability_; - Scalar mobility_[numPhases]; + Scalar mobility_[ParentType::numPhases()]; }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh b/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh index 5ecfba6a63a3757b08b451f2577c6822405bdc9c..25979c9a173645374004d201abf1fa54c9715724 100644 --- a/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh +++ b/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh @@ -44,26 +44,17 @@ namespace Dumux { * * \tparam TypeTag The TypeTag of the problem implementation * \tparam FractureGrid The Type used for the lower-dimensional grid - * \tparam phaseIdxOffset Used for single-phase problems to retrieve the right phase name * * Handles the output of scalar and vector fields to VTK formatted file for multiple * variables and timesteps. Certain predefined fields can be registered on * initialization and/or be turned on/off using the designated properties. Additionally * non-standardized scalar and vector fields can be added to the writer manually. */ -template -class BoxDfmVtkOutputModule : public VtkOutputModule +template +class BoxDfmVtkOutputModule : public VtkOutputModule { - using ParentType = VtkOutputModule; - - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - static constexpr int numPhases = ModelTraits::numPhases(); - + using ParentType = VtkOutputModule; + using FVGridGeometry = typename GridVariables::GridGeometry; using VV = typename GridVariables::VolumeVariables; using FluidSystem = typename VV::FluidSystem; using Scalar = typename GridVariables::Scalar; @@ -93,18 +84,16 @@ class BoxDfmVtkOutputModule : public VtkOutputModule public: //! The constructor - BoxDfmVtkOutputModule(const Problem& problem, - const FVGridGeometry& fvGridGeometry, - const GridVariables& gridVariables, + BoxDfmVtkOutputModule(const GridVariables& gridVariables, const SolutionVector& sol, const std::string& name, const std::string& paramGroup = "", Dune::VTK::DataMode dm = Dune::VTK::conforming, bool verbose = true) - : ParentType(problem, fvGridGeometry, gridVariables, sol, name, paramGroup, dm, verbose) + : ParentType(gridVariables, sol, name, paramGroup, dm, verbose) { // create the fracture grid and all objects needed on it - initializeFracture(fvGridGeometry); + initializeFracture(gridVariables.fvGridGeometry()); } ////////////////////////////////////////////////////////////////////////////////////////////// @@ -144,8 +133,7 @@ private: ////////////////////////////////////////////////////////////// // instatiate the velocity output - VelocityOutput velocityOutput(this->problem(), this->fvGridGeometry(), this->gridVariables(), this->sol()); - std::array, numPhases> velocity; + std::vector velocity; // process rank static bool addProcessRank = getParamFromGroup(this->paramGroup(), "Vtk.AddProcessRank"); @@ -166,7 +154,7 @@ private: if (!volVarScalarDataInfo.empty() || !volVarVectorDataInfo.empty() || !this->fields().empty() - || velocityOutput.enableOutput() + || this->velocityOutput().enableOutput() || addProcessRank) { const auto numCells = gridView.size(0); @@ -185,8 +173,8 @@ private: volVarVectorDataFracture.resize(volVarVectorDataInfo.size(), std::vector(numFractureVert)); } - if (velocityOutput.enableOutput()) - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + if (this->velocityOutput().enableOutput()) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) velocity[phaseIdx].resize(numDofs); // maybe allocate space for the process rank @@ -201,7 +189,7 @@ private: // If velocity output is enabled we need to bind to the whole stencil // otherwise element-local data is sufficient - if (velocityOutput.enableOutput()) + if (this->velocityOutput().enableOutput()) { fvGeometry.bind(element); elemVolVars.bind(element, fvGeometry, this->sol()); @@ -237,9 +225,9 @@ private: } // velocity output - if (velocityOutput.enableOutput()) - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) - velocityOutput.calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); + if (this->velocityOutput().enableOutput()) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) + this->velocityOutput().calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); //! the rank if (addProcessRank) @@ -266,11 +254,11 @@ private: } // the velocity field - if (velocityOutput.enableOutput()) + if (this->velocityOutput().enableOutput()) { - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) this->sequenceWriter().addVertexData( Field(gridView, this->fvGridGeometry().vertexMapper(), velocity[phaseIdx], - "velocity_" + std::string(FluidSystem::phaseName(phaseIdx+phaseIdxOffset)) + " (m/s)", + "velocity_" + std::string(this->velocityOutput().phaseName(phaseIdx)) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); } @@ -312,8 +300,7 @@ private: ////////////////////////////////////////////////////////////// // instatiate the velocity output - VelocityOutput velocityOutput(this->problem(), this->fvGridGeometry(), this->gridVariables(), this->sol()); - std::array, numPhases> velocity; + std::vector velocity; // process rank static bool addProcessRank = getParamFromGroup(this->paramGroup(), "Vtk.AddProcessRank"); @@ -336,7 +323,7 @@ private: if (!volVarScalarDataInfo.empty() || !volVarVectorDataInfo.empty() || !this->fields().empty() - || velocityOutput.enableOutput() + || this->velocityOutput().enableOutput() || addProcessRank) { const auto numCells = gridView.size(0); @@ -355,8 +342,8 @@ private: volVarVectorDataFracture.resize(volVarVectorDataInfo.size(), VectorDataContainer(numFractureCells)); } - if (velocityOutput.enableOutput()) - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + if (this->velocityOutput().enableOutput()) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) velocity[phaseIdx].resize(numDofs); // maybe allocate space for the process rank @@ -378,7 +365,7 @@ private: // If velocity output is enabled we need to bind to the whole stencil // otherwise element-local data is sufficient - if (velocityOutput.enableOutput()) + if (this->velocityOutput().enableOutput()) { fvGeometry.bind(element); elemVolVars.bind(element, fvGeometry, this->sol()); @@ -416,9 +403,9 @@ private: } // velocity output - if (velocityOutput.enableOutput()) - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) - velocityOutput.calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); + if (this->velocityOutput().enableOutput()) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) + this->velocityOutput().calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); //! the rank if (addProcessRank) @@ -451,11 +438,11 @@ private: } // the velocity field - if (velocityOutput.enableOutput()) + if (this->velocityOutput().enableOutput()) { - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) this->sequenceWriter().addVertexData( Field(gridView, this->fvGridGeometry().vertexMapper(), velocity[phaseIdx], - "velocity_" + std::string(FluidSystem::phaseName(phaseIdx+phaseIdxOffset)) + " (m/s)", + "velocity_" + std::string(this->velocityOutput().phaseName(phaseIdx)) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); } diff --git a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh index 5e3048dc7b3ba457b4507cbb93abcb77e08123a2..ae1e256e20c864a874ce1e7b7c1afeda1a641851 100644 --- a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh +++ b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh @@ -76,7 +76,7 @@ public: { // instatiate the velocity output using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); - VelocityOutput velocityOutput(*problem_, *this->fvGridGeometry_, *this, curSol); + VelocityOutput velocityOutput(*this); using Scalar = typename SolutionVector::field_type; using VelocityVector = typename Dune::FieldVector; diff --git a/dumux/porousmediumflow/properties.hh b/dumux/porousmediumflow/properties.hh index d328d4a07bd222597f8f5f52a5994a601b115b6c..d775eabd73a83efa1969c8e21108bc8270677b63 100644 --- a/dumux/porousmediumflow/properties.hh +++ b/dumux/porousmediumflow/properties.hh @@ -74,7 +74,9 @@ SET_BOOL_PROP(PorousMediumFlow, SolutionDependentHeatConduction, true); SET_TYPE_PROP(PorousMediumFlow, EnergyLocalResidual, EnergyLocalResidual ); //! Velocity output -SET_TYPE_PROP(PorousMediumFlow, VelocityOutput, PorousMediumFlowVelocityOutput); +SET_TYPE_PROP(PorousMediumFlow, VelocityOutput, + PorousMediumFlowVelocityOutput); //! By default, we set an empty primary variables switch SET_TYPE_PROP(PorousMediumFlow, PrimaryVariableSwitch, NoPrimaryVariableSwitch); diff --git a/dumux/porousmediumflow/velocityoutput.hh b/dumux/porousmediumflow/velocityoutput.hh index e379269144393755a742d7dc3efef1a18a8369ba..4abe31587ab214218d6cf653603a7a634b925dda 100644 --- a/dumux/porousmediumflow/velocityoutput.hh +++ b/dumux/porousmediumflow/velocityoutput.hh @@ -24,131 +24,97 @@ #ifndef DUMUX_POROUSMEDIUMFLOW_VELOCITYOUTPUT_HH #define DUMUX_POROUSMEDIUMFLOW_VELOCITYOUTPUT_HH -#include -#include #include -#include #include +#include #include #include namespace Dumux { /*! - * \brief Velocity output for implicit (porous media) models + * \brief Velocity output policy for implicit (porous media) models */ -template -class PorousMediumFlowVelocityOutput +template +class PorousMediumFlowVelocityOutput : public VelocityOutput { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - 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 SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - - static const int dim = GridView::dimension; - static const int dimWorld = GridView::dimensionworld; - - static const bool isBox = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box; - static const int dofCodim = isBox ? dim : 0; - - using Vertex = typename GridView::template Codim::Entity; + using ParentType = VelocityOutput; + using FVGridGeometry = typename GridVariables::GridGeometry; + using FVElementGeometry = typename FVGridGeometry::LocalView; + using SubControlVolume = typename FVGridGeometry::SubControlVolume; + using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; + using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; - using IndexType = typename GridView::IndexSet::IndexType; - using CoordScalar = typename GridView::ctype; + using GridVolumeVariables = typename GridVariables::GridVolumeVariables; + using VolumeVariables = typename GridVariables::VolumeVariables; + using ElementVolumeVariables = typename GridVolumeVariables::LocalView; + using FluidSystem = typename VolumeVariables::FluidSystem; + using Scalar = typename GridVariables::Scalar; + + // TODO should be possible to get this + using Problem = typename std::decay_t().problem())>; + using BoundaryTypes = typename std::decay_t().problem() + .boundaryTypes(std::declval(), std::declval()))>; + + static constexpr int dim = GridView::dimension; + static constexpr int dimWorld = GridView::dimensionworld; + static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box; + static constexpr int dofCodim = isBox ? dim : 0; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using ReferenceElements = Dune::ReferenceElements; + using ReferenceElements = Dune::ReferenceElements; public: + using VelocityVector = typename ParentType::VelocityVector; + /*! * \brief Constructor initializes the static data with the initial solution. * - * \param problem The problem to be solved + * \param gridVariables The grid variables */ - PorousMediumFlowVelocityOutput(const Problem& problem, - const FVGridGeometry& fvGridGeometry, - const GridVariables& gridVariables, - const SolutionVector& sol) - : problem_(problem) - , fvGridGeometry_(fvGridGeometry) + PorousMediumFlowVelocityOutput(const GridVariables& gridVariables) + : problem_(gridVariables.curGridVolVars().problem()) + , fvGridGeometry_(gridVariables.fvGridGeometry()) , gridVariables_(gridVariables) - , sol_(sol) { // check, if velocity output can be used (works only for cubes so far) - velocityOutput_ = getParamFromGroup(problem.paramGroup(), "Vtk.AddVelocity"); - if (velocityOutput_) + enableOutput_ = getParamFromGroup(problem_.paramGroup(), "Vtk.AddVelocity"); + if (enableOutput_) { // set the number of scvs the vertices are connected to if (isBox && dim > 1) { // resize to the number of vertices of the grid - cellNum_.assign(fvGridGeometry.gridView().size(dim), 0); + cellNum_.assign(fvGridGeometry_.gridView().size(dim), 0); - for (const auto& element : elements(fvGridGeometry.gridView())) + for (const auto& element : elements(fvGridGeometry_.gridView())) for (unsigned int vIdx = 0; vIdx < element.subEntities(dim); ++vIdx) - ++cellNum_[fvGridGeometry.vertexMapper().subIndex(element, vIdx, dim)]; + ++cellNum_[fvGridGeometry_.vertexMapper().subIndex(element, vIdx, dim)]; } } } //! returns whether or not velocity output is enabled - bool enableOutput() { return velocityOutput_; } - - //! returns the name of the phase for a given index - static std::string phaseName(int phaseIdx) { return FluidSystem::phaseName(phaseIdx); } - - //! returns the number of phase velocities computed by this class - static constexpr int numPhaseVelocities() { return GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(); } + bool enableOutput() const override { return enableOutput_; } - // The following SFINAE enable_if usage allows compilation, even if only a - // - // boundaryTypes(const Element&, const scv&) - // - // is provided in the problem file. In that case, the compiler cannot detect - // (without additional measures like "using...") the signature - // - // boundaryTypes(const Element&, const scvf&) - // - // in the problem base class. Therefore, calls to this method trigger a - // compiler error. However, that call is needed for calculating velocities - // if the cell-centered discretization is used. By proceeding as in the - // following lines, that call will only be compiled if cell-centered - // actually is used. - template - typename std::enable_if::type - problemBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const - { return problem_.boundaryTypes(element, scvf); } + //! returns the phase name of a given phase index + std::string phaseName(int phaseIdx) const override { return FluidSystem::phaseName(phaseIdx); } - //! we should never call this method for box models - template - typename std::enable_if::type - problemBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const - { return BoundaryTypes(); } + //! returns the number of phases + int numPhases() const override { return VolumeVariables::numPhases(); } //! Calculate the velocities for the scvs in the element //! We assume the local containers to be bound to the complete stencil - template void calculateVelocity(VelocityVector& velocity, const ElementVolumeVariables& elemVolVars, const FVElementGeometry& fvGeometry, const Element& element, - int phaseIdx) + int phaseIdx) const override { using Velocity = typename VelocityVector::value_type; - if (!velocityOutput_) return; + if (!enableOutput_) return; const auto geometry = element.geometry(); const Dune::GeometryType geomType = geometry.type(); @@ -181,7 +147,7 @@ public: Scalar flux = fluxVars.advectiveFlux(phaseIdx, upwindTerm) / localArea; flux /= problem_.extrusionFactor(element, fvGeometry.scv(scvf.insideScvIdx()), - elementSolution(element, sol_, fvGridGeometry_)); + elementSolution(element, elemVolVars, fvGeometry)); tmpVelocity *= flux; const int eIdxGlobal = fvGridGeometry_.elementMapper().index(element); @@ -289,11 +255,11 @@ public: scvfFluxes[scvfIndexInInside[localScvfIdx]] = fluxVars.advectiveFlux(phaseIdx, upwindTerm); scvfFluxes[scvfIndexInInside[localScvfIdx]] /= problem_.extrusionFactor(element, fvGeometry.scv(scvf.insideScvIdx()), - elementSolution(element, sol_, fvGridGeometry_)); + elementSolution(element, elemVolVars, fvGeometry)); } else { - auto bcTypes = problemBoundaryTypes(element, scvf); + auto bcTypes = problemBoundaryTypes_(element, scvf); if (bcTypes.hasOnlyDirichlet()) { FluxVariables fluxVars; @@ -301,7 +267,7 @@ public: scvfFluxes[scvfIndexInInside[localScvfIdx]] = fluxVars.advectiveFlux(phaseIdx, upwindTerm); scvfFluxes[scvfIndexInInside[localScvfIdx]] /= problem_.extrusionFactor(element, fvGeometry.scv(scvf.insideScvIdx()), - elementSolution(element, sol_, fvGridGeometry_)); + elementSolution(element, elemVolVars, fvGeometry)); } } @@ -320,7 +286,7 @@ public: { if (scvf.boundary()) { - auto bcTypes = problemBoundaryTypes(element, scvf); + auto bcTypes = problemBoundaryTypes_(element, scvf); if (bcTypes.hasNeumann()) { // cubes @@ -432,12 +398,34 @@ private: } private: + // The following SFINAE enable_if usage allows compilation, even if only a + // + // boundaryTypes(const Element&, const scv&) + // + // is provided in the problem file. In that case, the compiler cannot detect + // (without additional measures like "using...") the signature + // + // boundaryTypes(const Element&, const scvf&) + // + // in the problem base class. Therefore, calls to this method trigger a + // compiler error. However, that call is needed for calculating velocities + // if the cell-centered discretization is used. By proceeding as in the + // following lines, that call will only be compiled if cell-centered + // actually is used. + template = 0> + BoundaryTypes problemBoundaryTypes_(const Element& element, const SubControlVolumeFace& scvf) const + { return problem_.boundaryTypes(element, scvf); } + + //! we should never call this method for box models + template = 0> + BoundaryTypes problemBoundaryTypes_(const Element& element, const SubControlVolumeFace& scvf) const + { return BoundaryTypes(); } + const Problem& problem_; const FVGridGeometry& fvGridGeometry_; const GridVariables& gridVariables_; - const SolutionVector& sol_; - bool velocityOutput_; + bool enableOutput_; std::vector cellNum_; }; diff --git a/test/freeflow/navierstokes/test_angeli.cc b/test/freeflow/navierstokes/test_angeli.cc index 707536c3c401477a704222984ce6c156e1e490a5..b946a99885e3551bd5cc40cb91d201b7f21a289e 100644 --- a/test/freeflow/navierstokes/test_angeli.cc +++ b/test/freeflow/navierstokes/test_angeli.cc @@ -153,8 +153,8 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); diff --git a/test/freeflow/navierstokes/test_channel.cc b/test/freeflow/navierstokes/test_channel.cc index 632c9cdc5310b763a3da04abbe2a73e6ddd12c78..bee7ed183fd72be3295274245c615602bc303e85 100644 --- a/test/freeflow/navierstokes/test_channel.cc +++ b/test/freeflow/navierstokes/test_channel.cc @@ -155,7 +155,7 @@ int main(int argc, char** argv) try // initialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokes/test_channel_navierstokes.input b/test/freeflow/navierstokes/test_channel_navierstokes.input index 112b0f2a1d47fa6bb814210743c85d331d2f3bbc..8583ee9652fccac58aac861b4c5567be5bfa5985 100644 --- a/test/freeflow/navierstokes/test_channel_navierstokes.input +++ b/test/freeflow/navierstokes/test_channel_navierstokes.input @@ -16,5 +16,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-5 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokes/test_channel_stokes.input b/test/freeflow/navierstokes/test_channel_stokes.input index 651184566d82b7a8ae13f871dfedbbbcd30a4c22..ed56ca7244765073bde8fd562d9cb9f6ba26b776 100644 --- a/test/freeflow/navierstokes/test_channel_stokes.input +++ b/test/freeflow/navierstokes/test_channel_stokes.input @@ -16,10 +16,8 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false - [Assembly] NumericDifference.BaseEpsilon = 1e-8 diff --git a/test/freeflow/navierstokes/test_channel_stokesni_conduction.input b/test/freeflow/navierstokes/test_channel_stokesni_conduction.input index ebc6488b7575d34694ddd7cd38548610b2409494..cb06ec9a95ec981026f291f18aeed775b469334d 100644 --- a/test/freeflow/navierstokes/test_channel_stokesni_conduction.input +++ b/test/freeflow/navierstokes/test_channel_stokesni_conduction.input @@ -16,5 +16,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokes/test_channel_stokesni_convection.input b/test/freeflow/navierstokes/test_channel_stokesni_convection.input index dbaf6ddb5d40950afbfb651c7d8714d52e647f92..353c4b358286f1d98507288cf168d8b1190ca478 100644 --- a/test/freeflow/navierstokes/test_channel_stokesni_convection.input +++ b/test/freeflow/navierstokes/test_channel_stokesni_convection.input @@ -16,5 +16,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokes/test_closedsystem.cc b/test/freeflow/navierstokes/test_closedsystem.cc index a29b3bb4765535292028f5966d4872ed2fa35ae8..6b5791708df6f7aaa6071ae152f8565b83428ccd 100644 --- a/test/freeflow/navierstokes/test_closedsystem.cc +++ b/test/freeflow/navierstokes/test_closedsystem.cc @@ -148,7 +148,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokes/test_donea.cc b/test/freeflow/navierstokes/test_donea.cc index fd12e846ded774096a7cd3bbf6ecde3cac963529..e6ad45c4664d62ad5aab7c5bc1e66cba88bef16b 100644 --- a/test/freeflow/navierstokes/test_donea.cc +++ b/test/freeflow/navierstokes/test_donea.cc @@ -138,7 +138,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); diff --git a/test/freeflow/navierstokes/test_hydrostaticpressure.input b/test/freeflow/navierstokes/test_hydrostaticpressure.input index a48eb5fb26b694193d612146c8322f686880890b..4dcaf50ac099bf6febb0216d1ea236648f075fcb 100644 --- a/test/freeflow/navierstokes/test_hydrostaticpressure.input +++ b/test/freeflow/navierstokes/test_hydrostaticpressure.input @@ -19,5 +19,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-5 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokes/test_kovasznay.cc b/test/freeflow/navierstokes/test_kovasznay.cc index 4fe0635e9b82fbe9dd9987eae39c0c32990f622f..0d54568d9285a9aba77244f5986e1407e9f2144d 100644 --- a/test/freeflow/navierstokes/test_kovasznay.cc +++ b/test/freeflow/navierstokes/test_kovasznay.cc @@ -135,7 +135,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); diff --git a/test/freeflow/navierstokes/test_liddrivencavity_re1.input b/test/freeflow/navierstokes/test_liddrivencavity_re1.input index 8a7be861e59cc1888271094676a6a3824e57cc14..286d9c374e40237b2e67f79d3cde4ad00d40d5e8 100644 --- a/test/freeflow/navierstokes/test_liddrivencavity_re1.input +++ b/test/freeflow/navierstokes/test_liddrivencavity_re1.input @@ -20,5 +20,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-5 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokes/test_liddrivencavity_re1000.input b/test/freeflow/navierstokes/test_liddrivencavity_re1000.input index d0204fd129c6001ee600cc3ed6051fd78af79baf..cd5be48163103ec699c0a3a6d4c75654687d96a7 100644 --- a/test/freeflow/navierstokes/test_liddrivencavity_re1000.input +++ b/test/freeflow/navierstokes/test_liddrivencavity_re1000.input @@ -25,7 +25,6 @@ MaxRelativeShift = 1e-8 NumericDifference.BaseEpsilon = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false [Implicit] diff --git a/test/freeflow/navierstokes/test_navierstokes_1d.cc b/test/freeflow/navierstokes/test_navierstokes_1d.cc index 91edf0498ffbccad51d6a875876aff0f5c70f2b2..7b19b1038a9505900d4d587b76c7a38b9fea7743 100644 --- a/test/freeflow/navierstokes/test_navierstokes_1d.cc +++ b/test/freeflow/navierstokes/test_navierstokes_1d.cc @@ -124,7 +124,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); diff --git a/test/freeflow/navierstokes/test_navierstokes_1d.input b/test/freeflow/navierstokes/test_navierstokes_1d.input index 28c4f696f16bc534bfa8464e4cc3e7d302d3cf27..a6a61d826508d3a3da14a34c5b40a3d524227cbe 100644 --- a/test/freeflow/navierstokes/test_navierstokes_1d.input +++ b/test/freeflow/navierstokes/test_navierstokes_1d.input @@ -17,4 +17,3 @@ MaxRelativeShift = 1e-9 [Vtk] WriteFaceData = false -AddVelocity = true diff --git a/test/freeflow/navierstokes/test_navierstokes_angeli.input b/test/freeflow/navierstokes/test_navierstokes_angeli.input index 230e41dda782f4fda467451e08112be334bd52d4..787d776fc0f31babd2b6c3c381c844f97f7aeef4 100644 --- a/test/freeflow/navierstokes/test_navierstokes_angeli.input +++ b/test/freeflow/navierstokes/test_navierstokes_angeli.input @@ -25,4 +25,3 @@ MaxRelativeShift = 1e-5 [Vtk] WriteFaceData = false -AddVelocity = true diff --git a/test/freeflow/navierstokes/test_navierstokes_kovasznay.input b/test/freeflow/navierstokes/test_navierstokes_kovasznay.input index 03029c6f4623315826bb61f7d797442e77a78394..1ac0582f42bd170bba6c60edb099d72103080691 100644 --- a/test/freeflow/navierstokes/test_navierstokes_kovasznay.input +++ b/test/freeflow/navierstokes/test_navierstokes_kovasznay.input @@ -18,4 +18,3 @@ MaxRelativeShift = 1e-5 [Vtk] WriteFaceData = false -AddVelocity = true diff --git a/test/freeflow/navierstokes/test_stokes_channel_3d.cc b/test/freeflow/navierstokes/test_stokes_channel_3d.cc index 0eac30d6bb7f2f1816c56d77dd0f5903516d0df6..3c72b1ecf63c0b59f20119ebfe7f1d32aa72f838 100644 --- a/test/freeflow/navierstokes/test_stokes_channel_3d.cc +++ b/test/freeflow/navierstokes/test_stokes_channel_3d.cc @@ -132,7 +132,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokes/test_stokes_channel_3d.input b/test/freeflow/navierstokes/test_stokes_channel_3d.input index ce28a56783b4b492a37b7bad3a5a4aa6c648addb..7193f13d9b169550e0f695113b53d0d9067121da 100644 --- a/test/freeflow/navierstokes/test_stokes_channel_3d.input +++ b/test/freeflow/navierstokes/test_stokes_channel_3d.input @@ -20,7 +20,6 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false [FluxOverPlane] diff --git a/test/freeflow/navierstokes/test_stokes_channel_pseudo3d.input b/test/freeflow/navierstokes/test_stokes_channel_pseudo3d.input index 462959a1c6ea09ca25b417ac58fc865659cf79c1..e450d1a3b7a0259b60763e538f19c8350e47af73 100644 --- a/test/freeflow/navierstokes/test_stokes_channel_pseudo3d.input +++ b/test/freeflow/navierstokes/test_stokes_channel_pseudo3d.input @@ -22,4 +22,3 @@ NumericDifference.BaseEpsilon = 1e-8 [Vtk] WriteFaceData = false -AddVelocity = true diff --git a/test/freeflow/navierstokes/test_stokes_donea.input b/test/freeflow/navierstokes/test_stokes_donea.input index 1304128ffdee14e4d4726d9d1977df12e5af7bb9..cf34501bff789d31c8d358002e03b4ba14a01c17 100644 --- a/test/freeflow/navierstokes/test_stokes_donea.input +++ b/test/freeflow/navierstokes/test_stokes_donea.input @@ -13,4 +13,3 @@ MaxRelativeShift = 1e-5 [Vtk] WriteFaceData = false -AddVelocity = true diff --git a/test/freeflow/navierstokesnc/test_channel.cc b/test/freeflow/navierstokesnc/test_channel.cc index 066444114b30b2f2c522f9fb6a3349d62446ff9d..70fbdd037a494c87331c57ad23f1ae5db06cc888 100644 --- a/test/freeflow/navierstokesnc/test_channel.cc +++ b/test/freeflow/navierstokesnc/test_channel.cc @@ -153,7 +153,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getDeltaP(), "deltaP"); vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc index 25fd54d6f6173c2feb0e229b8b0a37154c8d6883..f4491998c7b7a2c9d08cb2dbb4a72eb31a794c71 100644 --- a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc +++ b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc @@ -152,7 +152,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getDeltaRho(), "deltaRho"); vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokesnc/test_msfreeflow.cc b/test/freeflow/navierstokesnc/test_msfreeflow.cc index 77c7f83a9c30030c6f52bf19be93b5e041b78c7f..91dbaba810296d29760f4c936c440d46171fd8a9 100644 --- a/test/freeflow/navierstokesnc/test_msfreeflow.cc +++ b/test/freeflow/navierstokesnc/test_msfreeflow.cc @@ -152,7 +152,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokesnc/test_msfreeflow.input b/test/freeflow/navierstokesnc/test_msfreeflow.input index 2bd101ed81f279c6e2e395fffc706d896d293d6b..c0eccab791b15eae0956102701bd78d5b0f4633c 100644 --- a/test/freeflow/navierstokesnc/test_msfreeflow.input +++ b/test/freeflow/navierstokesnc/test_msfreeflow.input @@ -20,3 +20,4 @@ MaxRelativeShift = 1e-8 [Vtk] WriteFaceData = false +AddVelocity = false diff --git a/test/freeflow/navierstokesnc/test_stokes2c_advection.input b/test/freeflow/navierstokesnc/test_stokes2c_advection.input index d3558dec4cc951d7515cdc0c0690064f7242b4ae..7b79ad42474cf32304666bfc251750d25b625734 100644 --- a/test/freeflow/navierstokesnc/test_stokes2c_advection.input +++ b/test/freeflow/navierstokesnc/test_stokes2c_advection.input @@ -19,5 +19,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokesnc/test_stokes2c_densitydrivenflow.input b/test/freeflow/navierstokesnc/test_stokes2c_densitydrivenflow.input index ae643fd64ca37b001645e3b6a3708531745bb237..e3dcd14f576da8ceff8486d1fec4e2dab36558dd 100644 --- a/test/freeflow/navierstokesnc/test_stokes2c_densitydrivenflow.input +++ b/test/freeflow/navierstokesnc/test_stokes2c_densitydrivenflow.input @@ -20,5 +20,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokesnc/test_stokes2c_purediffusion.input b/test/freeflow/navierstokesnc/test_stokes2c_purediffusion.input index bb365a1671bd4d476d1cd8a6371e85e9c11fb8d0..4fa305b802a40addcbd8bb0c01ad5aa8bdce9ad3 100644 --- a/test/freeflow/navierstokesnc/test_stokes2c_purediffusion.input +++ b/test/freeflow/navierstokesnc/test_stokes2c_purediffusion.input @@ -16,5 +16,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokesnc/test_stokes2cni_advection.input b/test/freeflow/navierstokesnc/test_stokes2cni_advection.input index 8580cc0dff70f35bc4cc5ecf247571f82e91f12b..43a8a92c73bd2c1789611063fac6ec00c2d85e10 100644 --- a/test/freeflow/navierstokesnc/test_stokes2cni_advection.input +++ b/test/freeflow/navierstokesnc/test_stokes2cni_advection.input @@ -19,5 +19,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokesnc/test_stokes2cni_diffusion.input b/test/freeflow/navierstokesnc/test_stokes2cni_diffusion.input index ec46ddaf8e7b06ac342df09bcfd8991732af21cb..82d99aacafae206fcf24800644457db573405462 100644 --- a/test/freeflow/navierstokesnc/test_stokes2cni_diffusion.input +++ b/test/freeflow/navierstokesnc/test_stokes2cni_diffusion.input @@ -16,5 +16,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/rans/test_pipe_laufer.cc b/test/freeflow/rans/test_pipe_laufer.cc index 4d5f63f078530ed1988e0c5cf3510a84dc8b6da0..8b4d2a70fe2af081e21f67532ceb28667fe560ec 100644 --- a/test/freeflow/rans/test_pipe_laufer.cc +++ b/test/freeflow/rans/test_pipe_laufer.cc @@ -148,7 +148,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/rans/test_pipe_laufer.input b/test/freeflow/rans/test_pipe_laufer.input index b0245e8898ea05886f7d7c25b812d520bf72190d..05350ff926cae7b7c0dcc3eb165b5932799a8f06 100644 --- a/test/freeflow/rans/test_pipe_laufer.input +++ b/test/freeflow/rans/test_pipe_laufer.input @@ -37,5 +37,4 @@ TargetSteps = 5 MaxRelativeShift = 1e-5 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/rans/test_pipe_laufer_reference.input b/test/freeflow/rans/test_pipe_laufer_reference.input index ef597de3f08a2da497d017ae1a9029a9177a96b8..398523ccd1c90b5b63ae7b8c9123d6427c262a4d 100644 --- a/test/freeflow/rans/test_pipe_laufer_reference.input +++ b/test/freeflow/rans/test_pipe_laufer_reference.input @@ -31,5 +31,4 @@ TargetSteps = 5 MaxRelativeShift = 1e-6 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/rans/test_pipe_laufer_reference_wallfunction.input b/test/freeflow/rans/test_pipe_laufer_reference_wallfunction.input index b0e86caf4e7ee138374549c37ccd4037e7660041..e1dccd2249a9d3e4d142ba745d64ab9861bfecfc 100644 --- a/test/freeflow/rans/test_pipe_laufer_reference_wallfunction.input +++ b/test/freeflow/rans/test_pipe_laufer_reference_wallfunction.input @@ -30,5 +30,4 @@ TargetSteps = 5 MaxRelativeShift = 1e-5 [Vtk] -AddVelocity = true WriteFaceData = true diff --git a/test/freeflow/rans/test_pipe_zeroeqni.input b/test/freeflow/rans/test_pipe_zeroeqni.input index 924d1259068a63aa870eca9865b69c759c6b2e03..9826fde70816d78ae246bd799636ab2acca0c0d6 100644 --- a/test/freeflow/rans/test_pipe_zeroeqni.input +++ b/test/freeflow/rans/test_pipe_zeroeqni.input @@ -29,5 +29,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-5 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/ransnc/test_flatplate.cc b/test/freeflow/ransnc/test_flatplate.cc index 0f426e96fb7d852a60bf6a261bd1fb47c687a465..40612bd1751f838209caf7db73ff6a9fb06b989d 100644 --- a/test/freeflow/ransnc/test_flatplate.cc +++ b/test/freeflow/ransnc/test_flatplate.cc @@ -144,7 +144,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/ransnc/test_flatplate2c.input b/test/freeflow/ransnc/test_flatplate2c.input index d55a97171556db467dee87ba06ed1c1cf37b9eea..7ebd7c9baeb919cd936f45eaf9e9027b392f3645 100644 --- a/test/freeflow/ransnc/test_flatplate2c.input +++ b/test/freeflow/ransnc/test_flatplate2c.input @@ -27,6 +27,3 @@ NumericEpsilon.BaseEpsilon = 1e-8 MaxSteps = 10 TargetSteps = 8 MaxRelativeShift = 1e-5 - -[Vtk] -AddVelocity = true diff --git a/test/freeflow/ransnc/test_flatplate2cni.input b/test/freeflow/ransnc/test_flatplate2cni.input index b23acfd7ee636916bc0126169bb926412cb8b552..ed2afed061316d3bfae2075e28539d04d86d8fad 100644 --- a/test/freeflow/ransnc/test_flatplate2cni.input +++ b/test/freeflow/ransnc/test_flatplate2cni.input @@ -27,6 +27,3 @@ NumericDifferenceMethod = 0 MaxSteps = 10 TargetSteps = 8 MaxRelativeShift = 1e-5 - -[Vtk] -AddVelocity = true diff --git a/test/freeflow/ransnc/test_flatplate2cni_wallfunction.input b/test/freeflow/ransnc/test_flatplate2cni_wallfunction.input index 53b88eeca2ee4beaca00ae65a3b5188b8dd9655e..a39400964f9003fe7dabcbf70aae2bb0ef09ab80 100644 --- a/test/freeflow/ransnc/test_flatplate2cni_wallfunction.input +++ b/test/freeflow/ransnc/test_flatplate2cni_wallfunction.input @@ -28,6 +28,3 @@ NumericDifferenceMethod = 0 MaxSteps = 10 TargetSteps = 8 MaxRelativeShift = 1e-5 - -[Vtk] -AddVelocity = true diff --git a/test/geomechanics/elastic/test_elastic.cc b/test/geomechanics/elastic/test_elastic.cc index 74ae58761f9f7d6673e9d59a31ce28da934f7d14..05920451267f76763dc680134dc18d629c96edfe 100644 --- a/test/geomechanics/elastic/test_elastic.cc +++ b/test/geomechanics/elastic/test_elastic.cc @@ -101,7 +101,7 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module and add displacement - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); vtkWriter.addField(x, "u"); // also, add exact solution to the output diff --git a/test/geomechanics/poroelastic/test_poroelastic.cc b/test/geomechanics/poroelastic/test_poroelastic.cc index 2f82bd8f59f9b90ded277a989fdc78ec2b2234f0..18152f4eb563100e006e422633767a049ccab703 100644 --- a/test/geomechanics/poroelastic/test_poroelastic.cc +++ b/test/geomechanics/poroelastic/test_poroelastic.cc @@ -145,8 +145,8 @@ int main(int argc, char** argv) try // intialize the vtk output module and output fields using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - using VtkOutputModule = VtkOutputModule; - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + using VtkOutputModule = Dumux::VtkOutputModule; + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); // also, add exact solution to the output diff --git a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc index 3d7be9226f0f0afcee716d9c89b2314917b8b0df..8715fc73b1f73d8cf716cda975e3b94aa8732b50 100644 --- a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc @@ -223,11 +223,13 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - VtkOutputModule vtkWriter0(*problem0, *fvGridGeometry0, *gridVariables0, sol[domain0Idx], problem0->name()); + using SolutionVector0 = std::decay_t; + VtkOutputModule vtkWriter0(*gridVariables0, sol[domain0Idx], problem0->name()); GET_PROP_TYPE(SubTypeTag0, VtkOutputFields)::init(vtkWriter0); vtkWriter0.write(0.0); - VtkOutputModule vtkWriter1(*problem1, *fvGridGeometry1, *gridVariables1, sol[domain1Idx], problem1->name()); + using SolutionVector1 = std::decay_t; + VtkOutputModule vtkWriter1(*gridVariables1, sol[domain1Idx], problem1->name()); GET_PROP_TYPE(SubTypeTag1, VtkOutputFields)::init(vtkWriter1); vtkWriter1.write(0.0); diff --git a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc index 2c0be5d86da9982706916f9a123d8588529e5e89..843599f375ce442057c6cc8ed300b5ac3bf89c29 100644 --- a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc @@ -208,11 +208,13 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - VtkOutputModule vtkWriter0(*problem0, *fvGridGeometry0, *gridVariables0, sol[domain0Idx], problem0->name()); + using SolutionVector0 = std::decay_t; + VtkOutputModule vtkWriter0(*gridVariables0, sol[domain0Idx], problem0->name()); GET_PROP_TYPE(SubTypeTag0, VtkOutputFields)::init(vtkWriter0); vtkWriter0.write(0.0); - VtkOutputModule vtkWriter1(*problem1, *fvGridGeometry1, *gridVariables1, sol[domain1Idx], problem1->name()); + using SolutionVector1 = std::decay_t; + VtkOutputModule vtkWriter1(*gridVariables1, sol[domain1Idx], problem1->name()); GET_PROP_TYPE(SubTypeTag1, VtkOutputFields)::init(vtkWriter1); vtkWriter1.write(0.0); diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc index 93a544995418532fbaceae0840a1b74f3a75bcac..0197c2208afbdc9c5349d754b77f809956f83d61 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc @@ -191,11 +191,13 @@ int main(int argc, char** argv) try const auto stokesName = getParam("Problem.Name") + "_" + stokesProblem->name(); const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); - StaggeredVtkOutputModule stokesVtkWriter(*stokesProblem, *stokesFvGridGeometry, *stokesGridVariables, stokesSol, stokesName); + StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); stokesVtkWriter.write(0.0); - VtkOutputModule darcyVtkWriter(*darcyProblem, *darcyFvGridGeometry, *darcyGridVariables, sol[darcyIdx], darcyName); + VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); + using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc index 5be1316991aa40009f7ffd39ae182f54c7f1012c..1f0673f05b206802e65b41b13d988e08ecc0c1f8 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc @@ -192,11 +192,13 @@ int main(int argc, char** argv) try const auto stokesName = getParam("Problem.Name") + "_" + stokesProblem->name(); const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); - StaggeredVtkOutputModule stokesVtkWriter(*stokesProblem, *stokesFvGridGeometry, *stokesGridVariables, stokesSol, stokesName); + StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); stokesVtkWriter.write(0.0); - VtkOutputModule darcyVtkWriter(*darcyProblem, *darcyFvGridGeometry, *darcyGridVariables, sol[darcyIdx], darcyName); + VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); + using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc index bd6c057d56dee19df375308d61ca988a9f204686..2f8864a37ac9d3cca45a434b12e306995f882f19 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc @@ -184,11 +184,13 @@ int main(int argc, char** argv) try const auto stokesName = getParam("Problem.Name") + "_" + stokesProblem->name(); const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); - StaggeredVtkOutputModule stokesVtkWriter(*stokesProblem, *stokesFvGridGeometry, *stokesGridVariables, stokesSol, stokesName); + StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); stokesVtkWriter.write(0.0); - VtkOutputModule darcyVtkWriter(*darcyProblem, *darcyFvGridGeometry, *darcyGridVariables, sol[darcyIdx], darcyName); + VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); + using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc index 1a8e094908f6e52d9ef43374bb8a22d6c960b6d2..c1caa48d32c8b0fe5decc723889131fa6133b04d 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc @@ -158,11 +158,13 @@ int main(int argc, char** argv) try const auto stokesName = getParam("Problem.Name") + "_" + stokesProblem->name(); const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); - StaggeredVtkOutputModule stokesVtkWriter(*stokesProblem, *stokesFvGridGeometry, *stokesGridVariables, stokesSol, stokesName); + StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); stokesVtkWriter.write(0.0); - VtkOutputModule darcyVtkWriter(*darcyProblem, *darcyFvGridGeometry, *darcyGridVariables, sol[darcyIdx], darcyName); + VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); + using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc index 3e039e36836126ffd10b691c95fdbb868f90348c..859451b901843d1efada3d459e6f9f6fa6e27cae 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc @@ -161,11 +161,13 @@ int main(int argc, char** argv) try const auto stokesName = getParam("Problem.Name") + "_" + stokesProblem->name(); const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); - StaggeredVtkOutputModule stokesVtkWriter(*stokesProblem, *stokesFvGridGeometry, *stokesGridVariables, stokesSol, stokesName); + StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); stokesVtkWriter.write(0.0); - VtkOutputModule darcyVtkWriter(*darcyProblem, *darcyFvGridGeometry, *darcyGridVariables, sol[darcyIdx], darcyName); + VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); + using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc b/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc index 9c786819060633d364ad7f7ae5570747c6e58484..35d4dc9ccc04a076ca7e788009f15786608a193a 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc @@ -183,11 +183,13 @@ int main(int argc, char** argv) try const auto stokesName = getParam("Problem.Name") + "_" + stokesProblem->name(); const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); - StaggeredVtkOutputModule stokesVtkWriter(*stokesProblem, *stokesFvGridGeometry, *stokesGridVariables, stokesSol, stokesName); + StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); stokesVtkWriter.write(0.0); - VtkOutputModule darcyVtkWriter(*darcyProblem, *darcyFvGridGeometry, *darcyGridVariables, sol[darcyIdx], darcyName); + VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); + using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); diff --git a/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc b/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc index 68853d64fda1cd9baca2cb461f95df81b38caf90..db84de765b132350b0d545703fbcccae9af274fa 100644 --- a/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc +++ b/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc @@ -348,14 +348,16 @@ int main(int argc, char** argv) try const bool outputVtk = getParam("Problem.EnableVtkOutput", true); // intialize the vtk output module - VtkOutputModule bulkVtkWriter(*bulkProblem, *bulkFvGridGeometry, *bulkGridVariables, sol[bulkIdx], bulkProblem->name()); + using BulkSolutionVector = std::decay_t; + VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); - if (outputVtk) bulkVtkWriter.write(0.0); + bulkVtkWriter.write(0.0); - VtkOutputModule lowDimVtkWriter(*lowDimProblem, *lowDimFvGridGeometry, *lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); + using LowDimSolutionVector = std::decay_t; + VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); lowDimProblem->addVtkOutputFields(lowDimVtkWriter); - if (outputVtk) lowDimVtkWriter.write(0.0); + lowDimVtkWriter.write(0.0); // instantiate time loop auto timeLoop = std::make_shared>(0.0, dt, tEnd); diff --git a/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc b/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc index 15a4cded00c443c833e58826bd1a9e0e08d63af3..86e55f594827b678777c6a39fe7fb124d5bff08a 100644 --- a/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc +++ b/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc @@ -159,12 +159,14 @@ int main(int argc, char** argv) try lowDimGridVariables->init(sol[lowDimIdx], oldSol[lowDimIdx]); // intialize the vtk output module - VtkOutputModule bulkVtkWriter(*bulkProblem, *bulkFvGridGeometry, *bulkGridVariables, sol[bulkIdx], bulkProblem->name()); + using BulkSolutionVector = std::decay_t; + VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); bulkProblem->addVtkOutputFields(bulkVtkWriter); bulkVtkWriter.write(0.0); - VtkOutputModule lowDimVtkWriter(*lowDimProblem, *lowDimFvGridGeometry, *lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); + using LowDimSolutionVector = std::decay_t; + VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); lowDimProblem->addVtkOutputFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); diff --git a/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc b/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc index 825b9430097de2aa74d9ba58263c6b1fb97a4fb3..a6d5e7981d5ee6c114f1076fff1ba5543b60baf8 100644 --- a/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc +++ b/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc @@ -165,11 +165,13 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - VtkOutputModule bulkVtkWriter(*bulkProblem, *bulkFvGridGeometry, *bulkGridVariables, sol[bulkIdx], bulkProblem->name()); + using BulkSolutionVector = std::decay_t; + VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); bulkVtkWriter.write(0.0); - VtkOutputModule lowDimVtkWriter(*lowDimProblem, *lowDimFvGridGeometry, *lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); + using LowDimSolutionVector = std::decay_t; + VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); lowDimProblem->addVtkOutputFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); diff --git a/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc b/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc index 78b86eddc3dd7dfa7f8aef49e2db203b75068d29..4a380363b38e49b3c3b7be4bb14bdaf69476ad7c 100644 --- a/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc +++ b/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc @@ -209,11 +209,13 @@ int main(int argc, char** argv) try lowDimGridVariables->init(sol[lowDimIdx], oldSol[lowDimIdx]); // intialize the vtk output module - VtkOutputModule bulkVtkWriter(*bulkProblem, *bulkFvGridGeometry, *bulkGridVariables, sol[bulkIdx], bulkProblem->name()); + using BulkSolutionVector = std::decay_t; + VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); bulkVtkWriter.write(0.0); - VtkOutputModule lowDimVtkWriter(*lowDimProblem, *lowDimFvGridGeometry, *lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); + using LowDimSolutionVector = std::decay_t; + VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); lowDimVtkWriter.write(0.0); diff --git a/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc b/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc index f8d4303290dd2e6ec716b8698c72661ac21a3071..7c73a4772a1906f6c7769c10a858b1303d21c63c 100644 --- a/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc +++ b/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc @@ -270,8 +270,10 @@ int main(int argc, char** argv) try // intialize the vtk output module const auto bulkDM = BulkFVGridGeometry::discMethod == DiscretizationMethod::box ? Dune::VTK::nonconforming : Dune::VTK::conforming; - VtkOutputModule bulkVtkWriter(*bulkProblem, *bulkFvGridGeometry, *bulkGridVariables, x[bulkId], bulkProblem->name(), "Bulk", bulkDM); - VtkOutputModule lowDimVtkWriter(*lowDimProblem, *lowDimFvGridGeometry, *lowDimGridVariables, x[lowDimId], lowDimProblem->name(), "LowDim"); + using BulkSolutionVector = std::decay_t; + using LowDimSolutionVector = std::decay_t; + VtkOutputModule bulkVtkWriter(*bulkGridVariables, x[bulkId], bulkProblem->name(), "Bulk", bulkDM); + VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, x[lowDimId], lowDimProblem->name(), "LowDim"); // container for the output of the exact solutions std::vector bulkExact; diff --git a/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc b/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc index b5ba775d1943e457398b85bf4fd435c49ace20f5..e86de1991e61ec5c0aed58dcb22ecac0b8cad765 100644 --- a/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc +++ b/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc @@ -176,9 +176,12 @@ int main(int argc, char** argv) try edgeGridVariables->init(x[edgeId]); // intialize the vtk output module - VtkOutputModule bulkVtkWriter(*bulkProblem, *bulkFvGridGeometry, *bulkGridVariables, x[bulkId], bulkProblem->name()); - VtkOutputModule facetVtkWriter(*facetProblem, *facetFvGridGeometry, *facetGridVariables, x[facetId], facetProblem->name()); - VtkOutputModule edgeVtkWriter(*edgeProblem, *edgeFvGridGeometry, *edgeGridVariables, x[edgeId], edgeProblem->name()); + using BulkSolutionVector = std::decay_t; + using FacetSolutionVector = std::decay_t; + using EdgeSolutionVector = std::decay_t; + VtkOutputModule bulkVtkWriter(*bulkGridVariables, x[bulkId], bulkProblem->name()); + VtkOutputModule facetVtkWriter(*facetGridVariables, x[facetId], facetProblem->name()); + VtkOutputModule edgeVtkWriter(*edgeGridVariables, x[edgeId], edgeProblem->name()); // Add model specific output fields using BulkVtkOutputFields = typename GET_PROP_TYPE(BulkProblemTypeTag, VtkOutputFields); diff --git a/test/porousmediumflow/1p/implicit/compressible/test_1p.cc b/test/porousmediumflow/1p/implicit/compressible/test_1p.cc index 1408949eadbefca13c79e8923ce7f02f46415b4f..e86724c8b49e8c5f12b0f4a4aef9cc5dfd89c9a6 100644 --- a/test/porousmediumflow/1p/implicit/compressible/test_1p.cc +++ b/test/porousmediumflow/1p/implicit/compressible/test_1p.cc @@ -110,7 +110,9 @@ int main(int argc, char** argv) try auto maxDt = getParam("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc b/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc index 723cf74e240e32ac6a4fd7f77d7a3eb0545b3f54..3d62ebbb3fee50a753499549f1f22fc40d1675bb 100644 --- a/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc +++ b/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc @@ -101,7 +101,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc b/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc index 2754ab3a4d0a16cf4866b67ba4f4c804b4168a75..0f46073e770cd0a7d44e232af78009a6d8ae47b7 100644 --- a/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc @@ -98,7 +98,9 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc index 75f38d634207ae54059ceec9a5fc83b9960200ab..89c40a00f736766fa66f3a4960364e7a1e3e11d8 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc @@ -113,7 +113,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc index 7603390e6b6da23fb847a789a9cbfca25a52e8f5..1dec574344c2bd33d3937a0d209a69aad5e31b11 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc @@ -113,7 +113,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/test_1pfv.cc b/test/porousmediumflow/1p/implicit/test_1pfv.cc index f021f8408ddfa8798e6a34dc9d4d63103f937c3e..088b66b5c32977134e78d6ad6dad06ab5b5ee556 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv.cc @@ -143,7 +143,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields // if we are using a random permeability field with gstat diff --git a/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc b/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc index 65a1a9c23b560f61b5db0c87501891f44b1a0493..7b2bce7541e84cf6b24446488b32a28b143c4fb3 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc @@ -137,7 +137,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc b/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc index edd24f310b7c7de23f3f420901527095796509bd..71a4560a305ed79948218bc5b6d5b01d0b7f2d31 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc @@ -137,7 +137,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/test_1pnifv.cc b/test/porousmediumflow/1p/implicit/test_1pnifv.cc index cceb83f2ad4a5632713bb381d108e42cb6ee606e..39fb147daff037a72f21b1cf6e0d7f4ed63b4f51 100644 --- a/test/porousmediumflow/1p/implicit/test_1pnifv.cc +++ b/test/porousmediumflow/1p/implicit/test_1pnifv.cc @@ -140,7 +140,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc index 2259a2af781a7e873a24afa3bcfaf34cef339124..d6eccc18a854135c949b788610f0cc6759c44d29 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc @@ -111,7 +111,9 @@ int main(int argc, char** argv) try auto maxDt = getParam("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc index 52bf9985fedd9652bcd66fd185d2d3581012407b..0a5b093a6a15c1a0bcb8785bc27920b66a8a017f 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc @@ -110,7 +110,9 @@ int main(int argc, char** argv) try auto maxDt = getParam("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc index 418edee9af223d02821644a78bb7177270b87dfb..df9dfdf7d7ab7822b5c728ccfee1cce761a9383a 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc @@ -110,7 +110,9 @@ int main(int argc, char** argv) try auto maxDt = getParam("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); diff --git a/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc b/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc index 2f09fdd81f979760ce9328fb52b88e4c5944111f..9b810e7049b314e736cc5592144c37160e5e683a 100644 --- a/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc +++ b/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc @@ -136,7 +136,7 @@ int main(int argc, char** argv) try auto maxDt = getParam("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); diff --git a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc index f0b9222f541418332f07e16a95bab95edf49afc4..ba3ff4952bc9d2775173019f90ba55db5488f549 100644 --- a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc +++ b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc @@ -189,7 +189,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc b/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc index cc85df984411b095ee4353eb463edd72a47fafa1..f7ead694af9efe0c6571cc994fdd399fcba3dbfa 100644 --- a/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc +++ b/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc @@ -173,7 +173,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); using FractureGrid = FRACTUREGRIDTYPE; - BoxDfmVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name(), "", Dune::VTK::nonconforming); + BoxDfmVtkOutputModule vtkWriter(*gridVariables, x, problem->name(), "", Dune::VTK::nonconforming); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc b/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc index 45ee211089f4cee32a437266d7d2d8bbb24b4a1d..8eb8464c8dd5400d00e294f60462a894704e29b0 100644 --- a/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc +++ b/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc @@ -153,7 +153,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, + VtkOutputModule vtkWriter(*gridVariables, + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); x, problem->name(), "", Dune::VTK::conforming); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields diff --git a/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc b/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc index ca4bbbc07f2a6a0779e64fb16979021ff720d424..f525dc508b2d9c05d2483be2eed29a7e67c2fa2a 100644 --- a/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc +++ b/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc @@ -126,7 +126,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc index 4df2e90942f7a9e15789156babb72b1700acea48..05ebfd15c2048f5f81eb47783ea5f2c187f36a8a 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc +++ b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc @@ -151,9 +151,10 @@ int main(int argc, char** argv) try // use non-conforming output for the test with interface solver const auto ncOutput = getParam("Problem.UseNonConformingOutput", false); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name(), "", - (ncOutput ? Dune::VTK::nonconforming : Dune::VTK::conforming)); - + VtkOutputModule vtkWriter(*gridVariables, x, problem->name(), "", + ncOutput ? Dune::VTK::nonconforming : Dune::VTK::conforming); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc b/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc index 81228335c8177c1177126ae840fad3a22eadf215..4b442d24b1f1d505b951970c572fd0ca1592892e 100644 --- a/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc +++ b/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc @@ -137,7 +137,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc index 9f869544a52fdea9ae96715dfdcaeca717a7b72c..3dd8850bd67d78be0ef291d7d0116840d058521e 100644 --- a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc +++ b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc @@ -110,7 +110,7 @@ int main(int argc, char** argv) try auto maxDt = getParam("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc b/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc index 1aeb4f518ddd850ebf299cf8e6c8995a0072c024..5c6abf285a5e7493fdd531498225b1c7a928121c 100644 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc @@ -138,7 +138,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc index 2e6f3fe159a3691cecc4ab6d09bfc446bc02f7dc..efef6227db1da1b9b981fbf4e247dccac6e70cd2 100644 --- a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc +++ b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc @@ -113,7 +113,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc b/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc index 8b4349cbb69d44f3251fcfadef8ca870a9dcb5a4..c42b5cbb9f4605ba63f5eb6da01b7705816dabb5 100644 --- a/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc +++ b/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc @@ -137,7 +137,9 @@ int main(int argc, char** argv) try // initialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields problem->addVtkFields(vtkWriter); //!< Add problem specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc b/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc index eaa00f5ba116f21c5a72a74596f0da8a70ea7e40..cbe43a64753d4c23a68d0c79469af472dbf537b1 100644 --- a/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc +++ b/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc @@ -135,7 +135,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc b/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc index 47c64c82c140f314f2b6516188fb74473a0e664a..8ab374d99f31d619b9b602c7a08179969c78b3d7 100644 --- a/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc +++ b/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc @@ -135,7 +135,9 @@ int main(int argc, char** argv) try // initialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields //add specific output vtkWriter.addField(problem->getPermeability(), "Permeability"); diff --git a/test/porousmediumflow/3p/implicit/test_3p_fv.cc b/test/porousmediumflow/3p/implicit/test_3p_fv.cc index de385c23203bd4b5a70cd5300359607400585dd5..847479cff6f59f4d2acf72f37d983e576fe28a02 100644 --- a/test/porousmediumflow/3p/implicit/test_3p_fv.cc +++ b/test/porousmediumflow/3p/implicit/test_3p_fv.cc @@ -142,7 +142,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc b/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc index d04de7bf5e34b6155cec61d1148fabc3131f8dc7..07921c89673db1ec8acdf5f122b1ed00c0873338 100644 --- a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc +++ b/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc @@ -142,7 +142,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc b/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc index b36e7ffd66d623c92b126ce1a7fbf35324f1017d..95ed2be98a79395f514337d6c16fd291e81610a1 100644 --- a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc +++ b/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc @@ -142,7 +142,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc b/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc index 57c0783b864d9abc8d3a3ecf11f37bc38aeed22f..f0ed0dc1d0b9095631bff9a41e2891f90dcd6efa 100644 --- a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc +++ b/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc @@ -142,7 +142,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc b/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc index e809fc4149804e8de78b5283883a94edbde4adff..968c2e907b684032b7520420e4f3edabccb72174 100644 --- a/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc +++ b/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc @@ -139,7 +139,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/co2/implicit/test_co2_fv.cc b/test/porousmediumflow/co2/implicit/test_co2_fv.cc index 85ddce197d22be6f8963e3807ef08ebfbdf68c44..260bd2a7024f91adcb788c04d27324fb7e5607b8 100644 --- a/test/porousmediumflow/co2/implicit/test_co2_fv.cc +++ b/test/porousmediumflow/co2/implicit/test_co2_fv.cc @@ -116,7 +116,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields problem->addFieldsToWriter(vtkWriter); //!< Add some more problem dependent fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc index 26324226ba8426b497b6502ce1900d73bd053b5d..7456e7adcc1a8db027067d6915cc479b321adb31 100644 --- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc +++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc @@ -144,7 +144,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc b/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc index 4d0fdb57172ac18b72d2628d81854df3df7a3c90..0f4e4867d2351c840cb329b2116ff95fd6212ab7 100644 --- a/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc +++ b/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc @@ -143,7 +143,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc b/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc index c0a6070ae6d9031719b59ce8e732012a9ffe8294..cc878606dddd5c3f5682ff4473e0d71b0901a358 100644 --- a/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc +++ b/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc @@ -142,7 +142,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc b/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc index 6176146751f548feba0b571b553f81d84ae2a111..6ae3e12e31c2990392e041f6f0f6b4feb9e60177 100644 --- a/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc +++ b/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc @@ -144,7 +144,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc b/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc index a39faff519ce811a807d1188b6b5272bdf2e29f9..78d37cb8ca0549ccc47784301ce4f4052d554e9b 100644 --- a/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc +++ b/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc @@ -137,7 +137,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc b/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc index d6190f237dea57abc423c42f9c7f817a3c2f016b..0a0334136f1a64561bf3f70c9f7dd77715990485 100644 --- a/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc @@ -112,7 +112,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc index d0fd30addaf62db84650e0d11c38bd12a20cb2c6..ababe0ffe34dc4664352372085ecc3470cd2c397 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc @@ -137,7 +137,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc index 99015535579c703189dc8394b46e25ec4b727571..f14f52e133426340f45a507d66afec6573f2f1fb 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc @@ -137,7 +137,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc index b2ba91688d93074f014a8cf7e3ad4ca2a016680a..cf93612ae3521da6978766bbd9463f342fe80ecd 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc @@ -105,7 +105,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc b/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc index 76d815c63e82b05e2bee644b67e3ac57911b460e..435c849833139f4408397cdfdfe650b02bddd402 100644 --- a/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc +++ b/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc @@ -138,7 +138,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc b/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc index 149ddff7a3351a16cdc31a1151647ac15020eff8..3415277e7e0a97996e4b40a1dbd98b6f5fa99933 100644 --- a/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc +++ b/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc @@ -225,9 +225,11 @@ int main(int argc, char** argv) try assembler->setLinearSystem(A, r); //! intialize the vtk output module - VtkOutputModule vtkWriter(*tracerProblem, *fvGridGeometry, *gridVariables, x, tracerProblem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, tracerProblem->name()); using VtkOutputFields = typename GET_PROP_TYPE(TracerTypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using VelocityOutput = typename GET_PROP_TYPE(TracerTypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); vtkWriter.write(0.0); ///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/test/porousmediumflow/tracer/constvel/test_tracer.cc b/test/porousmediumflow/tracer/constvel/test_tracer.cc index abfe53c3b3f7385394107dcd83cf5e280772a404..58ec4ed44faa6cafde9f7dcb982510c9690d23ca 100644 --- a/test/porousmediumflow/tracer/constvel/test_tracer.cc +++ b/test/porousmediumflow/tracer/constvel/test_tracer.cc @@ -124,7 +124,9 @@ int main(int argc, char** argv) try auto linearSolver = std::make_shared(); //! intialize the vtk output module - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc b/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc index da2bd4a0c1ad4bbec7f05ac7b21ca4f533bc7ca9..b798dd4d8349ea775d91e78c1d5d448bae09d3ef 100644 --- a/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc +++ b/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc @@ -144,7 +144,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0);