yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #26989
[Question #700397]: Problem with pfacetCreator3
New question #700397 on Yade:
https://answers.launchpad.net/yade/+question/700397
Hi all,
System information:
Welcome to Yade 2020.01a
Using python version: 3.8.10 (default, Nov 26 2021, 20:14:08)
[GCC 9.3.0]
Problem:
I'm trying to use pfacetCreator3 to create two beams (see MWE below). Everything is fine until I remove all BC's from non-root nodes (root_nodes stay fixed) in the function turnonstuds, once the BC's are removed, my two beams explode.
Other information:
Once the BC's are removed my terminal says (it says it over and over again):
<WARNING> InteractionLoop:135 virtual void yade::InteractionLoop::action(): IGeomFunctor returned false on existing interaction!
Does anyone know the cause?
Thanks,
Justin
MWE:
#!/usr/bin/python
# -*- coding: utf-8 -*-
from yade.gridpfacet import *
import numpy as np
from yade import utils, pack
from yade import ymport
import time,math,random,sys
from yade import qt
qt.View()
nodesIds=[]
nodesIds2=[]
rootNodes=[]
## Steps
spheres_fall = 5
Trans = 54817+spheres_fall
class YadePythonSimulation():
# O.materials.append(CohFrictMat(young=3e9,density=1150,poisson=.3,frictionAngle=10,normalCohesion=3e7,shearCohesion=3e7,momentRotationLaw=True,label='grassnodes'))
# O.materials.append(FrictMat(young=3e9,density=1150,poisson=.3,frictionAngle=10,label='grassgrid'))
O.materials.append(CohFrictMat(young=200e9,density=8050,poisson=.3,frictionAngle=10,normalCohesion=3e7,shearCohesion=3e7,momentRotationLaw=True,label='grassnodes'))
O.materials.append(FrictMat(young=200e9,density=8050,poisson=.3,frictionAngle=10,label='grassgrid'))
rCyl = 0.0006 ## Grass was about 1.2 [mm] wide
nL = 4 ## No exact number of spheres here, just trial and error
L = .022 ## Height of spheres after leveling
len_blade = 2*rCyl+.001
## Time step set to 20% of Rayleigh Wave
O.dt=0.0020719234774279633 # 0.0020719234774279633
## Engines
O.engines=[
###Reset all forces stored in Scene::forces (O.forces in python). Typically, this is the first engine to be run at every step. In addition, reset those energies that should be reset, if energy tracing is enabled.
## Resets forces and moments that act on bodies
ForceResetter(),
## Using bounding boxes find possible body collisions.
InsertionSortCollider([
Bo1_Sphere_Aabb(),
Bo1_Facet_Aabb(),
Bo1_PFacet_Aabb(),
# Bo1_GridConnection_Aabb(),
]),
InteractionLoop([
# Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
# Ig2_GridNode_GridNode_GridNodeGeom6D(),
# Ig2_Sphere_GridConnection_ScGridCoGeom(),
Ig2_Facet_Sphere_ScGeom(),
Ig2_Sphere_Sphere_ScGeom(),
Ig2_Sphere_PFacet_ScGridCoGeom(),
Ig2_PFacet_PFacet_ScGeom(),
Ig2_GridNode_GridNode_GridNodeGeom6D()
],
[
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False), # internal cylinder physics
Ip2_FrictMat_FrictMat_FrictPhys() # physics for external interactions, i.e., cylinder-cylinder, sphere-sphere, cylinder-sphere
],
[
# Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom_FrictPhys_CundallStrack(), # contact law for sphere-sphere
Law2_ScGridCoGeom_FrictPhys_CundallStrack(), # contact law for cylinder-sphere
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(), # contact law for "internal" cylinder forces
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),# contact law for cylinder-cylinder interaction
]),
NewtonIntegrator(damping=.2,gravity=[0, -9.81, 0],label='newtonInt'),
PyRunner(command='turnonstuds()',iterPeriod=spheres_fall, nDo = 11, label='switchstuds', dead = False),
]
color=[255./255.,102./255.,0./255.]
### Create all nodes first :
idxc = -1
blen = 0.21230 ## Length of Ball pit
x_gap = 0.09 ## tmp
z_gap = 0.1905 ## tmp
range_x = int(math.floor(blen/x_gap)) ## finding the range for x
range_z = int(math.floor(blen/z_gap)) ## finding the range for z
cen_z = -(range_z/2)*z_gap ## Allows the "box" of grass to be center in Z
tmpi = 0.0
for ii in range(0,range_z):
cen_x = -(range_x/2)*x_gap # Allows the "box" of grass to be center in X
for jj in range(0,range_x):
for i in np.linspace(0,L,nL):
if i != 0.0:
nodesIds.append(O.bodies.append(gridNode([cen_x,i,cen_z],rCyl,wire=False,fixed=True,material='grassnodes')))
nodesIds2.append(O.bodies.append(gridNode([cen_x+len_blade,i,cen_z],rCyl,wire=False,fixed=True,material='grassnodes')))
## Creates Nodes Connetions
if tmpi != 0.0:
pfacetCreator3(nodesIds[-2],nodesIds[-1],nodesIds2[-1],cylIds=[],pfIds=[],wire=False,material='grassgrid',color=color)
pfacetCreator3(nodesIds[-2],nodesIds2[-1],nodesIds2[-2],cylIds=[],pfIds=[],wire=False,material='grassgrid',color=color)
elif tmpi == 0.0:
pfacetCreator3(rootNodes[-2],rootNodes[-1],nodesIds[-1],cylIds=[],pfIds=[],wire=False,material='grassgrid',color=color)
pfacetCreator3(rootNodes[-1],nodesIds[-1],nodesIds2[-1],cylIds=[],pfIds=[],wire=False,material='grassgrid',color=color)
elif i == 0.0:
rootNodes.append(O.bodies.append(gridNode([cen_x,i,cen_z],rCyl,wire=False,fixed=True,material='grassnodes')))
rootNodes.append(O.bodies.append(gridNode([cen_x+len_blade,i,cen_z],rCyl,wire=False,fixed=True,material='grassnodes')))
tmpi = i
idxc += 1
d = idxc*nL ## Start of grass fiber
cen_x += x_gap
cen_z += z_gap
def run(self):
iterToRun=spheres_fall
O.run(iterToRun, True)
def turnonstuds():
## Removing all BC's for non-root nodes
for kk in range(0,len(nodesIds)):
O.bodies[nodesIds[kk]].state.blockedDOFs=''
O.bodies[nodesIds2[kk]].state.blockedDOFs=''
if __name__ == "__main__":
yaPySi = YadePythonSimulation()
sim1 = yaPySi.run()
--
You received this question notification because your team yade-users is
an answer contact for Yade.