TriaxialStressController.max_vel is not a maximum velocity
The following script (an empty triaxial cubic box searching for an impossible isotropic stress => at a max_vel
velocity, I would expect, also attached)
# defining wall boundaries for an empty box:
wallX1id = O.bodies.append(wall( (0.2,0,0),0))
wallX2id = O.bodies.append(wall( (0.4,0,0),0))
wallY1id = O.bodies.append(wall( (0,0.2,0),1))
wallY2id = O.bodies.append(wall( (0,0.4,0),1))
wallZ1id = O.bodies.append(wall( (0,0,0.2),2))
wallZ2id = O.bodies.append(wall( (0,0,0.4),2))
# engines list:
O.dt=1.e-3
O.engines=[ForceResetter()
,InsertionSortCollider([Bo1_Wall_Aabb()])
,InteractionLoop(
[Ig2_Wall_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
)
,TriaxialStressController(internalCompaction = 0
,wall_bottom_id=wallY1id,wall_top_id=wallY2id
,wall_back_id=wallZ1id,wall_front_id=wallZ2id
,wall_left_id=wallX1id,wall_right_id=wallX2id
,stressMask=7,max_vel = 0.05,stressDamping=0
,thickness = 0
,label = 'tsc')
,NewtonIntegrator()
]
# searching for compression (or max_vel)
tsc.goal1 = tsc.goal2 = tsc.goal3 = - 20.e3
O.run(1000,True)
print('\nAfter',O.iter,'iterations, we had a change in length =',tsc.width-tsc.width0,'vs',-2*tsc.max_vel*O.dt*O.iter,'expected.')
print('Maximum boundaries velocity is indeed',max([abs(b.state.vel[axis]) for axis in range(3) for b in O.bodies]),'vs',tsc.max_vel,'expected\n')
illustrates how TriaxialStressController.max_vel
is not a wall maximum velocity, since, with yadedaily 20210217-49800ed545f0focal1, I for instance get:
After 1000 iterations, we had a change in length = -0.4974999999999656 vs -0.1 expected.
Maximum boundaries velocities is indeed 0.25 vs 0.05 expected
I think it is because of that line (whose second term in the sum I do not really understand).
There seems to be at least room for improvement in the doc but I would actually like tsc.max_vel
to really be a wall maximum velocity, which would require changes in the C++.
Thoughts ?
Edited by Jérôme Duriez