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

Function OPS_getNodeLoadData

SRC/interpreter/OpenSeesOutputCommands.cpp:3934–4003  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3932}
3933
3934int OPS_getNodeLoadData()
3935{
3936 Domain* theDomain = OPS_GetDomain();
3937 if (theDomain == 0) return -1;
3938
3939 int numdata = OPS_GetNumRemainingInputArgs();
3940
3941 std::vector <double> data;
3942
3943 if (numdata < 1) {
3944 LoadPattern *thePattern;
3945 LoadPatternIter &thePatterns = theDomain->getLoadPatterns();
3946
3947 int typeEL;
3948
3949 while ((thePattern = thePatterns()) != 0) {
3950 NodalLoadIter &theNodLoads = thePattern->getNodalLoads();
3951 NodalLoad* theNodLoad;
3952
3953 while ((theNodLoad = theNodLoads()) != 0) {
3954 const Vector &nodeLoadData = theNodLoad->getData(typeEL);
3955
3956 int nodeLoadDataSize = nodeLoadData.Size();
3957 for (int i = 0; i < nodeLoadDataSize; i++) {
3958 data.push_back(nodeLoadData(i));
3959 }
3960 }
3961 }
3962
3963 } else if (numdata == 1) {
3964
3965 int patternTag;
3966 if (OPS_GetIntInput(&numdata, &patternTag) < 0) {
3967 opserr << "could not read patternTag\n";
3968 return -1;
3969 }
3970
3971 LoadPattern* thePattern = theDomain->getLoadPattern(patternTag);
3972 if (thePattern == nullptr) {
3973 opserr << "ERROR load pattern with tag " << patternTag << " not found in domain -- getNodeLoadData\n";
3974 return -1;
3975 }
3976 NodalLoadIter& theNodLoads = thePattern->getNodalLoads();
3977 NodalLoad* theNodLoad;
3978
3979 int typeEL;
3980
3981 while ((theNodLoad = theNodLoads()) != 0) {
3982 const Vector &nodeLoadData = theNodLoad->getData(typeEL);
3983
3984 int nodeLoadDataSize = nodeLoadData.Size();
3985 for (int i = 0; i < nodeLoadDataSize; i++) {
3986 data.push_back(nodeLoadData(i));
3987 }
3988 }
3989
3990 } else {
3991 opserr << "WARNING want - getNodeLoadData <patternTag?>\n";

Callers 2

Tcl_ops_getNodeLoadDataFunction · 0.85
Py_ops_getNodeLoadDataFunction · 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