version 3.11-dev
method.hh
Go to the documentation of this file.
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//
12#ifndef DUMUX_DISCRETIZATION_METHOD_HH
13#define DUMUX_DISCRETIZATION_METHOD_HH
14
15#include <ostream>
16#include <string>
17
18#include <dumux/common/tag.hh>
19
21
22/*
23 * \brief Cell-centered finite volume scheme with two-point flux approximation
24 */
25struct CCTpfa : public Utility::Tag<CCTpfa> {
26 static std::string name() { return "cctpfa"; }
27};
28
29
30/*
31 * \brief Cell-centered finite volume scheme with multi-point flux approximation
32 */
33struct CCMpfa : public Utility::Tag<CCMpfa> {
34 static std::string name() { return "ccmpfa"; }
35};
36
37
38/*
39 * \brief Control-volume finite element methods
40 * This is a group of discretization methods that share certain properties.
41 * Therefore there is a single meta-tag parametrized in terms of the actual
42 * discretization method in the group. Having a common tag allows to specialize
43 * template agnostic of the underlying discretization type
44 */
45template<class DM>
46struct CVFE : public Utility::Tag<CVFE<DM>> {
47 static std::string name() { return DM::name(); }
48};
49
50
51#ifndef DOXYGEN
52namespace Detail {
53
54template<class DM>
55struct IsCVFE : public std::false_type {};
56
57template<class DM>
58struct IsCVFE<CVFE<DM>> : public std::true_type {};
59
60} // end namespace Detail
61#endif
62
63/*
64 * \brief Template variable that is true when the discretization method DM is a CVFE schemes
65 */
66template<class DM>
67inline constexpr bool isCVFE = Detail::IsCVFE<DM>::value;
68
69
70/*
71 * \brief Various control volume finite element discretization methods
72 */
73namespace CVFEMethods {
74
75struct PQ1 {
76 static std::string name() { return "box"; }
77};
78
79struct PQ2 {
80 static std::string name() { return "pq2"; }
81};
82
83struct CR_RT {
84 static std::string name() { return "fcdiamond"; }
85};
86
87struct PQ1Bubble {
88 static std::string name() { return "pq1bubble"; }
89};
90
91} // end namespace CVFEMethods
92
93
94/*
95 * \brief Vertex-centered finite volume scheme
96 * or control-volume finite element scheme based on a P1 (simplices) or Q1 (quads) basis
97 */
99
100/*
101 * \brief Face-centered finite volume scheme
102 * or control-volume finite element scheme based on
103 * Crouzeix-Raviart (simplices) or Rannacher-Turek (quads) basis
104 */
106
107/*
108 * \brief Vertex- and cell-centered finite volume scheme
109 * or control-volume finite element scheme based on
110 * linear Lagrangian elements with bubble function
111 */
113
114/*
115 * \brief Control-volume finite element scheme based on
116 * quadratic Lagrangian elements
117 */
119
120/*
121 * \brief Staggered-grid finite volume scheme (old)
122 */
123struct Staggered : public Utility::Tag<Staggered> {
124 static std::string name() { return "staggered"; }
125};
126
127
128/*
129 * \brief Finite element method
130 */
131struct FEM : public Utility::Tag<FEM> {
132 static std::string name() { return "fem"; }
133};
134
135
136/*
137 * \brief Staggered-grid finite volume scheme
138 */
139struct FCStaggered : public Utility::Tag<FCStaggered> {
140 static std::string name() { return "fcstaggered"; }
141};
142
143
144/*
145 * \brief Tag used for defaults not depending on the discretization
146 * or in situations where a discretization tag is needed but none
147 * can be provided (the implementation has to support this of course)
148 */
149struct None : public Utility::Tag<None> {
150 static std::string name() { return "none"; }
151};
152
153
154inline constexpr CCTpfa cctpfa{};
155inline constexpr CCMpfa ccmpfa{};
156inline constexpr Box box{};
157inline constexpr PQ2 pq2{};
158inline constexpr PQ1Bubble pq1bubble{};
159inline constexpr Staggered staggered{};
160inline constexpr FEM fem{};
161inline constexpr FCStaggered fcstaggered{};
162inline constexpr FCDiamond fcdiamond{};
163inline constexpr None none{};
164
165} // end namespace Dumux::DiscretizationMethods
166
167#endif
Definition: method.hh:20
constexpr CCMpfa ccmpfa
Definition: method.hh:155
constexpr FCDiamond fcdiamond
Definition: method.hh:162
constexpr PQ2 pq2
Definition: method.hh:157
constexpr CCTpfa cctpfa
Definition: method.hh:154
constexpr Box box
Definition: method.hh:156
constexpr Staggered staggered
Definition: method.hh:159
constexpr None none
Definition: method.hh:163
constexpr FEM fem
Definition: method.hh:160
constexpr bool isCVFE
Definition: method.hh:67
constexpr PQ1Bubble pq1bubble
Definition: method.hh:158
constexpr FCStaggered fcstaggered
Definition: method.hh:161
Definition: method.hh:33
static std::string name()
Definition: method.hh:34
Definition: method.hh:25
static std::string name()
Definition: method.hh:26
Definition: method.hh:46
static std::string name()
Definition: method.hh:47
static std::string name()
Definition: method.hh:84
static std::string name()
Definition: method.hh:88
static std::string name()
Definition: method.hh:76
static std::string name()
Definition: method.hh:80
static std::string name()
Definition: method.hh:140
Definition: method.hh:131
static std::string name()
Definition: method.hh:132
Definition: method.hh:149
static std::string name()
Definition: method.hh:150
static std::string name()
Definition: method.hh:124
Helper class to create (named and comparable) tagged types Tags any given type. The tagged type is eq...
Definition: tag.hh:30
Helper class to create (named and comparable) tagged types.