yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #29806
[Question #707210]: seeking help in VTKRecorder
New question #707210 on Yade:
https://answers.launchpad.net/yade/+question/707210
Hi folks!
I am trying to run a simulation with Geogrid and Balls. It is running fine but I want to visualize Geogrid and Balls separately.
How can I achieve this?
I am using Ubuntu 22.04.2 LTS and Yade 2022.01a.
my code is attached:
from builtins import range
from yade import pack, geom, plot, export
from yade.gridpfacet import *
rate=-0.5 #1.66e-4
compFricDegree=30
finalFricDegree = 40
stabilityThreshold = 0.1
young = 5e6
mn, mx = Vector3(0, 0, 0), Vector3(0.9, 0.6, 0.6)
O.engines = [
ForceResetter(),
InsertionSortCollider([
Bo1_Sphere_Aabb(),
Bo1_GridConnection_Aabb(),
Bo1_Facet_Aabb(), Bo1_Wall_Aabb()
]),
InteractionLoop(
[ Ig2_Sphere_Sphere_ScGeom(),
Ig2_Facet_Sphere_ScGeom(), Ig2_Wall_Sphere_ScGeom(),
Ig2_Sphere_GridConnection_ScGridCoGeom(),
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_GridConnection_GridConnection_GridCoGridCoGeom()],
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True, setCohesionOnNewContacts=True), Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack(), Law2_ScGridCoGeom_FrictPhys_CundallStrack(), Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),]
),
GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.1, label='ts'),
NewtonIntegrator(gravity=(0,-10,0), damping=.5, label='newton'),
PyRunner(command='addPlotData()', iterPeriod=500),
# VTKRecorder(fileName='/home/harshal/files/Geogrid/paraview/pullout', recorders=['all'], iterPeriod=500),
]
def addPlotData():
plot.addData(
unbalanced=unbalancedForce(),
i=O.iter
)
plot.plots = {
'i':('unbalanced'),
}
plot.plot()
O.materials.append(FrictMat(young=young, poisson=0.5, frictionAngle=radians(compFricDegree), density=2600, label='spheres'))
O.materials.append(FrictMat(young=young, poisson=0.5, frictionAngle=0, density=0, label='walls'))
O.materials.append(CohFrictMat(young=1.325e8, poisson=0.40, density=900, frictionAngle=radians(10), normalCohesion=1.1e8, shearCohesion=1.1e8, momentRotationLaw=True, label='spheremat'))
L = 0.608 #length [m]
l = 0.304 #width [m]
nbL = 16+1 #number of nodes for the length [#]
nbl = 8+1 #number of nodes for the width [#]
r = 0.008/2 # L / 100. #radius
color = [255. / 255., 102. / 255., 0. / 255.]
nodesIds = []
for i in range(0, nbL):
for j in range(0, nbl):
nodesIds.append(O.bodies.append(gridNode([i*L/nbL, 0.3, 0.15+j*l/nbl], r, wire=False, fixed=False, material='spheremat', color=color)))
#Create connection between the nodes
for i in range(0, len(nodesIds)):
for j in range(i + 1, len(nodesIds)):
dist = (O.bodies[i].state.pos-O.bodies[j].state.pos).norm()
if (dist <= (L/nbL)*1.05):
O.bodies.append(gridConnection(i, j, r, color=color))
O.bodies.append(geom.facetBox((.45, .5, .3), (.45, .5, .3), wallMask=55, material='walls'))
sp = pack.SpherePack()
sp.makeCloud((0, 0, 0), (0.9, 0.2, 0.6), rMean=.05, rRelFuzz=.3)
sp.makeCloud((0, 0.4, 0), (0.9, 0.6, 0.6), rMean=.05, rRelFuzz=.3)
O.bodies.append([sphere(center, rad, material='spheres') for center, rad in sp])
O.run()
--
You received this question notification because your team yade-users is
an answer contact for Yade.