| 238 | |
| 239 | |
| 240 | int |
| 241 | DistributedDisplacementControl::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++) { |
nothing calls this directly
no test coverage detected