← Back to team overview

yade-users team mailing list archive

Re: [Question #632960]: How to erase GridConnection

 

Question #632960 on Yade changed:
https://answers.launchpad.net/yade/+question/632960

Klaus Thoeni proposed the following answer:
Hi Loic,

I see the problem but I can't find a quick fix for it at the moment. So
deleting and recreating GridConnections is not recommended at the
current stage. Nevertheless, I came up with a much nicer and easier
solution for your problem. Just modify your equilibrium distance unp in
the interaction physics. Here my simplified script:

-----------------------------------------------
# encoding: utf-8
from yade.gridpfacet import *

#### Parameters ####
L=5. # minimum length
r=0.5 # radius of the cylinder element
phi=30. # friction angle
E=1e6 # Young's modulus

#### Engines ####
O.engines=[
 ForceResetter(),
 InsertionSortCollider([
  Bo1_GridConnection_Aabb(),
  Bo1_Sphere_Aabb(),
 ]),
 InteractionLoop([
  Ig2_GridNode_GridNode_GridNodeGeom6D(),
 ],
 [
  Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
 ],
 [
  Law2_ScGeom6D_CohFrictPhys_CohesionMoment(), # contact law for "internal" cylider forces
 ]
 ),
 NewtonIntegrator(gravity=(0.,0.,0.),damping=0.5,label='newton'),
]

#### Creat materials ####
O.materials.append( CohFrictMat( young=E,poisson=0.3,density=1000,frictionAngle=radians(phi),normalCohesion=1e10,shearCohesion=1e10,momentRotationLaw=True,label='cMat' ) ) # material to create the gridConnections
O.materials.append( FrictMat( young=E,poisson=0.3,density=1000,frictionAngle=radians(phi),label='fMat' ) ) # material for general interactions

#### Create cylinder ####
nodesIds=[]
cylIds=[]
cylinder((0,0,2*r),(0,0,L+2*r),radius=r,nodesIds=nodesIds,cylIds=cylIds,fixed=False,intMaterial='cMat',extMaterial='fMat')
O.bodies[nodesIds[0]].state.blockedDOFs='xyzXYZ' # fix one node

#### Change unp to simulate pre-stressing ####
cinter=O.interactions[nodesIds[0],nodesIds[1]]
cinter.phys.unp = -3.

O.dt=1.e-6

#### For viewing ####
from yade import qt
qtc = qt.Controller()
qtv = qt.View()
qtr = qt.Renderer()
qtr.intrAllWire = True
qtr.wire = True
qtr.intrPhys = True
-----------------------------------------------


If needed, you could iteratively set your unp to achieve a specific pre-stressing condition. I hope this is solving your problem.

HTH
Klaus

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