← Back to team overview

yade-users team mailing list archive

Re: [Question #685539]: shape orientation for Potential Block

 

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

Ali Rafiee gave more information on the question:
Here is a simple example with a single polyhedron.

Thanks again
Ali


################################## simple code
from yade import polyhedra_utils
from yade import export, ymport
from yade import plot
from yade import qt
import itertools
import numpy as np
import math
import random


gravel = PolyhedraMat()
gravel.IsSplitable = False
gravel.strength = 7.9e6
gravel.density = 2678#kg/m^3
gravel.young = 5.98e7 #Pa
gravel.poisson =0.3
gravel.frictionAngle = 0.5 #rad

inputfil="poly-1"
inputfiln=inputfil+".txt"

O.materials.append(FrictMat(young=1e10,poisson=0.25,frictionAngle=radians(0.0),density=2500,label='frictionless'))


##################################"

O.engines=[
	ForceResetter(),
	InsertionSortCollider([PotentialBlock2AABB()],verletDist=0.01),
	InteractionLoop(
		[Ig2_PB_PB_ScGeom(twoDimension=False, unitWidth2D=1.0)],
		[Ip2_FrictMat_FrictMat_KnKsPBPhys(kn_i=1e8, ks_i=1e7, Knormal=1e8, Kshear=1e7, useFaceProperties=False, calJointLength=False, viscousDamping=0.2)],
		[Law2_SCG_KnKsPBPhys_KnKsPBLaw(label='law',neverErase=False, allowViscousAttraction=True, traceEnergy=False)]
	),
	#GlobalStiffnessTimeStepper(),
	NewtonIntegrator(damping=0.0,exactAsphericalRot=True,gravity=[0,0,-9.81]),
	#PotentialBlockVTKRecorder(fileName='./vtk/Arch-1',iterPeriod=10000,twoDimension=False,sampleX=50,sampleY=50,sampleZ=50,maxDimension=0.2,label='vtkRecorder')
]

###################################

chosenR=0.0001
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.4233422835886639,-0.0,-1.0,-0.0,-0.0,-0.2544435504552162,-0.0,0.2256157225428006,0.7071067811865475], b=[-0.4658182304526213,-1.0,0.0,1.0,-0.0,-0.0,0.2924660204513265,-0.5965652970583126,-0.0], c=[-0.4658182304526213,0.0,-0.0,-0.0,1.0,-0.8250734563293101,-0.12273156061799324,-0.4512314450856012,-0.0], d=[0.9630391247904834,1.20623023977275,1.83734355291125,0.79356976022725,1.1039638685226245,1.2066387820121347,0.3419810759564882,0.7092731583297133,1.5290583284351422], id=0)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[0.6733279600737498,3.79366976022725,6.1040638685226245]
bbb.state.ori=bbb.shape.orientation
#bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)


#create a polyhedron
O.bodies.append(yade.ymport.textPolyhedra(inputfiln, material=gravel, shift=Vector3(0,0,0), scale=1.0))


################################ end of Yade code


#################### poly-1.txt   file
1 8 9
-1.489228487015 3.0 5.0
-1.489228487015 3.0 7.0
-1.489228487015 5.0 5.0
-0.188776910305 3.349358081818 7.832510948181
2.510771512985 3.0 5.0
2.510771512985 3.0 7.0
2.510771512985 5.0 5.0
2.510771512985 5.0 7.0
1 3 2
7 6 2
7 5 4 6
5 1 0 4
0 2 6 4
5 7 3
1 5 3
3 7 2
0 1 2

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