New question #692613 on Yade:
https://answers.launchpad.net/yade/+question/692613

Hello all,

I am new to yade. I have tried the basic tutorial scripts and in them the 
objects are defined first followed by the engines. In an advanced script 
(cylinderconnection-roots.py) I saw that the objects were defined after the 
engines. 

Now I tried writing a script for a ball interacting with a beam made of 
cylinders. I defined the objects (cylinders and sphere) first and then the 
engines. When I ran the code, the beam sort of fell apart. I modified the code 
by defining the cylinder after the engines. It fixed the problem. I want to 
know what is causing this or if we are required to define the bodies after the 
engines. 

I am using Ubuntu 20.04 

Please find the bare minimum script that showed this issue.

###################################################################################
from yade.gridpfacet import *


#### params
young = 1e6
poiss = 3
dens  = 1e3
sp_r  = 0.05 
fr_a  = radians(10)



## cylinder
no_cyl = 5
dl_cyl = 0.1

#### materials

O.materials.append(
        FrictMat(
                young         = young,
                poisson       = poiss,
                density       = dens,
                frictionAngle = fr_a,
                label            = 'cyl_ext_mat'
        )
)

O.materials.append(
        CohFrictMat(
                young        = young,
                poisson      = poiss,
                density      = dens,
                frictionAngle= fr_a,
                normalCohesion = 1e40,
                shearCohesion  = 1e40,
                momentRotationLaw = True, 
                label        = 'cyl_int_mat'
        )
 )


#### cylinder
nodesIds=[]
cylIds=[]
verts = []
for i in range(no_cyl):
        verts.append([0.1 + dl_cyl*i,   0.5,    0.8])


cylinderConnection( # Defining the beam here is causing the issue
        verts,
        nodesIds = nodesIds,
        cylIds   = cylIds,
        radius   = 0.03,
        color    = [1,0,0],
        extMaterial = 'cyl_ext_mat',
        intMaterial = 'cyl_int_mat'
)
O.bodies[nodesIds[-1]].state.blockedDOFs='xyzXYZ'


####
O.engines = [
        ForceResetter(),
        InsertionSortCollider([
                Bo1_GridConnection_Aabb(),
        ]),
        InteractionLoop(
                [
                        Ig2_GridNode_GridNode_GridNodeGeom6D(),
                        Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
                ],
                [
                        Ip2_FrictMat_FrictMat_FrictPhys(),
                        
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False)
                ],
                [
                        Law2_ScGeom_FrictPhys_CundallStrack(),
                        Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
                        Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
                        Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),
                ]
        ),
        GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.1,label='ts'), 
        NewtonIntegrator(gravity = (0,0,9.1))
]

# if I define the beam here, it fixes everything


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to