GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/discretization/staggered/freeflow/fvgridgeometrytraits.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 2 6 33.3%
Functions: 0 8 0.0%
Branches: 0 6 0.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 StaggeredDiscretization
10 * \copydoc Dumux::StaggeredFreeFlowDefaultFVGridGeometryTraits
11 */
12 #ifndef DUMUX_DISCRETIZATION_STAGGERED_FREEFLOW_FV_GRID_GEOMETRY_TRAITS
13 #define DUMUX_DISCRETIZATION_STAGGERED_FREEFLOW_FV_GRID_GEOMETRY_TRAITS
14
15 #include <dumux/common/defaultmappertraits.hh>
16 #include <dumux/common/intersectionmapper.hh>
17 #include <dumux/discretization/cellcentered/subcontrolvolume.hh>
18 #include <dumux/discretization/staggered/fvelementgeometry.hh>
19
20 #include "subcontrolvolumeface.hh"
21 #include "connectivitymap.hh"
22 #include "staggeredgeometryhelper.hh"
23
24 namespace Dumux {
25
26 template<class GridView>
27 class FreeflowStaggeredSCV
28 {
29 using ctype = typename GridView::ctype;
30 using GlobalPosition = Dune::FieldVector<ctype, GridView::dimensionworld>;
31 public:
32 struct Traits
33 {
34 using Scalar = ctype;
35 using Geometry = typename GridView::template Codim<0>::Geometry;
36 };
37
38 FreeflowStaggeredSCV(const GlobalPosition& center, const ctype volume)
39 136075228 : center_(center), volume_(volume) {}
40
41 const GlobalPosition& center() const
42 { return center_; }
43
44 ctype volume() const
45 { return volume_; }
46 private:
47 GlobalPosition center_;
48 ctype volume_;
49 };
50
51 template<class GridView>
52 class FreeflowStaggeredSCVF
53 {
54 using ctype = typename GridView::ctype;
55 using GlobalPosition = Dune::FieldVector<ctype, GridView::dimensionworld>;
56 public:
57 struct Traits
58 {
59 using Scalar = ctype;
60 using Geometry = typename GridView::template Codim<1>::Geometry;
61 };
62
63 FreeflowStaggeredSCVF(const GlobalPosition& center, const ctype area)
64
0/6
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
701740598 : center_(center), area_(area) {}
65
66 const GlobalPosition& center() const
67 { return center_; }
68
69 ctype area() const
70 { return area_; }
71 private:
72 GlobalPosition center_;
73 ctype area_;
74 };
75
76
77 /*!
78 * \ingroup StaggeredDiscretization
79 * \brief Default traits for the finite volume grid geometry.
80 */
81 template<class GridView, int upwOrder, class MapperTraits = DefaultMapperTraits<GridView>>
82 struct StaggeredFreeFlowDefaultFVGridGeometryTraits
83 : public MapperTraits
84 {
85 using SubControlVolume = CCSubControlVolume<GridView>;
86 using SubControlVolumeFace = FreeFlowStaggeredSubControlVolumeFace<GridView, upwOrder>;
87 using IntersectionMapper = ConformingGridIntersectionMapper<GridView>;
88 using GeometryHelper = FreeFlowStaggeredGeometryHelper<GridView, upwOrder>;
89 static constexpr int upwindSchemeOrder = upwOrder;
90
91 struct DofTypeIndices
92 {
93 using FaceIdx = Dune::index_constant<0>;
94 using CellCenterIdx = Dune::index_constant<1>;
95 };
96
97 template<class GridGeometry>
98 using ConnectivityMap = StaggeredFreeFlowConnectivityMap<GridGeometry>;
99
100 template<class GridGeometry, bool cachingEnabled>
101 using LocalView = StaggeredFVElementGeometry<GridGeometry, cachingEnabled>;
102
103 struct PublicTraits
104 {
105 using CellSubControlVolume = SubControlVolume;
106 using CellSubControlVolumeFace = SubControlVolumeFace;
107 using FaceSubControlVolume = FreeflowStaggeredSCV<GridView>;
108 using FaceLateralSubControlVolumeFace = FreeflowStaggeredSCVF<GridView>;
109 using FaceFrontalSubControlVolumeFace = FreeflowStaggeredSCVF<GridView>;
110 };
111 };
112
113 } //end namespace Dumux
114
115 #endif
116