GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/examples/1protationsymmetry/spatialparams.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 4 8 50.0%
Functions: 1 3 33.3%
Branches: 4 16 25.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 #ifndef DUMUX_ONEP_ROTATION_SYMMETRY_SPATIAL_PARAMS_HH
9 #define DUMUX_ONEP_ROTATION_SYMMETRY_SPATIAL_PARAMS_HH
10
11 // ## Parameter distributions (`spatialparams.hh`)
12 //
13 // This file contains the __spatial parameters class__ which defines the
14 // distributions for the porous medium parameters permeability and porosity
15 // over the computational grid.
16 // [[content]]
17 // We include the spatial parameters class for single-phase models discretized
18 // by finite volume schemes, from which the spatial parameters defined for this
19 // example inherit.
20 #include <dumux/porousmediumflow/fvspatialparams1p.hh>
21
22 // ### The spatial parameters class
23 //
24 // In the `RotSymExampleSpatialParams` class, we define the functions needed to describe
25 // the porous medium, that is, porosity and permeability.
26 // We inherit from the `FVPorousMediumFlowSpatialParamsOneP` class here, which is the base class
27 // for spatial parameters in the context of single-phase porous medium flow
28 // applications using finite volume discretization schemes.
29 // [[codeblock]]
30 namespace Dumux {
31
32 template<class GridGeometry, class Scalar>
33
1/6
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 class RotSymExampleSpatialParams
34 : public FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, RotSymExampleSpatialParams<GridGeometry, Scalar>>
35 {
36 using ThisType = RotSymExampleSpatialParams<GridGeometry, Scalar>;
37 using ParentType = FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, ThisType>;
38 using Element = typename GridGeometry::GridView::template Codim<0>::Entity;
39 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
40 public:
41 // Spatial parameter classes for porous medium flow applications need to
42 // export the type used for intrinsic permeabilities.
43 using PermeabilityType = Scalar;
44
45 // In the constructor we obtain the permeability value from the input file.
46 1 RotSymExampleSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
47
2/8
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
1 : ParentType(gridGeometry)
48
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 { permeability_ = getParam<Scalar>("SpatialParams.Permeability"); }
49 // [[/codeblock]]
50
51 // #### Porosity distribution
52 // This function is used to define the porosity distribution in the
53 // computational domain. Here, we use a constant porosity of 1.0.
54 Scalar porosityAtPos(const GlobalPosition& globalPos) const
55 { return 1.0; }
56
57 // #### Permeability distribution
58 // This function is used to define the permeability distribution in the
59 // computational domain. Here, we use a constant permeability that is
60 // defined in the input file.
61 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
62 { return permeability_; }
63
64 private:
65 Scalar permeability_;
66 };
67
68 } // end namespace Dumux
69 // [[/content]]
70 #endif
71