3.3.0
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
freeflow/navierstokes/boundarytypes.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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef FREEFLOW_NAVIERSTOKES_BOUNDARY_TYPES_HH
25#define FREEFLOW_NAVIERSTOKES_BOUNDARY_TYPES_HH
26
29
30namespace Dumux {
31
36template <int numEq>
38{
40
41public:
43 {
44 for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
45 resetEq(eqIdx);
46 }
47
51 void resetEq(const int eqIdx)
52 {
54
55 boundaryInfo_[eqIdx].isSymmetry = false;
56 boundaryInfo_[eqIdx].isBeaversJoseph = false;
57 }
58
63 {
64 for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
65 {
66 resetEq(eqIdx);
67 boundaryInfo_[eqIdx].isSymmetry = true;
68 }
69 }
70
74 bool isSymmetry() const
75 { return boundaryInfo_[0].isSymmetry; }
76
80 template<class T = void>
82 {
83 static_assert(AlwaysFalse<T>::value, "Setting all boundary types to Dirichlet not permitted!");
84 }
85
89 template<class T = void>
91 {
92 static_assert(AlwaysFalse<T>::value, "Setting all boundary types to Neumann not permitted!");
93 }
94
99 void setBeaversJoseph(const int eqIdx)
100 {
101 resetEq(eqIdx);
102 boundaryInfo_[eqIdx].isBeaversJoseph = true;
103 }
104
111 bool isBeaversJoseph(const int eqIdx) const
112 { return boundaryInfo_[eqIdx].isBeaversJoseph; }
113
118 bool hasBeaversJoseph() const
119 {
120 for (int i = 0; i < numEq; ++i)
122 return true;
123 return false;
124 }
125
126protected:
129 {
130 bool isSymmetry : 1;
132 };
133
134 std::array<NavierStokesBoundaryInfo, numEq> boundaryInfo_;
135};
136
137} // end namespace Dumux
138
139#endif
Definition: adapt.hh:29
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:38
void resetEq(int eqIdx)
Reset the boundary types for one equation.
Definition: common/boundarytypes.hh:63
Template which always yields a false value.
Definition: typetraits.hh:36
Class to specify the type of a boundary condition for the Navier-Stokes model.
Definition: freeflow/navierstokes/boundarytypes.hh:38
void setAllSymmetry()
Sets a symmetry boundary condition for all equations.
Definition: freeflow/navierstokes/boundarytypes.hh:62
void resetEq(const int eqIdx)
Reset the boundary types for one equation.
Definition: freeflow/navierstokes/boundarytypes.hh:51
bool hasBeaversJoseph() const
Returns true if some equation is used to specify a Beavers-Joseph(-Saffman) boundary condition.
Definition: freeflow/navierstokes/boundarytypes.hh:118
void setAllNeumann()
Prevent setting all boundary conditions to Neumann.
Definition: freeflow/navierstokes/boundarytypes.hh:90
std::array< NavierStokesBoundaryInfo, numEq > boundaryInfo_
Definition: freeflow/navierstokes/boundarytypes.hh:134
NavierStokesBoundaryTypes()
Definition: freeflow/navierstokes/boundarytypes.hh:42
void setBeaversJoseph(const int eqIdx)
Set a boundary condition for a single equation to Beavers-Joseph(-Saffmann) (special case of Dirichle...
Definition: freeflow/navierstokes/boundarytypes.hh:99
void setAllDirichlet()
Prevent setting all boundary conditions to Dirichlet.
Definition: freeflow/navierstokes/boundarytypes.hh:81
bool isSymmetry() const
Returns true if the there is a symmetry boundary condition.
Definition: freeflow/navierstokes/boundarytypes.hh:74
bool isBeaversJoseph(const int eqIdx) const
Returns true if an equation is used to specify a Beavers-Joseph(-Saffman) boundary condition.
Definition: freeflow/navierstokes/boundarytypes.hh:111
use bitfields to minimize the size
Definition: freeflow/navierstokes/boundarytypes.hh:129
bool isBeaversJoseph
Definition: freeflow/navierstokes/boundarytypes.hh:131
bool isSymmetry
Definition: freeflow/navierstokes/boundarytypes.hh:130
Class to specify the type of a boundary.