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

Function OPS_NodalLoad

SRC/interpreter/OpenSeesPatternCommands.cpp:140–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140int OPS_NodalLoad()
141{
142 Domain* theDomain = OPS_GetDomain();
143 if(theDomain == 0) {
144 opserr<<"WARNING: domain is not defined\n";
145 return -1;
146 }
147
148 int ndf = OPS_GetNumRemainingInputArgs()-1;
149 if(ndf < 1) {
150 opserr<<"insufficient number of args\n";
151 return -1;
152 }
153
154 // get node tag
155 int ndtag;
156 int numData = 1;
157 if(OPS_GetIntInput(&numData, &ndtag) < 0) {
158 opserr << "WARNING invalid node tag\n";
159 return -1;
160 }
161
162 // get load vector
163 Vector forces(ndf);
164 if(OPS_GetDoubleInput(&ndf, &forces(0)) < 0) {
165 opserr << "WARNING invalid load vector\n";
166 return -1;
167 }
168
169 // get options
170 bool isLoadConst = false;
171 bool userPattern = false;
172 int loadPatternTag = 0;
173 while(OPS_GetNumRemainingInputArgs() > 0) {
174 const char* type = OPS_GetString();
175 if(strcmp(type,"-const") == 0) {
176 isLoadConst = true;
177 } else if(strcmp(type,"-pattern") == 0) {
178 int numData = 1;
179 if(OPS_GetIntInput(&numData, &loadPatternTag) < 0) {
180 return -1;
181 }
182 userPattern = true;
183 }
184 }
185
186 // get the current pattern tag
187 LoadPattern* currPattern = theActiveLoadPattern;
188 if(userPattern == false) {
189 if(currPattern==0) {
190 opserr<<"WARNING: no current load pattern is set\n";
191 return -1;
192 }
193 loadPatternTag = currPattern->getTag();
194 }
195
196 // create the load
197 static int nodeLoadTag = 0;

Callers 3

Tcl_ops_nodalLoadFunction · 0.85
ops_addNodalLoadFunction · 0.85
Py_ops_nodalLoadFunction · 0.85

Calls 7

OPS_GetDomainFunction · 0.70
OPS_GetIntInputFunction · 0.70
OPS_GetDoubleInputFunction · 0.70
OPS_GetStringFunction · 0.70
getTagMethod · 0.45
addNodalLoadMethod · 0.45

Tested by

no test coverage detected