-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.cpp
More file actions
41 lines (30 loc) · 988 Bytes
/
setup.cpp
File metadata and controls
41 lines (30 loc) · 988 Bytes
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
#include "idefix.hpp"
#include "setup.hpp"
// Initialisation routine. Can be used to allocate
// Arrays or variables which are used later on
Setup::Setup(Input &input, Grid &grid, DataBlock &data, Output &output) {
}
// This routine initialize the flow
// Note that data is on the device.
// One can therefore define locally
// a datahost and sync it, if needed
void Setup::InitFlow(DataBlock &data) {
// Create a host copy
DataBlockHost d(data);
for(int k = 0; k <= d.np_tot[KDIR] ; k++) {
for(int j = 0; j <= d.np_tot[JDIR] ; j++) {
for(int i = 0; i <= d.np_tot[IDIR] ; i++) {
d.Vc(RHO,k,j,i) = (d.x[IDIR](i)>HALF_F) ? 0.125 : 1.0;
d.Vc(VX1,k,j,i) = ZERO_F;
#if HAVE_ENERGY
d.Vc(PRS,k,j,i) = (d.x[IDIR](i)>HALF_F) ? 0.1 : 1.0;
#endif
}
}
}
// Send it all, if needed
d.SyncToDevice();
}
// Analyse data to produce an output
void MakeAnalysis(DataBlock & data) {
}