Commit d7d8aae8 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

Merge branch 'feature/vtkoutputmodule-without-typetag' into 'master'

Free vtkoutputmodule from TypeTag

See merge request !1113
parents 9e81ef0e 0e53474c
......@@ -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<const GridGeometry> fvGridGeometry_; //!< pointer to the constant grid geometry
......
......@@ -115,7 +115,9 @@ SET_PROP(StaggeredFreeFlowModel, BoundaryTypes)
};
//! The velocity output
SET_TYPE_PROP(StaggeredFreeFlowModel, VelocityOutput, StaggeredFreeFlowVelocityOutput<TypeTag>);
SET_TYPE_PROP(StaggeredFreeFlowModel, VelocityOutput,
StaggeredFreeFlowVelocityOutput<typename GET_PROP_TYPE(TypeTag, GridVariables),
typename GET_PROP_TYPE(TypeTag, SolutionVector)>);
} // namespace Properties
} // namespace Dumux
......
......@@ -24,80 +24,67 @@
#ifndef DUMUX_STAGGERED_FF_VELOCITYOUTPUT_HH
#define DUMUX_STAGGERED_FF_VELOCITYOUTPUT_HH
#include <dune/common/fvector.hh>
#include <dumux/common/properties.hh>
#include <dumux/io/velocityoutput.hh>
#include <dumux/common/parameters.hh>
namespace Dumux
{
namespace Dumux {
/*!
* \ingroup StaggeredDiscretization
* \brief Velocity output for staggered free-flow models
*/
template<class TypeTag>
class StaggeredFreeFlowVelocityOutput
template<class GridVariables, class SolutionVector>
class StaggeredFreeFlowVelocityOutput : public VelocityOutput<GridVariables>
{
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<GridVariables>;
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<decltype(std::declval<GridVolumeVariables>().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<bool>(problem.paramGroup(), "Vtk.AddVelocity");
// enable per default
enableOutput_ = getParamFromGroup<bool>(gridVariables.curGridVolVars().problem().paramGroup(), "Vtk.AddVelocity", true);
}
//! Returns whether to enable the velocity output or not
bool enableOutput()
{ return velocityOutput_; }
// returns the name of the phase for a given index
static std::string phaseName(int phaseIdx)
{ return GET_PROP_TYPE(TypeTag, FluidSystem)::phaseName(phaseIdx); }
bool enableOutput() const override { return enableOutput_; }
// returns the number of phase velocities computed by this class
static constexpr int numPhaseVelocities()
{ return GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(); }
//! returns the phase name of a given phase index
std::string phaseName(int phaseIdx) const override { return FluidSystem::phaseName(phaseIdx); }
//! Return the problem boundary types
auto problemBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const
{ return problem_.boundaryTypes(element, scvf); }
//! returns the number of phases
int numPhases() const override { return VolumeVariables::numPhases(); }
//! Calculate the velocities for the scvs in the element
//! We assume the local containers to be bound to the complete stencil
template<class VelocityVector>
void calculateVelocity(VelocityVector& velocity,
const ElementVolumeVariables& elemVolVars,
const FVElementGeometry& fvGeometry,
const Element& element,
int phaseIdx)
int phaseIdx) const override
{
auto elemFaceVars = localView(gridVariables_.curGridFaceVars());
elemFaceVars.bindElement(element, fvGeometry, sol_);
......@@ -114,11 +101,10 @@ public:
}
private:
const Problem& problem_;
const FVGridGeometry& fvGridGeometry_;
const GridVariables& gridVariables_;
const SolutionVector& sol_;
bool velocityOutput_;
bool enableOutput_ = true;
};
} // end namespace Dumux
......
......@@ -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<typename GET_PROP_TYPE(TypeTag, GridVariables)>);
//! The solid state must be inert
SET_PROP(Geomechanics, SolidState)
......
......@@ -23,9 +23,9 @@
#ifndef DUMUX_GEOMECHANICS_VELOCITYOUTPUT_HH
#define DUMUX_GEOMECHANICS_VELOCITYOUTPUT_HH
#include <string>
#include <dune/common/exceptions.hh>
#include <dumux/io/velocityoutput.hh>
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 GridVariables>
class GeomechanicsVelocityOutput
: public VelocityOutput<GridVariables>
{
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
......
......@@ -29,6 +29,7 @@
#include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/pointcloudvtkwriter.hh>
#include <dumux/io/vtksequencewriter.hh>
#include <dumux/discretization/staggered/freeflow/velocityoutput.hh>
namespace Dumux {
......@@ -40,25 +41,21 @@ class PointCloudVtkWriter;
* \brief A VTK output module to simplify writing dumux simulation data to VTK format
* Specialization for staggered grids with dofs on faces.
*
* \tparam TypeTag The TypeTag of the problem implementation
* \tparam phaseIdxOffset Used for single-phase problems to retrieve the right phase name
* \tparam GridVariables The grid variables
* \tparam SolutionVector The solution vector
*/
template<typename TypeTag, int phaseIdxOffset = 0>
class StaggeredVtkOutputModule : public VtkOutputModule<TypeTag, phaseIdxOffset>
template<class GridVariables, class SolutionVector>
class StaggeredVtkOutputModule
: public VtkOutputModule<GridVariables, SolutionVector>
{
friend class VtkOutputModule<TypeTag, phaseIdxOffset>;
using ParentType = VtkOutputModule<TypeTag, phaseIdxOffset>;
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<GridVariables, SolutionVector>;
using FVGridGeometry = typename GridVariables::GridGeometry;
using GridView = typename FVGridGeometry::GridView;
using Scalar = typename GridVariables::Scalar;
using FaceVariables = typename GridVariables::GridFaceVariables::FaceVariables;
using FVElementGeometry = typename FVGridGeometry::LocalView;
using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
enum { dim = GridView::dimension };
using Element = typename GridView::template Codim<0>::Entity;
......@@ -85,26 +82,22 @@ class StaggeredVtkOutputModule : public VtkOutputModule<TypeTag, phaseIdxOffset>
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<PointCloudVtkWriter<Scalar, GlobalPosition>>(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<bool>(problem.paramGroup(), "Vtk.WriteFaceData", false);
// enable velocity output per default
this->addVelocityOutput(std::make_shared<StaggeredFreeFlowVelocityOutput<GridVariables, SolutionVector>>(gridVariables, sol));
writeFaceVars_ = getParamFromGroup<bool>(paramGroup, "Vtk.WriteFaceData", false);
coordinatesInitialized_ = false;
}
......@@ -118,7 +111,7 @@ public:
//! \param name The name of the vtk field
void addFaceField(const std::vector<Scalar>& v, const std::string& name)
{
if (v.size() == this->gridGeom_.gridView().size(1))
if (v.size() == this->fvGridGeometry().gridView().size(1))
faceFieldScalarDataInfo_.emplace_back(v, name);
else
DUNE_THROW(Dune::RangeError, "Size mismatch of added field!");
......@@ -129,7 +122,7 @@ public:
//! \param name The name of the vtk field
void addFaceField(const std::vector<DimVector>& v, const std::string& name)
{
if (v.size() == this->gridGeom_.gridView().size(1))
if (v.size() == this->fvGridGeometry().gridView().size(1))
faceFieldVectorDataInfo_.emplace_back(v, name);
else
DUNE_THROW(Dune::RangeError, "Size mismatch of added field!");
......@@ -167,10 +160,10 @@ private:
//! Update the coordinates (the face centers)
void updateCoordinates_()
{
coordinates_.resize(gridGeom_.numFaceDofs());
for(auto&& facet : facets(gridGeom_.gridView()))
coordinates_.resize(this->fvGridGeometry().numFaceDofs());
for(auto&& facet : facets(this->fvGridGeometry().gridView()))
{
const int dofIdxGlobal = gridGeom_.gridView().indexSet().index(facet);
const int dofIdxGlobal = this->fvGridGeometry().gridView().indexSet().index(facet);
coordinates_[dofIdxGlobal] = facet.geometry().center();
}
coordinatesInitialized_ = true;
......@@ -180,7 +173,7 @@ private:
//! \param time The current time
void getFaceDataAndWrite_(const Scalar time)
{
const auto numPoints = gridGeom_.numFaceDofs();
const auto numPoints = this->fvGridGeometry().numFaceDofs();
// make sure not to iterate over the same dofs twice
std::vector<bool> dofVisited(numPoints, false);
......@@ -199,15 +192,15 @@ private:
if(!faceVarVectorDataInfo_.empty())
faceVarVectorData.resize(faceVarVectorDataInfo_.size(), std::vector<DimVector>(numPoints));
for (const auto& element : elements(gridGeom_.gridView(), Dune::Partitions::interior))
for (const auto& element : elements(this->fvGridGeometry().gridView(), Dune::Partitions::interior))
{
auto fvGeometry = localView(gridGeom_);
auto elemFaceVars = localView(gridVariables_.curGridFaceVars());
auto fvGeometry = localView(this->fvGridGeometry());
auto elemFaceVars = localView(this->gridVariables().curGridFaceVars());
if (!faceVarScalarDataInfo_.empty() || !faceVarVectorDataInfo_.empty())
{
fvGeometry.bind(element);
elemFaceVars.bindElement(element, fvGeometry, sol_);
elemFaceVars.bindElement(element, fvGeometry, this->sol());
for (auto&& scvf : scvfs(fvGeometry))
{
......@@ -256,11 +249,6 @@ private:
}
const Problem& problem_;
const FVGridGeometry& gridGeom_;
const GridVariables& gridVariables_;
const SolutionVector& sol_;
std::shared_ptr<PointCloudVtkWriter<Scalar, GlobalPosition>> faceWriter_;
VTKSequenceWriter<PointCloudVtkWriter<Scalar, GlobalPosition>> sequenceWriter_;
......
// -*- 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 <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief Default velocity output policy for porous media models
*/
#ifndef DUMUX_IO_VELOCITYOUTPUT_HH
#define DUMUX_IO_VELOCITYOUTPUT_HH
#include <vector>
#include <dune/common/fvector.hh>
#include <dune/common/exceptions.hh>
#include <dumux/common/parameters.hh>
namespace Dumux {
/*!
* \brief Velocity output for implicit (porous media) models
*/
template<class GridVariables>
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<Dune::FieldVector<Scalar, dimWorld>>;
/*!
* \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
This diff is collapsed.
......@@ -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
......
......@@ -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 TypeTag, class FractureGrid, int phaseIdxOffset = 0>
class BoxDfmVtkOutputModule : public VtkOutputModule<TypeTag, phaseIdxOffset>
template<class GridVariables, class SolutionVector, class FractureGrid>
class BoxDfmVtkOutputModule : public VtkOutputModule<GridVariables, SolutionVector>
{
using ParentType = VtkOutputModule<TypeTag, phaseIdxOffset>;
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<GridVariables, SolutionVector>;
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<TypeTag, phaseIdxOffset>
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<std::vector<GlobalPosition>, numPhases> velocity;
std::vector<typename ParentType::VelocityOutput::VelocityVector> velocity;
// process rank
static bool addProcessRank = getParamFromGroup<bool>(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<GlobalPosition>(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