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-FileCopyrightText: 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 Experimental | ||
10 | * \ingroup Discretization | ||
11 | * \brief Base class for grid variables | ||
12 | */ | ||
13 | #ifndef DUMUX_DISCRETIZATION_GRID_VARIABLES_HH | ||
14 | #define DUMUX_DISCRETIZATION_GRID_VARIABLES_HH | ||
15 | |||
16 | #include <utility> | ||
17 | #include <memory> | ||
18 | |||
19 | #include <dumux/experimental/common/variables.hh> | ||
20 | |||
21 | namespace Dumux::Experimental { | ||
22 | |||
23 | /*! | ||
24 | * \ingroup Experimental | ||
25 | * \ingroup Discretization | ||
26 | * \brief Base class for grid variables. | ||
27 | * \tparam GG The grid geometry type | ||
28 | * \tparam X The type used for solution vectors | ||
29 | */ | ||
30 | template<class GG, class X> | ||
31 | class GridVariables | ||
32 | : public Variables<X> | ||
33 | { | ||
34 | using ParentType = Variables<X>; | ||
35 | |||
36 | public: | ||
37 | //! export the grid geometry type | ||
38 | using GridGeometry = GG; | ||
39 | |||
40 | /*! | ||
41 | * \brief Constructor from a grid geometry. The remaining arguments must | ||
42 | * be valid arguments for the construction of the Variables class. | ||
43 | */ | ||
44 | template<class... Args> | ||
45 | 9 | GridVariables(std::shared_ptr<const GridGeometry> gridGeometry, | |
46 | Args&&... args) | ||
47 | : ParentType(std::forward<Args>(args)...) | ||
48 | 9 | , gridGeometry_(gridGeometry) | |
49 | 7 | {} | |
50 | |||
51 | //! Return a reference to the grid geometry | ||
52 | 2259 | const GridGeometry& gridGeometry() const | |
53 |
6/18✓ Branch 1 taken 11 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 11 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 11 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 1100 times.
✓ Branch 12 taken 11 times.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✓ Branch 24 taken 11 times.
✗ Branch 25 not taken.
|
2247 | { return *gridGeometry_; } |
54 | |||
55 | private: | ||
56 | std::shared_ptr<const GridGeometry> gridGeometry_; | ||
57 | }; | ||
58 | |||
59 | } // end namespace Dumux::Experimental | ||
60 | |||
61 | #endif | ||
62 |