Vaclav, you can paste this code after l.90 in cell.cc (the modified
version).
Some more numerical experiments. It is in fact the comparison between
one step with dt, and 100 steps with dt/100, for the same velocity.
Bruno
///Again the same, but decomposed in n=100 increments : the constant
volume distorsion is represented more accurately : (det(F)-1) is
O(1/n). This example shows what will happen in dynamic simulations,
as long as we don't have large transformations in only one step.
C._totalShearTrsf = Id;
dt /= 100;
C.Hsize = Matrix3r(C.size[0],0,0,
0,C.size[1],0,
0,0,C.size[2]);
previousHsize = C.Hsize;
for (int i = 1; i<=100; i++) C.updateCache2(dt);
cerr<<endl<<"incremental volume change (depsv) "<<
(C._shearTrsf)(0,0)+(C._shearTrsf)(1,1)+(C._shearTrsf)(2,2)<<endl;
cerr<<"real incremental volume change (V(t)-V(t-dt)/V(t-dt)) "<<
(C.Hsize.Determinant() - previousHsize.Determinant())/
previousHsize.Determinant() << " =(?) 100 x " <<
(C._shearTrsf+Id).Determinant() -1 <<endl;
cerr<<"total volume change (epsv) "<<
(C._totalShearTrsf)(0,0)+(C._totalShearTrsf)(1,1)+(C._totalShearTrsf)(2,2)
- 3 <<endl;
cerr<<"det(F) - 1 = "<< C._totalShearTrsf.Determinant() - 1 <<endl;
cerr<<"real total volume change (dV/V0) "<<
((C.Hsize.Determinant() -initV )/ initV) <<endl; dt *= 100;
Václav Šmilauer a écrit :
Hi there,
I commited a few changes for the period cell shear. For now, just the
underlying Cell class is in place and OpenGLRenderer renders the
sheared
cell (no collisions yet, in particular). You can have a look at
scripts/test/periodic-shear.py, it looks pretty :-)
For the python interface, it will have to be changed in some meaningful
way, so please don't use it in your script, it is not stable. In
particular, instead of O.cellSize and O.cellShear, we will have O.cell
returning a Cell object, which will contain the properties, like in c++
(O.cell.size and O.cell.shear, perhaps some more as needed).
If you feel sad and run gnome, press Alt-F2 and run the command "free
the fish" (without quotes).
Cheers, Václav
_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~yade-dev
More help : https://help.launchpad.net/ListHelp