← Back to team overview

yade-users team mailing list archive

Re: [Question #670852]: remote interaction, net&wire mats attribution by sphere's material

 

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

    Status: Answered => Open

Ali Rafiee is still having a problem:
Thanks Jan,

I completed the script in this way, and it seems to be correct now?



#===============================================
# -*- coding: utf-8 -*-

from yade import plot, qt

tolerance=0.01
errors=0

#### define parameters for the net
# wire diameter
d = 2.7/1000.
# particle radius
radius = d*4.
# define piecewise lineare stress-strain curve
strainStressValues=[(0.0019230769,2.5e8),(0.0192,3.2195e8),(0.05,3.8292e8),(0.15,5.1219e8),(0.25,5.5854e8),(0.3,5.6585e8),(0.35,5.6585e8)]
# elastic material properties
particleVolume = 4./3.*pow(radius,3)*pi
particleMass = 3.9/1000.
density = particleMass/particleVolume
young = strainStressValues[0][1] / strainStressValues[0][0]
poisson = 0.3


#### material definition
netMat = O.materials.append( WireMat( young=young,poisson=poisson,frictionAngle=radians(30),density=density,isDoubleTwist=True,diameter=d,strainStressValues=strainStressValues,lambdaEps=0.4,lambdak=0.66) )

wireMat = O.materials.append( WireMat(
young=young,poisson=poisson,frictionAngle=radians(30),density=density,isDoubleTwist=False,diameter=3.4/1000,strainStressValues=strainStressValues
) )


#### get net 
s1=O.bodies.append(sphere([-0.04,0.075,0],radius=0.01,wire=False,highlight=False,fixed=False, color=[0,1,0],material=netMat))
s2=O.bodies.append(sphere([-0.04,0.025,0],radius=0.01,wire=False,highlight=False,fixed=False, color=[0,1,0],material=netMat))
s3=O.bodies.append(sphere([0.04,0.075,0],radius=0.01,wire=False,highlight=False,fixed=False, color=[0,1,0],material=netMat))
s4=O.bodies.append(sphere([0.04,0.025,0],radius=0.01,wire=False,highlight=False,fixed=False, color=[0,1,0],material=netMat))
s5=O.bodies.append(sphere([0,0.15,0],radius=0.01,wire=False,highlight=False,fixed=True, color=[1,0,0],material=wireMat))
s6=O.bodies.append(sphere([0,0.1,0],radius=0.01,wire=False,highlight=False,fixed=False, color=[0,0,1],material=wireMat))
s7=O.bodies.append(sphere([0,0,0],radius=0.01,wire=False,highlight=False,fixed=False, color=[0,0,1],material=wireMat))
s8=O.bodies.append(sphere([0,-0.05,0],radius=0.01,wire=False,highlight=False,fixed=True, color=[1,0,0],material=wireMat))


####################################""
#### define engines to create link
interactionRadius=1	# value has to be adjusted according to the particle size of the net and the mesh opening size of the net (check always if links are created)
O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=interactionRadius,label='aabb')]), 
	InteractionLoop(
	[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=interactionRadius,label='Ig2ssGeom')],
	[Ip2_WireMat_WireMat_WirePhys(linkThresholdIteration=1,label='wire_wire'),Ip2_FrictMat_FrictMat_FrictPhys(label='block_wire')],
	[Law2_ScGeom_WirePhys_WirePM(linkThresholdIteration=1,label='Law_1'),Law2_ScGeom_FrictPhys_CundallStrack(label='Law_2')]
	),
	NewtonIntegrator(gravity=(0.,0,-10),damping=0.5,label='newton'),
]

#############################################
O.dt=1e-5
dd=createInteraction( s3,s6 )

createInteraction( s1,s6 )
createInteraction( s2,s1 )
createInteraction( s7,s2 )
createInteraction( s7,s4 )
createInteraction( s4,s3 )
createInteraction( s6,s5 )
createInteraction( s8,s7 )
##############################
O.step()
aabb.aabbEnlargeFactor=-1.
Ig2ssGeom.interactionDetectionFactor=-1.

print dd.phys
v = qt.Controller()
v = qt.View()
rr = qt.Renderer()
rr.intrAllWire = True

#############################
O.run(20000)

#=======================================================

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