25#ifndef DUMUX_POROUSMEDIUMFLOW_VELOCITYOUTPUT_HH
26#define DUMUX_POROUSMEDIUMFLOW_VELOCITYOUTPUT_HH
29#include <dune/common/float_cmp.hh>
43template<
class Gr
idVariables,
class FluxVariables>
47 using GridGeometry =
typename GridVariables::GridGeometry;
48 using FVElementGeometry =
typename GridGeometry::LocalView;
49 using SubControlVolume =
typename GridGeometry::SubControlVolume;
50 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
51 using GridView =
typename GridGeometry::GridView;
52 using Element =
typename GridView::template Codim<0>::Entity;
53 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
54 using ElementFluxVarsCache =
typename GridVariables::GridFluxVariablesCache::LocalView;
55 using VolumeVariables =
typename GridVariables::VolumeVariables;
56 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
57 using FluidSystem =
typename VolumeVariables::FluidSystem;
58 using Scalar =
typename GridVariables::Scalar;
60 static constexpr int dim = GridView::dimension;
61 static constexpr int dimWorld = GridView::dimensionworld;
63 static constexpr int dofCodim = isBox ? dim : 0;
65 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
67 using Problem =
typename GridVolumeVariables::Problem;
81 enableOutput_ = getParamFromGroup<bool>(gridVariables.curGridVolVars().problem().paramGroup(),
"Vtk.AddVelocity");
83 velocityBackend = std::make_unique<VelocityBackend>(gridVariables);
90 std::string
phaseName(
int phaseIdx)
const override {
return FluidSystem::phaseName(phaseIdx); }
93 int numFluidPhases()
const override {
return VolumeVariables::numFluidPhases(); }
98 const Element& element,
99 const FVElementGeometry& fvGeometry,
100 const ElementVolumeVariables& elemVolVars,
101 const ElementFluxVarsCache& elemFluxVarsCache,
102 int phaseIdx)
const override
105 velocityBackend->calculateVelocity(velocity, element, fvGeometry, elemVolVars, elemFluxVarsCache, phaseIdx);
110 std::unique_ptr<VelocityBackend> velocityBackend;
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Element solution classes and factory functions.
The available discretization methods in Dumux.
Velocity computation for implicit (porous media) models.
constexpr Box box
Definition: method.hh:139
Velocity output for implicit (porous media) models.
Definition: io/velocityoutput.hh:41
std::vector< Dune::FieldVector< Scalar, dimWorld > > VelocityVector
Definition: io/velocityoutput.hh:50
Velocity computation for implicit (porous media) models.
Definition: velocity.hh:71
Velocity output policy for implicit (porous media) models.
Definition: porousmediumflow/velocityoutput.hh:45
std::string phaseName(int phaseIdx) const override
Returns the phase name of a given phase index.
Definition: porousmediumflow/velocityoutput.hh:90
bool enableOutput() const override
Returns whether or not velocity output is enabled.
Definition: porousmediumflow/velocityoutput.hh:87
void calculateVelocity(VelocityVector &velocity, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVarsCache &elemFluxVarsCache, int phaseIdx) const override
Definition: porousmediumflow/velocityoutput.hh:97
PorousMediumFlowVelocityOutput(const GridVariables &gridVariables)
Constructor initializes the static data with the initial solution.
Definition: porousmediumflow/velocityoutput.hh:78
int numFluidPhases() const override
Returns the number of phases.
Definition: porousmediumflow/velocityoutput.hh:93
Default velocity output policy for porous media models.