version 3.8
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-FileCopyrightInfo: 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 CR_RT {
80 static std::string name() { return "fcdiamond"; }
81};
82
83struct PQ1Bubble {
84 static std::string name() { return "pq1bubble"; }
85};
86
87} // end namespace CVFEMethods
88
89
90/*
91 * \brief Vertex-centered finite volume scheme
92 * or control-volume finite element scheme based on a P1 (simplices) or Q1 (quads) basis
93 */
95
96/*
97 * \brief Face-centered finite volume scheme
98 * or control-volume finite element scheme based on
99 * Crouzeix-Raviart (simplices) or Rannacher-Turek (quads) basis
100 */
102
103/*
104 * \brief Vertex- and cell-centered finite volume scheme
105 * or control-volume finite element scheme based on
106 * linear Lagrangian elements with bubble function
107 */
109
110
111/*
112 * \brief Staggered-grid finite volume scheme (old)
113 */
114struct Staggered : public Utility::Tag<Staggered> {
115 static std::string name() { return "staggered"; }
116};
117
118
119/*
120 * \brief Finite element method
121 */
122struct FEM : public Utility::Tag<FEM> {
123 static std::string name() { return "fem"; }
124};
125
126
127/*
128 * \brief Staggered-grid finite volume scheme
129 */
130struct FCStaggered : public Utility::Tag<FCStaggered> {
131 static std::string name() { return "fcstaggered"; }
132};
133
134
135/*
136 * \brief Tag used for defaults not depending on the discretization
137 * or in situations where a discretization tag is needed but none
138 * can be provided (the implementation has to support this of course)
139 */
140struct None : public Utility::Tag<None> {
141 static std::string name() { return "none"; }
142};
143
144
145inline constexpr CCTpfa cctpfa{};
146inline constexpr CCMpfa ccmpfa{};
147inline constexpr Box box{};
148inline constexpr PQ1Bubble pq1bubble{};
149inline constexpr Staggered staggered{};
150inline constexpr FEM fem{};
151inline constexpr FCStaggered fcstaggered{};
152inline constexpr FCDiamond fcdiamond{};
153inline constexpr None none{};
154
155} // end namespace Dumux::DiscretizationMethods
156
157#endif
Definition: method.hh:20
constexpr CCMpfa ccmpfa
Definition: method.hh:146
constexpr FCDiamond fcdiamond
Definition: method.hh:152
constexpr CCTpfa cctpfa
Definition: method.hh:145
constexpr Box box
Definition: method.hh:147
constexpr Staggered staggered
Definition: method.hh:149
constexpr None none
Definition: method.hh:153
constexpr FEM fem
Definition: method.hh:150
constexpr bool isCVFE
Definition: method.hh:67
constexpr PQ1Bubble pq1bubble
Definition: method.hh:148
constexpr FCStaggered fcstaggered
Definition: method.hh:151
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:80
static std::string name()
Definition: method.hh:84
static std::string name()
Definition: method.hh:76
static std::string name()
Definition: method.hh:131
Definition: method.hh:122
static std::string name()
Definition: method.hh:123
Definition: method.hh:140
static std::string name()
Definition: method.hh:141
static std::string name()
Definition: method.hh:115
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.