O.cell.volume=0 during flipCell
Hello,
I am trying to use flipCell to avoid a RuntimeError "Body larger than half of the cell size encountered" during some periodic simulations (see my previous question about the documentation [1]). I am having a more technical issue now, it appears that in some simulations the new O.cell.hSize computed in flipCell has a determinant equal to 0.
A bit of context:
The periodic DEM simulations I am running are actually RVEs for a larger scale method (the Material Point Method), I have thus no direct control on the velocity gradient imposed to the DEM periodic cells. During a MPMxDEM granular column collapse, some RVEs get deformed a lot in unpredictable directions so I’d like to flip them whenever the cell is too much deformed. I tried to generalise the flipping condition used in [2] so it takes into account all directions, see the MWE below.
A MWE with a problematic RVE’s hSize:
```
O.periodic = True
O.cell.hSize = Matrix3(
cond_x = abs(O.cell.
cond_y = abs(O.cell.
cond_z = abs(O.cell.
print("\nInitial hSize:", O.cell.hSize, "\nFlipping condition: ", cond_x or cond_y or cond_z, “\n”)
try: flipCell()
except RuntimeError as err:
print("\nNew hSize: ", O.cell.hSize, "\n")
raise(err)
```
Which outputs with yadedaily (git revision 406fb7a):
```
Welcome to Yade 20220206-
Using python version: 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0]
Warning: no X rendering available (see https:/
TCP python prompt on localhost:9001, auth cookie `duacks'
XMLRPC info provider on http://
/usr/lib/
warn("Attempting to work in a virtualenv. If you encounter problems, please "
Running script mwe.py
Initial hSize: Matrix3(
Flipping condition: True
New hSize: Matrix3(
Traceback (most recent call last):
File "/usr/bin/
execfile(
File "/usr/lib/
exec_(code, myglobals, mylocals)
File "mwe.py", line 13, in <module>
raise(err)
File "mwe.py", line 10, in <module>
try: flipCell()
RuntimeError: Cell is degenerate (zero volume)
```
This error is raised because the determinant of O.cell.hSize is zero [3], which is tested because Cell::integrate
Should flipCell be able to find a flip matrix for any hSize ? Is there a problem the way I use it ?
Thanks in advance,
Sacha
[1]: https:/
[2]: https:/
[3]: https:/
[4]: https:/
[5]: https:/
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: