← Back to team overview

yade-users team mailing list archive

Re: [Question #685305]: can't update velGrad value in a periodic cell

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

> I assign new values through O.cell.nextVelGrad as yade's documention
specifies it

it is always good to be more specific (like a link to a paragraph in
documentation). I assume you mean [1].

First of all, nextVelGrad is read-only [2]. Usually it has some reason.
The documentation [1] says, that if you set velGrad, internally it is
stored in nextVelGrad, but it is not meant to set nextVelGrad directly.

You can hack it by assignment of individual components, but definitely
it is not recommended.

> Besides O.cell.velGradChanged always stays False.

according to source code [3], velGradChanged=true is set, if velGrad is set (also see above)
Moreover, it is reset to false at O.step() [4], so print it before O.step().

###
O.cell.velGrad = Matrix3(-1,0,0, 0,-1,0, 0,0,-1)
print O.cell.velGrad, O.cell.velGradChanged
O.step()
print O.cell.velGrad, O.cell.velGradChanged
###

cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Cell.velGrad
[2] https://gitlab.com/yade-dev/trunk/blob/master/core/Cell.hpp#L162
[3] https://gitlab.com/yade-dev/trunk/blob/master/core/Cell.hpp#L106
[4] https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/NewtonIntegrator.cpp#L100

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.