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

Function getEleLoadData

SRC/tcl/commands.cpp:9161–9225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9159}
9160
9161int
9162getEleLoadData(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv)
9163{
9164
9165 if (argc == 1) {
9166 LoadPattern *thePattern;
9167 LoadPatternIter &thePatterns = theDomain.getLoadPatterns();
9168
9169 char buffer[40];
9170 int typeEL;
9171
9172 while ((thePattern = thePatterns()) != 0) {
9173 ElementalLoadIter &theEleLoads = thePattern->getElementalLoads();
9174 ElementalLoad *theLoad;
9175
9176 while ((theLoad = theEleLoads()) != 0) {
9177 const Vector &eleLoadData = theLoad->getData(typeEL, 1.0);
9178
9179 int eleLoadDataSize = eleLoadData.Size();
9180 opserr << "eleLoadDataSize: "<< eleLoadDataSize << "\n";
9181 for (int i = 0; i < eleLoadDataSize; i++) {
9182 sprintf(buffer, "%35.20f ", eleLoadData(i));
9183 Tcl_AppendResult(interp, buffer, NULL);
9184 }
9185 }
9186 }
9187
9188 } else if (argc == 2) {
9189 int patternTag;
9190
9191 if (Tcl_GetInt(interp, argv[1], &patternTag) != TCL_OK) {
9192 opserr << "WARNING getEleLoadData -- could not read patternTag \n";
9193 return TCL_ERROR;
9194 }
9195
9196 LoadPattern *thePattern = theDomain.getLoadPattern(patternTag);
9197 if (thePattern == nullptr) {
9198 opserr << "ERROR load pattern with tag " << patternTag << " not found in domain -- getEleLoadData\n";
9199 return TCL_ERROR;
9200 }
9201
9202 ElementalLoadIter theEleLoads = thePattern->getElementalLoads();
9203 ElementalLoad* theLoad;
9204
9205 int typeEL;
9206 char buffer[40];
9207
9208 while ((theLoad = theEleLoads()) != 0) {
9209 const Vector &eleLoadData = theLoad->getData(typeEL, 1.0);
9210
9211 int eleLoadDataSize = eleLoadData.Size();
9212 for (int i = 0; i < eleLoadDataSize; i++) {
9213 sprintf(buffer, "%35.20f ", eleLoadData(i));
9214 Tcl_AppendResult(interp, buffer, NULL);
9215 }
9216
9217 }
9218

Callers

nothing calls this directly

Calls 3

getDataMethod · 0.45
SizeMethod · 0.45
getLoadPatternMethod · 0.45

Tested by

no test coverage detected