GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/io/velocityoutput.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 5 8 62.5%
Functions: 719 2268 31.7%
Branches: 24 48 50.0%

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
24/48
✓ Branch 1 taken 545 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 127 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 7 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✓ Branch 31 taken 1 times.
✗ Branch 32 not taken.
✓ Branch 34 taken 1 times.
✗ Branch 35 not taken.
✓ Branch 37 taken 1 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 1 times.
✗ Branch 41 not taken.
✓ Branch 43 taken 1 times.
✗ Branch 44 not taken.
✓ Branch 46 taken 1 times.
✗ Branch 47 not taken.
✓ Branch 49 taken 1 times.
✗ Branch 50 not taken.
✓ Branch 52 taken 1 times.
✗ Branch 53 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 67 taken 1 times.
✗ Branch 68 not taken.
✓ Branch 70 taken 1 times.
✗ Branch 71 not taken.
703 VelocityOutput() = default;
52
53 //! virtual destructor
54 1406 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 14124 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