OpenLB
1.8.1
Loading...
Searching...
No Matches
src
refinement
fields.h
Go to the documentation of this file.
1
/* This file is part of the OpenLB library
2
*
3
* Copyright (C) 2024 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 REFINEMENT_FIELDS_H
25
#define REFINEMENT_FIELDS_H
26
27
#include "
descriptor/fields.h
"
28
29
namespace
olb
{
30
31
namespace
fields::refinement {
32
33
struct
CELL_ID_COARSE
:
public
descriptors::TYPED_FIELD_BASE
<CellID,1> { };
34
struct
CELL_ID_FINE
:
public
descriptors::TYPED_FIELD_BASE
<CellID,1> { };
35
36
struct
NORMAL
:
public
descriptors::FIELD_BASE
<0,1> { };
37
38
struct
PREV_RHO
:
public
descriptors::FIELD_BASE
<1> { };
39
struct
PREV_U
:
public
descriptors::FIELD_BASE
<0,1> { };
40
struct
PREV_FNEQ
:
public
descriptors::FIELD_BASE
<0,0,1> { };
41
43
struct
CONTEXT_NEIGHBORS
:
public
descriptors::NEIGHBOR_FIELD
{
44
template
<
typename
T>
45
using
value_type
=
CellID
;
46
47
template
<
typename
T>
48
using
column_type
=
AbstractColumn<int>
;
49
50
template
<
typename
DESCRIPTOR>
51
requires
(DESCRIPTOR::d == 2)
52
static
constexpr
auto
count
()
any_platform
{
53
return
descriptors::q<descriptors::D2Q9<>
>()-1;
54
}
55
56
template
<
typename
DESCRIPTOR>
57
requires
(DESCRIPTOR::d == 2)
58
static
constexpr
auto
c
(
unsigned
i)
any_platform
{
59
return
descriptors::c<descriptors::D2Q9<>
>(i+1);
60
}
61
62
template
<
typename
DESCRIPTOR>
63
requires
(DESCRIPTOR::d == 3)
64
static
constexpr
auto
count
()
any_platform
{
65
return
descriptors::q<descriptors::D3Q27<>
>()-1;
66
}
67
68
template
<
typename
DESCRIPTOR>
69
requires
(DESCRIPTOR::d == 3)
70
static
constexpr
auto
c
(
unsigned
i)
any_platform
{
71
return
descriptors::c<descriptors::D3Q27<>
>(i+1);
72
}
73
74
};
75
76
}
77
78
namespace
refinement {
79
80
template
<
typename
DESCRIPTOR>
81
using
DATA_DESCRIPTOR
=
descriptors::LATTICE_DESCRIPTOR
<DESCRIPTOR::d, DESCRIPTOR::q,
82
fields::refinement::CELL_ID_COARSE
,
83
fields::refinement::CELL_ID_FINE
84
>;
85
86
}
87
88
}
89
90
#endif
fields.h
olb::descriptors::q
constexpr int q() any_platform
Definition
functions.h:140
olb::descriptors::c
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition
functions.h:83
olb
Top level namespace for all of OpenLB.
Definition
advectionDiffusionDirichlet.h:27
olb::CellID
std::uint32_t CellID
Type for sequential block-local cell indices.
Definition
blockStructure.h:36
any_platform
#define any_platform
Define preprocessor macros for device-side functions, constant storage.
Definition
platform.h:77
olb::AbstractColumn< int >
olb::descriptors::FIELD_BASE
Base of a field whose size is defined by [C_0,C_1,C_2]^T * [1,D,Q].
Definition
fields.h:52
olb::descriptors::LATTICE_DESCRIPTOR
Base descriptor of a D-dimensional lattice with Q directions and a list of additional fields.
Definition
base.h:95
olb::descriptors::NEIGHBOR_FIELD
Definition
fields.h:111
olb::descriptors::TYPED_FIELD_BASE
Base of a descriptor field of scalar TYPE.
Definition
fields.h:132
olb::fields::refinement::CELL_ID_COARSE
Definition
fields.h:33
olb::fields::refinement::CELL_ID_FINE
Definition
fields.h:34
olb::fields::refinement::CONTEXT_NEIGHBORS
Field for storing indices to context data neighbors.
Definition
fields.h:43
olb::fields::refinement::CONTEXT_NEIGHBORS::count
static constexpr auto count() any_platform
Definition
fields.h:64
olb::fields::refinement::CONTEXT_NEIGHBORS::count
static constexpr auto count() any_platform
Definition
fields.h:52
olb::fields::refinement::CONTEXT_NEIGHBORS::c
static constexpr auto c(unsigned i) any_platform
Definition
fields.h:70
olb::fields::refinement::CONTEXT_NEIGHBORS::c
static constexpr auto c(unsigned i) any_platform
Definition
fields.h:58
olb::fields::refinement::CONTEXT_NEIGHBORS::value_type
CellID value_type
Definition
fields.h:45
olb::fields::refinement::NORMAL
Definition
fields.h:36
olb::fields::refinement::PREV_FNEQ
Definition
fields.h:40
olb::fields::refinement::PREV_RHO
Definition
fields.h:38
olb::fields::refinement::PREV_U
Definition
fields.h:39
Generated on Sat May 17 2025 10:47:59 for OpenLB by
1.12.0