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

Method domainChanged

SRC/analysis/integrator/DistributedDisplacementControl.cpp:240–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238
239
240int
241DistributedDisplacementControl::domainChanged(void)
242{
243 // we first create the Vectors needed
244 AnalysisModel *theModel = this->getAnalysisModel();
245 LinearSOE *theLinSOE = this->getLinearSOE();
246 if (theModel == 0 || theLinSOE == 0) {
247 opserr << "WARNING DistributedDisplacementControl::update() ";
248 opserr << "No AnalysisModel or LinearSOE has been set\n";
249 return -1;
250 }
251
252 //int size = theModel->getNumEqn(); // ask model in case N+1 space
253 const Vector &b = theLinSOE->getB(); // ask model in case N+1 space
254 int size = b.Size();
255
256 // first we determine the id of the nodal dof
257 Domain *theDomain = theModel->getDomainPtr();
258 if (theDomain == 0) {
259 opserr << "BUG WARNING DistributedDisplacementControl::domainChanged() - no Domain associated!!";
260 return -1;
261 }
262
263 theDofID = -1;
264 Node *theNodePtr = theDomain->getNode(theNode);
265 if (theNodePtr != 0) {
266 DOF_Group *theGroup = theNodePtr->getDOF_GroupPtr();
267 if (theGroup == 0) {
268 opserr << "BUG DistributedDisplacementControl::domainChanged() - no DOF_Group associated with the node!!\n";
269 return -1;
270 }
271 const ID &theID = theGroup->getID();
272 if (theDof < 0 || theDof >= theID.Size()) {
273 opserr << "DistributedDisplacementControl::domainChanged() - not a valid dof " << theDof << endln;
274 return -1;
275 }
276 theDofID = theID(theDof);
277 if (theDofID < 0) {
278 opserr << "DistributedDisplacementControl::domainChanged() - constrained dof not a valid a dof\n";;
279 return -1;
280 }
281 }
282
283 static ID data(1);
284
285 if (processID != 0) {
286 Channel *theChannel = theChannels[0];
287 data(0) = theDofID;
288
289 theChannel->sendID(0, 0, data);
290 theChannel->recvID(0, 0, data);
291 theDofID = data(0);
292 }
293
294 // if main domain, collect all theDofID if not -1 then this is the value & send value out
295 else {
296
297 for (int j=0; j<numChannels; j++) {

Callers

nothing calls this directly

Calls 15

exitFunction · 0.85
getBMethod · 0.80
getIDMethod · 0.80
getAnalysisModelMethod · 0.45
getLinearSOEMethod · 0.45
SizeMethod · 0.45
getDomainPtrMethod · 0.45
getNodeMethod · 0.45
getDOF_GroupPtrMethod · 0.45
sendIDMethod · 0.45
recvIDMethod · 0.45
getCurrentDomainTimeMethod · 0.45

Tested by

no test coverage detected