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

Function getNodeLoadData

SRC/tcl/commands.cpp:9279–9343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9277}
9278
9279int
9280getNodeLoadData(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv)
9281{
9282
9283 if (argc == 1) {
9284 LoadPattern *thePattern;
9285 LoadPatternIter &thePatterns = theDomain.getLoadPatterns();
9286
9287 char buffer[40];
9288 int typeEL;
9289
9290 while ((thePattern = thePatterns()) != 0) {
9291 NodalLoadIter &theNodeLoads = thePattern->getNodalLoads();
9292 NodalLoad *theNodLoad;
9293
9294 while ((theNodLoad = theNodeLoads()) != 0) {
9295 const Vector &eleLoadData = theNodLoad->getData(typeEL);
9296
9297 int eleLoadDataSize = eleLoadData.Size();
9298 opserr << "eleLoadDataSize: "<< eleLoadDataSize << "\n";
9299 for (int i = 0; i < eleLoadDataSize; i++) {
9300 sprintf(buffer, "%35.20f ", eleLoadData(i));
9301 Tcl_AppendResult(interp, buffer, NULL);
9302 }
9303 }
9304 }
9305
9306 } else if (argc == 2) {
9307 int patternTag;
9308
9309 if (Tcl_GetInt(interp, argv[1], &patternTag) != TCL_OK) {
9310 opserr << "WARNING getNodeLoadData -- could not read patternTag \n";
9311 return TCL_ERROR;
9312 }
9313
9314 LoadPattern *thePattern = theDomain.getLoadPattern(patternTag);
9315 if (thePattern == nullptr) {
9316 opserr << "ERROR load pattern with tag " << patternTag << " not found in domain -- getNodeLoadData\n";
9317 return TCL_ERROR;
9318 }
9319
9320 NodalLoadIter theNodeLoads = thePattern->getNodalLoads();
9321 NodalLoad* theNodLoad;
9322
9323 int typeEL;
9324 char buffer[40];
9325
9326 while ((theNodLoad = theNodeLoads()) != 0) {
9327 const Vector &eleLoadData = theNodLoad->getData(typeEL);
9328
9329 int eleLoadDataSize = eleLoadData.Size();
9330 for (int i = 0; i < eleLoadDataSize; i++) {
9331 sprintf(buffer, "%35.20f ", eleLoadData(i));
9332 Tcl_AppendResult(interp, buffer, NULL);
9333 }
9334
9335 }
9336

Callers

nothing calls this directly

Calls 3

getDataMethod · 0.45
SizeMethod · 0.45
getLoadPatternMethod · 0.45

Tested by

no test coverage detected