MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / sendSelf

Method sendSelf

SRC/domain/pattern/PeerMotion.cpp:326–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324
325
326int
327PeerMotion::sendSelf(int commitTag, Channel &theChannel)
328{
329 int dbTag = this->getDbTag();
330
331 Vector data(5);
332 data(0) = cFactor;
333 data(1) = dT;
334 data(2) = -1;
335
336 if (thePath != 0) {
337 int size = thePath->Size();
338 data(2) = size;
339 if (otherDbTag == 0)
340 otherDbTag = theChannel.getDbTag();
341 data(3) = otherDbTag;
342 }
343
344 if ((lastSendCommitTag == -1) && (theChannel.isDatastore() == 1)) {
345 lastSendCommitTag = commitTag;
346 }
347
348 data(4) = lastSendCommitTag;
349
350 int result = theChannel.sendVector(dbTag,commitTag, data);
351 if (result < 0) {
352 opserr << "PeerMotion::sendSelf() - channel failed to send data\n";
353 return result;
354 }
355
356 // we only send the vector data if this is the first time it is sent to the database
357 // or the channel is for sending the data to a remote process
358
359 if ((lastSendCommitTag == commitTag) || (theChannel.isDatastore() == 0)) {
360 if (thePath != 0) {
361 result = theChannel.sendVector(otherDbTag, commitTag, *thePath);
362 if (result < 0) {
363 opserr << "PeerMotion::sendSelf() - ";
364 opserr << "channel failed to send the Path Vector\n";
365 return result;
366 }
367 }
368 }
369
370 return 0;
371}
372
373
374int

Callers

nothing calls this directly

Calls 4

getDbTagMethod · 0.45
SizeMethod · 0.45
isDatastoreMethod · 0.45
sendVectorMethod · 0.45

Tested by

no test coverage detected