3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
io/velocityoutput.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_IO_VELOCITYOUTPUT_HH
25#define DUMUX_IO_VELOCITYOUTPUT_HH
26
27#include <vector>
28
29#include <dune/common/fvector.hh>
30#include <dune/common/exceptions.hh>
32
33namespace Dumux {
34
39template<class GridVariables>
41{
42 using Scalar = typename GridVariables::Scalar;
43 static constexpr int dimWorld = GridVariables::GridGeometry::GridView::dimensionworld;
44 using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView;
45 using ElementFluxVarsCache = typename GridVariables::GridFluxVariablesCache::LocalView;
46 using FVElementGeometry = typename GridVariables::GridGeometry::LocalView;
47 using Element = typename GridVariables::GridGeometry::GridView::template Codim<0>::Entity;
48
49public:
50 using VelocityVector = std::vector<Dune::FieldVector<Scalar, dimWorld>>;
51
55 enum class FieldType
56 {
57 element, vertex, automatic
58 };
59
63 VelocityOutput() = default;
64
66 virtual ~VelocityOutput() {};
67
69 virtual bool enableOutput() const { return false; }
70
72 virtual std::string phaseName(int phaseIdx) const { return "none"; }
73
75 virtual FieldType fieldType() const { return FieldType::automatic; }
76
78 virtual int numFluidPhases() const { return 0; }
79
82 virtual void calculateVelocity(VelocityVector& velocity,
83 const Element& element,
84 const FVElementGeometry& fvGeometry,
85 const ElementVolumeVariables& elemVolVars,
86 const ElementFluxVarsCache& elemFluxVarsCache,
87 int phaseIdx) const
88 {}
89};
90
91} // end namespace Dumux
92
93#endif
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
Velocity output for implicit (porous media) models.
Definition: io/velocityoutput.hh:41
virtual FieldType fieldType() const
returns the field type
Definition: io/velocityoutput.hh:75
std::vector< Dune::FieldVector< Scalar, dimWorld > > VelocityVector
Definition: io/velocityoutput.hh:50
virtual std::string phaseName(int phaseIdx) const
returns the phase name of a given phase index
Definition: io/velocityoutput.hh:72
FieldType
A container for possible velocity data types.
Definition: io/velocityoutput.hh:56
VelocityOutput()=default
Default constructor.
virtual bool enableOutput() const
returns whether or not velocity output is enabled
Definition: io/velocityoutput.hh:69
virtual int numFluidPhases() const
returns the number of phases
Definition: io/velocityoutput.hh:78
virtual void calculateVelocity(VelocityVector &velocity, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVarsCache &elemFluxVarsCache, int phaseIdx) const
Definition: io/velocityoutput.hh:82
virtual ~VelocityOutput()
virtual destructor
Definition: io/velocityoutput.hh:66