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

Function OPS_getEleLoadData

SRC/interpreter/OpenSeesOutputCommands.cpp:3805–3874  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3803}
3804
3805int OPS_getEleLoadData()
3806{
3807 Domain* theDomain = OPS_GetDomain();
3808 if (theDomain == 0) return -1;
3809
3810 int numdata = OPS_GetNumRemainingInputArgs();
3811
3812 std::vector <double> data;
3813
3814 if (numdata < 1) {
3815 LoadPattern *thePattern;
3816 LoadPatternIter &thePatterns = theDomain->getLoadPatterns();
3817
3818 int typeEL;
3819
3820 while ((thePattern = thePatterns()) != 0) {
3821 ElementalLoadIter &theEleLoads = thePattern->getElementalLoads();
3822 ElementalLoad* theLoad;
3823
3824 while ((theLoad = theEleLoads()) != 0) {
3825 const Vector &eleLoadData = theLoad->getData(typeEL, 1.0);
3826
3827 int eleLoadDataSize = eleLoadData.Size();
3828 for (int i = 0; i < eleLoadDataSize; i++) {
3829 data.push_back(eleLoadData(i));
3830 }
3831 }
3832 }
3833
3834 } else if (numdata == 1) {
3835
3836 int patternTag;
3837 if (OPS_GetIntInput(&numdata, &patternTag) < 0) {
3838 opserr << "could not read patternTag\n";
3839 return -1;
3840 }
3841
3842 LoadPattern* thePattern = theDomain->getLoadPattern(patternTag);
3843 if (thePattern == nullptr) {
3844 opserr << "ERROR load pattern with tag " << patternTag << " not found in domain -- getEleLoadData\n";
3845 return -1;
3846 }
3847 ElementalLoadIter& theEleLoads = thePattern->getElementalLoads();
3848 ElementalLoad* theLoad;
3849
3850 int typeEL;
3851
3852 while ((theLoad = theEleLoads()) != 0) {
3853 const Vector &eleLoadData = theLoad->getData(typeEL, 1.0);
3854
3855 int eleLoadDataSize = eleLoadData.Size();
3856 for (int i = 0; i < eleLoadDataSize; i++) {
3857 data.push_back(eleLoadData(i));
3858 }
3859 }
3860
3861 } else {
3862 opserr << "WARNING want - getEleLoadData <patternTag?>\n";

Callers 2

Tcl_ops_getEleLoadDataFunction · 0.85
Py_ops_getEleLoadDataFunction · 0.85

Calls 10

push_backMethod · 0.80
OPS_GetDomainFunction · 0.70
OPS_GetIntInputFunction · 0.70
OPS_SetDoubleOutputFunction · 0.70
getDataMethod · 0.45
SizeMethod · 0.45
getLoadPatternMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected