Append a grid to an existing grid during a running simulation
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=
node2=
#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(
connectionIds
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 "penetrationDep
print "normalForce=", i.phys.normalForce
#######
### DEFINING ENGINES ###
#######
newton=
O.engines=[
ForceResetter(),
InsertionSortC
Bo1_GridConne
]),
InteractionLoop([
Ig2_GridNode_
Ig2_GridConne
],
[
Ip2_CohFrictM
Ip2_FrictMat_
],
[
Law2_
Law2_
]
),
## We will use the global stiffness of each body to determine an optimal timestep (see https:/
GlobalStiffnes
newton
]
# cylinders material
O.materials.append( CohFrictMat( young=1e6,
O.materials.append( FrictMat( young=1e6,
#create a two first nodes at the top of the simulation domain
color=[
nodeIds=[] #this will be the list of Ids of the node of the root
nodeIds.append( O.bodies.append( gridNode(
nodeIds.append( O.bodies.append( gridNode(
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[
connectionIds
O.run(100,True)
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: