version 3.8
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_IO_VELOCITYOUTPUT_HH
13#define DUMUX_IO_VELOCITYOUTPUT_HH
14
15#include <vector>
16
17#include <dune/common/fvector.hh>
18#include <dune/common/exceptions.hh>
20
21namespace Dumux {
22
27template<class GridVariables>
29{
30 using Scalar = typename GridVariables::Scalar;
31 static constexpr int dimWorld = GridVariables::GridGeometry::GridView::dimensionworld;
32 using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView;
33 using ElementFluxVarsCache = typename GridVariables::GridFluxVariablesCache::LocalView;
34 using FVElementGeometry = typename GridVariables::GridGeometry::LocalView;
35 using Element = typename GridVariables::GridGeometry::GridView::template Codim<0>::Entity;
36
37public:
38 using VelocityVector = std::vector<Dune::FieldVector<Scalar, dimWorld>>;
39
43 enum class FieldType
44 {
45 element, vertex, automatic
46 };
47
51 VelocityOutput() = default;
52
54 virtual ~VelocityOutput() {};
55
57 virtual bool enableOutput() const { return false; }
58
60 virtual std::string phaseName(int phaseIdx) const { return "none"; }
61
63 virtual FieldType fieldType() const { return FieldType::automatic; }
64
66 virtual int numFluidPhases() const { return 0; }
67
70 virtual void calculateVelocity(VelocityVector& velocity,
71 const Element& element,
72 const FVElementGeometry& fvGeometry,
73 const ElementVolumeVariables& elemVolVars,
74 const ElementFluxVarsCache& elemFluxVarsCache,
75 int phaseIdx) const
76 {}
77};
78
79} // end namespace Dumux
80
81#endif
Velocity output for implicit (porous media) models.
Definition: io/velocityoutput.hh:29
virtual FieldType fieldType() const
returns the field type
Definition: io/velocityoutput.hh:63
std::vector< Dune::FieldVector< Scalar, dimWorld > > VelocityVector
Definition: io/velocityoutput.hh:38
virtual std::string phaseName(int phaseIdx) const
returns the phase name of a given phase index
Definition: io/velocityoutput.hh:60
FieldType
A container for possible velocity data types.
Definition: io/velocityoutput.hh:44
VelocityOutput()=default
Default constructor.
virtual bool enableOutput() const
returns whether or not velocity output is enabled
Definition: io/velocityoutput.hh:57
virtual int numFluidPhases() const
returns the number of phases
Definition: io/velocityoutput.hh:66
virtual void calculateVelocity(VelocityVector &velocity, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVarsCache &elemFluxVarsCache, int phaseIdx) const
Definition: io/velocityoutput.hh:70
virtual ~VelocityOutput()
virtual destructor
Definition: io/velocityoutput.hh:54
Definition: adapt.hh:17
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.