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

Method addNode

DEVELOPER/core/Domain.cpp:466–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464// Method to add a Node to the model.
465
466bool
467Domain::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 *);

Callers 5

recvSelfMethod · 0.95
OPS_NodeFunction · 0.45
mainFunction · 0.45
TclPlaneTruss_addNodeFunction · 0.45
mainFunction · 0.45

Calls 7

domainChangeMethod · 0.95
getCrdsMethod · 0.80
getTagMethod · 0.45
getComponentPtrMethod · 0.45
addComponentMethod · 0.45
setDomainMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected