← Back to team overview

yade-users team mailing list archive

Re: [Question #206415]: getStress() applies for clumps?

 

Question #206415 on Yade changed:
https://answers.launchpad.net/yade/+question/206415

ceguo posted a new comment:
Or something like this:

if (Body::byId(I->getId1(),scene)->isClumpMember()) {
        int id_clump_1 = Body::byId(I->getId1(),scene)->clumpId;
        pos1 = Body::byId(id_clump_1,scene)->state->pos;
}
else {
        pos1 = Body::byId(I->getId1())->state->pos;
}
if (Body::byId(I->getId2(),scene)->isClumpMember()) {
        int id_clump_2 = Body::byId(I->getId2(),scene)->clumpId;
        pos2 = Body::byId(id_clump_2,scene)->state->pos;
}
else {
        pos2 = Body::byId(I->getId2())->state->pos;
}
branch= pos2 + scene->cell->hSize*I->cellDist.cast<Real>() - pos1;

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.