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

Method convectParticle

SRC/element/PFEMElement/BackgroundMesh.cpp:3531–3641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3529}
3530
3531int BackgroundMesh::convectParticle(Particle* pt, VInt index,
3532 int nums) {
3533 Domain* domain = OPS_GetDomain();
3534 if (domain == 0) return 0;
3535
3536 int ndm = OPS_GetNDM();
3537
3538 // check dt
3539 double dt = pt->getDt();
3540 if (dt <= 0) {
3541 return 0;
3542 }
3543
3544 // get corners
3545 VVInt indices, ndtags;
3546 VVDouble crds;
3547 std::vector<BackgroundType> types;
3548 VVDouble vels, dvns;
3549 VDouble pns, dpns;
3550
3551 // convect in a cell
3552 while (pt->getDt() > 0) {
3553 // get subdt
3554 double subdt = dt / nums;
3555 if (pt->getDt() < subdt) {
3556 subdt = pt->getDt();
3557 }
3558
3559 // particle crds
3560 const VDouble& pcrds = pt->getCrds();
3561
3562 // new index
3563 VInt newIndex;
3564 lowerIndex(pcrds, newIndex);
3565
3566 // update corners
3567 if (indices.empty() || newIndex != index) {
3568 index = newIndex;
3569
3570 VVInt temp;
3571 getCorners(index, 1, temp);
3572 indices = temp;
3573 indices[2] = temp[3];
3574 indices[3] = temp[2];
3575 if (ndm == 3) {
3576 indices[6] = temp[7];
3577 indices[7] = temp[6];
3578 }
3579
3580 // get corner coordinates, types, and velocities
3581 // pressures for structural damping
3582 ndtags.assign(indices.size(), VInt());
3583 crds.assign(indices.size(), VDouble());
3584 types.assign(indices.size(), BACKGROUND_FIXED);
3585 vels.assign(indices.size(), VDouble());
3586 dvns.assign(indices.size(), VDouble());
3587 pns.assign(indices.size(), 0.0);
3588 dpns.assign(indices.size(), 0.0);

Callers

nothing calls this directly

Calls 13

getCornersFunction · 0.85
getCrdsMethod · 0.80
emptyMethod · 0.80
OPS_GetNDMFunction · 0.70
OPS_GetDomainFunction · 0.50
getDtMethod · 0.45
sizeMethod · 0.45
endMethod · 0.45
getTypeMethod · 0.45
getVelMethod · 0.45
getAccelMethod · 0.45
getPressureMethod · 0.45

Tested by

no test coverage detected