From 0bc32d272f5bd9f1ea964feea59e89cc8865dcb3 Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Wed, 18 Jul 2018 13:54:38 +0200 Subject: [PATCH] Free velocity output of TypeTag --- .../staggered/freeflow/properties.hh | 4 +- .../staggered/freeflow/velocityoutput.hh | 73 ++++---- dumux/geomechanics/properties.hh | 2 +- dumux/geomechanics/velocityoutput.hh | 23 +-- dumux/io/staggeredvtkoutputmodule.hh | 17 +- dumux/io/velocityoutput.hh | 79 +++++++++ dumux/io/vtkoutputmodule.hh | 92 +++++----- dumux/porousmediumflow/properties.hh | 4 +- dumux/porousmediumflow/velocityoutput.hh | 158 ++++++++---------- test/freeflow/navierstokes/test_angeli.cc | 4 +- test/freeflow/navierstokes/test_channel.cc | 4 +- .../navierstokes/test_closedsystem.cc | 4 +- test/freeflow/navierstokes/test_donea.cc | 4 +- test/freeflow/navierstokes/test_kovasznay.cc | 4 +- .../navierstokes/test_navierstokes_1d.cc | 4 +- .../navierstokes/test_stokes_channel_3d.cc | 4 +- test/freeflow/navierstokesnc/test_channel.cc | 4 +- .../navierstokesnc/test_densitydrivenflow.cc | 4 +- .../navierstokesnc/test_msfreeflow.cc | 4 +- test/freeflow/rans/test_pipe_laufer.cc | 4 +- test/freeflow/ransnc/test_flatplate.cc | 4 +- test/geomechanics/elastic/test_elastic.cc | 4 +- .../poroelastic/test_poroelastic.cc | 4 +- .../1p2c_richards2c/test_1p2c_richards2c.cc | 10 +- .../embedded/1d3d/1p_1p/test_1p_1p.cc | 6 +- .../1d3d/1p_richards/test_1p_richards.cc | 6 +- .../1p/implicit/compressible/test_1p.cc | 4 +- .../compressible/test_1p_stationary.cc | 4 +- .../1p/implicit/incompressible/test_1pfv.cc | 4 +- .../pointsources/test_1pfv_pointsources.cc | 4 +- .../test_1pfv_pointsources_timedependent.cc | 4 +- .../porousmediumflow/1p/implicit/test_1pfv.cc | 4 +- .../1p/implicit/test_1pfv_fracture2d3d.cc | 4 +- .../1p/implicit/test_1pfv_network1d3d.cc | 4 +- .../1p/implicit/test_1pnifv.cc | 4 +- .../1pnc/implicit/test_1p2c_fv.cc | 4 +- .../implicit/test_1p2cni_conduction_fv.cc | 4 +- .../implicit/test_1p2cni_convection_fv.cc | 4 +- .../implicit/adaptive/test_2p_adaptive_fv.cc | 4 +- .../cornerpoint/test_2p_cornerpoint.cc | 4 +- .../implicit/fracture/test_2p_fracture_fv.cc | 4 +- .../2p/implicit/incompressible/test_2p_fv.cc | 4 +- .../2p/implicit/nonisothermal/test_2pni_fv.cc | 4 +- .../mpnccomparison/test_2p2c_comparison_fv.cc | 4 +- .../2p2c/implicit/test_2p2c_fv.cc | 4 +- .../2pnc/implicit/test_2pnc_fv.cc | 4 +- .../2pnc/implicit/test_cc2pnc_diffusion.cc | 4 +- .../2pncmin/implicit/test_2pncmin_fv.cc | 4 +- .../3p/implicit/test_3p_fv.cc | 4 +- .../3p/implicit/test_3pni_fv_conduction.cc | 4 +- .../3p/implicit/test_3pni_fv_convection.cc | 4 +- .../3p3c/implicit/test_3p3c_fv.cc | 4 +- .../3pwateroil/implicit/test_box3pwateroil.cc | 4 +- .../co2/implicit/test_co2_fv.cc | 4 +- .../2p2ccomparison/test_mpnc_comparison_fv.cc | 4 +- .../mpnc/implicit/test_boxmpnckinetic.cc | 4 +- .../implicit/test_boxmpncthermalnonequil.cc | 4 +- .../mpnc/implicit/test_mpnc_obstacle_fv.cc | 4 +- .../implicit/test_ccrichardsanalytical.cc | 4 +- .../richards/implicit/test_richardslens_fv.cc | 4 +- .../implicit/test_richardsniconduction_fv.cc | 4 +- .../implicit/test_richardsniconvection_fv.cc | 4 +- .../implicit/test_richardsnievaporation_fv.cc | 4 +- .../richardsnc/implicit/test_richardsnc_fv.cc | 4 +- .../tracer/constvel/test_tracer.cc | 4 +- .../multicomp/test_tracer_maxwellstefan.cc | 4 +- 66 files changed, 430 insertions(+), 260 deletions(-) create mode 100644 dumux/io/velocityoutput.hh diff --git a/dumux/discretization/staggered/freeflow/properties.hh b/dumux/discretization/staggered/freeflow/properties.hh index 74815ff2b2..14c484bf72 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 dff401d9d8..d9d5e40672 100644 --- a/dumux/discretization/staggered/freeflow/velocityoutput.hh +++ b/dumux/discretization/staggered/freeflow/velocityoutput.hh @@ -24,80 +24,66 @@ #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"); + enableOutput_ = getParamFromGroup(gridVariables.curGridVolVars().problem().paramGroup(), "Vtk.AddVelocity"); } //! 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 +100,10 @@ public: } private: - const Problem& problem_; - const FVGridGeometry& fvGridGeometry_; const GridVariables& gridVariables_; const SolutionVector& sol_; - bool velocityOutput_; + + bool enableOutput_; }; } // end namespace Dumux diff --git a/dumux/geomechanics/properties.hh b/dumux/geomechanics/properties.hh index 058df41039..1036c4467c 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 a7687b19fb..aff80b6175 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 2c6e940fda..94f2784694 100644 --- a/dumux/io/staggeredvtkoutputmodule.hh +++ b/dumux/io/staggeredvtkoutputmodule.hh @@ -41,14 +41,12 @@ template class StaggeredVtkOutputModule; template -class DUNE_DEPRECATED_MSG("Use StaggeredVtkOutputModule instead!") StaggeredVtkOutputModule +class DUNE_DEPRECATED_MSG("Use StaggeredVtkOutputModule instead!") StaggeredVtkOutputModule : public StaggeredVtkOutputModule + typename GET_PROP_TYPE(TypeTag, SolutionVector)> { using ParentType = StaggeredVtkOutputModule; + typename GET_PROP_TYPE(TypeTag, SolutionVector)>; public: using ParentType::ParentType; @@ -73,13 +71,12 @@ public: * * \tparam GridVariables The grid variables * \tparam SolutionVector The solution vector - * \tparam VelocityOutput The velocity output nodule */ -template -class StaggeredVtkOutputModule -: public VtkOutputModule +template +class StaggeredVtkOutputModule +: public VtkOutputModule { - using ParentType = VtkOutputModule; + using ParentType = VtkOutputModule; using FVGridGeometry = typename GridVariables::GridGeometry; using GridView = typename FVGridGeometry::GridView; using Scalar = typename GridVariables::Scalar; diff --git a/dumux/io/velocityoutput.hh b/dumux/io/velocityoutput.hh new file mode 100644 index 0000000000..7aec5fdc08 --- /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 f6fcbab711..9ae75e5b46 100644 --- a/dumux/io/vtkoutputmodule.hh +++ b/dumux/io/vtkoutputmodule.hh @@ -46,6 +46,7 @@ #include #include "vtkfunction.hh" +#include "velocityoutput.hh" namespace Dumux { @@ -54,14 +55,12 @@ template class VtkOutputModule; template -class DUNE_DEPRECATED_MSG("Use VtkOutputModule instead!") VtkOutputModule +class DUNE_DEPRECATED_MSG("Use VtkOutputModule instead!") VtkOutputModule : public VtkOutputModule + typename GET_PROP_TYPE(TypeTag, SolutionVector)> { using ParentType = VtkOutputModule; + typename GET_PROP_TYPE(TypeTag, SolutionVector)>; public: using ParentType::ParentType; @@ -93,11 +92,10 @@ public: * 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 VtkOutputModule +template +class VtkOutputModule { using FVGridGeometry = typename GridVariables::GridGeometry; - static constexpr int numPhaseVelocities = VelocityOutput::numPhaseVelocities(); using VV = typename GridVariables::VolumeVariables; using Scalar = typename GridVariables::Scalar; @@ -111,7 +109,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; @@ -120,6 +117,8 @@ class VtkOutputModule struct VolVarVectorDataInfo { std::function get; std::string name; }; using Field = Vtk::template Field; + using VelocityOutput = Dumux::VelocityOutput; + public: //! export type of the volume variables for the outputfields using VolumeVariables = VV; @@ -144,6 +143,7 @@ public: , dm_(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 @@ -155,6 +155,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 @@ -277,8 +286,8 @@ private: ////////////////////////////////////////////////////////////// // instatiate the velocity output - VelocityOutput velocityOutput(problem(), fvGridGeometry(), 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"); @@ -292,7 +301,7 @@ private: if (!volVarScalarDataInfo_.empty() || !volVarVectorDataInfo_.empty() || !fields_.empty() - || velocityOutput.enableOutput() + || velocityOutput_->enableOutput() || addProcessRank) { const auto numCells = fvGridGeometry().gridView().size(0); @@ -304,9 +313,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); @@ -327,7 +336,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_); @@ -357,9 +366,9 @@ 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) @@ -391,21 +400,21 @@ private: } // the velocity field - if (velocityOutput.enableOutput()) + if (velocityOutput_->enableOutput()) { if (isBox && dim > 1) { - for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), velocity[phaseIdx], - "velocity_" + velocityOutput.phaseName(phaseIdx) + " (m/s)", + "velocity_" + velocityOutput_->phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); } // cell-centered models else { - for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), velocity[phaseIdx], - "velocity_" + velocityOutput.phaseName(phaseIdx) + " (m/s)", + "velocity_" + velocityOutput_->phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/0).get() ); } } @@ -447,9 +456,15 @@ private: //! (1) Assemble all variable fields and add to writer ////////////////////////////////////////////////////////////// - // instatiate the velocity output - VelocityOutput velocityOutput(problem(), fvGridGeometry(), 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"); @@ -465,7 +480,7 @@ private: if (!volVarScalarDataInfo_.empty() || !volVarVectorDataInfo_.empty() || !fields_.empty() - || velocityOutput.enableOutput() + || velocityOutput_->enableOutput() || addProcessRank) { const auto numCells = fvGridGeometry().gridView().size(0); @@ -477,9 +492,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); @@ -507,7 +522,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_); @@ -536,9 +551,9 @@ 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) @@ -559,20 +574,20 @@ private: 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) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), velocity[phaseIdx], - "velocity_" + velocityOutput.phaseName(phaseIdx) + " (m/s)", + "velocity_" + velocityOutput_->phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); // cell-wise velocities else - for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), velocity[phaseIdx], - "velocity_" + velocityOutput.phaseName(phaseIdx) + " (m/s)", + "velocity_" + velocityOutput_->phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/0).get() ); } @@ -629,6 +644,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/properties.hh b/dumux/porousmediumflow/properties.hh index d328d4a07b..d775eabd73 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 e379269144..4abe31587a 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 813c1e8768..76607dd72e 100644 --- a/test/freeflow/navierstokes/test_angeli.cc +++ b/test/freeflow/navierstokes/test_angeli.cc @@ -153,9 +153,11 @@ 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(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables, x)); vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); vtkWriter.addFaceField(problem->getAnalyticalVelocitySolutionOnFace(), "faceVelocityExact"); diff --git a/test/freeflow/navierstokes/test_channel.cc b/test/freeflow/navierstokes/test_channel.cc index 362761d510..b72e30520e 100644 --- a/test/freeflow/navierstokes/test_channel.cc +++ b/test/freeflow/navierstokes/test_channel.cc @@ -155,7 +155,9 @@ int main(int argc, char** argv) try // initialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables, x)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokes/test_closedsystem.cc b/test/freeflow/navierstokes/test_closedsystem.cc index 57c976f9cb..3d64a81497 100644 --- a/test/freeflow/navierstokes/test_closedsystem.cc +++ b/test/freeflow/navierstokes/test_closedsystem.cc @@ -148,7 +148,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables, x)); 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 0dac5f1df2..0eb4ce99c6 100644 --- a/test/freeflow/navierstokes/test_donea.cc +++ b/test/freeflow/navierstokes/test_donea.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); - StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables, x)); 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_kovasznay.cc b/test/freeflow/navierstokes/test_kovasznay.cc index 5b18eb25bc..897b9dfa50 100644 --- a/test/freeflow/navierstokes/test_kovasznay.cc +++ b/test/freeflow/navierstokes/test_kovasznay.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); - StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables, x)); 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.cc b/test/freeflow/navierstokes/test_navierstokes_1d.cc index 9ca7d67547..65ae0eabb7 100644 --- a/test/freeflow/navierstokes/test_navierstokes_1d.cc +++ b/test/freeflow/navierstokes/test_navierstokes_1d.cc @@ -124,7 +124,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables, x)); 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_stokes_channel_3d.cc b/test/freeflow/navierstokes/test_stokes_channel_3d.cc index 61b9537315..bff1f348a5 100644 --- a/test/freeflow/navierstokes/test_stokes_channel_3d.cc +++ b/test/freeflow/navierstokes/test_stokes_channel_3d.cc @@ -132,7 +132,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables, x)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokesnc/test_channel.cc b/test/freeflow/navierstokesnc/test_channel.cc index f89e85f8e2..e31b2dae41 100644 --- a/test/freeflow/navierstokesnc/test_channel.cc +++ b/test/freeflow/navierstokesnc/test_channel.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); - StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables, x)); 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 06ebf4f3b5..05deb3c1c7 100644 --- a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc +++ b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc @@ -152,7 +152,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables, x)); 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 8069567133..2357c25959 100644 --- a/test/freeflow/navierstokesnc/test_msfreeflow.cc +++ b/test/freeflow/navierstokesnc/test_msfreeflow.cc @@ -152,7 +152,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables, x)); VtkOutputFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/rans/test_pipe_laufer.cc b/test/freeflow/rans/test_pipe_laufer.cc index 098e7ef5e8..79bb451eb4 100644 --- a/test/freeflow/rans/test_pipe_laufer.cc +++ b/test/freeflow/rans/test_pipe_laufer.cc @@ -148,7 +148,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables, x)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/ransnc/test_flatplate.cc b/test/freeflow/ransnc/test_flatplate.cc index 57806bce46..86969a129b 100644 --- a/test/freeflow/ransnc/test_flatplate.cc +++ b/test/freeflow/ransnc/test_flatplate.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); - StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables, x)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/geomechanics/elastic/test_elastic.cc b/test/geomechanics/elastic/test_elastic.cc index 74ae58761f..d146efd969 100644 --- a/test/geomechanics/elastic/test_elastic.cc +++ b/test/geomechanics/elastic/test_elastic.cc @@ -101,7 +101,9 @@ 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()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); 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 2f82bd8f59..18152f4eb5 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/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc b/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc index 68853d64fd..db84de765b 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 15a4cded00..86e55f5948 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 825b943009..a6d5e7981d 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/porousmediumflow/1p/implicit/compressible/test_1p.cc b/test/porousmediumflow/1p/implicit/compressible/test_1p.cc index 1408949ead..e86724c8b4 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 723cf74e24..3d62ebbb3f 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 2754ab3a4d..0f46073e77 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 75f38d6342..89c40a00f7 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 7603390e6b..1dec574344 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 f021f8408d..088b66b5c3 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 65a1a9c23b..7b2bce7541 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 edd24f310b..71a4560a30 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 cceb83f2ad..39fb147daf 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 2259a2af78..d6eccc18a8 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 52bf9985fe..0a5b093a6a 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 418edee9af..df9dfdf7d7 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/2p/implicit/adaptive/test_2p_adaptive_fv.cc b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc index f0b9222f54..ba3ff4952b 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/cornerpoint/test_2p_cornerpoint.cc b/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc index 45ee211089..8eb8464c8d 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 ca4bbbc07f..f525dc508b 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 4df2e90942..2fd68fa239 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc +++ b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc @@ -151,7 +151,9 @@ 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(), "", + VtkOutputModule vtkWriter(*gridVariables, x, problem->name(), "", + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); (ncOutput ? Dune::VTK::nonconforming : Dune::VTK::conforming)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields diff --git a/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc b/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc index 81228335c8..4b442d24b1 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/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc b/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc index 1aeb4f518d..5c6abf285a 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 2e6f3fe159..efef6227db 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 8b4349cbb6..c42b5cbb9f 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 eaa00f5ba1..cbe43a6475 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 47c64c82c1..8ab374d99f 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 de385c2320..847479cff6 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 d04de7bf5e..07921c8967 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 b36e7ffd66..95ed2be98a 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 57c0783b86..f0ed0dc1d0 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 e809fc4149..968c2e907b 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 85ddce197d..260bd2a702 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 26324226ba..7456e7adcc 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 4d0fdb5717..0f4e4867d2 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 c0a6070ae6..cc878606dd 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 6176146751..6ae3e12e31 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 a39faff519..78d37cb8ca 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 d6190f237d..0a0334136f 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 d0fd30adda..ababe0ffe3 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 9901553557..f14f52e133 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 b2ba91688d..cf93612ae3 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 76d815c63e..435c849833 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/constvel/test_tracer.cc b/test/porousmediumflow/tracer/constvel/test_tracer.cc index abfe53c3b3..58ec4ed44f 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 da2bd4a0c1..b798dd4d83 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); -- GitLab