Use flipCell in periodic simulations

Asked by Sacha Duverger

Hello,

I'd like to use the flipCell function to avoid the RuntimeError "Body larger than half of the cell size encountered" during some periodic simulations.

According to the documentation [1], when calling this function one should also reset the Interaction.cellDist of boundary particles and re-initialise the collider. However, in an example in the source code [2], flipCell is called without any additional operation.

Has flipCell been improved since its documentation was redacted so one don't have to mind Interaction.cellDist and the collider ? Is it safe to use it as in [2] ?

Thanks in advance,

Sacha

[1]: https://yade-dem.org/doc/yade.utils.html#yade._utils.flipCell
[2]: https://gitlab.com/yade-dev/trunk/-/blob/277c4f0c4a94dd1df423e8d499e56a457d356ea0/examples/PeriodicBoundaries/cellFlipping.py

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Bruno Chareyre
Solved:
Last query:
Last reply:
Revision history for this message
Best Bruno Chareyre (bruno-chareyre) said :
#1

Hi,
[1] is outdated, or maybe just misleading (it says "it needs to be done", not "it's not done").
And, yes, [2] is safe, I'm using this mechanism routinely and I never distinguished any sort of discontinuity or weird response associated to flipping.
We could probably implement it as a Cell method since currently everyone has to re-type something like:
O.engines=O.engines+[PyRunner(command='if O.cell.hSize[0,1]>O.cell.hSize[0,0]: flipCell()',iterPeriod=20)]

Bruno

Revision history for this message
Sacha Duverger (schmxprr) said :
#2

Thank you for these precisions. I am now having a problem when trying to use cellFlip on a randomly deformed cell, I opened a new question about that [3].

Cheers,

Sacha

[3]: https://answers.launchpad.net/yade/+question/701782

Revision history for this message
Sacha Duverger (schmxprr) said :
#3

Thanks Bruno Chareyre, that solved my question.