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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151 | class Interface
{
public:
int zoneid;
std::vector<int> zoneList;
std::vector<int> global_faceids;
std::vector<int> local_faceids;
std::vector<int> ijk_ghosts;
std::vector<int> ijk_donors;
std::vector<double> data_recv;
std::vector<double> data_send;
public:
std::vector<int> neighbor_donor_zones;
std::vector<std::vector<int>> neighbor_donorfaces;
std::vector<int> send_zones;
std::vector<std::vector<int>> send_donorfaces;
};
neighbor_donor_zones;
neighbor_donorfaces;
{
int donor_zoneid;
std::vector<int> donorfaces;
}
---------------------------------
send
zone0 zone2 zone1 zone3
| 0 | 2 | 1 | 3 |
globalfaceid
0 1 2
zone0:
donor zone2 donorfaces(0)
zone0->send_geom(zone=2,facelist(0)) :
zone2->recv_geom(zone=0,facelist(0));
zone2->get_value(facelist(0),valuelist(200));
zone2->send_value(zone=0,valuelist(200));
zone0->recv_value(zone=2,valuelist(200))
zone1:
donor zone2 donorfaces(1)
zone1->send_geom(zone=2,facelist(1)) :
zone2->recv_geom(zone=1,facelist(1));
zone2->get_value(facelist(0),valuelist(201));
zone2->send_value(zone=1,valuelist(201));
zone1->recv_value(zone=2,valuelist(201))
donor zone3 donorfaces(2)
zone1->sendgeom(zone=3,facelist(2)) :
zone3->recv_geom(zone=1,facelist(2));
zone3->get_value(facelist(2),valuelist(302));
zone3->send_value(zone=1,valuelist(302));
zone1->recv_value(zone=3,valuelist(302));
zone2:
donor zone0 donorfaces(0)
zone2->sendgeom(zone=0,facelist(0)) :
zone0->recv_geom(zone=2,facelist(0));
zone0->get_value(facelist(0),valuelist(000));
zone0->send_value(zone=2,valuelist(000));
zone2->recv_value(zone=0,valuelist(000));
donor zone1 donorfaces(1)
zone2->sendgeom(zone=1,facelist(1)) :
zone1->recv_geom(zone=2,facelist(1));
zone1->get_value(facelist(1),valuelist(201));
zone1->send_value(zone=2,valuelist(201));
zone2->recv_value(zone=1,valuelist(201));
zone3:
donor zone1 donorfaces(2)
zone3->sendgeom(zone=1,facelist(2)) :
zone1->recv_geom(zone=3,facelist(2));
zone1->get_value(facelist(2),valuelist(102));
zone1->send_value(zone=3,valuelist(102));
zone3->recv_value(zone=1,valuelist(102));
int nZones = Global::grids.size();
for ( int iZone = 0; iZone < nZones; ++ iZone )
{
Interface * interface = Global::interfaces[ iZone ];
std::vector<std::vector<int>> & neighbor_donorfaces = interface->neighbor_donorfaces;
std::vector<int> &neighbor_donor_zones = interface->neighbor_donor_zones;
int ndonor_zones = neighbor_donor_zones.size();
std::cout << "zone = " << iZone << " donorzone = ";
for ( int iNei = 0; iNei < ndonor_zones; ++ iNei )
{
int donorzone = neighbor_donor_zones[ iNei ];
std::cout << donorzone;
if( iNei != ndonor_zones - 1 )
{
std::cout << ",";
}
}
std::cout << "\n";
for ( int iNei = 0; iNei < ndonor_zones; ++ iNei )
{
int donorzone = neighbor_donor_zones[ iNei ];
std::cout << "donorzone = " << donorzone << " donorfaces = ";
std::vector<int> & neighbor_donorface = neighbor_donorfaces[ iNei ];
int ndonorfaces = neighbor_donorface.size();
for ( int idonorface = 0; idonorface < ndonorfaces; ++ idonorface )
{
std::cout << neighbor_donorface[ idonorface ];
if( idonorface != ndonorfaces - 1 )
{
std::cout << ",";
}
}
std::cout << "\n";
}
std::cout << "\n";
}
---------------------------------
zone = 0 donorzone = 2
donorzone = 2 donorfaces = 0
zone = 1 donorzone = 2,3
donorzone = 2 donorfaces = 1
donorzone = 3 donorfaces = 2
zone = 2 donorzone = 0,1
donorzone = 0 donorfaces = 0
donorzone = 1 donorfaces = 1
zone = 3 donorzone = 1
donorzone = 1 donorfaces = 2
---------------------------------
recv
zone0 zone2 zone1 zone3
| 0 | 2 | 1 | 3 |
globalfaceid
0 1 2
zone0:
recv from zone2 donorfaces(0): zone2: donorfaces (0)
zone1:
recv from zone2 donorfaces(1): zone2: donorfaces (1)
recv from zone3 donorfaces(2): zone2: donorfaces (2)
zone2:
recv from zone0 donorfaces(0): zone0: donorfaces (0)
recv from zone1 donorfaces(1): zone2: donorfaces (1)
zone3:
recv from zone1 donorfaces(2): zone1: donorfaces (2)
|