-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscheme_wrapper.cpp
executable file
·59 lines (58 loc) · 2.28 KB
/
scheme_wrapper.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <map>
#include <vector>
#include "flowfield.h"
#include "scheme.h"
#include "ops_seq_v2.h"
#include "scheme_kernel.inc"
#ifdef OPS_3D
void Stream3D() {
#ifdef OPS_3D
for (const auto& idBlock : g_Block()) {
const Block& block{idBlock.second};
std::vector<int> iterRng;
iterRng.assign(block.WholeRange().begin(), block.WholeRange().end());
const int blockIndex{block.ID()};
for (const auto& compo : g_Components()) {
ops_par_loop(
KerStream3D, "KerStream3D", block.Get(), SpaceDim(),
iterRng.data(),
ops_arg_dat(g_f().at(blockIndex), NUMXI, LOCALSTENCIL, "double",
OPS_RW),
ops_arg_dat(g_fStage().at(blockIndex), NUMXI,
ONEPTLATTICESTENCIL, "double", OPS_READ),
ops_arg_dat(g_NodeType().at(compo.first).at(blockIndex), 1,
LOCALSTENCIL, "int", OPS_READ),
ops_arg_dat(g_GeometryProperty().at(blockIndex), 1,
LOCALSTENCIL, "int", OPS_READ),
ops_arg_gbl(compo.second.index, 2, "int", OPS_READ));
}
}
#endif // OPS_3Ds
}
#endif // OPS_3D
#ifdef OPS_2D
void Stream() {
#ifdef OPS_2D
for (const auto& idBlock : g_Block()) {
const Block& block{idBlock.second};
std::vector<int> iterRng;
iterRng.assign(block.WholeRange().begin(), block.WholeRange().end());
const int blockIndex{block.ID()};
for (const auto& compo : g_Components()) {
ops_par_loop(
KerStream, "KerStream", block.Get(), SpaceDim(),
iterRng.data(),
ops_arg_dat(g_f().at(blockIndex), NUMXI, LOCALSTENCIL, "double",
OPS_RW),
ops_arg_dat(g_fStage().at(blockIndex), NUMXI,
ONEPTLATTICESTENCIL, "double", OPS_READ),
ops_arg_dat(g_NodeType().at(compo.first).at(blockIndex), 1,
LOCALSTENCIL, "int", OPS_READ),
ops_arg_dat(g_GeometryProperty().at(blockIndex), 1,
LOCALSTENCIL, "int", OPS_READ),
ops_arg_gbl(compo.second.index, 2, "int", OPS_READ));
}
}
#endif // OPS_2D
}
#endif // OPS_2D