GCC Code Coverage Report


Directory: ./
File: Core/fluidToMaster.cpp
Date: 2024-04-14 07:32:34
Exec Total Coverage
Lines: 99 125 79.2%
Branches: 63 136 46.3%

Line Branch Exec Source
1 #if defined(FELISCE_WITH_PVM) || defined(FELISCE_WITH_ZEROMQ)
2
3 #include <Core/fluidToMaster.hpp>
4 #include <Core/felisceParam.hpp>
5 #include <cstdlib>
6 namespace felisce {
7
8 #ifdef FELISCE_WITH_PVM
9 6 FluidToMaster::FluidToMaster(int fsiStatus,
10 int nbCoor,
11 std::vector<int>& match,
12 std::vector<double>& disp_master,
13 std::vector<double>& velo_master,
14 std::vector<double>& lumpMmaster,
15 std::vector<double>& force_fluid,
16 6 std::vector<double>& velo_fluid):
17 #endif
18 #ifdef FELISCE_WITH_ZEROMQ
19 FluidToMaster::FluidToMaster(int fsiStatus,
20 int nbCoor,
21 std::vector<int>& match,
22 std::vector<double>& disp_master,
23 std::vector<double>& velo_master,
24 std::vector<double>& lumpMmaster,
25 std::vector<double>& force_fluid,
26 std::vector<double>& velo_fluid,
27 std::string socketTransport,std::string socketAddress,std::string socketPort):
28 #endif
29 6 m_nbCoor(nbCoor),
30 6 m_nbNodeFSI(0),
31 6 m_ntdlfConf(0),
32 #ifdef FELISCE_WITH_PVM
33 6 m_masterID(0),
34 #endif
35 #ifdef FELISCE_WITH_ZEROMQ
36 m_socketTransport(socketTransport),
37 m_socketAddress(socketAddress),
38 m_socketPort(socketPort),
39 m_zmq_context(1),
40 m_socket(m_zmq_context, ZMQ_PAIR),
41 #endif
42 6 m_fsiStatus(fsiStatus),
43 6 m_match(match),
44 6 m_disp_master(disp_master),
45 6 m_velo_master(velo_master),
46 6 m_lumpMmaster(lumpMmaster),
47 6 m_force_fluid(force_fluid),
48 6 m_velo_fluid(velo_fluid),
49 6 m_dt(0.0)
50 6 {}
51
52 #ifdef FELISCE_WITH_ZEROMQ
53 void FluidToMaster::recvZEROMQ_default(zmq::message_t &msg, void * data, std::size_t sizeData)
54 {
55 // default correspond to used the flags zmq::recv_flags::none
56 zmq::recv_result_t recvResult = m_socket.recv( msg, zmq::recv_flags::none);
57 memcpy( data, msg.data(),sizeData);
58 if( recvResult != sizeData){
59 FEL_ASSERT( recvResult == sizeData );
60 }
61 }
62 #endif
63
64 // dispm_master, velo_master, lumpMmaster, force_fluid, velo_fluid have the correct size (i.e., nbCoor * nbNodeFSI)
65
66 3 void FluidToMaster::setMaster() {
67 #ifdef FELISCE_WITH_PVM
68 3 m_masterID = pvm_parent();
69
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if( m_masterID == PvmNoParent )
70 {
71 std::cout << " I am a poor lonesome job\n ";
72 exit(1);
73 }
74
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 else if( m_masterID == 0 )
75 {
76 std::cout << "PVM is not ok\n";
77 exit(1);
78 }
79
80 3 std::cout <<"%%%%%%%%%%% \n";
81 3 std::cout << " I am the slave " << pvm_mytid()<< std::endl;
82 3 std::cout << " My master is " << m_masterID << std::endl;
83 #endif
84 #ifdef FELISCE_WITH_ZEROMQ
85 std::string socket_endpoint;
86 if(m_socketPort != "")
87 socket_endpoint = m_socketTransport + "://" + m_socketAddress + ":" + m_socketPort;
88 else
89 socket_endpoint = m_socketTransport + "://" + m_socketAddress;
90
91 std::cout << "[ZeroMQ] Connect to " << socket_endpoint << std::endl;
92 if ( zmq_connect(m_socket,socket_endpoint.c_str()) != 0 ) {
93 std::cout << "Problem while connecting to : " << socket_endpoint << std::endl;
94 exit(1);
95 }
96 #endif
97 3 }
98
99 542 void FluidToMaster::sdToMasterFSI() {
100
101 static int ipass=0;
102 542 int nt = 3*m_nbNodeFSI;
103 542 double vref=1.;
104
105
2/4
✓ Branch 1 taken 542 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 542 times.
✗ Branch 5 not taken.
542 std::cout << "---> Fluid sends data to Master\n" << std::endl;
106
107 #ifdef FELISCE_WITH_PVM
108
1/2
✓ Branch 1 taken 542 times.
✗ Branch 2 not taken.
542 pvm_initsend(PvmDataDefault);
109
1/2
✓ Branch 1 taken 542 times.
✗ Branch 2 not taken.
542 pvm_pkint(&nt,1,1);
110
111
2/4
✓ Branch 1 taken 542 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 542 times.
542 if ( FelisceParam::instance().hasOldMaster ) {
112 for(int i=0; i<m_nbNodeFSI; ++i)
113 for(int j=0; j<m_nbCoor; ++j) {
114 m_vec1_master[3*i+j] = m_velo_fluid[m_nbCoor*i+j];
115 m_vec2_master[3*i+j] = m_force_fluid[m_nbCoor*i+j];
116 }
117
118 pvm_pkdouble(m_vec1_master.data(),nt,1);
119 pvm_pkdouble(m_vec2_master.data(),nt,1);
120 }
121 else {
122
2/2
✓ Branch 0 taken 62887 times.
✓ Branch 1 taken 542 times.
63429 for(int i=0; i<m_nbNodeFSI; ++i)
123
2/2
✓ Branch 0 taken 142994 times.
✓ Branch 1 taken 62887 times.
205881 for(int j=0; j<m_nbCoor; ++j) {
124 //m_vec1_master[3*i+j] = m_velo_fluid[m_nbCoor*i+j]; // uncoment for R-N iterations
125 142994 m_vec2_master[3*i+j] = m_force_fluid[m_nbCoor*i+j];
126 }
127
128 //pvm_pkdouble(m_vec1_master.data(),nt,1); // uncoment for R-N iterations
129
1/2
✓ Branch 2 taken 542 times.
✗ Branch 3 not taken.
542 pvm_pkdouble(m_vec2_master.data(),nt,1);
130 }
131
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 539 times.
542 if(!ipass){
132
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 pvm_pkdouble(&vref,1,1);
133 3 ipass = 1;
134 }
135
1/2
✓ Branch 1 taken 542 times.
✗ Branch 2 not taken.
542 pvm_send(m_masterID,120);
136 #endif
137 #ifdef FELISCE_WITH_ZEROMQ
138 zmq::message_t msg1(1*sizeof(int));
139 memcpy(msg1.data(),&nt,1*sizeof(int));
140 m_socket.send(msg1,zmq::send_flags::none);
141 //
142 if ( FelisceParam::instance().hasOldMaster ) {
143 for(int i=0; i<m_nbNodeFSI; ++i)
144 for(int j=0; j<m_nbCoor; ++j) {
145 m_vec1_master[3*i+j] = m_velo_fluid[m_nbCoor*i+j];
146 m_vec2_master[3*i+j] = m_force_fluid[m_nbCoor*i+j];
147 }
148
149 zmq::message_t msg2(nt*sizeof(double));
150 memcpy(msg2.data(),m_vec1_master.data(),nt*sizeof(double));
151 m_socket.send(msg2,zmq::send_flags::none);
152
153 zmq::message_t msg3(nt*sizeof(double));
154 memcpy(msg3.data(),m_vec2_master.data(),nt*sizeof(double));
155 m_socket.send(msg3,zmq::send_flags::none);
156 }
157 else {
158 for(int i=0; i<m_nbNodeFSI; ++i)
159 for(int j=0; j<m_nbCoor; ++j) {
160 //m_vec1_master[3*i+j] = m_velo_fluid[m_nbCoor*i+j]; // uncoment for R-N iterations
161 m_vec2_master[3*i+j] = m_force_fluid[m_nbCoor*i+j];
162 }
163 // zmq::message_t msg2(nt*sizeof(double)); // uncoment for R-N iterations
164 // memcpy(msg2.data(),m_vec1_master.data(),nt*sizeof(double)); // uncoment for R-N iterations
165 // m_socket.send(msg2,zmq::send_flags::none); // uncoment for R-N iterations
166
167 zmq::message_t msg3(nt*sizeof(double));
168 memcpy(msg3.data(),m_vec2_master.data(),nt*sizeof(double));
169 m_socket.send(msg3,zmq::send_flags::none);
170 }
171 if(!ipass){
172 zmq::message_t msg4(1*sizeof(double));
173 memcpy(msg4.data(),&vref,1*sizeof(double));
174 m_socket.send(msg4,zmq::send_flags::none);
175 ipass = 1;
176 }
177 #endif
178 542 }
179
180 548 void FluidToMaster::rvFromMasterFSI(int msg) {
181 548 std::cout << "<-- Fluid receives from Master\n" << std::endl;
182
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 545 times.
✗ Branch 3 not taken.
548 switch(msg){
183 case 99:
184 {
185 std::cout << " -- Fluid Receives Message 99\n" << std::endl;
186 #ifdef FELISCE_WITH_PVM
187 pvm_recv(m_masterID,99);
188 pvm_upkint(&m_hasLumpedMass,1,1);
189 std::cout << " m_hasLumpedMass = " << m_hasLumpedMass << std::endl;
190 pvm_upkint(&m_dimLumpMass,1,1);
191 if ( (m_dimLumpMass != 3*m_nbNodeFSI) && m_hasLumpedMass ){
192 std::cout << "In rvFromMasterFSI(msg=99) m_dimLumpMass != 3*m_nbNodeFSI " << m_dimLumpMass << " " << 3*m_nbNodeFSI << std::endl;
193 exit(1);
194 }
195 pvm_upkdouble(m_vec1_master.data(),3*m_nbNodeFSI,1);
196 #endif
197 #ifdef FELISCE_WITH_ZEROMQ
198 zmq::message_t msg1;
199 recvZEROMQ_default(msg1, &m_hasLumpedMass, 1*sizeof(int));
200 // zmq::recv_result_t recvResult1 = m_socket.recv(msg1,recv_flags_none);
201 // FEL_ASSERT( recvResult1 == sizeof(int) );
202 // memcpy(&m_hasLumpedMass,msg1.data(),1*sizeof(int));
203 std::cout << " m_hasLumpedMass = " << m_hasLumpedMass << std::endl;
204
205 zmq::message_t msg2;
206 recvZEROMQ_default(msg2, &m_dimLumpMass, 1*sizeof(int));
207 // zmq::recv_result_t recvResult2 = m_socket.recv(msg2,recv_flags_none);
208 // FEL_ASSERT(recvResult2 == sizeof(int) );
209 // memcpy(&m_dimLumpMass,msg2.data(),1*sizeof(int));
210
211 if ( (m_dimLumpMass != 3*m_nbNodeFSI) && m_hasLumpedMass ){
212 std::cout << "In rvFromMasterFSI(msg=99) m_dimLumpMass != 3*m_nbNodeFSI " << m_dimLumpMass << " " << 3*m_nbNodeFSI << std::endl;
213 exit(1);
214 }
215 zmq::message_t msg3;
216 recvZEROMQ_default(msg3, m_vec1_master.data(), 3*m_nbNodeFSI*sizeof(double));
217 // zmq::recv_result_t recvResult3 = m_socket.recv(msg3,recv_flags_none);
218 // FEL_ASSERT( recvResult3 == 3*m_nbNodeFSI*sizeof(double) );
219 // memcpy(m_vec1_master.data(),msg3.data(),3*m_nbNodeFSI*sizeof(double));
220 #endif
221 // reduce to true size
222 for(int i=0; i<m_nbNodeFSI; ++i)
223 for(int j=0; j<m_nbCoor; ++j)
224 m_lumpMmaster[m_nbCoor*i+j] = m_vec1_master[3*i+j];
225 }
226 break;
227 3 case 140:
228 {
229
2/4
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
3 std::cout << " -- Fluid Receives Message 140\n" << std::endl;
230 int nnifsConf, nnifsIm, nnifsCrack, ntdlfIm, ntdlfCrack ;
231 #ifdef FELISCE_WITH_PVM
232
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 pvm_recv(m_masterID,140);
233
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 pvm_upkint(&nnifsConf,1,1);
234
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 pvm_upkint(&nnifsIm,1,1);
235
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 pvm_upkint(&nnifsCrack,1,1);
236
237 3 m_nbNodeFSI= nnifsConf + nnifsIm;
238
239
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 m_match.resize(m_nbNodeFSI);
240
241
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 pvm_upkint(&m_ntdlfConf,1,1);
242
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 pvm_upkint(&ntdlfIm,1,1);
243
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 pvm_upkint(&ntdlfCrack,1,1);
244
1/2
✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
3 pvm_upkint(m_match.data(),nnifsConf,1);
245 #endif
246 #ifdef FELISCE_WITH_ZEROMQ
247 zmq::message_t msg1;
248 recvZEROMQ_default(msg1, &nnifsConf, 1*sizeof(int));
249 // zmq::recv_result_t recvResult1 = m_socket.recv(msg1,recv_flags_none);
250 // FEL_ASSERT(recvResult1 == sizeof(int) );
251 // memcpy(&nnifsConf,msg1.data(),1*sizeof(int));
252 //
253 zmq::message_t msg2;
254 recvZEROMQ_default(msg2, &nnifsIm, 1*sizeof(int));
255 // zmq::recv_result_t recvResult2 = m_socket.recv(msg2,recv_flags_none);
256 // FEL_ASSERT(recvResult2 == sizeof(int) );
257 // memcpy(&nnifsIm,msg2.data(),1*sizeof(int));
258 //
259 zmq::message_t msg3;
260 recvZEROMQ_default(msg3,&nnifsCrack,1*sizeof(int));
261 // zmq::recv_result_t recvResult3 = m_socket.recv(msg3,recv_flags_none);
262 // FEL_ASSERT(recvResult3 == sizeof(int) );
263 // memcpy(&nnifsCrack,msg3.data(),1*sizeof(int));
264 //
265 m_nbNodeFSI= nnifsConf + nnifsIm;
266
267 m_match.resize(m_nbNodeFSI);
268 //
269 zmq::message_t msg4;
270 recvZEROMQ_default(msg4,&m_ntdlfConf,1*sizeof(int));
271 // zmq::recv_result_t recvResult4 = m_socket.recv(msg4,recv_flags_none);
272 // FEL_ASSERT(recvResult4 == sizeof(int) );
273 // memcpy(&m_ntdlfConf,msg4.data(),1*sizeof(int));
274 //
275 zmq::message_t msg5;
276 recvZEROMQ_default(msg5,&ntdlfIm,1*sizeof(int));
277 // zmq::recv_result_t recvResult5 = m_socket.recv(msg5,recv_flags_none);
278 // FEL_ASSERT(recvResult5 == sizeof(int) );
279 // memcpy(&ntdlfIm,msg5.data(),1*sizeof(int));
280 //
281 zmq::message_t msg6;
282 recvZEROMQ_default(msg6,&ntdlfCrack,1*sizeof(int));
283 // zmq::recv_result_t recvResult6 = m_socket.recv(msg6,recv_flags_none);
284 // FEL_ASSERT(recvResult6 == sizeof(int) );
285 // memcpy(&ntdlfCrack,msg6.data(),1*sizeof(int));
286 //
287 zmq::message_t msg7;
288 recvZEROMQ_default(msg7,m_match.data(),nnifsConf*sizeof(int));
289 // zmq::recv_result_t recvResult7 = m_socket.recv(msg7,recv_flags_none);
290 // FEL_ASSERT(recvResult7 == nnifsConf*sizeof(int) );
291 // memcpy(m_match.data(),msg7.data(),nnifsConf*sizeof(int));
292 #endif
293
3/6
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
3 std::cout << "--> Nodes FSI:" << m_nbNodeFSI <<std::endl;
294
295
296
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 m_vec1_master.resize(3*m_nbNodeFSI);
297
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 m_vec2_master.resize(3*m_nbNodeFSI);
298
299
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 m_disp_master.resize(m_nbCoor*m_nbNodeFSI);
300
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 m_velo_master.resize(m_nbCoor*m_nbNodeFSI);
301
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 m_force_fluid.resize(m_nbCoor*m_nbNodeFSI);
302
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 m_velo_fluid.resize(m_nbCoor*m_nbNodeFSI);
303
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 m_lumpMmaster.resize(m_nbCoor*m_nbNodeFSI);
304
305
2/2
✓ Branch 0 taken 3728 times.
✓ Branch 1 taken 3 times.
3731 for(int i=0; i< m_nbCoor * m_nbNodeFSI; ++i) {
306 3728 m_disp_master[i] = 0.;
307 3728 m_velo_master[i] = 0.;
308 3728 m_force_fluid[i] = 0.;
309 3728 m_velo_fluid[i] = 0.;
310 3728 m_lumpMmaster[i] = 0.;
311 }
312
313
2/2
✓ Branch 0 taken 3870 times.
✓ Branch 1 taken 3 times.
3873 for(int i=0; i< 3 * m_nbNodeFSI; ++i) {
314 3870 m_vec1_master[i] = 0.;
315 3870 m_vec2_master[i] = 0.;
316 }
317 3 break;
318 }
319 545 case 110:
320 {
321
2/4
✓ Branch 1 taken 545 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 545 times.
✗ Branch 5 not taken.
545 std::cout << "Fluid Receives Message 110\n" << std::endl;
322 int ntdlf;
323 #ifdef FELISCE_WITH_PVM
324
1/2
✓ Branch 1 taken 545 times.
✗ Branch 2 not taken.
545 pvm_recv(m_masterID,110);
325
1/2
✓ Branch 1 taken 545 times.
✗ Branch 2 not taken.
545 pvm_upkint(&m_fsiStatus,1,1);
326
4/8
✓ Branch 1 taken 545 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 545 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 545 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 545 times.
✗ Branch 11 not taken.
545 std::cout << "-----> fsiStatus = " << m_fsiStatus << std::endl << std::endl;
327
328
2/2
✓ Branch 0 taken 542 times.
✓ Branch 1 taken 3 times.
545 if(m_fsiStatus>=0){
329
330
1/2
✓ Branch 1 taken 542 times.
✗ Branch 2 not taken.
542 pvm_upkdouble(&m_dt,1,1);
331
1/2
✓ Branch 1 taken 542 times.
✗ Branch 2 not taken.
542 pvm_upkint(&ntdlf,1,1);
332
333
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 542 times.
542 if(ntdlf != 3*m_nbNodeFSI)
334 std::cout << "rv: ntdlf = " << ntdlf << " 3*nbNodeFSI ="
335 << 3*m_nbNodeFSI << std::endl;
336
337
1/2
✓ Branch 2 taken 542 times.
✗ Branch 3 not taken.
542 pvm_upkdouble(m_vec1_master.data(),3*m_nbNodeFSI,1);
338
1/2
✓ Branch 2 taken 542 times.
✗ Branch 3 not taken.
542 pvm_upkdouble(m_vec2_master.data(),3*m_nbNodeFSI,1);
339
2/2
✓ Branch 0 taken 62887 times.
✓ Branch 1 taken 542 times.
63429 for(int i=0; i<m_nbNodeFSI; ++i)
340
2/2
✓ Branch 0 taken 142994 times.
✓ Branch 1 taken 62887 times.
205881 for(int j=0; j<m_nbCoor; ++j) {
341 142994 m_disp_master[m_nbCoor*i+j] = m_vec1_master[3*i+j];
342 142994 m_velo_master[m_nbCoor*i+j] = m_vec2_master[3*i+j];
343 }
344 }
345 #endif
346 #ifdef FELISCE_WITH_ZEROMQ
347 zmq::message_t msg1;
348 recvZEROMQ_default(msg1,&m_fsiStatus,1*sizeof(int));
349 //m_socket.recv(msg1,recv_flags_none);
350 // zmq::recv_result_t recvResult1 = m_socket.recv(msg1,recv_flags_none);
351 // FEL_ASSERT( recvResult1 == sizeof(int) );
352 // memcpy(&m_fsiStatus,msg1.data(),1*sizeof(int));
353 std::cout << "-----> fsiStatus = " << m_fsiStatus << std::endl << std::endl;
354
355 if(m_fsiStatus>=0){
356 zmq::message_t msg2;
357 recvZEROMQ_default(msg2,&m_dt,1*sizeof(double));
358 //m_socket.recv(msg2,recv_flags_none);
359 // zmq::recv_result_t recvResult2 = m_socket.recv(msg2,recv_flags_none);
360 // FEL_ASSERT(recvResult2 == sizeof(double) );
361 // memcpy(&m_dt,msg2.data(),1*sizeof(double));
362
363 //
364 zmq::message_t msg3;
365 recvZEROMQ_default(msg3,&ntdlf,1*sizeof(int));
366 // zmq::recv_result_t recvResult3 = m_socket.recv(msg3,recv_flags_none);
367 // FEL_ASSERT(recvResult3 == sizeof(int) );
368 // memcpy(&ntdlf,msg3.data(),1*sizeof(int));
369 //
370 if(ntdlf != 3*m_nbNodeFSI)
371 std::cout << "rv: ntdlf = " << ntdlf << " 3*nbNodeFSI ="
372 << 3*m_nbNodeFSI << std::endl;
373 //
374
375 zmq::message_t msg4;
376 recvZEROMQ_default(msg4,m_vec1_master.data(),3*m_nbNodeFSI*sizeof(double));
377 // zmq::recv_result_t recvResult4 = m_socket.recv(msg4,recv_flags_none);
378 // FEL_ASSERT( recvResult4 == 3*m_nbNodeFSI*sizeof(double) );
379 // memcpy(m_vec1_master.data(),msg4.data(),3*m_nbNodeFSI*sizeof(double));
380 //
381 zmq::message_t msg5;
382 recvZEROMQ_default(msg5,m_vec2_master.data(),3*m_nbNodeFSI*sizeof(double));
383 // zmq::recv_result_t recvResult5 = m_socket.recv(msg5,recv_flags_none);
384 // FEL_ASSERT( recvResult5 == 3*m_nbNodeFSI*sizeof(double) );
385 // memcpy(m_vec2_master.data(),msg5.data(),3*m_nbNodeFSI*sizeof(double));
386 //
387 for(int i=0; i<m_nbNodeFSI; ++i)
388 for(int j=0; j<m_nbCoor; ++j) {
389 m_disp_master[m_nbCoor*i+j] = m_vec1_master[3*i+j];
390 m_velo_master[m_nbCoor*i+j] = m_vec2_master[3*i+j];
391 }
392 }
393 #endif
394 }
395 }
396 548 }
397
398 3 void FluidToMaster::sdInterfCoorToMasterFSI() {
399
400 3 std::cout << "---> Fluid sends Interface Coor to Master\n" << std::endl;
401 #ifdef FELISCE_WITH_PVM
402 3 pvm_initsend(PvmDataDefault);
403 3 pvm_pkint(&m_ntdlfConf,1,1);
404
405 3 pvm_pkdouble(m_vec1_master.data(),m_ntdlfConf,1);
406
407 3 pvm_send(m_masterID,125);
408 #endif
409 #ifdef FELISCE_WITH_ZEROMQ
410 zmq::message_t msg1(1*sizeof(int));
411 memcpy(msg1.data(),&m_ntdlfConf,1*sizeof(int));
412 m_socket.send(msg1,zmq::send_flags::none);
413 //
414 zmq::message_t msg2(m_ntdlfConf*sizeof(double));
415 memcpy(msg2.data(),m_vec1_master.data(),m_ntdlfConf*sizeof(double));
416 m_socket.send(msg2,zmq::send_flags::none);
417 //
418 #endif
419
420 3 }
421
422 545 double FluidToMaster::timeStep() {return m_dt;}
423
424 3 int FluidToMaster::nbNodes() {return m_nbNodeFSI;}
425
426 3 int FluidToMaster::hasLumpedMass() {return m_hasLumpedMass;}
427
428 545 int FluidToMaster::status() {return m_fsiStatus;}
429
430 }
431
432 #endif
433
434
435