Skip to content

fabricTensor for non-spherical particles through extrema argument

Jérôme Duriez requested to merge nospherFabric into master

fabricTensor() is now able to work with non-Sphere-shaped bodies (a wish of #220), modulo a new extrema argument, e.g.:

O.bodies.append(levelSetBody('superellipsoid',(0,0,0),extents = (4,2,1),epsilons=(1,1),nodesPath=1))
O.bodies.append(levelSetBody('superellipsoid',(0,0,1.95),extents = (1,3,1),epsilons=(0.5,1.5),nodesPath=1))

O.engines = [ForceResetter()
             ,InsertionSortCollider([Bo1_LevelSet_Aabb()],verletDist=0)
             ,InteractionLoop(
                 [Ig2_LevelSet_LevelSet_ScGeom()],
                 [Ip2_FrictMat_FrictMat_FrictPhys()],
                 [Law2_ScGeom_FrictPhys_CundallStrack(sphericalBodies=False)])
             ,NewtonIntegrator()]
O.step()

image

fabricTensor() with current yadedaily gives:

Welcome to Yade 20230109-6986b2cda7b1jammy1

..

(Matrix3(-nan,-nan,-nan, -nan,-nan,-nan, -nan,-nan,-nan),)

(which is unchanged after the possible merge) while fabricTensor(extrema=(-5 * Vector3.Ones,5 * Vector3.Ones)) would now be possible and give:

Welcome to Yade 2023-01-03.git-8f82e08

..

(Matrix3(0.1010694700965960591,0.02560595508178227162,-0.3003310962510193916, 0.02560595508178227162,0.006487269944362096703,-0.07608889759604103853, -0.3003310962510193916,-0.07608889759604103853,0.8924432599590417237),)

which is the expected answer (= 1 vec ez times vec ez) modulo the LevelSet discretization parameters

Merge request reports