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

Function findID

SRC/tcl/commands.cpp:6741–6777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6739
6740
6741int
6742findID(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv)
6743{
6744 // make sure at least one other argument to contain type of system
6745 if (argc < 2) {
6746 opserr << "WARNING want - findNodesWithID ?id\n";
6747 return TCL_ERROR;
6748 }
6749
6750 int tag;
6751
6752 if (Tcl_GetInt(interp, argv[1], &tag) != TCL_OK) {
6753 opserr << "WARNING eleForce eleTag? dof? - could not read nodeTag? \n";
6754 return TCL_ERROR;
6755 }
6756
6757 NodeIter &theNodes = theDomain.getNodes();
6758 Node *theNode;
6759 char buffer[20] ={0};
6760
6761
6762 while ((theNode = theNodes()) != 0) {
6763 DOF_Group *theGroup = theNode->getDOF_GroupPtr();
6764 if (theGroup != 0) {
6765 const ID &nodeID = theGroup->getID();
6766 for (int i=0; i<nodeID.Size(); i++) {
6767 if (nodeID(i) == tag) {
6768 sprintf(buffer, "%d ", theNode->getTag());
6769 Tcl_AppendResult(interp, buffer, NULL);
6770 break;
6771 }
6772 }
6773 }
6774 }
6775
6776 return TCL_OK;
6777}
6778
6779int
6780nodeCoord(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv)

Callers

nothing calls this directly

Calls 5

getNodesMethod · 0.80
getIDMethod · 0.80
getDOF_GroupPtrMethod · 0.45
SizeMethod · 0.45
getTagMethod · 0.45

Tested by

no test coverage detected