GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/io/velocityoutput.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 5 8 62.5%
Functions: 675 2280 29.6%
Branches: 4 48 8.3%

Line Branch Exec Source
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 //
7 /*!
8 * \file
9 * \ingroup InputOutput
10 * \brief Default velocity output policy for porous media models
11 */
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>
19 #include <dumux/common/parameters.hh>
20
21 namespace Dumux {
22
23 /*!
24 * \ingroup InputOutput
25 * \brief Velocity output for implicit (porous media) models
26 */
27 template<class GridVariables>
28 class VelocityOutput
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
37 public:
38 using VelocityVector = std::vector<Dune::FieldVector<Scalar, dimWorld>>;
39
40 /*!
41 * \brief A container for possible velocity data types
42 */
43 enum class FieldType
44 {
45 element, vertex, automatic
46 };
47
48 /*!
49 * \brief Default constructor
50 */
51
4/48
✓ Branch 1 taken 538 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 125 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 6 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 3 times.
✗ Branch 11 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
672 VelocityOutput() = default;
52
53 //! virtual destructor
54 1344 virtual ~VelocityOutput() {};
55
56 //! returns whether or not velocity output is enabled
57 7893834 virtual bool enableOutput() const { return false; }
58
59 //! returns the phase name of a given phase index
60 virtual std::string phaseName(int phaseIdx) const { return "none"; }
61
62 //! returns the field type
63 13864 virtual FieldType fieldType() const { return FieldType::automatic; }
64
65 //! returns the number of phases
66 2483 virtual int numFluidPhases() const { return 0; }
67
68 //! Calculate the velocities for the scvs in the element
69 //! We assume the local containers to be bound to the complete stencil
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
82