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

Method getDisplayCrds

SRC/domain/node/Node.cpp:2325–2370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2323}
2324
2325int
2326Node::getDisplayCrds(Vector &res, double fact, int mode)
2327{
2328 // Get all DOFs
2329 int ndm = Crd->Size();
2330 int resSize = res.Size();
2331
2332 if (resSize < ndm)
2333 return -1;
2334
2335 if (mode < 0) {
2336 int eigenMode = -mode;
2337 if ((theEigenvectors != 0) && ((*theEigenvectors).noCols() >= eigenMode)) {
2338 if (displayLocation != 0)
2339 for (int i = 0; i < ndm; i++)
2340 res(i) = (*displayLocation)(i) + (*theEigenvectors)(i, eigenMode - 1) * fact;
2341 else
2342 for (int i = 0; i < ndm; i++)
2343 res(i) = (*Crd)(i) + (*theEigenvectors)(i, eigenMode - 1) * fact;
2344 }
2345 }
2346 else {
2347 if (commitDisp != 0) {
2348 if (displayLocation != 0)
2349 for (int i = 0; i < ndm; i++)
2350 res(i) = (*displayLocation)(i) + (*commitDisp)(i) * fact;
2351 else
2352 for (int i = 0; i < ndm; i++)
2353 res(i) = (*Crd)(i) + (*commitDisp)(i) * fact;
2354 }
2355 else {
2356 if (displayLocation != 0)
2357 for (int i = 0; i < ndm; i++)
2358 res(i) = (*displayLocation)(i);
2359 else
2360 for (int i = 0; i < ndm; i++)
2361 res(i) = (*Crd)(i);
2362 }
2363 }
2364
2365 // zero rest
2366 for (int i = ndm; i < resSize; i++)
2367 res(i) = 0;
2368
2369 return 0;
2370}
2371
2372int
2373Node::setDisplayCrds(const Vector &theCrds)

Callers 15

displaySelfMethod · 0.95
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45

Calls 2

SizeMethod · 0.45
noColsMethod · 0.45

Tested by

no test coverage detected