OpenLB 1.8.1
Loading...
Searching...
No Matches
rtlbm.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2017-2019 Albert Mink, Adrian Kummerlaender
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24#ifndef DESCRIPTOR_DEFINITION_RTLBM_H
25#define DESCRIPTOR_DEFINITION_RTLBM_H
26
27#include "utilities/omath.h"
28
29namespace olb {
30
31namespace descriptors {
32
33namespace tag {
34
35struct RTLBM : public CATEGORY, public DESCRIPTOR_TAG { };
36
37}
38
39
40namespace rtlbm_data {
41
43
44template <unsigned D, unsigned Q>
46
47template <unsigned D, unsigned Q>
49
50template <>
52 0,
53 {1, 6}, {1, 6}, {1, 6},
54 {1, 6}, {1, 6}, {1, 6}
55};
56
57template <>
59 0.0,
60 1.0, 1.0, 1.0,
61 1.0, 1.0, 1.0
62};
63
64template <>
66 0,
67 {1, 15}, {1, 15}, {1, 15},
68 {3, 40}, {3, 40}, {3, 40}, {3, 40},
69 {1, 15}, {1, 15}, {1, 15},
70 {3, 40}, {3, 40}, {3, 40}, {3, 40}
71};
72
73template <>
75 0.0,
76 1.0, 1.0, 1.0,
77 1.73205080757, 1.73205080757, 1.73205080757, 1.73205080757,
78 1.0, 1.0, 1.0,
79 1.73205080757, 1.73205080757, 1.73205080757, 1.73205080757
80};
81
82template <>
84 0,
85
86 {1, 21}, {1, 21}, {1, 21},
87 {4, 105}, {4, 105}, {4, 105},
88 {4, 105}, {4, 105}, {4, 105},
89 {9, 280}, {9, 280}, {9, 280}, {9, 280},
90
91 {1, 21}, {1, 21}, {1, 21},
92 {4, 105}, {4, 105}, {4, 105},
93 {4, 105}, {4, 105}, {4, 105},
94 {9, 280}, {9, 280}, {9, 280}, {9, 280}
95};
96
97template <>
99 0.0,
100 1.0, 1.0, 1.0,
101 1.41421356237, 1.41421356237, 1.41421356237,
102 1.41421356237, 1.41421356237, 1.41421356237,
103 1.73205080757, 1.73205080757, 1.73205080757, 1.73205080757,
104 1.0, 1.0, 1.0,
105 1.41421356237, 1.41421356237, 1.41421356237,
106 1.41421356237, 1.41421356237, 1.41421356237,
107 1.73205080757, 1.73205080757, 1.73205080757, 1.73205080757
108};
109
110}
111
112template <typename T, unsigned D, unsigned Q>
113constexpr T t(unsigned iPop, tag::RTLBM)
114{
115 return rtlbm_data::t<D,Q>[iPop].template as<T>();
116}
117
118template <typename T, unsigned D, unsigned Q>
119constexpr T norm_c(unsigned iPop, tag::RTLBM)
120{
121 return T{rtlbm_data::norm_c<D,Q>[iPop]};
122}
123
124template <typename T, typename DESCRIPTOR>
125constexpr T norm_c(unsigned iPop)
126{
127 return norm_c<T, DESCRIPTOR::d, DESCRIPTOR::q>(iPop, typename DESCRIPTOR::category_tag());
128}
129
130} // namespace descriptors
131
132} // namespace olb
133
134#endif
Floating-point independent fraction type.
Definition fraction.h:34
platform_constant Fraction t[Q]
Definition rtlbm.h:45
platform_constant_definition Fraction t< 3, 7 >[7]
Definition rtlbm.h:51
platform_constant_definition Fraction t< 3, 15 >[15]
Definition rtlbm.h:65
platform_constant_definition double norm_c< 3, 27 >[27]
Definition rtlbm.h:98
platform_constant double norm_c[Q]
Definition rtlbm.h:48
platform_constant_definition double norm_c< 3, 7 >[7]
Definition rtlbm.h:58
platform_constant_definition Fraction t< 3, 27 >[27]
Definition rtlbm.h:83
platform_constant_definition double norm_c< 3, 15 >[15]
Definition rtlbm.h:74
constexpr T t(unsigned iPop, tag::CUM) any_platform
Definition cum.h:108
constexpr T norm_c(unsigned iPop, tag::RTLBM)
Definition rtlbm.h:119
Top level namespace for all of OpenLB.
#define platform_constant_definition
Definition platform.h:79
#define platform_constant
Definition platform.h:78
Base of a descriptor tag.
Definition tag.h:39
Base of all tags describing the category of a descriptor.
Definition tag.h:59