3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
freeflow/navierstokes/momentum/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_MOMENTUM_BOUNDARY_TYPES_HH
25#define FREEFLOW_NAVIERSTOKES_MOMENTUM_BOUNDARY_TYPES_HH
26
28
29namespace Dumux {
30
35template <int size>
37{
39
40public:
42 {
43 for (int eqIdx=0; eqIdx < size; ++eqIdx)
44 resetEq(eqIdx);
45 }
46
50 void resetEq(const int eqIdx)
51 {
53
54 boundaryInfo_[eqIdx].isSymmetry = false;
55 boundaryInfo_[eqIdx].isBeaversJoseph = false;
56 }
57
62 {
63 for (int eqIdx=0; eqIdx < size; ++eqIdx)
64 {
65 resetEq(eqIdx);
66 boundaryInfo_[eqIdx].isSymmetry = true;
67 }
68 }
69
73 bool isSymmetry() const
74 { return boundaryInfo_[0].isSymmetry; }
75
80 void setBeaversJoseph(const int eqIdx)
81 {
82 resetEq(eqIdx);
83 boundaryInfo_[eqIdx].isBeaversJoseph = true;
84 }
85
92 bool isBeaversJoseph(const int eqIdx) const
93 { return boundaryInfo_[eqIdx].isBeaversJoseph; }
94
99 bool hasBeaversJoseph() const
100 {
101 for (int i = 0; i < size; ++i)
103 return true;
104 return false;
105 }
106
107protected:
110 {
111 bool isSymmetry : 1;
113 };
114
115 std::array<NavierStokesBoundaryInfo, size> boundaryInfo_;
116};
117
118} // end namespace Dumux
119
120#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
static constexpr int size()
we have a boundary condition for each equation
Definition: common/boundarytypes.hh:44
Class to specify the type of a boundary condition for the Navier-Stokes model.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:37
void setAllSymmetry()
Sets a symmetry boundary condition for all equations.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:61
void resetEq(const int eqIdx)
Reset the boundary types for one equation.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:50
void setBeaversJoseph(const int eqIdx)
Set a boundary condition for a single equation to Beavers-Joseph(-Saffmann) (special case of Dirichle...
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:80
NavierStokesMomentumBoundaryTypes()
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:41
bool isBeaversJoseph(const int eqIdx) const
Returns true if an equation is used to specify a Beavers-Joseph(-Saffman) boundary condition.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:92
std::array< NavierStokesBoundaryInfo, size > boundaryInfo_
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:115
bool hasBeaversJoseph() const
Returns true if some equation is used to specify a Beavers-Joseph(-Saffman) boundary condition.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:99
bool isSymmetry() const
Returns true if the there is a symmetry boundary condition.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:73
use bitfields to minimize the size
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:110
bool isBeaversJoseph
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:112
bool isSymmetry
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:111
Class to specify the type of a boundary.