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

Function TclCommand_getNDM

SRC/runtime/commands/modeling/nodes.cpp:288–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286
287
288int
289TclCommand_getNDM(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char ** const argv)
290{
291 assert(clientData != nullptr);
292 BasicModelBuilder* builder = static_cast<BasicModelBuilder*>(clientData);
293 Domain *the_domain = builder->getDomain();
294
295 int ndm;
296
297 if (argc > 1) {
298 int tag;
299 if (Tcl_GetInt(interp, argv[1], &tag) != TCL_OK) {
300 opserr << OpenSees::PromptValueError << "ndm nodeTag? \n";
301 return TCL_ERROR;
302 }
303
304 Node *theNode = the_domain->getNode(tag);
305 if (theNode == nullptr) {
306 opserr << OpenSees::PromptValueError << "nodeTag " << tag << " does not exist \n";
307 return TCL_ERROR;
308 }
309 const Vector &coords = theNode->getCrds();
310 ndm = coords.Size();
311
312 } else {
313 ndm = builder->getNDM();
314 }
315
316 Tcl_SetObjResult(interp, Tcl_NewIntObj(ndm));
317 return TCL_OK;
318}
319
320int
321TclCommand_getNDF(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char ** const argv)

Callers

nothing calls this directly

Calls 5

getCrdsMethod · 0.80
getDomainMethod · 0.45
getNodeMethod · 0.45
SizeMethod · 0.45
getNDMMethod · 0.45

Tested by

no test coverage detected