3.1-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
45 for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
46 resetEq(eqIdx);
47 }
48
52 void resetEq(int eqIdx)
53 {
55
56 boundaryInfo_[eqIdx].visited = false;
57 boundaryInfo_[eqIdx].isSymmetry = false;
58 boundaryInfo_[eqIdx].isBJS = false;
59 }
60
65 {
66 for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
67 {
68 resetEq(eqIdx);
69 boundaryInfo_[eqIdx].visited = true;
70 boundaryInfo_[eqIdx].isSymmetry = true;
71 }
72 }
73
77 bool isSymmetry() const
78 { return boundaryInfo_[0].isSymmetry; }
79
83 template<class T = void>
85 {
86 static_assert(AlwaysFalse<T>::value, "Setting all boundary types to Dirichlet not permitted!");
87 }
88
92 template<class T = void>
94 {
95 static_assert(AlwaysFalse<T>::value, "Setting all boundary types to Neumann not permitted!");
96 }
97
102 void setBJS(int eqIdx)
103 {
104 resetEq(eqIdx);
105 boundaryInfo_[eqIdx].visited = true;
106 boundaryInfo_[eqIdx].isBJS = true;
107 }
108
115 bool isBJS(unsigned eqIdx) const
116 {
117 return boundaryInfo_[eqIdx].isBJS;
118 }
119
124 bool hasBJS() const
125 {
126 for (int i = 0; i < numEq; ++i)
127 if (boundaryInfo_[i].isBJS)
128 return true;
129 return false;
130 }
131
132protected:
136 bool isBJS;
137 };
138
139 std::array<StaggeredFreeFlowBoundaryInfo, numEq> boundaryInfo_;
140};
141
142} // end namespace Dumux
143
144#endif
make the local view function available whenever we use the grid geometry
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 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:64
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:115
void setAllNeumann()
Prevent setting all boundary conditions to Neumann.
Definition: discretization/staggered/freeflow/boundarytypes.hh:93
std::array< StaggeredFreeFlowBoundaryInfo, numEq > boundaryInfo_
Definition: discretization/staggered/freeflow/boundarytypes.hh:139
void setAllDirichlet()
Prevent setting all boundary conditions to Dirichlet.
Definition: discretization/staggered/freeflow/boundarytypes.hh:84
void resetEq(int eqIdx)
Reset the boundary types for one equation.
Definition: discretization/staggered/freeflow/boundarytypes.hh:52
bool hasBJS() const
Returns true if some equation is used to specify a Beavers-Joseph-Saffman boundary condition.
Definition: discretization/staggered/freeflow/boundarytypes.hh:124
StaggeredFreeFlowBoundaryTypes()
Definition: discretization/staggered/freeflow/boundarytypes.hh:42
bool isSymmetry() const
Returns true if the there is a symmetry boundary condition.
Definition: discretization/staggered/freeflow/boundarytypes.hh:77
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
Definition: discretization/staggered/freeflow/boundarytypes.hh:133
bool visited
Definition: discretization/staggered/freeflow/boundarytypes.hh:134
bool isBJS
Definition: discretization/staggered/freeflow/boundarytypes.hh:136
bool isSymmetry
Definition: discretization/staggered/freeflow/boundarytypes.hh:135
Class to specify the type of a boundary.