| 464 | // Method to add a Node to the model. |
| 465 | |
| 466 | bool |
| 467 | Domain::addNode(Node * node) |
| 468 | { |
| 469 | int nodTag = node->getTag(); |
| 470 | |
| 471 | TaggedObject *other = theNodes->getComponentPtr(nodTag); |
| 472 | if (other != 0) { |
| 473 | opserr << "Domain::addNode - node with tag " << nodTag << "already exists in model\n"; |
| 474 | return false; |
| 475 | } |
| 476 | |
| 477 | bool result = theNodes->addComponent(node); |
| 478 | if (result == true) { |
| 479 | node->setDomain(this); |
| 480 | this->domainChange(); |
| 481 | |
| 482 | // see if the physical bounds are changed |
| 483 | // note this assumes 0,0,0,0,0,0 as startup min,max values |
| 484 | const Vector &crds = node->getCrds(); |
| 485 | int dim = crds.Size(); |
| 486 | if (dim >= 1) { |
| 487 | double x = crds(0); |
| 488 | if (x < theBounds(0)) theBounds(0) = x; |
| 489 | if (x > theBounds(3)) theBounds(3) = x; |
| 490 | } |
| 491 | if (dim >= 2) { |
| 492 | double y = crds(1); |
| 493 | if (y < theBounds(1)) theBounds(1) = y; |
| 494 | if (y > theBounds(4)) theBounds(4) = y; |
| 495 | } |
| 496 | if (dim == 3) { |
| 497 | double z = crds(2); |
| 498 | if (z < theBounds(2)) theBounds(2) = z; |
| 499 | if (z > theBounds(5)) theBounds(5) = z; |
| 500 | } |
| 501 | |
| 502 | } else |
| 503 | opserr << "Domain::addNode - node with tag " << nodTag << "could not be added to container\n"; |
| 504 | |
| 505 | return result; |
| 506 | } |
| 507 | |
| 508 | |
| 509 | // void addSP_Constraint(SP_Constraint *); |
no test coverage detected