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

Method sendSelf

SRC/material/nD/InitStressNDMaterial.cpp:331–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331int
332InitStressNDMaterial::sendSelf(int cTag, Channel &theChannel)
333{
334 if (theMaterial == 0) {
335 opserr << "InitStressNDMaterial::sendSelf() - theMaterial is null, nothing to send" << endln;
336 return -1;
337 }
338
339 int dbTag = this->getDbTag();
340
341 static ID dataID(5);
342 dataID(0) = this->getTag();
343 dataID(1) = theMaterial->getClassTag();
344 int matDbTag = theMaterial->getDbTag();
345 if ( matDbTag == 0) {
346 matDbTag = theChannel.getDbTag();
347 theMaterial->setDbTag(matDbTag);
348 }
349 dataID(2) = matDbTag;
350 if (theChannel.sendID(dbTag, cTag, dataID) < 0) {
351 opserr << "InitStressNDMaterial::sendSelf() - failed to send the ID\n";
352 return -1;
353 }
354 dataID(3) = numDim;
355 int order = theMaterial->getOrder();
356 dataID(4) = order;
357
358 Vector dataVec(2*order);
359 for (int i = 0; i < order; i++) {
360 dataVec(i) = sigInit(i);
361 dataVec(i+order) = epsInit(i);
362 }
363
364 if (theChannel.sendVector(dbTag, cTag, dataVec) < 0) {
365 opserr << "InitStressNDMaterial::sendSelf() - failed to send the Vector\n";
366 return -2;
367 }
368
369 if (theMaterial->sendSelf(cTag, theChannel) < 0) {
370 opserr << "InitStressNDMaterial::sendSelf() - failed to send the Material\n";
371 return -3;
372 }
373
374 return 0;
375}
376
377int
378InitStressNDMaterial::recvSelf(int cTag, Channel &theChannel,

Callers

nothing calls this directly

Calls 7

getDbTagMethod · 0.45
getTagMethod · 0.45
getClassTagMethod · 0.45
setDbTagMethod · 0.45
sendIDMethod · 0.45
getOrderMethod · 0.45
sendVectorMethod · 0.45

Tested by

no test coverage detected