← Back to team overview

yade-users team mailing list archive

Re: [Question #290070]: TesselationWrapper and porosity

 

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

behzad posted a new comment:
I see, but I cannot get how this can be mapped or exported to vtk or whatever 
Please check out the following script. 
Is this what you'r talking about? Then what do I do with 'density matrix'? 

Cheers,


from yade import utils, plot
from yade import pack, qt
from datetime import datetime


#================= define the materials =======================

O.materials.append(CohFrictMat(normalCohesion= 1e20, shearCohesion= 1e20, isCohesive= False, young=6.81e5, 
density=1523.6, poisson=0.3, frictionAngle= 20, fragile=True, label='wall'))


#========= creating walls ======================

walls=aabbWalls([(-0.4,-0.4,0.0),(0.4,0.4,1.0)],thickness=0.01,oversizeFactor=1.0,material='wall')
wallIds=O.bodies.append(walls)


#==================================== make the binder
==================================

pred1=pack.inAlignedBox((-0.4,-0.4,0.0),(0.4,0.4,0.32))
O.bodies.append(pack.regularOrtho(pred1,radius=3e-2,gap=1e-4, material='wall'))

pred2=pack.inAlignedBox((-0.4,-0.4,0.31),(0.4,0.4,0.65))
O.bodies.append(pack.regularOrtho(pred2,radius=3e-2,gap=-1e-4, material='wall'))

pred3=pack.inAlignedBox((-0.4,-0.4,0.64),(0.4,0.4,0.999))
O.bodies.append(pack.regularOrtho(pred3,radius=3e-2,gap=-6e-3, material='wall'))


j=0
for x in range(len(O.bodies)):
	if (O.bodies[x]):
		if isinstance(O.bodies[x].shape,Sphere):
			if (O.bodies[x].isStandalone):
				j=j+1
print ''
print ''
print 'standalone ones are ***   ',j


v_s=j*1.3333333333*pi*(0.03**3)
############################
###   DEFINING ENGINES   ###
############################


O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Facet_Aabb()]),
	InteractionLoop([Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
	[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True, setCohesionOnNewContacts=True)],
	[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
	),
	NewtonIntegrator(damping=0.4,gravity=[0,0,-10])
]

O.dt=3e-6
#===============================

TW=TesselationWrapper()
TW.triangulate()
TW.computeVolumes()


density=[]

for i in O.bodies:
	if isinstance(i.shape,Sphere):
		density.append((1.13097e-4)/TW.volume(i.id))

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