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

Method applyLoad

SRC/domain/pattern/UniformExcitation.cpp:302–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void
303UniformExcitation::applyLoad(double time)
304{
305 Domain *theDomain = this->getDomain();
306 if (theDomain == 0)
307 return;
308
309 NodeIter &theNodes = theDomain->getNodes();
310 Node *theNode;
311 while ((theNode = theNodes()) != 0) {
312 theNode->setNumColR(1);
313 const Vector &crds=theNode->getCrds();
314 int ndm = crds.Size();
315
316 if (ndm == 1) {
317 if (theDof < 1) {
318 theNode->setR(theDof, 0, fact);
319 }
320 }
321 else if (ndm == 2) {
322 if (theDof < 2) {
323 theNode->setR(theDof, 0, fact);
324 }
325 else if (theDof == 2) {
326 double xCrd = crds(0);
327 double yCrd = crds(1);
328 theNode->setR(0, 0, -fact*yCrd);
329 theNode->setR(1, 0, fact*xCrd);
330 theNode->setR(2, 0, fact);
331 }
332 }
333 else if (ndm == 3) {
334 if (theDof < 3) {
335 theNode->setR(theDof, 0, fact);
336 }
337 else if (theDof == 3) {
338 double yCrd = crds(1);
339 double zCrd = crds(2);
340 theNode->setR(1, 0, -fact*zCrd);
341 theNode->setR(2, 0, fact*yCrd);
342 theNode->setR(3, 0, fact);
343 }
344 else if (theDof == 4) {
345 double xCrd = crds(0);
346 double zCrd = crds(2);
347 theNode->setR(0, 0, fact*zCrd);
348 theNode->setR(2, 0, -fact*xCrd);
349 theNode->setR(4, 0, fact);
350 }
351 else if (theDof == 5) {
352 double xCrd = crds(0);
353 double yCrd = crds(1);
354 theNode->setR(0, 0, -fact*yCrd);
355 theNode->setR(1, 0, fact*xCrd);
356 theNode->setR(5, 0, fact);
357 }
358 }
359 }

Callers

nothing calls this directly

Calls 6

getNodesMethod · 0.80
getCrdsMethod · 0.80
getDomainMethod · 0.45
setNumColRMethod · 0.45
SizeMethod · 0.45
setRMethod · 0.45

Tested by

no test coverage detected