From 3cfbd3a4e1a6c966f17703115e3c81977a1bd4df Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Wed, 18 Jul 2018 10:13:09 +0200 Subject: [PATCH 01/10] [fvGridVariables] Add public function returning fvGridGeometry --- dumux/discretization/fvgridvariables.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dumux/discretization/fvgridvariables.hh b/dumux/discretization/fvgridvariables.hh index ac7346c55f..73f81d913e 100644 --- a/dumux/discretization/fvgridvariables.hh +++ b/dumux/discretization/fvgridvariables.hh @@ -164,6 +164,10 @@ public: GridVolumeVariables& prevGridVolVars() { return prevGridVolVars_; } + //! return the finite volume grid geometry + const GridGeometry& fvGridGeometry() const + { return *fvGridGeometry_; } + protected: std::shared_ptr fvGridGeometry_; //!< pointer to the constant grid geometry -- GitLab From 3e4a1d95fb284f4bb00a8d5c2caed53baec844fc Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Wed, 18 Jul 2018 07:46:02 +0200 Subject: [PATCH 02/10] [io] Free vtkoutputmodule from TypeTag * use template specialization to deprecate old interface * phaseIdx cannot be used anymore due to the variadic template template class VtkOutputmodule --- dumux/io/staggeredvtkoutputmodule.hh | 111 +++++++++++++---------- dumux/io/vtkoutputmodule.hh | 131 ++++++++++++++++----------- 2 files changed, 141 insertions(+), 101 deletions(-) diff --git a/dumux/io/staggeredvtkoutputmodule.hh b/dumux/io/staggeredvtkoutputmodule.hh index cb298c2057..2c6e940fda 100644 --- a/dumux/io/staggeredvtkoutputmodule.hh +++ b/dumux/io/staggeredvtkoutputmodule.hh @@ -30,35 +30,63 @@ #include #include +#include + namespace Dumux { template class PointCloudVtkWriter; +template +class StaggeredVtkOutputModule; + +template +class DUNE_DEPRECATED_MSG("Use StaggeredVtkOutputModule instead!") StaggeredVtkOutputModule +: public StaggeredVtkOutputModule +{ + using ParentType = StaggeredVtkOutputModule; +public: + using ParentType::ParentType; + + template + DUNE_DEPRECATED_MSG("Use StaggeredVtkOutputModule(gridVariables, sol, name) instead!") + StaggeredVtkOutputModule(const Problem& problem, + const FVGridGeometry& fvGridGeometry, + const GridVariables& gridVariables, + const SolutionVector& sol, + const std::string& name, + const std::string& paramGroup = "", + Dune::VTK::DataMode dm = Dune::VTK::conforming, + bool verbose = true) + : ParentType(gridVariables, sol, name, paramGroup, dm, verbose) {} + +}; + /*! * \ingroup InputOutput * \brief A VTK output module to simplify writing dumux simulation data to VTK format * Specialization for staggered grids with dofs on faces. * - * \tparam TypeTag The TypeTag of the problem implementation - * \tparam phaseIdxOffset Used for single-phase problems to retrieve the right phase name + * \tparam GridVariables The grid variables + * \tparam SolutionVector The solution vector + * \tparam VelocityOutput The velocity output nodule */ -template -class StaggeredVtkOutputModule : public VtkOutputModule +template +class StaggeredVtkOutputModule +: public VtkOutputModule { - friend class VtkOutputModule; - using ParentType = VtkOutputModule; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using FaceVariables = typename GET_PROP_TYPE(TypeTag, FaceVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using ParentType = VtkOutputModule; + using FVGridGeometry = typename GridVariables::GridGeometry; + using GridView = typename FVGridGeometry::GridView; + using Scalar = typename GridVariables::Scalar; + using FaceVariables = typename GridVariables::GridFaceVariables::FaceVariables; + using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - enum { dim = GridView::dimension }; using Element = typename GridView::template Codim<0>::Entity; @@ -85,26 +113,20 @@ class StaggeredVtkOutputModule : public VtkOutputModule public: - StaggeredVtkOutputModule(const Problem& problem, - const FVGridGeometry& fvGridGeometry, - const GridVariables& gridVariables, - const SolutionVector& sol, - const std::string& name, - const std::string& paramGroup = "", - Dune::VTK::DataMode dm = Dune::VTK::conforming, - bool verbose = true) - : ParentType(problem, fvGridGeometry, gridVariables, sol, name, paramGroup, dm, verbose) - , problem_(problem) - , gridGeom_(fvGridGeometry) - , gridVariables_(gridVariables) - , sol_(sol) + StaggeredVtkOutputModule(const GridVariables& gridVariables, + const SolutionVector& sol, + const std::string& name, + const std::string& paramGroup = "", + Dune::VTK::DataMode dm = Dune::VTK::conforming, + bool verbose = true) + : ParentType(gridVariables, sol, name, paramGroup, dm, verbose) , faceWriter_(std::make_shared>(coordinates_)) - , sequenceWriter_(faceWriter_, problem.name() + "-face", "","", - fvGridGeometry.gridView().comm().rank(), - fvGridGeometry.gridView().comm().size() ) + , sequenceWriter_(faceWriter_, name + "-face", "","", + gridVariables.curGridVolVars().problem().fvGridGeometry().gridView().comm().rank(), + gridVariables.curGridVolVars().problem().fvGridGeometry().gridView().comm().size() ) { - writeFaceVars_ = getParamFromGroup(problem.paramGroup(), "Vtk.WriteFaceData", false); + writeFaceVars_ = getParamFromGroup(paramGroup, "Vtk.WriteFaceData", false); coordinatesInitialized_ = false; } @@ -118,7 +140,7 @@ public: //! \param name The name of the vtk field void addFaceField(const std::vector& v, const std::string& name) { - if (v.size() == this->gridGeom_.gridView().size(1)) + if (v.size() == this->fvGridGeometry().gridView().size(1)) faceFieldScalarDataInfo_.emplace_back(v, name); else DUNE_THROW(Dune::RangeError, "Size mismatch of added field!"); @@ -129,7 +151,7 @@ public: //! \param name The name of the vtk field void addFaceField(const std::vector& v, const std::string& name) { - if (v.size() == this->gridGeom_.gridView().size(1)) + if (v.size() == this->fvGridGeometry().gridView().size(1)) faceFieldVectorDataInfo_.emplace_back(v, name); else DUNE_THROW(Dune::RangeError, "Size mismatch of added field!"); @@ -167,10 +189,10 @@ private: //! Update the coordinates (the face centers) void updateCoordinates_() { - coordinates_.resize(gridGeom_.numFaceDofs()); - for(auto&& facet : facets(gridGeom_.gridView())) + coordinates_.resize(this->fvGridGeometry().numFaceDofs()); + for(auto&& facet : facets(this->fvGridGeometry().gridView())) { - const int dofIdxGlobal = gridGeom_.gridView().indexSet().index(facet); + const int dofIdxGlobal = this->fvGridGeometry().gridView().indexSet().index(facet); coordinates_[dofIdxGlobal] = facet.geometry().center(); } coordinatesInitialized_ = true; @@ -180,7 +202,7 @@ private: //! \param time The current time void getFaceDataAndWrite_(const Scalar time) { - const auto numPoints = gridGeom_.numFaceDofs(); + const auto numPoints = this->fvGridGeometry().numFaceDofs(); // make sure not to iterate over the same dofs twice std::vector dofVisited(numPoints, false); @@ -199,15 +221,15 @@ private: if(!faceVarVectorDataInfo_.empty()) faceVarVectorData.resize(faceVarVectorDataInfo_.size(), std::vector(numPoints)); - for (const auto& element : elements(gridGeom_.gridView(), Dune::Partitions::interior)) + for (const auto& element : elements(this->fvGridGeometry().gridView(), Dune::Partitions::interior)) { - auto fvGeometry = localView(gridGeom_); - auto elemFaceVars = localView(gridVariables_.curGridFaceVars()); + auto fvGeometry = localView(this->fvGridGeometry()); + auto elemFaceVars = localView(this->gridVariables().curGridFaceVars()); if (!faceVarScalarDataInfo_.empty() || !faceVarVectorDataInfo_.empty()) { fvGeometry.bind(element); - elemFaceVars.bindElement(element, fvGeometry, sol_); + elemFaceVars.bindElement(element, fvGeometry, this->sol()); for (auto&& scvf : scvfs(fvGeometry)) { @@ -256,11 +278,6 @@ private: } - const Problem& problem_; - const FVGridGeometry& gridGeom_; - const GridVariables& gridVariables_; - const SolutionVector& sol_; - std::shared_ptr> faceWriter_; VTKSequenceWriter> sequenceWriter_; diff --git a/dumux/io/vtkoutputmodule.hh b/dumux/io/vtkoutputmodule.hh index dbf58ba2ae..f6fcbab711 100644 --- a/dumux/io/vtkoutputmodule.hh +++ b/dumux/io/vtkoutputmodule.hh @@ -43,31 +43,60 @@ #include #include #include +#include #include "vtkfunction.hh" namespace Dumux { + +template +class VtkOutputModule; + +template +class DUNE_DEPRECATED_MSG("Use VtkOutputModule instead!") VtkOutputModule + : public VtkOutputModule +{ + using ParentType = VtkOutputModule; +public: + using ParentType::ParentType; + + template + DUNE_DEPRECATED_MSG("Use VtkOutputModule(gridVariables, sol, name) instead!") + VtkOutputModule(const Problem& problem, + const FVGridGeometry& fvGridGeometry, + const GridVariables& gridVariables, + const SolutionVector& sol, + const std::string& name, + const std::string& paramGroup = "", + Dune::VTK::DataMode dm = Dune::VTK::conforming, + bool verbose = true) + : ParentType(gridVariables, sol, name, paramGroup, dm, + (fvGridGeometry.gridView().comm().rank() == 0 && verbose)) + {} +}; + /*! * \ingroup InputOutput * \brief A VTK output module to simplify writing dumux simulation data to VTK format * - * \tparam TypeTag The TypeTag of the problem implementation - * \tparam phaseIdxOffset Used for single-phase problems to retrieve the right phase name + * \tparam GridVariables The grid variables + * \tparam SolutionVector The solution vector + * \tparam VelocityOutput The velocity output nodule * * Handles the output of scalar and vector fields to VTK formatted file for multiple * variables and timesteps. Certain predefined fields can be registered on * initialization and/or be turned on/off using the designated properties. Additionally * non-standardized scalar and vector fields can be added to the writer manually. */ -template -class VtkOutputModule +template +class VtkOutputModule { - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using FVGridGeometry = typename GridVariables::GridGeometry; static constexpr int numPhaseVelocities = VelocityOutput::numPhaseVelocities(); using VV = typename GridVariables::VolumeVariables; @@ -101,23 +130,19 @@ public: element, vertex, automatic }; - VtkOutputModule(const Problem& problem, - const FVGridGeometry& fvGridGeometry, - const GridVariables& gridVariables, + VtkOutputModule(const GridVariables& gridVariables, const SolutionVector& sol, const std::string& name, const std::string& paramGroup = "", Dune::VTK::DataMode dm = Dune::VTK::conforming, bool verbose = true) - : problem_(problem) - , gridGeom_(fvGridGeometry) - , gridVariables_(gridVariables) + : gridVariables_(gridVariables) , sol_(sol) , name_(name) , paramGroup_(paramGroup) - , verbose_(fvGridGeometry.gridView().comm().rank() == 0 && verbose) + , verbose_(gridVariables.fvGridGeometry().gridView().comm().rank() == 0 && verbose) , dm_(dm) - , writer_(std::make_shared>(fvGridGeometry.gridView(), dm)) + , writer_(std::make_shared>(gridVariables.fvGridGeometry().gridView(), dm)) , sequenceWriter_(writer_, name) {} @@ -160,8 +185,8 @@ public: // Deduce the number of components from the given vector type const auto nComp = getNumberOfComponents_(v); - const auto numElemDofs = gridGeom_.elementMapper().size(); - const auto numVertexDofs = gridGeom_.vertexMapper().size(); + const auto numElemDofs = fvGridGeometry().elementMapper().size(); + const auto numVertexDofs = fvGridGeometry().vertexMapper().size(); // Automatically deduce the field type ... if(fieldType == FieldType::automatic) @@ -190,9 +215,9 @@ public: // add the appropriate field if (fieldType == FieldType::element) - fields_.emplace_back(gridGeom_.gridView(), gridGeom_.elementMapper(), v, name, nComp, 0); + fields_.emplace_back(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), v, name, nComp, 0); else - fields_.emplace_back(gridGeom_.gridView(), gridGeom_.vertexMapper(), v, name, nComp, dim); + fields_.emplace_back(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), v, name, nComp, dim); } ////////////////////////////////////////////////////////////////////////////////////////////// @@ -226,8 +251,8 @@ public: protected: // some return functions for differing implementations to use - const Problem& problem() const { return problem_; } - const FVGridGeometry& fvGridGeometry() const { return gridGeom_; } + const auto& problem() const { return gridVariables_.curGridVolVars().problem(); } + const FVGridGeometry& fvGridGeometry() const { return gridVariables_.fvGridGeometry(); } const GridVariables& gridVariables() const { return gridVariables_; } const SolutionVector& sol() const { return sol_; } @@ -252,7 +277,7 @@ private: ////////////////////////////////////////////////////////////// // instatiate the velocity output - VelocityOutput velocityOutput(problem_, gridGeom_, gridVariables_, sol_); + VelocityOutput velocityOutput(problem(), fvGridGeometry(), gridVariables_, sol_); std::array, numPhaseVelocities> velocity; // process rank @@ -270,7 +295,7 @@ private: || velocityOutput.enableOutput() || addProcessRank) { - const auto numCells = gridGeom_.gridView().size(0); + const auto numCells = fvGridGeometry().gridView().size(0); const auto numDofs = numDofs_(); // get fields for all volume variables @@ -293,11 +318,11 @@ private: // maybe allocate space for the process rank if (addProcessRank) rank.resize(numCells); - for (const auto& element : elements(gridGeom_.gridView(), Dune::Partitions::interior)) + for (const auto& element : elements(fvGridGeometry().gridView(), Dune::Partitions::interior)) { - const auto eIdxGlobal = gridGeom_.elementMapper().index(element); + const auto eIdxGlobal = fvGridGeometry().elementMapper().index(element); - auto fvGeometry = localView(gridGeom_); + auto fvGeometry = localView(fvGridGeometry()); auto elemVolVars = localView(gridVariables_.curGridVolVars()); // If velocity output is enabled we need to bind to the whole stencil @@ -338,7 +363,7 @@ private: //! the rank if (addProcessRank) - rank[eIdxGlobal] = static_cast(gridGeom_.gridView().comm().rank()); + rank[eIdxGlobal] = static_cast(fvGridGeometry().gridView().comm().rank()); } ////////////////////////////////////////////////////////////// @@ -349,19 +374,19 @@ private: if (isBox) { for (std::size_t i = 0; i < volVarScalarDataInfo_.size(); ++i) - sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.vertexMapper(), volVarScalarData[i], + sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), volVarScalarData[i], volVarScalarDataInfo_[i].name, /*numComp*/1, /*codim*/dim).get() ); for (std::size_t i = 0; i < volVarVectorDataInfo_.size(); ++i) - sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.vertexMapper(), volVarVectorData[i], + sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), volVarVectorData[i], volVarVectorDataInfo_[i].name, /*numComp*/dimWorld, /*codim*/dim).get() ); } else { for (std::size_t i = 0; i < volVarScalarDataInfo_.size(); ++i) - sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), volVarScalarData[i], + sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), volVarScalarData[i], volVarScalarDataInfo_[i].name, /*numComp*/1, /*codim*/0).get() ); for (std::size_t i = 0; i < volVarVectorDataInfo_.size(); ++i) - sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), volVarVectorData[i], + sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), volVarVectorData[i], volVarVectorDataInfo_[i].name, /*numComp*/dimWorld, /*codim*/0).get() ); } @@ -371,23 +396,23 @@ private: if (isBox && dim > 1) { for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) - sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.vertexMapper(), velocity[phaseIdx], - "velocity_" + velocityOutput.phaseName(phaseIdx+phaseIdxOffset) + " (m/s)", + sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), velocity[phaseIdx], + "velocity_" + velocityOutput.phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); } // cell-centered models else { for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) - sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), velocity[phaseIdx], - "velocity_" + velocityOutput.phaseName(phaseIdx+phaseIdxOffset) + " (m/s)", + sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), velocity[phaseIdx], + "velocity_" + velocityOutput.phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/0).get() ); } } // the process rank if (addProcessRank) - sequenceWriter_.addCellData(Field(gridGeom_.gridView(), gridGeom_.elementMapper(), rank, "process rank", 1, 0).get()); + sequenceWriter_.addCellData(Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), rank, "process rank", 1, 0).get()); // also register additional (non-standardized) user fields if any for (auto&& field : fields_) @@ -423,7 +448,7 @@ private: ////////////////////////////////////////////////////////////// // instatiate the velocity output - VelocityOutput velocityOutput(problem_, gridGeom_, gridVariables_, sol_); + VelocityOutput velocityOutput(problem(), fvGridGeometry(), gridVariables_, sol_); std::array, numPhaseVelocities> velocity; // process rank @@ -443,7 +468,7 @@ private: || velocityOutput.enableOutput() || addProcessRank) { - const auto numCells = gridGeom_.gridView().size(0); + const auto numCells = fvGridGeometry().gridView().size(0); const auto numDofs = numDofs_(); // get fields for all volume variables @@ -466,12 +491,12 @@ private: // maybe allocate space for the process rank if (addProcessRank) rank.resize(numCells); - for (const auto& element : elements(gridGeom_.gridView(), Dune::Partitions::interior)) + for (const auto& element : elements(fvGridGeometry().gridView(), Dune::Partitions::interior)) { - const auto eIdxGlobal = gridGeom_.elementMapper().index(element); + const auto eIdxGlobal = fvGridGeometry().elementMapper().index(element); const auto numCorners = element.subEntities(dim); - auto fvGeometry = localView(gridGeom_); + auto fvGeometry = localView(fvGridGeometry()); auto elemVolVars = localView(gridVariables_.curGridVolVars()); // resize element-local data containers @@ -517,7 +542,7 @@ private: //! the rank if (addProcessRank) - rank[eIdxGlobal] = static_cast(gridGeom_.gridView().comm().rank()); + rank[eIdxGlobal] = static_cast(fvGridGeometry().gridView().comm().rank()); } ////////////////////////////////////////////////////////////// @@ -526,11 +551,11 @@ private: // volume variables if any for (std::size_t i = 0; i < volVarScalarDataInfo_.size(); ++i) - sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), volVarScalarData[i], + sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), volVarScalarData[i], volVarScalarDataInfo_[i].name, /*numComp*/1, /*codim*/dim, /*nonconforming*/dm_).get() ); for (std::size_t i = 0; i < volVarVectorDataInfo_.size(); ++i) - sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), volVarVectorData[i], + sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), volVarVectorData[i], volVarVectorDataInfo_[i].name, /*numComp*/dimWorld, /*codim*/dim, /*nonconforming*/dm_).get() ); // the velocity field @@ -539,21 +564,21 @@ private: // node-wise velocities if (dim > 1) for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) - sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.vertexMapper(), velocity[phaseIdx], - "velocity_" + velocityOutput.phaseName(phaseIdx+phaseIdxOffset) + " (m/s)", + sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), velocity[phaseIdx], + "velocity_" + velocityOutput.phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); // cell-wise velocities else for (int phaseIdx = 0; phaseIdx < numPhaseVelocities; ++phaseIdx) - sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), velocity[phaseIdx], - "velocity_" + velocityOutput.phaseName(phaseIdx+phaseIdxOffset) + " (m/s)", + sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), velocity[phaseIdx], + "velocity_" + velocityOutput.phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/0).get() ); } // the process rank if (addProcessRank) - sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), rank, "process rank", 1, 0).get() ); + sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), rank, "process rank", 1, 0).get() ); // also register additional (non-standardized) user fields if any for (auto&& field : fields_) @@ -587,10 +612,8 @@ private: std::size_t getNumberOfComponents_(const Vector& v) { return 1; } //! return the number of dofs, we only support vertex and cell data - std::size_t numDofs_() const { return dofCodim == dim ? gridGeom_.vertexMapper().size() : gridGeom_.elementMapper().size(); } + std::size_t numDofs_() const { return dofCodim == dim ? fvGridGeometry().vertexMapper().size() : fvGridGeometry().elementMapper().size(); } - const Problem& problem_; - const FVGridGeometry& gridGeom_; const GridVariables& gridVariables_; const SolutionVector& sol_; -- GitLab From 5c70110881457be13410a83ebafd9aca9227b238 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Wed, 18 Jul 2018 10:20:26 +0200 Subject: [PATCH 03/10] [test][freeflow] Use new VtkOutputModule signature in all tests --- test/freeflow/navierstokes/test_angeli.cc | 2 +- test/freeflow/navierstokes/test_channel.cc | 2 +- test/freeflow/navierstokes/test_closedsystem.cc | 2 +- test/freeflow/navierstokes/test_donea.cc | 2 +- test/freeflow/navierstokes/test_kovasznay.cc | 2 +- test/freeflow/navierstokes/test_navierstokes_1d.cc | 2 +- test/freeflow/navierstokes/test_stokes_channel_3d.cc | 2 +- test/freeflow/navierstokesnc/test_channel.cc | 2 +- test/freeflow/navierstokesnc/test_densitydrivenflow.cc | 2 +- test/freeflow/navierstokesnc/test_msfreeflow.cc | 2 +- test/freeflow/rans/test_pipe_laufer.cc | 2 +- test/freeflow/ransnc/test_flatplate.cc | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/freeflow/navierstokes/test_angeli.cc b/test/freeflow/navierstokes/test_angeli.cc index 707536c3c4..813c1e8768 100644 --- a/test/freeflow/navierstokes/test_angeli.cc +++ b/test/freeflow/navierstokes/test_angeli.cc @@ -154,7 +154,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); diff --git a/test/freeflow/navierstokes/test_channel.cc b/test/freeflow/navierstokes/test_channel.cc index 632c9cdc53..362761d510 100644 --- a/test/freeflow/navierstokes/test_channel.cc +++ b/test/freeflow/navierstokes/test_channel.cc @@ -155,7 +155,7 @@ int main(int argc, char** argv) try // initialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokes/test_closedsystem.cc b/test/freeflow/navierstokes/test_closedsystem.cc index a29b3bb476..57c976f9cb 100644 --- a/test/freeflow/navierstokes/test_closedsystem.cc +++ b/test/freeflow/navierstokes/test_closedsystem.cc @@ -148,7 +148,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokes/test_donea.cc b/test/freeflow/navierstokes/test_donea.cc index fd12e846de..0dac5f1df2 100644 --- a/test/freeflow/navierstokes/test_donea.cc +++ b/test/freeflow/navierstokes/test_donea.cc @@ -138,7 +138,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); diff --git a/test/freeflow/navierstokes/test_kovasznay.cc b/test/freeflow/navierstokes/test_kovasznay.cc index 4fe0635e9b..5b18eb25bc 100644 --- a/test/freeflow/navierstokes/test_kovasznay.cc +++ b/test/freeflow/navierstokes/test_kovasznay.cc @@ -135,7 +135,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); diff --git a/test/freeflow/navierstokes/test_navierstokes_1d.cc b/test/freeflow/navierstokes/test_navierstokes_1d.cc index 91edf0498f..9ca7d67547 100644 --- a/test/freeflow/navierstokes/test_navierstokes_1d.cc +++ b/test/freeflow/navierstokes/test_navierstokes_1d.cc @@ -124,7 +124,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); diff --git a/test/freeflow/navierstokes/test_stokes_channel_3d.cc b/test/freeflow/navierstokes/test_stokes_channel_3d.cc index 0eac30d6bb..61b9537315 100644 --- a/test/freeflow/navierstokes/test_stokes_channel_3d.cc +++ b/test/freeflow/navierstokes/test_stokes_channel_3d.cc @@ -132,7 +132,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokesnc/test_channel.cc b/test/freeflow/navierstokesnc/test_channel.cc index 066444114b..f89e85f8e2 100644 --- a/test/freeflow/navierstokesnc/test_channel.cc +++ b/test/freeflow/navierstokesnc/test_channel.cc @@ -153,7 +153,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getDeltaP(), "deltaP"); vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc index 25fd54d6f6..06ebf4f3b5 100644 --- a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc +++ b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc @@ -152,7 +152,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getDeltaRho(), "deltaRho"); vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokesnc/test_msfreeflow.cc b/test/freeflow/navierstokesnc/test_msfreeflow.cc index 77c7f83a9c..8069567133 100644 --- a/test/freeflow/navierstokesnc/test_msfreeflow.cc +++ b/test/freeflow/navierstokesnc/test_msfreeflow.cc @@ -152,7 +152,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/rans/test_pipe_laufer.cc b/test/freeflow/rans/test_pipe_laufer.cc index 4d5f63f078..098e7ef5e8 100644 --- a/test/freeflow/rans/test_pipe_laufer.cc +++ b/test/freeflow/rans/test_pipe_laufer.cc @@ -148,7 +148,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/ransnc/test_flatplate.cc b/test/freeflow/ransnc/test_flatplate.cc index 0f426e96fb..57806bce46 100644 --- a/test/freeflow/ransnc/test_flatplate.cc +++ b/test/freeflow/ransnc/test_flatplate.cc @@ -144,7 +144,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - StaggeredVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); -- GitLab From a3c6bba742918d98255c82c824a92673adf5e2a2 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Wed, 18 Jul 2018 10:23:13 +0200 Subject: [PATCH 04/10] [test][2p1cni] Use new VtkOutputModule signature --- test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc index 9f869544a5..57d3d549e1 100644 --- a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc +++ b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc @@ -110,7 +110,7 @@ int main(int argc, char** argv) try auto maxDt = getParam("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); -- GitLab From 223165a97120873ab75479469ecf03e074517ba4 Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Wed, 18 Jul 2018 13:54:38 +0200 Subject: [PATCH 05/10] 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 | 95 ++++++----- dumux/porousmediumflow/3p/volumevariables.hh | 8 +- .../boxdfm/vtkoutputmodule.hh | 71 ++++---- .../nonequilibrium/gridvariables.hh | 2 +- 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 | 2 +- .../poroelastic/test_poroelastic.cc | 4 +- .../boundary/darcydarcy/1p_1p/main.cc | 6 +- .../boundary/darcydarcy/1p_2p/main.cc | 6 +- .../test_stokes1p2cdarcy1p2chorizontal.cc | 8 +- .../test_stokes1p2cdarcy1p2cvertical.cc | 8 +- .../test_stokes1p2cdarcy2p2chorizontal.cc | 8 +- .../test_stokes1pdarcy1phorizontal.cc | 8 +- .../test_stokes1pdarcy1pvertical.cc | 8 +- .../1p_2p/test_stokes1pdarcy2pvertical.cc | 8 +- .../1p2c_richards2c/test_1p2c_richards2c.cc | 10 +- .../embedded/1d3d/1p_1p/test_1p_1p.cc | 6 +- .../1d3d/1p_richards/test_1p_richards.cc | 6 +- .../embedded/2d3d/1p_1p/test_1p_1p.cc | 6 +- .../analytical/test_facetcoupling_fv_1p1p.cc | 6 +- ...est_facetcoupling_tpfa_1p1p_threedomain.cc | 9 +- .../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 +- .../1pncmin/implicit/test_1pncminni_fv.cc | 2 +- .../implicit/adaptive/test_2p_adaptive_fv.cc | 4 +- .../2p/implicit/boxdfm/test_2pboxdfm.cc | 2 +- .../cornerpoint/test_2p_cornerpoint.cc | 4 +- .../implicit/fracture/test_2p_fracture_fv.cc | 4 +- .../2p/implicit/incompressible/test_2p_fv.cc | 7 +- .../2p/implicit/nonisothermal/test_2pni_fv.cc | 4 +- .../2p1c/implicit/test_2p1c_fv.cc | 2 +- .../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/1ptracer/test_cctracer.cc | 4 +- .../tracer/constvel/test_tracer.cc | 4 +- .../multicomp/test_tracer_maxwellstefan.cc | 4 +- 84 files changed, 529 insertions(+), 337 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..fede41d1f3 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 VelocityOutputType = 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 @@ -267,6 +276,9 @@ protected: const std::vector& volVarVectorDataInfo() const { return volVarVectorDataInfo_; } const std::vector& fields() const { return fields_; } + using VelocityOutput = VelocityOutputType; + const VelocityOutput& velocityOutput() const { return *velocityOutput_; } + private: //! Assembles the fields and adds them to the writer (conforming output) @@ -277,8 +289,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 +304,7 @@ private: if (!volVarScalarDataInfo_.empty() || !volVarVectorDataInfo_.empty() || !fields_.empty() - || velocityOutput.enableOutput() + || velocityOutput_->enableOutput() || addProcessRank) { const auto numCells = fvGridGeometry().gridView().size(0); @@ -304,9 +316,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 +339,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 +369,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 +403,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 +459,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 +483,7 @@ private: if (!volVarScalarDataInfo_.empty() || !volVarVectorDataInfo_.empty() || !fields_.empty() - || velocityOutput.enableOutput() + || velocityOutput_->enableOutput() || addProcessRank) { const auto numCells = fvGridGeometry().gridView().size(0); @@ -477,9 +495,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 +525,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 +554,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 +577,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 +647,7 @@ private: std::vector volVarVectorDataInfo_; //!< Registered volume variables (vector) std::vector fields_; //!< Registered scalar and vector fields + std::shared_ptr velocityOutput_; //!< The velocity output policy }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/3p/volumevariables.hh b/dumux/porousmediumflow/3p/volumevariables.hh index 55323cd628..524fd4026e 100644 --- a/dumux/porousmediumflow/3p/volumevariables.hh +++ b/dumux/porousmediumflow/3p/volumevariables.hh @@ -52,8 +52,6 @@ class ThreePVolumeVariables static constexpr int numFluidComps = ParentType::numComponents(); enum { - numPhases = Traits::ModelTraits::numPhases(), - wPhaseIdx = FS::wPhaseIdx, gPhaseIdx = FS::gPhaseIdx, nPhaseIdx = FS::nPhaseIdx, @@ -97,7 +95,7 @@ public: completeFluidState(elemSol, problem, element, scv, fluidState_, solidState_); // mobilities - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ParentType::numPhases(); ++phaseIdx) { mobility_[phaseIdx] = MaterialLaw::kr(materialParams, phaseIdx, fluidState_.saturation(wPhaseIdx), @@ -171,7 +169,7 @@ public: typename FluidSystem::ParameterCache paramCache; paramCache.updateAll(fluidState); - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ParentType::numPhases(); ++phaseIdx) { // compute and set the viscosity const Scalar mu = FluidSystem::viscosity(fluidState, paramCache, phaseIdx); @@ -274,7 +272,7 @@ protected: private: PermeabilityType permeability_; - Scalar mobility_[numPhases]; + Scalar mobility_[ParentType::numPhases()]; }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh b/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh index 5ecfba6a63..25979c9a17 100644 --- a/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh +++ b/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh @@ -44,26 +44,17 @@ namespace Dumux { * * \tparam TypeTag The TypeTag of the problem implementation * \tparam FractureGrid The Type used for the lower-dimensional grid - * \tparam phaseIdxOffset Used for single-phase problems to retrieve the right phase name * * Handles the output of scalar and vector fields to VTK formatted file for multiple * variables and timesteps. Certain predefined fields can be registered on * initialization and/or be turned on/off using the designated properties. Additionally * non-standardized scalar and vector fields can be added to the writer manually. */ -template -class BoxDfmVtkOutputModule : public VtkOutputModule +template +class BoxDfmVtkOutputModule : public VtkOutputModule { - using ParentType = VtkOutputModule; - - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - static constexpr int numPhases = ModelTraits::numPhases(); - + using ParentType = VtkOutputModule; + using FVGridGeometry = typename GridVariables::GridGeometry; using VV = typename GridVariables::VolumeVariables; using FluidSystem = typename VV::FluidSystem; using Scalar = typename GridVariables::Scalar; @@ -93,18 +84,16 @@ class BoxDfmVtkOutputModule : public VtkOutputModule public: //! The constructor - BoxDfmVtkOutputModule(const Problem& problem, - const FVGridGeometry& fvGridGeometry, - const GridVariables& gridVariables, + BoxDfmVtkOutputModule(const GridVariables& gridVariables, const SolutionVector& sol, const std::string& name, const std::string& paramGroup = "", Dune::VTK::DataMode dm = Dune::VTK::conforming, bool verbose = true) - : ParentType(problem, fvGridGeometry, gridVariables, sol, name, paramGroup, dm, verbose) + : ParentType(gridVariables, sol, name, paramGroup, dm, verbose) { // create the fracture grid and all objects needed on it - initializeFracture(fvGridGeometry); + initializeFracture(gridVariables.fvGridGeometry()); } ////////////////////////////////////////////////////////////////////////////////////////////// @@ -144,8 +133,7 @@ private: ////////////////////////////////////////////////////////////// // instatiate the velocity output - VelocityOutput velocityOutput(this->problem(), this->fvGridGeometry(), this->gridVariables(), this->sol()); - std::array, numPhases> velocity; + std::vector velocity; // process rank static bool addProcessRank = getParamFromGroup(this->paramGroup(), "Vtk.AddProcessRank"); @@ -166,7 +154,7 @@ private: if (!volVarScalarDataInfo.empty() || !volVarVectorDataInfo.empty() || !this->fields().empty() - || velocityOutput.enableOutput() + || this->velocityOutput().enableOutput() || addProcessRank) { const auto numCells = gridView.size(0); @@ -185,8 +173,8 @@ private: volVarVectorDataFracture.resize(volVarVectorDataInfo.size(), std::vector(numFractureVert)); } - if (velocityOutput.enableOutput()) - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + if (this->velocityOutput().enableOutput()) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) velocity[phaseIdx].resize(numDofs); // maybe allocate space for the process rank @@ -201,7 +189,7 @@ private: // If velocity output is enabled we need to bind to the whole stencil // otherwise element-local data is sufficient - if (velocityOutput.enableOutput()) + if (this->velocityOutput().enableOutput()) { fvGeometry.bind(element); elemVolVars.bind(element, fvGeometry, this->sol()); @@ -237,9 +225,9 @@ private: } // velocity output - if (velocityOutput.enableOutput()) - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) - velocityOutput.calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); + if (this->velocityOutput().enableOutput()) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) + this->velocityOutput().calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); //! the rank if (addProcessRank) @@ -266,11 +254,11 @@ private: } // the velocity field - if (velocityOutput.enableOutput()) + if (this->velocityOutput().enableOutput()) { - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) this->sequenceWriter().addVertexData( Field(gridView, this->fvGridGeometry().vertexMapper(), velocity[phaseIdx], - "velocity_" + std::string(FluidSystem::phaseName(phaseIdx+phaseIdxOffset)) + " (m/s)", + "velocity_" + std::string(this->velocityOutput().phaseName(phaseIdx)) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); } @@ -312,8 +300,7 @@ private: ////////////////////////////////////////////////////////////// // instatiate the velocity output - VelocityOutput velocityOutput(this->problem(), this->fvGridGeometry(), this->gridVariables(), this->sol()); - std::array, numPhases> velocity; + std::vector velocity; // process rank static bool addProcessRank = getParamFromGroup(this->paramGroup(), "Vtk.AddProcessRank"); @@ -336,7 +323,7 @@ private: if (!volVarScalarDataInfo.empty() || !volVarVectorDataInfo.empty() || !this->fields().empty() - || velocityOutput.enableOutput() + || this->velocityOutput().enableOutput() || addProcessRank) { const auto numCells = gridView.size(0); @@ -355,8 +342,8 @@ private: volVarVectorDataFracture.resize(volVarVectorDataInfo.size(), VectorDataContainer(numFractureCells)); } - if (velocityOutput.enableOutput()) - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + if (this->velocityOutput().enableOutput()) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) velocity[phaseIdx].resize(numDofs); // maybe allocate space for the process rank @@ -378,7 +365,7 @@ private: // If velocity output is enabled we need to bind to the whole stencil // otherwise element-local data is sufficient - if (velocityOutput.enableOutput()) + if (this->velocityOutput().enableOutput()) { fvGeometry.bind(element); elemVolVars.bind(element, fvGeometry, this->sol()); @@ -416,9 +403,9 @@ private: } // velocity output - if (velocityOutput.enableOutput()) - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) - velocityOutput.calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); + if (this->velocityOutput().enableOutput()) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) + this->velocityOutput().calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); //! the rank if (addProcessRank) @@ -451,11 +438,11 @@ private: } // the velocity field - if (velocityOutput.enableOutput()) + if (this->velocityOutput().enableOutput()) { - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) this->sequenceWriter().addVertexData( Field(gridView, this->fvGridGeometry().vertexMapper(), velocity[phaseIdx], - "velocity_" + std::string(FluidSystem::phaseName(phaseIdx+phaseIdxOffset)) + " (m/s)", + "velocity_" + std::string(this->velocityOutput().phaseName(phaseIdx)) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); } diff --git a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh index 5e3048dc7b..ae1e256e20 100644 --- a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh +++ b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh @@ -76,7 +76,7 @@ public: { // instatiate the velocity output using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); - VelocityOutput velocityOutput(*problem_, *this->fvGridGeometry_, *this, curSol); + VelocityOutput velocityOutput(*this); using Scalar = typename SolutionVector::field_type; using VelocityVector = typename Dune::FieldVector; diff --git a/dumux/porousmediumflow/properties.hh b/dumux/porousmediumflow/properties.hh index 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..0592045126 100644 --- a/test/geomechanics/elastic/test_elastic.cc +++ b/test/geomechanics/elastic/test_elastic.cc @@ -101,7 +101,7 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module and add displacement - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); vtkWriter.addField(x, "u"); // also, add exact solution to the output diff --git a/test/geomechanics/poroelastic/test_poroelastic.cc b/test/geomechanics/poroelastic/test_poroelastic.cc index 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/boundary/darcydarcy/1p_1p/main.cc b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc index 3d7be9226f..8715fc73b1 100644 --- a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc @@ -223,11 +223,13 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - VtkOutputModule vtkWriter0(*problem0, *fvGridGeometry0, *gridVariables0, sol[domain0Idx], problem0->name()); + using SolutionVector0 = std::decay_t; + VtkOutputModule vtkWriter0(*gridVariables0, sol[domain0Idx], problem0->name()); GET_PROP_TYPE(SubTypeTag0, VtkOutputFields)::init(vtkWriter0); vtkWriter0.write(0.0); - VtkOutputModule vtkWriter1(*problem1, *fvGridGeometry1, *gridVariables1, sol[domain1Idx], problem1->name()); + using SolutionVector1 = std::decay_t; + VtkOutputModule vtkWriter1(*gridVariables1, sol[domain1Idx], problem1->name()); GET_PROP_TYPE(SubTypeTag1, VtkOutputFields)::init(vtkWriter1); vtkWriter1.write(0.0); diff --git a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc index 2c0be5d86d..843599f375 100644 --- a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc @@ -208,11 +208,13 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - VtkOutputModule vtkWriter0(*problem0, *fvGridGeometry0, *gridVariables0, sol[domain0Idx], problem0->name()); + using SolutionVector0 = std::decay_t; + VtkOutputModule vtkWriter0(*gridVariables0, sol[domain0Idx], problem0->name()); GET_PROP_TYPE(SubTypeTag0, VtkOutputFields)::init(vtkWriter0); vtkWriter0.write(0.0); - VtkOutputModule vtkWriter1(*problem1, *fvGridGeometry1, *gridVariables1, sol[domain1Idx], problem1->name()); + using SolutionVector1 = std::decay_t; + VtkOutputModule vtkWriter1(*gridVariables1, sol[domain1Idx], problem1->name()); GET_PROP_TYPE(SubTypeTag1, VtkOutputFields)::init(vtkWriter1); vtkWriter1.write(0.0); diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc index 93a5449954..7664a9ed62 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc @@ -191,11 +191,15 @@ int main(int argc, char** argv) try const auto stokesName = getParam("Problem.Name") + "_" + stokesProblem->name(); const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); - StaggeredVtkOutputModule stokesVtkWriter(*stokesProblem, *stokesFvGridGeometry, *stokesGridVariables, stokesSol, stokesName); + StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + using StokesVelocityOutput = typename GET_PROP_TYPE(StokesTypeTag, VelocityOutput); + stokesVtkWriter.addVelocityOutput(std::make_shared(*stokesGridVariables, stokesSol)); stokesVtkWriter.write(0.0); - VtkOutputModule darcyVtkWriter(*darcyProblem, *darcyFvGridGeometry, *darcyGridVariables, sol[darcyIdx], darcyName); + VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); + using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc index 5be1316991..30bf4e121b 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc @@ -192,11 +192,15 @@ int main(int argc, char** argv) try const auto stokesName = getParam("Problem.Name") + "_" + stokesProblem->name(); const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); - StaggeredVtkOutputModule stokesVtkWriter(*stokesProblem, *stokesFvGridGeometry, *stokesGridVariables, stokesSol, stokesName); + StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + using StokesVelocityOutput = typename GET_PROP_TYPE(StokesTypeTag, VelocityOutput); + stokesVtkWriter.addVelocityOutput(std::make_shared(*stokesGridVariables, stokesSol)); stokesVtkWriter.write(0.0); - VtkOutputModule darcyVtkWriter(*darcyProblem, *darcyFvGridGeometry, *darcyGridVariables, sol[darcyIdx], darcyName); + VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); + using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc index bd6c057d56..95b7216eb8 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc @@ -184,11 +184,15 @@ int main(int argc, char** argv) try const auto stokesName = getParam("Problem.Name") + "_" + stokesProblem->name(); const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); - StaggeredVtkOutputModule stokesVtkWriter(*stokesProblem, *stokesFvGridGeometry, *stokesGridVariables, stokesSol, stokesName); + StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + using StokesVelocityOutput = typename GET_PROP_TYPE(StokesTypeTag, VelocityOutput); + stokesVtkWriter.addVelocityOutput(std::make_shared(*stokesGridVariables, stokesSol)); stokesVtkWriter.write(0.0); - VtkOutputModule darcyVtkWriter(*darcyProblem, *darcyFvGridGeometry, *darcyGridVariables, sol[darcyIdx], darcyName); + VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); + using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc index 1a8e094908..3ea7a0aedb 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc @@ -158,11 +158,15 @@ int main(int argc, char** argv) try const auto stokesName = getParam("Problem.Name") + "_" + stokesProblem->name(); const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); - StaggeredVtkOutputModule stokesVtkWriter(*stokesProblem, *stokesFvGridGeometry, *stokesGridVariables, stokesSol, stokesName); + StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + using StokesVelocityOutput = typename GET_PROP_TYPE(StokesTypeTag, VelocityOutput); + stokesVtkWriter.addVelocityOutput(std::make_shared(*stokesGridVariables, stokesSol)); stokesVtkWriter.write(0.0); - VtkOutputModule darcyVtkWriter(*darcyProblem, *darcyFvGridGeometry, *darcyGridVariables, sol[darcyIdx], darcyName); + VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); + using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc index 3e039e3683..b6e51d5f91 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc @@ -161,11 +161,15 @@ int main(int argc, char** argv) try const auto stokesName = getParam("Problem.Name") + "_" + stokesProblem->name(); const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); - StaggeredVtkOutputModule stokesVtkWriter(*stokesProblem, *stokesFvGridGeometry, *stokesGridVariables, stokesSol, stokesName); + StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + using StokesVelocityOutput = typename GET_PROP_TYPE(StokesTypeTag, VelocityOutput); + stokesVtkWriter.addVelocityOutput(std::make_shared(*stokesGridVariables, stokesSol)); stokesVtkWriter.write(0.0); - VtkOutputModule darcyVtkWriter(*darcyProblem, *darcyFvGridGeometry, *darcyGridVariables, sol[darcyIdx], darcyName); + VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); + using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc b/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc index 9c78681906..430337e91e 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc @@ -183,11 +183,15 @@ int main(int argc, char** argv) try const auto stokesName = getParam("Problem.Name") + "_" + stokesProblem->name(); const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); - StaggeredVtkOutputModule stokesVtkWriter(*stokesProblem, *stokesFvGridGeometry, *stokesGridVariables, stokesSol, stokesName); + StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + using StokesVelocityOutput = typename GET_PROP_TYPE(StokesTypeTag, VelocityOutput); + stokesVtkWriter.addVelocityOutput(std::make_shared(*stokesGridVariables, stokesSol)); stokesVtkWriter.write(0.0); - VtkOutputModule darcyVtkWriter(*darcyProblem, *darcyFvGridGeometry, *darcyGridVariables, sol[darcyIdx], darcyName); + VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); + using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); diff --git a/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc b/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc index 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/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc b/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc index 78b86eddc3..4a380363b3 100644 --- a/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc +++ b/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc @@ -209,11 +209,13 @@ int main(int argc, char** argv) try lowDimGridVariables->init(sol[lowDimIdx], oldSol[lowDimIdx]); // intialize the vtk output module - VtkOutputModule bulkVtkWriter(*bulkProblem, *bulkFvGridGeometry, *bulkGridVariables, sol[bulkIdx], bulkProblem->name()); + using BulkSolutionVector = std::decay_t; + VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); bulkVtkWriter.write(0.0); - VtkOutputModule lowDimVtkWriter(*lowDimProblem, *lowDimFvGridGeometry, *lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); + using LowDimSolutionVector = std::decay_t; + VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); lowDimVtkWriter.write(0.0); diff --git a/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc b/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc index f8d4303290..7c73a4772a 100644 --- a/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc +++ b/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc @@ -270,8 +270,10 @@ int main(int argc, char** argv) try // intialize the vtk output module const auto bulkDM = BulkFVGridGeometry::discMethod == DiscretizationMethod::box ? Dune::VTK::nonconforming : Dune::VTK::conforming; - VtkOutputModule bulkVtkWriter(*bulkProblem, *bulkFvGridGeometry, *bulkGridVariables, x[bulkId], bulkProblem->name(), "Bulk", bulkDM); - VtkOutputModule lowDimVtkWriter(*lowDimProblem, *lowDimFvGridGeometry, *lowDimGridVariables, x[lowDimId], lowDimProblem->name(), "LowDim"); + using BulkSolutionVector = std::decay_t; + using LowDimSolutionVector = std::decay_t; + VtkOutputModule bulkVtkWriter(*bulkGridVariables, x[bulkId], bulkProblem->name(), "Bulk", bulkDM); + VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, x[lowDimId], lowDimProblem->name(), "LowDim"); // container for the output of the exact solutions std::vector bulkExact; diff --git a/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc b/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc index b5ba775d19..e86de1991e 100644 --- a/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc +++ b/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc @@ -176,9 +176,12 @@ int main(int argc, char** argv) try edgeGridVariables->init(x[edgeId]); // intialize the vtk output module - VtkOutputModule bulkVtkWriter(*bulkProblem, *bulkFvGridGeometry, *bulkGridVariables, x[bulkId], bulkProblem->name()); - VtkOutputModule facetVtkWriter(*facetProblem, *facetFvGridGeometry, *facetGridVariables, x[facetId], facetProblem->name()); - VtkOutputModule edgeVtkWriter(*edgeProblem, *edgeFvGridGeometry, *edgeGridVariables, x[edgeId], edgeProblem->name()); + using BulkSolutionVector = std::decay_t; + using FacetSolutionVector = std::decay_t; + using EdgeSolutionVector = std::decay_t; + VtkOutputModule bulkVtkWriter(*bulkGridVariables, x[bulkId], bulkProblem->name()); + VtkOutputModule facetVtkWriter(*facetGridVariables, x[facetId], facetProblem->name()); + VtkOutputModule edgeVtkWriter(*edgeGridVariables, x[edgeId], edgeProblem->name()); // Add model specific output fields using BulkVtkOutputFields = typename GET_PROP_TYPE(BulkProblemTypeTag, VtkOutputFields); diff --git a/test/porousmediumflow/1p/implicit/compressible/test_1p.cc b/test/porousmediumflow/1p/implicit/compressible/test_1p.cc index 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/1pncmin/implicit/test_1pncminni_fv.cc b/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc index 2f09fdd81f..9b810e7049 100644 --- a/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc +++ b/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc @@ -136,7 +136,7 @@ int main(int argc, char** argv) try auto maxDt = getParam("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); diff --git a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc index 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/boxdfm/test_2pboxdfm.cc b/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc index cc85df9844..f7ead694af 100644 --- a/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc +++ b/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc @@ -173,7 +173,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); using FractureGrid = FRACTUREGRIDTYPE; - BoxDfmVtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name(), "", Dune::VTK::nonconforming); + BoxDfmVtkOutputModule vtkWriter(*gridVariables, x, problem->name(), "", Dune::VTK::nonconforming); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc b/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc index 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..05ebfd15c2 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc +++ b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc @@ -151,9 +151,10 @@ int main(int argc, char** argv) try // use non-conforming output for the test with interface solver const auto ncOutput = getParam("Problem.UseNonConformingOutput", false); - VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name(), "", - (ncOutput ? Dune::VTK::nonconforming : Dune::VTK::conforming)); - + VtkOutputModule vtkWriter(*gridVariables, x, problem->name(), "", + ncOutput ? Dune::VTK::nonconforming : Dune::VTK::conforming); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc b/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc index 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/2p1c/implicit/test_2p1c_fv.cc b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc index 57d3d549e1..3dd8850bd6 100644 --- a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc +++ b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc @@ -110,7 +110,7 @@ int main(int argc, char** argv) try auto maxDt = getParam("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module - VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc b/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc index 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/1ptracer/test_cctracer.cc b/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc index 149ddff7a3..3415277e7e 100644 --- a/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc +++ b/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc @@ -225,9 +225,11 @@ int main(int argc, char** argv) try assembler->setLinearSystem(A, r); //! intialize the vtk output module - VtkOutputModule vtkWriter(*tracerProblem, *fvGridGeometry, *gridVariables, x, tracerProblem->name()); + VtkOutputModule vtkWriter(*gridVariables, x, tracerProblem->name()); using VtkOutputFields = typename GET_PROP_TYPE(TracerTypeTag, VtkOutputFields); VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using VelocityOutput = typename GET_PROP_TYPE(TracerTypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); vtkWriter.write(0.0); ///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/test/porousmediumflow/tracer/constvel/test_tracer.cc b/test/porousmediumflow/tracer/constvel/test_tracer.cc index 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 From 65a624fd8904e9f9d991c53a295db39fbd8746f5 Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Wed, 18 Jul 2018 22:47:51 +0200 Subject: [PATCH 06/10] [io][vtk] Remove deprecated vtkoutput module with TypeTag --- dumux/io/vtkoutputmodule.hh | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/dumux/io/vtkoutputmodule.hh b/dumux/io/vtkoutputmodule.hh index fede41d1f3..aaec3ce493 100644 --- a/dumux/io/vtkoutputmodule.hh +++ b/dumux/io/vtkoutputmodule.hh @@ -39,7 +39,6 @@ #include #include -#include #include #include #include @@ -50,35 +49,6 @@ namespace Dumux { - -template -class VtkOutputModule; - -template -class DUNE_DEPRECATED_MSG("Use VtkOutputModule instead!") VtkOutputModule - : public VtkOutputModule -{ - using ParentType = VtkOutputModule; -public: - using ParentType::ParentType; - - template - DUNE_DEPRECATED_MSG("Use VtkOutputModule(gridVariables, sol, name) instead!") - VtkOutputModule(const Problem& problem, - const FVGridGeometry& fvGridGeometry, - const GridVariables& gridVariables, - const SolutionVector& sol, - const std::string& name, - const std::string& paramGroup = "", - Dune::VTK::DataMode dm = Dune::VTK::conforming, - bool verbose = true) - : ParentType(gridVariables, sol, name, paramGroup, dm, - (fvGridGeometry.gridView().comm().rank() == 0 && verbose)) - {} -}; - /*! * \ingroup InputOutput * \brief A VTK output module to simplify writing dumux simulation data to VTK format -- GitLab From 6083b1aa4c4a93592e1cc579698d298cc9ad8fcb Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Fri, 20 Jul 2018 15:39:22 +0200 Subject: [PATCH 07/10] [io][staggered] Remove deprecated vtk output module --- dumux/io/staggeredvtkoutputmodule.hh | 29 +--------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/dumux/io/staggeredvtkoutputmodule.hh b/dumux/io/staggeredvtkoutputmodule.hh index 94f2784694..6c16f4bc2c 100644 --- a/dumux/io/staggeredvtkoutputmodule.hh +++ b/dumux/io/staggeredvtkoutputmodule.hh @@ -37,33 +37,6 @@ namespace Dumux { template class PointCloudVtkWriter; -template -class StaggeredVtkOutputModule; - -template -class DUNE_DEPRECATED_MSG("Use StaggeredVtkOutputModule instead!") StaggeredVtkOutputModule -: public StaggeredVtkOutputModule -{ - using ParentType = StaggeredVtkOutputModule; -public: - using ParentType::ParentType; - - template - DUNE_DEPRECATED_MSG("Use StaggeredVtkOutputModule(gridVariables, sol, name) instead!") - StaggeredVtkOutputModule(const Problem& problem, - const FVGridGeometry& fvGridGeometry, - const GridVariables& gridVariables, - const SolutionVector& sol, - const std::string& name, - const std::string& paramGroup = "", - Dune::VTK::DataMode dm = Dune::VTK::conforming, - bool verbose = true) - : ParentType(gridVariables, sol, name, paramGroup, dm, verbose) {} - -}; - /*! * \ingroup InputOutput * \brief A VTK output module to simplify writing dumux simulation data to VTK format @@ -73,7 +46,7 @@ public: * \tparam SolutionVector The solution vector */ template -class StaggeredVtkOutputModule +class StaggeredVtkOutputModule : public VtkOutputModule { using ParentType = VtkOutputModule; -- GitLab From dc9185eb84e753e6f064805d160fc67b06cbd499 Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Fri, 20 Jul 2018 15:39:54 +0200 Subject: [PATCH 08/10] [io][staggered] Set staggered velocity output per default --- dumux/io/staggeredvtkoutputmodule.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dumux/io/staggeredvtkoutputmodule.hh b/dumux/io/staggeredvtkoutputmodule.hh index 6c16f4bc2c..6a3d839c66 100644 --- a/dumux/io/staggeredvtkoutputmodule.hh +++ b/dumux/io/staggeredvtkoutputmodule.hh @@ -29,8 +29,7 @@ #include #include #include - -#include +#include namespace Dumux { @@ -96,6 +95,8 @@ public: gridVariables.curGridVolVars().problem().fvGridGeometry().gridView().comm().size() ) { + // enable velocity output per default + this->addVelocityOutput(std::make_shared>(gridVariables, sol)); writeFaceVars_ = getParamFromGroup(paramGroup, "Vtk.WriteFaceData", false); coordinatesInitialized_ = false; } -- GitLab From d4445f8a58a05a46d9869af3ab50fbd4d86c747c Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Fri, 20 Jul 2018 15:40:28 +0200 Subject: [PATCH 09/10] [io][staggered] Enable velocity output per default --- dumux/discretization/staggered/freeflow/velocityoutput.hh | 5 +++-- test/freeflow/navierstokes/test_channel_navierstokes.input | 1 - test/freeflow/navierstokes/test_channel_stokes.input | 2 -- .../navierstokes/test_channel_stokesni_conduction.input | 1 - .../navierstokes/test_channel_stokesni_convection.input | 1 - test/freeflow/navierstokes/test_hydrostaticpressure.input | 1 - test/freeflow/navierstokes/test_liddrivencavity_re1.input | 1 - test/freeflow/navierstokes/test_liddrivencavity_re1000.input | 1 - test/freeflow/navierstokes/test_navierstokes_1d.input | 1 - test/freeflow/navierstokes/test_navierstokes_angeli.input | 1 - test/freeflow/navierstokes/test_navierstokes_kovasznay.input | 1 - test/freeflow/navierstokes/test_stokes_channel_3d.input | 1 - .../freeflow/navierstokes/test_stokes_channel_pseudo3d.input | 1 - test/freeflow/navierstokes/test_stokes_donea.input | 1 - test/freeflow/navierstokesnc/test_msfreeflow.input | 1 + test/freeflow/navierstokesnc/test_stokes2c_advection.input | 1 - .../navierstokesnc/test_stokes2c_densitydrivenflow.input | 1 - .../navierstokesnc/test_stokes2c_purediffusion.input | 1 - test/freeflow/navierstokesnc/test_stokes2cni_advection.input | 1 - test/freeflow/navierstokesnc/test_stokes2cni_diffusion.input | 1 - test/freeflow/rans/test_pipe_laufer.input | 1 - test/freeflow/rans/test_pipe_laufer_reference.input | 1 - .../rans/test_pipe_laufer_reference_wallfunction.input | 1 - test/freeflow/rans/test_pipe_zeroeqni.input | 1 - test/freeflow/ransnc/test_flatplate2c.input | 3 --- test/freeflow/ransnc/test_flatplate2cni.input | 3 --- test/freeflow/ransnc/test_flatplate2cni_wallfunction.input | 3 --- 27 files changed, 4 insertions(+), 34 deletions(-) diff --git a/dumux/discretization/staggered/freeflow/velocityoutput.hh b/dumux/discretization/staggered/freeflow/velocityoutput.hh index d9d5e40672..57ad84f921 100644 --- a/dumux/discretization/staggered/freeflow/velocityoutput.hh +++ b/dumux/discretization/staggered/freeflow/velocityoutput.hh @@ -65,7 +65,8 @@ public: , sol_(sol) { // check if velocity vectors shall be written to the VTK file - enableOutput_ = getParamFromGroup(gridVariables.curGridVolVars().problem().paramGroup(), "Vtk.AddVelocity"); + // enable per default + enableOutput_ = getParamFromGroup(gridVariables.curGridVolVars().problem().paramGroup(), "Vtk.AddVelocity", true); } //! Returns whether to enable the velocity output or not @@ -103,7 +104,7 @@ private: const GridVariables& gridVariables_; const SolutionVector& sol_; - bool enableOutput_; + bool enableOutput_ = true; }; } // end namespace Dumux diff --git a/test/freeflow/navierstokes/test_channel_navierstokes.input b/test/freeflow/navierstokes/test_channel_navierstokes.input index 112b0f2a1d..8583ee9652 100644 --- a/test/freeflow/navierstokes/test_channel_navierstokes.input +++ b/test/freeflow/navierstokes/test_channel_navierstokes.input @@ -16,5 +16,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-5 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokes/test_channel_stokes.input b/test/freeflow/navierstokes/test_channel_stokes.input index 651184566d..ed56ca7244 100644 --- a/test/freeflow/navierstokes/test_channel_stokes.input +++ b/test/freeflow/navierstokes/test_channel_stokes.input @@ -16,10 +16,8 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false - [Assembly] NumericDifference.BaseEpsilon = 1e-8 diff --git a/test/freeflow/navierstokes/test_channel_stokesni_conduction.input b/test/freeflow/navierstokes/test_channel_stokesni_conduction.input index ebc6488b75..cb06ec9a95 100644 --- a/test/freeflow/navierstokes/test_channel_stokesni_conduction.input +++ b/test/freeflow/navierstokes/test_channel_stokesni_conduction.input @@ -16,5 +16,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokes/test_channel_stokesni_convection.input b/test/freeflow/navierstokes/test_channel_stokesni_convection.input index dbaf6ddb5d..353c4b3582 100644 --- a/test/freeflow/navierstokes/test_channel_stokesni_convection.input +++ b/test/freeflow/navierstokes/test_channel_stokesni_convection.input @@ -16,5 +16,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokes/test_hydrostaticpressure.input b/test/freeflow/navierstokes/test_hydrostaticpressure.input index a48eb5fb26..4dcaf50ac0 100644 --- a/test/freeflow/navierstokes/test_hydrostaticpressure.input +++ b/test/freeflow/navierstokes/test_hydrostaticpressure.input @@ -19,5 +19,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-5 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokes/test_liddrivencavity_re1.input b/test/freeflow/navierstokes/test_liddrivencavity_re1.input index 8a7be861e5..286d9c374e 100644 --- a/test/freeflow/navierstokes/test_liddrivencavity_re1.input +++ b/test/freeflow/navierstokes/test_liddrivencavity_re1.input @@ -20,5 +20,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-5 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokes/test_liddrivencavity_re1000.input b/test/freeflow/navierstokes/test_liddrivencavity_re1000.input index d0204fd129..cd5be48163 100644 --- a/test/freeflow/navierstokes/test_liddrivencavity_re1000.input +++ b/test/freeflow/navierstokes/test_liddrivencavity_re1000.input @@ -25,7 +25,6 @@ MaxRelativeShift = 1e-8 NumericDifference.BaseEpsilon = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false [Implicit] diff --git a/test/freeflow/navierstokes/test_navierstokes_1d.input b/test/freeflow/navierstokes/test_navierstokes_1d.input index 28c4f696f1..a6a61d8265 100644 --- a/test/freeflow/navierstokes/test_navierstokes_1d.input +++ b/test/freeflow/navierstokes/test_navierstokes_1d.input @@ -17,4 +17,3 @@ MaxRelativeShift = 1e-9 [Vtk] WriteFaceData = false -AddVelocity = true diff --git a/test/freeflow/navierstokes/test_navierstokes_angeli.input b/test/freeflow/navierstokes/test_navierstokes_angeli.input index 230e41dda7..787d776fc0 100644 --- a/test/freeflow/navierstokes/test_navierstokes_angeli.input +++ b/test/freeflow/navierstokes/test_navierstokes_angeli.input @@ -25,4 +25,3 @@ MaxRelativeShift = 1e-5 [Vtk] WriteFaceData = false -AddVelocity = true diff --git a/test/freeflow/navierstokes/test_navierstokes_kovasznay.input b/test/freeflow/navierstokes/test_navierstokes_kovasznay.input index 03029c6f46..1ac0582f42 100644 --- a/test/freeflow/navierstokes/test_navierstokes_kovasznay.input +++ b/test/freeflow/navierstokes/test_navierstokes_kovasznay.input @@ -18,4 +18,3 @@ MaxRelativeShift = 1e-5 [Vtk] WriteFaceData = false -AddVelocity = true diff --git a/test/freeflow/navierstokes/test_stokes_channel_3d.input b/test/freeflow/navierstokes/test_stokes_channel_3d.input index ce28a56783..7193f13d9b 100644 --- a/test/freeflow/navierstokes/test_stokes_channel_3d.input +++ b/test/freeflow/navierstokes/test_stokes_channel_3d.input @@ -20,7 +20,6 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false [FluxOverPlane] diff --git a/test/freeflow/navierstokes/test_stokes_channel_pseudo3d.input b/test/freeflow/navierstokes/test_stokes_channel_pseudo3d.input index 462959a1c6..e450d1a3b7 100644 --- a/test/freeflow/navierstokes/test_stokes_channel_pseudo3d.input +++ b/test/freeflow/navierstokes/test_stokes_channel_pseudo3d.input @@ -22,4 +22,3 @@ NumericDifference.BaseEpsilon = 1e-8 [Vtk] WriteFaceData = false -AddVelocity = true diff --git a/test/freeflow/navierstokes/test_stokes_donea.input b/test/freeflow/navierstokes/test_stokes_donea.input index 1304128ffd..cf34501bff 100644 --- a/test/freeflow/navierstokes/test_stokes_donea.input +++ b/test/freeflow/navierstokes/test_stokes_donea.input @@ -13,4 +13,3 @@ MaxRelativeShift = 1e-5 [Vtk] WriteFaceData = false -AddVelocity = true diff --git a/test/freeflow/navierstokesnc/test_msfreeflow.input b/test/freeflow/navierstokesnc/test_msfreeflow.input index 2bd101ed81..c0eccab791 100644 --- a/test/freeflow/navierstokesnc/test_msfreeflow.input +++ b/test/freeflow/navierstokesnc/test_msfreeflow.input @@ -20,3 +20,4 @@ MaxRelativeShift = 1e-8 [Vtk] WriteFaceData = false +AddVelocity = false diff --git a/test/freeflow/navierstokesnc/test_stokes2c_advection.input b/test/freeflow/navierstokesnc/test_stokes2c_advection.input index d3558dec4c..7b79ad4247 100644 --- a/test/freeflow/navierstokesnc/test_stokes2c_advection.input +++ b/test/freeflow/navierstokesnc/test_stokes2c_advection.input @@ -19,5 +19,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokesnc/test_stokes2c_densitydrivenflow.input b/test/freeflow/navierstokesnc/test_stokes2c_densitydrivenflow.input index ae643fd64c..e3dcd14f57 100644 --- a/test/freeflow/navierstokesnc/test_stokes2c_densitydrivenflow.input +++ b/test/freeflow/navierstokesnc/test_stokes2c_densitydrivenflow.input @@ -20,5 +20,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokesnc/test_stokes2c_purediffusion.input b/test/freeflow/navierstokesnc/test_stokes2c_purediffusion.input index bb365a1671..4fa305b802 100644 --- a/test/freeflow/navierstokesnc/test_stokes2c_purediffusion.input +++ b/test/freeflow/navierstokesnc/test_stokes2c_purediffusion.input @@ -16,5 +16,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokesnc/test_stokes2cni_advection.input b/test/freeflow/navierstokesnc/test_stokes2cni_advection.input index 8580cc0dff..43a8a92c73 100644 --- a/test/freeflow/navierstokesnc/test_stokes2cni_advection.input +++ b/test/freeflow/navierstokesnc/test_stokes2cni_advection.input @@ -19,5 +19,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/navierstokesnc/test_stokes2cni_diffusion.input b/test/freeflow/navierstokesnc/test_stokes2cni_diffusion.input index ec46ddaf8e..82d99aacaf 100644 --- a/test/freeflow/navierstokesnc/test_stokes2cni_diffusion.input +++ b/test/freeflow/navierstokesnc/test_stokes2cni_diffusion.input @@ -16,5 +16,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-8 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/rans/test_pipe_laufer.input b/test/freeflow/rans/test_pipe_laufer.input index b0245e8898..05350ff926 100644 --- a/test/freeflow/rans/test_pipe_laufer.input +++ b/test/freeflow/rans/test_pipe_laufer.input @@ -37,5 +37,4 @@ TargetSteps = 5 MaxRelativeShift = 1e-5 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/rans/test_pipe_laufer_reference.input b/test/freeflow/rans/test_pipe_laufer_reference.input index ef597de3f0..398523ccd1 100644 --- a/test/freeflow/rans/test_pipe_laufer_reference.input +++ b/test/freeflow/rans/test_pipe_laufer_reference.input @@ -31,5 +31,4 @@ TargetSteps = 5 MaxRelativeShift = 1e-6 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/rans/test_pipe_laufer_reference_wallfunction.input b/test/freeflow/rans/test_pipe_laufer_reference_wallfunction.input index b0e86caf4e..e1dccd2249 100644 --- a/test/freeflow/rans/test_pipe_laufer_reference_wallfunction.input +++ b/test/freeflow/rans/test_pipe_laufer_reference_wallfunction.input @@ -30,5 +30,4 @@ TargetSteps = 5 MaxRelativeShift = 1e-5 [Vtk] -AddVelocity = true WriteFaceData = true diff --git a/test/freeflow/rans/test_pipe_zeroeqni.input b/test/freeflow/rans/test_pipe_zeroeqni.input index 924d125906..9826fde708 100644 --- a/test/freeflow/rans/test_pipe_zeroeqni.input +++ b/test/freeflow/rans/test_pipe_zeroeqni.input @@ -29,5 +29,4 @@ MaxSteps = 10 MaxRelativeShift = 1e-5 [Vtk] -AddVelocity = true WriteFaceData = false diff --git a/test/freeflow/ransnc/test_flatplate2c.input b/test/freeflow/ransnc/test_flatplate2c.input index d55a971715..7ebd7c9bae 100644 --- a/test/freeflow/ransnc/test_flatplate2c.input +++ b/test/freeflow/ransnc/test_flatplate2c.input @@ -27,6 +27,3 @@ NumericEpsilon.BaseEpsilon = 1e-8 MaxSteps = 10 TargetSteps = 8 MaxRelativeShift = 1e-5 - -[Vtk] -AddVelocity = true diff --git a/test/freeflow/ransnc/test_flatplate2cni.input b/test/freeflow/ransnc/test_flatplate2cni.input index b23acfd7ee..ed2afed061 100644 --- a/test/freeflow/ransnc/test_flatplate2cni.input +++ b/test/freeflow/ransnc/test_flatplate2cni.input @@ -27,6 +27,3 @@ NumericDifferenceMethod = 0 MaxSteps = 10 TargetSteps = 8 MaxRelativeShift = 1e-5 - -[Vtk] -AddVelocity = true diff --git a/test/freeflow/ransnc/test_flatplate2cni_wallfunction.input b/test/freeflow/ransnc/test_flatplate2cni_wallfunction.input index 53b88eeca2..a39400964f 100644 --- a/test/freeflow/ransnc/test_flatplate2cni_wallfunction.input +++ b/test/freeflow/ransnc/test_flatplate2cni_wallfunction.input @@ -28,6 +28,3 @@ NumericDifferenceMethod = 0 MaxSteps = 10 TargetSteps = 8 MaxRelativeShift = 1e-5 - -[Vtk] -AddVelocity = true -- GitLab From 0e53474c9a012accc697d9e4056f8c3f279486e7 Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Fri, 20 Jul 2018 15:41:37 +0200 Subject: [PATCH 10/10] [test][staggered] Velocity output policy is already set per default now --- test/freeflow/navierstokes/test_angeli.cc | 2 -- test/freeflow/navierstokes/test_channel.cc | 2 -- test/freeflow/navierstokes/test_closedsystem.cc | 2 -- test/freeflow/navierstokes/test_donea.cc | 2 -- test/freeflow/navierstokes/test_kovasznay.cc | 2 -- test/freeflow/navierstokes/test_navierstokes_1d.cc | 2 -- test/freeflow/navierstokes/test_stokes_channel_3d.cc | 2 -- test/freeflow/navierstokesnc/test_channel.cc | 2 -- test/freeflow/navierstokesnc/test_densitydrivenflow.cc | 2 -- test/freeflow/navierstokesnc/test_msfreeflow.cc | 2 -- test/freeflow/rans/test_pipe_laufer.cc | 2 -- test/freeflow/ransnc/test_flatplate.cc | 2 -- .../horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc | 2 -- .../1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc | 2 -- .../stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc | 2 -- .../1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc | 2 -- .../1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc | 2 -- .../boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc | 2 -- 18 files changed, 36 deletions(-) diff --git a/test/freeflow/navierstokes/test_angeli.cc b/test/freeflow/navierstokes/test_angeli.cc index 76607dd72e..b946a99885 100644 --- a/test/freeflow/navierstokes/test_angeli.cc +++ b/test/freeflow/navierstokes/test_angeli.cc @@ -155,9 +155,7 @@ int main(int argc, char** argv) try // intialize the vtk output module StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - 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 b72e30520e..bee7ed183f 100644 --- a/test/freeflow/navierstokes/test_channel.cc +++ b/test/freeflow/navierstokes/test_channel.cc @@ -156,8 +156,6 @@ 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()); - 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 3d64a81497..6b5791708d 100644 --- a/test/freeflow/navierstokes/test_closedsystem.cc +++ b/test/freeflow/navierstokes/test_closedsystem.cc @@ -149,8 +149,6 @@ 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()); - 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 0eb4ce99c6..e6ad45c466 100644 --- a/test/freeflow/navierstokes/test_donea.cc +++ b/test/freeflow/navierstokes/test_donea.cc @@ -139,8 +139,6 @@ 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()); - 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 897b9dfa50..0d54568d92 100644 --- a/test/freeflow/navierstokes/test_kovasznay.cc +++ b/test/freeflow/navierstokes/test_kovasznay.cc @@ -136,8 +136,6 @@ 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()); - 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 65ae0eabb7..7b19b1038a 100644 --- a/test/freeflow/navierstokes/test_navierstokes_1d.cc +++ b/test/freeflow/navierstokes/test_navierstokes_1d.cc @@ -125,8 +125,6 @@ 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()); - 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 bff1f348a5..3c72b1ecf6 100644 --- a/test/freeflow/navierstokes/test_stokes_channel_3d.cc +++ b/test/freeflow/navierstokes/test_stokes_channel_3d.cc @@ -133,8 +133,6 @@ 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()); - 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 e31b2dae41..70fbdd037a 100644 --- a/test/freeflow/navierstokesnc/test_channel.cc +++ b/test/freeflow/navierstokesnc/test_channel.cc @@ -154,8 +154,6 @@ 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()); - 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 05deb3c1c7..f4491998c7 100644 --- a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc +++ b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc @@ -153,8 +153,6 @@ 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()); - 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 2357c25959..91dbaba810 100644 --- a/test/freeflow/navierstokesnc/test_msfreeflow.cc +++ b/test/freeflow/navierstokesnc/test_msfreeflow.cc @@ -153,8 +153,6 @@ 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()); - 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 79bb451eb4..8b4d2a70fe 100644 --- a/test/freeflow/rans/test_pipe_laufer.cc +++ b/test/freeflow/rans/test_pipe_laufer.cc @@ -149,8 +149,6 @@ 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()); - 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 86969a129b..40612bd175 100644 --- a/test/freeflow/ransnc/test_flatplate.cc +++ b/test/freeflow/ransnc/test_flatplate.cc @@ -145,8 +145,6 @@ 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()); - 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/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc index 7664a9ed62..0197c2208a 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc @@ -193,8 +193,6 @@ int main(int argc, char** argv) try StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); - using StokesVelocityOutput = typename GET_PROP_TYPE(StokesTypeTag, VelocityOutput); - stokesVtkWriter.addVelocityOutput(std::make_shared(*stokesGridVariables, stokesSol)); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc index 30bf4e121b..1f0673f05b 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc @@ -194,8 +194,6 @@ int main(int argc, char** argv) try StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); - using StokesVelocityOutput = typename GET_PROP_TYPE(StokesTypeTag, VelocityOutput); - stokesVtkWriter.addVelocityOutput(std::make_shared(*stokesGridVariables, stokesSol)); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc index 95b7216eb8..2f8864a37a 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc @@ -186,8 +186,6 @@ int main(int argc, char** argv) try StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); - using StokesVelocityOutput = typename GET_PROP_TYPE(StokesTypeTag, VelocityOutput); - stokesVtkWriter.addVelocityOutput(std::make_shared(*stokesGridVariables, stokesSol)); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc index 3ea7a0aedb..c1caa48d32 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc @@ -160,8 +160,6 @@ int main(int argc, char** argv) try StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); - using StokesVelocityOutput = typename GET_PROP_TYPE(StokesTypeTag, VelocityOutput); - stokesVtkWriter.addVelocityOutput(std::make_shared(*stokesGridVariables, stokesSol)); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc index b6e51d5f91..859451b901 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc @@ -163,8 +163,6 @@ int main(int argc, char** argv) try StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); - using StokesVelocityOutput = typename GET_PROP_TYPE(StokesTypeTag, VelocityOutput); - stokesVtkWriter.addVelocityOutput(std::make_shared(*stokesGridVariables, stokesSol)); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc b/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc index 430337e91e..35d4dc9ccc 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc @@ -185,8 +185,6 @@ int main(int argc, char** argv) try StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); - using StokesVelocityOutput = typename GET_PROP_TYPE(StokesTypeTag, VelocityOutput); - stokesVtkWriter.addVelocityOutput(std::make_shared(*stokesGridVariables, stokesSol)); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); -- GitLab