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

Method line

SRC/element/PFEMElement/ParticleGroup.cpp:414–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414int ParticleGroup::line(const VDouble &p1, const VDouble &p2, int num,
415 const VDouble &vel0, double p0) {
416 if (num <= 0)
417 return 0;
418
419 if (p1.size() != p2.size())
420 return -1;
421
422 VDouble p1p2 = p2;
423 p1p2 -= p1;
424 p1p2 /= num;
425
426 VDouble crds(p1);
427 VDouble vel(crds.size());
428 for (int i = 0; i < (int) vel.size(); i++) {
429 if (i < (int) vel0.size()) {
430 vel[i] = vel0[i];
431 }
432 }
433
434 for (int i = 0; i <= num; i++) {
435 this->addParticle(crds, vel, p0);
436 crds += p1p2;
437 }
438
439 return 0;
440}
441
442int ParticleGroup::pointlist(VDouble &pointdata) {
443 int ndm = OPS_GetNDM();

Callers 2

qua_dMethod · 0.95
OPS_ParticleGroupFunction · 0.80

Calls 2

addParticleMethod · 0.95
sizeMethod · 0.45

Tested by

no test coverage detected