3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
discretization/staggered/freeflow/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 STAGGERED_FREEFLOW_BOUNDARY_TYPES_HH
25#define STAGGERED_FREEFLOW_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(int eqIdx)
52 {
54
55 boundaryInfo_[eqIdx].visited = false;
56 boundaryInfo_[eqIdx].isSymmetry = false;
57 boundaryInfo_[eqIdx].isBeaversJoseph = false;
58 }
59
64 {
65 for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
66 {
67 resetEq(eqIdx);
68 boundaryInfo_[eqIdx].visited = true;
69 boundaryInfo_[eqIdx].isSymmetry = true;
70 }
71 }
72
76 bool isSymmetry() const
77 { return boundaryInfo_[0].isSymmetry; }
78
82 template<class T = void>
84 {
85 static_assert(AlwaysFalse<T>::value, "Setting all boundary types to Dirichlet not permitted!");
86 }
87
91 template<class T = void>
93 {
94 static_assert(AlwaysFalse<T>::value, "Setting all boundary types to Neumann not permitted!");
95 }
96
101 [[deprecated("Use setBeaversJoseph instead. Will be removed after 3.2")]]
102 void setBJS(int eqIdx)
103 { setBeaversJoseph(eqIdx); }
104
109 void setBeaversJoseph(unsigned eqIdx)
110 {
111 resetEq(eqIdx);
112 boundaryInfo_[eqIdx].visited = true;
113 boundaryInfo_[eqIdx].isBeaversJoseph = true;
114 }
115
122 [[deprecated("Use isBeaversJoseph instead. Will be removed after 3.2")]]
123 bool isBJS(unsigned eqIdx) const
124 { return isBeaversJoseph(eqIdx); }
125
132 bool isBeaversJoseph(unsigned eqIdx) const
133 { return boundaryInfo_[eqIdx].isBeaversJoseph; }
134
139 [[deprecated("Use hasBeaversJoseph instead. Will be removed after 3.2")]]
140 bool hasBJS() const
141 { return hasBeaversJoseph(); }
142
147 bool hasBeaversJoseph() const
148 {
149 for (int i = 0; i < numEq; ++i)
151 return true;
152 return false;
153 }
154
155protected:
157 {
161 };
162
163 std::array<StaggeredFreeFlowBoundaryInfo, numEq> boundaryInfo_;
164};
165
166} // end namespace Dumux
167
168#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:37
Class to specify the type of a boundary condition for the staggered Navier-Stokes model.
Definition: discretization/staggered/freeflow/boundarytypes.hh:38
void setAllSymmetry()
Sets a symmetry boundary condition for all equations.
Definition: discretization/staggered/freeflow/boundarytypes.hh:63
bool isBJS(unsigned eqIdx) const
Returns true if an equation is used to specify a Beavers-Joseph-Saffman boundary condition.
Definition: discretization/staggered/freeflow/boundarytypes.hh:123
bool isBeaversJoseph(unsigned eqIdx) const
Returns true if an equation is used to specify a Beavers-Joseph(-Saffman) boundary condition.
Definition: discretization/staggered/freeflow/boundarytypes.hh:132
void setAllNeumann()
Prevent setting all boundary conditions to Neumann.
Definition: discretization/staggered/freeflow/boundarytypes.hh:92
std::array< StaggeredFreeFlowBoundaryInfo, numEq > boundaryInfo_
Definition: discretization/staggered/freeflow/boundarytypes.hh:163
void setAllDirichlet()
Prevent setting all boundary conditions to Dirichlet.
Definition: discretization/staggered/freeflow/boundarytypes.hh:83
void resetEq(int eqIdx)
Reset the boundary types for one equation.
Definition: discretization/staggered/freeflow/boundarytypes.hh:51
bool hasBJS() const
Returns true if some equation is used to specify a Beavers-Joseph-Saffman boundary condition.
Definition: discretization/staggered/freeflow/boundarytypes.hh:140
StaggeredFreeFlowBoundaryTypes()
Definition: discretization/staggered/freeflow/boundarytypes.hh:42
void setBeaversJoseph(unsigned eqIdx)
Set a boundary condition for a single equation to Beavers-Joseph(-Saffmann) (special case of Dirichle...
Definition: discretization/staggered/freeflow/boundarytypes.hh:109
bool isSymmetry() const
Returns true if the there is a symmetry boundary condition.
Definition: discretization/staggered/freeflow/boundarytypes.hh:76
void setBJS(int eqIdx)
Set a boundary condition for a single equation to Beavers-Joseph-Saffman (special case of Dirichlet b...
Definition: discretization/staggered/freeflow/boundarytypes.hh:102
bool hasBeaversJoseph() const
Returns true if some equation is used to specify a Beavers-Joseph(-Saffman) boundary condition.
Definition: discretization/staggered/freeflow/boundarytypes.hh:147
Definition: discretization/staggered/freeflow/boundarytypes.hh:157
bool visited
Definition: discretization/staggered/freeflow/boundarytypes.hh:158
bool isBeaversJoseph
Definition: discretization/staggered/freeflow/boundarytypes.hh:160
bool isSymmetry
Definition: discretization/staggered/freeflow/boundarytypes.hh:159
Class to specify the type of a boundary.