yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #18620
[Question #676953]: Append a grid to an existing grid during a running simulation
New question #676953 on Yade:
https://answers.launchpad.net/yade/+question/676953
Hello,
I am trying to append a grid (i.e a new gridNode with a new gridConnection) to an existing grid during a simulation.
For that I made the short script pasted below: it defines two gridNodes related by a gridConnection and run 100 iterations. Then there is function gridAppend() to add a new gridNode and new gridConnection relating the new gridNode to the last one previously created.
A second function printct() print information about the existing contacts and in particular the id of the bodies in contact.
If I run this script and add a new gridNode and a new gridConnection with gridAppend() all is fine.
Then if I run some additional iterations and I add again a grid element with gridAppend(), one iteration after that I have the following problem:
an interaction between the bodies 6 and 2 is created (you can check it with printct(). These bodies correspond to the 1st gridConnection and the last one:
[0] Node -- [2] Connection -- [1] Node -- [4] Connection -- [3] Node -- [6] Connection -- [5] Node
However these two gridConnection should not be in interaction, there should be interactions only between nodes (0-1, 1-3 and 3-5).
Do you have an idea about the direction to follow to solve that?
Cheers,
Luc
##Short script to append grid to an existing grid
from yade.gridpfacet import *
import numpy as np
def gridAppend():
node1=O.bodies[nodeIds[-2]]
node2=O.bodies[nodeIds[-1]]
#print "node -2"
#print nodeIds[-2]
#print node1.state.pos
#print "node -1"
#print nodeIds[-1]
#print node2.state.pos
nodeIds.append( O.bodies.append( gridNode(node2.state.pos+Vector3(0,0,-0.08),0.05,wire=False,material='cylindermat',color=color) ) )
connectionIds.append( O.bodies.append( gridConnection(nodeIds[-2],nodeIds[-1],0.05,color=color,material='fMat') ) )
print "### Add a new grid segment ###"
def printct():
global root
for i in O.interactions:
print "contact"
print "id1=", i.id1
print "id2=", i.id2
print "unp=", i.phys.unp
print "penetrationDepth=", i.geom.penetrationDepth
print "normalForce=", i.phys.normalForce
############################
### DEFINING ENGINES ###
############################
newton=NewtonIntegrator(damping=0.1)
O.engines=[
ForceResetter(),
InsertionSortCollider([
Bo1_GridConnection_Aabb(),
]),
InteractionLoop([
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_GridConnection_GridConnection_GridCoGridCoGeom()
],
[
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=True), # internal cylinder physics
Ip2_FrictMat_FrictMat_FrictPhys() # physics for external interactions, i.e., cylinder-cylinder, sphere-sphere, cylinder-sphere
],
[
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(), # contact law for "internal" cylinder forces
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack() # contact law for cylinder-cylinder interaction
]
),
## We will use the global stiffness of each body to determine an optimal timestep (see https://yade-dem.org/w/images/1/1b/Chareyre&Villard2005_licensed.pdf)
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.5),
newton
]
# cylinders material
O.materials.append( CohFrictMat( young=1e6,poisson=0.5,density=2600,frictionAngle=radians(30),normalCohesion=1e40,shearCohesion=1e40,momentRotationLaw=True,label='cylindermat') ) # material to create the gridConnections
O.materials.append( FrictMat( young=1e6,poisson=0.5,density=2600,frictionAngle=radians(30),label='fMat' ) ) # material for general interactions with cylinders
#create a two first nodes at the top of the simulation domain
color=[255./255.,102./255.,0./255.] # the root color
nodeIds=[] #this will be the list of Ids of the node of the root
nodeIds.append( O.bodies.append( gridNode([1,1,1],0.05,wire=False,fixed=True,material='cylindermat',color=color) ) )
nodeIds.append( O.bodies.append( gridNode([1,1,0.8],0.05,wire=False,fixed=False,material='cylindermat',color=color) ) )
connectionIds=[] #this will be the list of Ids of segments of the root; a segment is the part of the root in between two nodes
for i,j in zip(nodeIds[:-1],nodeIds[1:]):
connectionIds.append( O.bodies.append( gridConnection(i,j,0.05,color=color,material='fMat') ) )
O.run(100,True)
--
You received this question notification because your team yade-users is
an answer contact for Yade.