version 3.10-dev
freeflow/navierstokes/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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_NAVIERSTOKES_INDICES_HH
13#define DUMUX_NAVIERSTOKES_INDICES_HH
14
15namespace Dumux {
16
23template <int dimension>
25{
26 static constexpr int dimXIdx = 0;
27 static constexpr int dimYIdx = 1;
28 static constexpr int dimZIdx = 2;
29
30 static constexpr int conti0EqIdx = dimension;
31 static constexpr int pressureIdx = conti0EqIdx;
32
33 static constexpr auto dim = dimension;
34
35 static constexpr int momentumXBalanceIdx = 0;
36 static constexpr int momentumYBalanceIdx = 1;
37 static constexpr int momentumZBalanceIdx = 2;
38
39 static constexpr int velocityXIdx = 0;
40 static constexpr int velocityYIdx = 1;
41 static constexpr int velocityZIdx = 2;
42
48 static constexpr int velocity(int dirIdx)
49 {
50 return dirIdx;
51 }
52};
53
54} // end namespace Dumux
55
56#endif
Definition: adapt.hh:17
The common indices for the isothermal Navier-Stokes model.
Definition: freeflow/navierstokes/indices.hh:25
static constexpr int momentumXBalanceIdx
Index of the momentum balance equation.
Definition: freeflow/navierstokes/indices.hh:35
static constexpr int dimXIdx
Index of the x-component of a vector of size dim.
Definition: freeflow/navierstokes/indices.hh:26
static constexpr int pressureIdx
Index of the pressure in a solution vector.
Definition: freeflow/navierstokes/indices.hh:31
static constexpr int velocityYIdx
Index of the velocity in a solution vector.
Definition: freeflow/navierstokes/indices.hh:40
static constexpr auto dim
Definition: freeflow/navierstokes/indices.hh:33
static constexpr int dimYIdx
Index of the y-component of a vector of size dim.
Definition: freeflow/navierstokes/indices.hh:27
static constexpr int momentumZBalanceIdx
Index of the momentum balance equation.
Definition: freeflow/navierstokes/indices.hh:37
static constexpr int velocity(int dirIdx)
Index of the velocity in a solution vector given a certain direction.
Definition: freeflow/navierstokes/indices.hh:48
static constexpr int conti0EqIdx
Index of the total mass balance equation.
Definition: freeflow/navierstokes/indices.hh:30
static constexpr int velocityZIdx
Index of the velocity in a solution vector.
Definition: freeflow/navierstokes/indices.hh:41
static constexpr int dimZIdx
Index of the z-component of a vector of size dim.
Definition: freeflow/navierstokes/indices.hh:28
static constexpr int momentumYBalanceIdx
Index of the momentum balance equation.
Definition: freeflow/navierstokes/indices.hh:36
static constexpr int velocityXIdx
Index of the velocity in a solution vector.
Definition: freeflow/navierstokes/indices.hh:39