3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
freeflow/navierstokes/momentum/indices.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 DUMUX_NAVIERSTOKES_MOMENTUM_INDICES_HH
25#define DUMUX_NAVIERSTOKES_MOMENTUM_INDICES_HH
26
27namespace Dumux {
28
35template <int dimension>
36struct NavierStokesMomentumIndices // TODO specialize for staggered / diamond / etc
37{
38 static constexpr int dimXIdx = 0;
39 static constexpr int dimYIdx = 1;
40 static constexpr int dimZIdx = 2;
41
42 static constexpr auto dim = dimension;
43
44 static constexpr int momentumXBalanceIdx = 0;
45 static constexpr int momentumYBalanceIdx = 1;
46 static constexpr int momentumZBalanceIdx = 2;
47
48 static constexpr int velocityXIdx = 0;
49 static constexpr int velocityYIdx = 1;
50 static constexpr int velocityZIdx = 2;
51
57 static constexpr int velocity(int dirIdx)
58 {
59 return dirIdx;
60 }
61
67 static constexpr int momentumBalanceIdx(int dirIdx)
68 {
69 return dirIdx;
70 }
71};
72
73} // end namespace Dumux
74
75#endif
Definition: adapt.hh:29
The common indices for the isothermal Navier-Stokes model.
Definition: freeflow/navierstokes/momentum/indices.hh:37
static constexpr int momentumXBalanceIdx
Index of the momentum balance equation.
Definition: freeflow/navierstokes/momentum/indices.hh:44
static constexpr int dimXIdx
Index of the x-component of a vector of size dim.
Definition: freeflow/navierstokes/momentum/indices.hh:38
static constexpr int dimZIdx
Index of the z-component of a vector of size dim.
Definition: freeflow/navierstokes/momentum/indices.hh:40
static constexpr auto dim
Definition: freeflow/navierstokes/momentum/indices.hh:42
static constexpr int dimYIdx
Index of the y-component of a vector of size dim.
Definition: freeflow/navierstokes/momentum/indices.hh:39
static constexpr int velocity(int dirIdx)
Index of the velocity in a solution vector given a certain direction.
Definition: freeflow/navierstokes/momentum/indices.hh:57
static constexpr int momentumBalanceIdx(int dirIdx)
Index of the momentum balance equation given the direction.
Definition: freeflow/navierstokes/momentum/indices.hh:67
static constexpr int velocityYIdx
Index of the velocity in a solution vector.
Definition: freeflow/navierstokes/momentum/indices.hh:49
static constexpr int momentumYBalanceIdx
Index of the momentum balance equation.
Definition: freeflow/navierstokes/momentum/indices.hh:45
static constexpr int velocityZIdx
Index of the velocity in a solution vector.
Definition: freeflow/navierstokes/momentum/indices.hh:50
static constexpr int momentumZBalanceIdx
Index of the momentum balance equation.
Definition: freeflow/navierstokes/momentum/indices.hh:46
static constexpr int velocityXIdx
Index of the velocity in a solution vector.
Definition: freeflow/navierstokes/momentum/indices.hh:48