-
Notifications
You must be signed in to change notification settings - Fork 8
/
globalDomains.cpp
61 lines (45 loc) · 1.41 KB
/
globalDomains.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
60
61
#include "fvmhd3d.h"
namespace fvmhd3d
{
globalDomains::globalDomains() {};
globalDomains::globalDomains(CkMigrateMessage *msg) {}
void globalDomains::setDomains(const CkVec<boundary> &bnd, CkCallback &cb)
{
assert(numElements == (int)bnd.size());
proc_domains.resize(numElements);
for (int i = 0; i < numElements; i++)
proc_domains[i] = bnd[i];
const int node_n = (int)(numElements * 100.0/NLEAF);
proc_tree.clear();
proc_tree.set_domain(
boundary(
global_domain.centre() - global_domain.hsize()*1.5,
global_domain.centre() + global_domain.hsize()*1.5));
proc_tree.insert(&proc_domains[0], numElements, 0, node_n);
proc_tree.root.inner_boundary();
contribute(cb);
}
void globalDomains::pup(PUP::er &p)
{
CBase_globalDomains::pup(p);
int n = proc_domains.size();
p|n;
if (p.isUnpacking())
{
proc_domains.resize(n);
assert(n == numElements);
}
PUParray(p, &proc_domains[0], numElements);
if (p.isUnpacking())
{
const int node_n = (int)(numElements * 100.0/NLEAF);
proc_tree.clear();
proc_tree.set_domain(
boundary(
global_domain.centre() - global_domain.hsize()*1.5,
global_domain.centre() + global_domain.hsize()*1.5));
proc_tree.insert(&proc_domains[0], numElements, 0, node_n);
proc_tree.root.inner_boundary();
}
}
}