| 412 | } |
| 413 | |
| 414 | int 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 | |
| 442 | int ParticleGroup::pointlist(VDouble &pointdata) { |
| 443 | int ndm = OPS_GetNDM(); |
no test coverage detected