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..d9d5e40672da8bc39499b511ac45115e61cca3fc 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 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 2c6e940fda50455eddfe88dec356a965f93f2f2e..94f2784694a47c30d3275874c9b25dd046aba5ca 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 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 f6fcbab711ef4e89b10ffd1fe761ef24fdc6b3e0..9ae75e5b463735b7a7a02e088120e012c933b29f 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 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 813c1e8768cdab006bb3f9a4ab3b5862e4e590e9..76607dd72edd09499dd73af5056ab1ac916237fa 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 362761d510c3c4f556605bbbee39276b36aed55b..b72e30520e1271951ea743ea2186e8910e692a2b 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 57c976f9cbecde8329167189a8f25128766c80f1..3d64a81497c41ab113a48bbfc72c6daf0efa6aef 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 0dac5f1df2302a71fe2343facfc1a7b812ef7f5e..0eb4ce99c6b23957ba7590699bb19837ccb993df 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 5b18eb25bc1ea2b64b5d911af5775d086cf14d87..897b9dfa506d5df2050f6ba4444a2c9e03f6d401 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 9ca7d67547eb901da24938cea66f2940de15f3b0..65ae0eabb7031539a0a0951b1dde30373033f080 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 61b953731574d5073fec8c6b4c52afcffe49c024..bff1f348a54cedd7317ef0f2eb8a3e3696430769 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 f89e85f8e21fc7ecfd7658522dc46ae5b6a7cae7..e31b2dae413a89d76b451a1f7a7f6a590d8f4fbb 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 06ebf4f3b51ab1829f832c359e6f95cc92398e64..05deb3c1c70d67d9d89b8c41d79f7d521c3b282d 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 80695671330a1948efff2a5361624b2a891f90d8..2357c25959aefcac23db05390d4e7bee9827bfd1 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 098e7ef5e8afb8043548b110e42592adf3563131..79bb451eb46974ca930daaa18b0b0d4f101cfcca 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 57806bce468eefaffbd67341db44486f60b49cd3..86969a129b0153f1aad36cec611dc4663ce7825e 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 74ae58761f9f7d6673e9d59a31ce28da934f7d14..d146efd969db2ddcd43bf5df29d88c88b1a9d005 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 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/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/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/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/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..2fd68fa2392a963ef3c758b6b5ed75b5d2a2a203 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 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/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/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);