version 3.8
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef FREEFLOW_NAVIERSTOKES_MOMENTUM_BOUNDARY_TYPES_HH
13#define FREEFLOW_NAVIERSTOKES_MOMENTUM_BOUNDARY_TYPES_HH
14
16
17namespace Dumux {
18
23template <int size>
25{
27
28public:
30 {
31 for (int eqIdx=0; eqIdx < size; ++eqIdx)
32 resetEq(eqIdx);
33 }
34
38 void resetEq(const int eqIdx)
39 {
41
42 boundaryInfo_[eqIdx].isSymmetry = false;
43 boundaryInfo_[eqIdx].isBeaversJoseph = false;
44 }
45
50 {
51 for (int eqIdx=0; eqIdx < size; ++eqIdx)
52 {
53 resetEq(eqIdx);
54 boundaryInfo_[eqIdx].isSymmetry = true;
55 }
56 }
57
61 bool isSymmetry() const
62 { return boundaryInfo_[0].isSymmetry; }
63
68 void setBeaversJoseph(const int eqIdx)
69 {
70 resetEq(eqIdx);
71 boundaryInfo_[eqIdx].isBeaversJoseph = true;
72 }
73
80 bool isBeaversJoseph(const int eqIdx) const
81 { return boundaryInfo_[eqIdx].isBeaversJoseph; }
82
87 bool hasBeaversJoseph() const
88 {
89 for (int i = 0; i < size; ++i)
91 return true;
92 return false;
93 }
94
95protected:
98 {
99 bool isSymmetry : 1;
101 };
102
103 std::array<NavierStokesBoundaryInfo, size> boundaryInfo_;
104};
105
106} // end namespace Dumux
107
108#endif
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:26
void resetEq(int eqIdx)
Reset the boundary types for one equation.
Definition: common/boundarytypes.hh:51
static constexpr int size()
we have a boundary condition for each equation
Definition: common/boundarytypes.hh:32
Class to specify the type of a boundary condition for the Navier-Stokes model.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:25
void setAllSymmetry()
Sets a symmetry boundary condition for all equations.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:49
void resetEq(const int eqIdx)
Reset the boundary types for one equation.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:38
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:68
NavierStokesMomentumBoundaryTypes()
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:29
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:80
std::array< NavierStokesBoundaryInfo, size > boundaryInfo_
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:103
bool hasBeaversJoseph() const
Returns true if some equation is used to specify a Beavers-Joseph(-Saffman) boundary condition.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:87
bool isSymmetry() const
Returns true if the there is a symmetry boundary condition.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:61
Class to specify the type of a boundary.
Definition: adapt.hh:17
use bitfields to minimize the size
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:98
bool isBeaversJoseph
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:100
bool isSymmetry
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:99