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