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

Function getNDM

SRC/tcl/commands.cpp:7190–7222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7188}
7189
7190int
7191getNDM(ClientData clientData, Tcl_Interp* interp, int argc, TCL_Char** argv)
7192{
7193 int ndm;
7194
7195 if (argc > 1) {
7196 int tag;
7197 if (Tcl_GetInt(interp, argv[1], &tag) != TCL_OK) {
7198 opserr << "WARNING getNDM nodeTag? \n";
7199 return TCL_ERROR;
7200 }
7201 Node* theNode = theDomain.getNode(tag);
7202 if (theNode == 0) {
7203 opserr << "WARNING nodeTag " << tag << " does not exist \n";
7204 return TCL_ERROR;
7205 }
7206 const Vector& coords = theNode->getCrds();
7207 ndm = coords.Size();
7208 } else {
7209 if (theBuilder == 0) {
7210 return TCL_OK;
7211 }
7212 else {
7213 ndm = OPS_GetNDM();
7214 }
7215 }
7216
7217 char buffer[20];
7218 sprintf(buffer, "%d", ndm);
7219 Tcl_AppendResult(interp, buffer, NULL);
7220
7221 return TCL_OK;
7222}
7223
7224int
7225getNDF(ClientData clientData, Tcl_Interp* interp, int argc, TCL_Char** argv)

Callers

nothing calls this directly

Calls 4

getCrdsMethod · 0.80
OPS_GetNDMFunction · 0.50
getNodeMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected