version 3.11-dev
Loading...
Searching...
No Matches
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 PQ3 {
84 static std::string name() { return "pq3"; }
85};
86
87struct CR_RT {
88 static std::string name() { return "fcdiamond"; }
89};
90
91struct PQ1Bubble {
92 static std::string name() { return "pq1bubble"; }
93};
94
95} // end namespace CVFEMethods
96
97
98/*
99 * \brief Vertex-centered finite volume scheme
100 * or control-volume finite element scheme based on a P1 (simplices) or Q1 (quads) basis
101 */
103
104/*
105 * \brief Vertex-centered control-volume finite element scheme
106 * based on a P1 (simplices) or Q1 (quads) basis
107 */
109
110/*
111 * \brief Face-centered control-volume finite element scheme based on
112 * Crouzeix-Raviart (simplices) or Rannacher-Turek (quads) basis
113 */
115
116/*
117 * \brief Alias for PQ1Nonconforming.
118 */
120
121/*
122 * \brief Vertex- and cell-centered finite volume scheme
123 * or control-volume finite element scheme based on
124 * linear Lagrangian elements with bubble function
125 */
127
128/*
129 * \brief Control-volume finite element scheme based on
130 * quadratic Lagrangian elements
131 */
133
134/*
135 * \brief Control-volume finite element scheme based on
136 * cubic Lagrangian elements
137 */
139
140/*
141 * \brief Staggered-grid finite volume scheme (old)
142 */
143struct Staggered : public Utility::Tag<Staggered> {
144 static std::string name() { return "staggered"; }
145};
146
147
148/*
149 * \brief Finite element method
150 */
151struct FEM : public Utility::Tag<FEM> {
152 static std::string name() { return "fem"; }
153};
154
155
156/*
157 * \brief Staggered-grid finite volume scheme
158 */
159struct FCStaggered : public Utility::Tag<FCStaggered> {
160 static std::string name() { return "fcstaggered"; }
161};
162
163
164/*
165 * \brief Tag used for defaults not depending on the discretization
166 * or in situations where a discretization tag is needed but none
167 * can be provided (the implementation has to support this of course)
168 */
169struct None : public Utility::Tag<None> {
170 static std::string name() { return "none"; }
171};
172
173
174inline constexpr CCTpfa cctpfa{};
175inline constexpr CCMpfa ccmpfa{};
176inline constexpr Box box{};
177inline constexpr PQ1 pq1{};
178inline constexpr PQ2 pq2{};
179inline constexpr PQ3 pq3{};
180inline constexpr PQ1Bubble pq1bubble{};
181inline constexpr Staggered staggered{};
182inline constexpr FEM fem{};
183inline constexpr FCStaggered fcstaggered{};
184inline constexpr FCDiamond fcdiamond{};
186inline constexpr None none{};
187
188} // end namespace Dumux::DiscretizationMethods
189
190#endif
Definition cvfelocalresidual.hh:25
Definition method.hh:20
constexpr CCMpfa ccmpfa
Definition method.hh:175
PQ1Nonconforming FCDiamond
Definition method.hh:119
constexpr FCDiamond fcdiamond
Definition method.hh:184
constexpr PQ2 pq2
Definition method.hh:178
constexpr CCTpfa cctpfa
Definition method.hh:174
constexpr Box box
Definition method.hh:176
constexpr PQ1Nonconforming pq1nonconforming
Definition method.hh:185
CVFE< CVFEMethods::PQ1 > PQ1
Definition method.hh:108
constexpr PQ1 pq1
Definition method.hh:177
constexpr Staggered staggered
Definition method.hh:181
constexpr None none
Definition method.hh:186
constexpr PQ3 pq3
Definition method.hh:179
CVFE< CVFEMethods::PQ1Bubble > PQ1Bubble
Definition method.hh:126
CVFE< CVFEMethods::CR_RT > PQ1Nonconforming
Definition method.hh:114
CVFE< CVFEMethods::PQ3 > PQ3
Definition method.hh:138
constexpr FEM fem
Definition method.hh:182
CVFE< CVFEMethods::PQ1 > Box
Definition method.hh:102
constexpr bool isCVFE
Definition method.hh:67
constexpr PQ1Bubble pq1bubble
Definition method.hh:180
CVFE< CVFEMethods::PQ2 > PQ2
Definition method.hh:132
constexpr FCStaggered fcstaggered
Definition method.hh:183
static std::string name()
Definition method.hh:34
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:88
static std::string name()
Definition method.hh:92
static std::string name()
Definition method.hh:76
static std::string name()
Definition method.hh:80
static std::string name()
Definition method.hh:84
static std::string name()
Definition method.hh:160
Definition method.hh:151
static std::string name()
Definition method.hh:152
Definition method.hh:169
static std::string name()
Definition method.hh:170
static std::string name()
Definition method.hh:144
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.