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

Method recvSelf

SRC/domain/pattern/MultiSupportPattern.cpp:240–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240int
241MultiSupportPattern::recvSelf(int commitTag, Channel &theChannel,
242 FEM_ObjectBroker &theBroker)
243{
244 // get my current database tag
245 // NOTE - dbTag equals 0 if not sending to a database OR has not yet been sent
246 int myDbTag = this->getDbTag();
247
248 if (this->LoadPattern::recvSelf(commitTag, theChannel, theBroker) < 0) {
249 opserr << "MultiSupportPattern::recvSelf() - LoadPattern class failed in sendSelf()";
250 return -1;
251 }
252
253 // clear out the all the components in the current load pattern
254 if (theMotions != 0) {
255 for (int i=0; i<numMotions; i++)
256 if (theMotions[i] != 0)
257 delete theMotions[i];
258 delete [] theMotions;
259 numMotions = 0;
260 }
261
262 //
263 // now we rebuild the motions
264 //
265
266 static ID myData(3);
267 if (theChannel.recvID(myDbTag, commitTag, myData) < 0) {
268 opserr << "MultiSupportPattern::sendSelf - channel failed to send the initial ID\n";
269 return -1;
270 }
271
272 numMotions = myData(0);
273 dbMotions = myData(1);
274
275 if (numMotions != 0) {
276 ID motionData(numMotions*3);
277
278 // now send the ID
279 if (theChannel.recvID(dbMotions, commitTag, motionData) < 0) {
280 opserr << "MultiSupportPattern::sendSelf - channel failed to send the NodalLoads ID\n";
281 return -4;
282 }
283
284 theMotions = new GroundMotion *[numMotions];
285 for (int i=0; i<numMotions; i++)
286 theMotions[i] = 0;
287
288 if (theMotions == 0) {
289 opserr << "MultiSupportPattern::recvSelf() - out of memory\n";
290 return -1;
291 }
292
293 GroundMotion *theMotion;
294 for (int i=0; i<numMotions; i++) {
295 int motionClassTag = motionData(i*3);
296
297 theMotion = theBroker.getNewGroundMotion(motionClassTag);

Callers

nothing calls this directly

Calls 4

getDbTagMethod · 0.45
recvIDMethod · 0.45
getNewGroundMotionMethod · 0.45
setDbTagMethod · 0.45

Tested by

no test coverage detected