version 3.8
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// 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_MOMENTUM_INDICES_HH
13#define DUMUX_NAVIERSTOKES_MOMENTUM_INDICES_HH
14
15namespace Dumux {
16
23template <int dimension>
24struct NavierStokesMomentumIndices // TODO specialize for staggered / diamond / etc
25{
26 static constexpr int dimXIdx = 0;
27 static constexpr int dimYIdx = 1;
28 static constexpr int dimZIdx = 2;
29
30 static constexpr auto dim = dimension;
31
32 static constexpr int momentumXBalanceIdx = 0;
33 static constexpr int momentumYBalanceIdx = 1;
34 static constexpr int momentumZBalanceIdx = 2;
35
36 static constexpr int velocityXIdx = 0;
37 static constexpr int velocityYIdx = 1;
38 static constexpr int velocityZIdx = 2;
39
45 static constexpr int velocity(int dirIdx)
46 {
47 return dirIdx;
48 }
49
55 static constexpr int momentumBalanceIdx(int dirIdx)
56 {
57 return dirIdx;
58 }
59};
60
61} // end namespace Dumux
62
63#endif
Definition: adapt.hh:17
The common indices for the isothermal Navier-Stokes model.
Definition: freeflow/navierstokes/momentum/indices.hh:25
static constexpr int momentumXBalanceIdx
Index of the momentum balance equation.
Definition: freeflow/navierstokes/momentum/indices.hh:32
static constexpr int dimXIdx
Index of the x-component of a vector of size dim.
Definition: freeflow/navierstokes/momentum/indices.hh:26
static constexpr int dimZIdx
Index of the z-component of a vector of size dim.
Definition: freeflow/navierstokes/momentum/indices.hh:28
static constexpr auto dim
Definition: freeflow/navierstokes/momentum/indices.hh:30
static constexpr int dimYIdx
Index of the y-component of a vector of size dim.
Definition: freeflow/navierstokes/momentum/indices.hh:27
static constexpr int velocity(int dirIdx)
Index of the velocity in a solution vector given a certain direction.
Definition: freeflow/navierstokes/momentum/indices.hh:45
static constexpr int momentumBalanceIdx(int dirIdx)
Index of the momentum balance equation given the direction.
Definition: freeflow/navierstokes/momentum/indices.hh:55
static constexpr int velocityYIdx
Index of the velocity in a solution vector.
Definition: freeflow/navierstokes/momentum/indices.hh:37
static constexpr int momentumYBalanceIdx
Index of the momentum balance equation.
Definition: freeflow/navierstokes/momentum/indices.hh:33
static constexpr int velocityZIdx
Index of the velocity in a solution vector.
Definition: freeflow/navierstokes/momentum/indices.hh:38
static constexpr int momentumZBalanceIdx
Index of the momentum balance equation.
Definition: freeflow/navierstokes/momentum/indices.hh:34
static constexpr int velocityXIdx
Index of the velocity in a solution vector.
Definition: freeflow/navierstokes/momentum/indices.hh:36