← Back to team overview

yade-users team mailing list archive

Re: [Question #685375]: Converting polyhedron body to Potential Particle or Potential Block

 

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

    Status: Answered => Open

Ali Rafiee is still having a problem:
Hi Vasileios,

I solve the problems related to the geometric transformation, but I
think I have another problem concerning parameter setting in Potential
block part, because I do not know exactly how it works.

1 ## below, you can find my code for an arch structure, it should slide
with 0 degree for friction angle without cohesion, but it remains
without any movement.

2 ## in order to generate vtk files with PotentialBlockVTKRecorder, the
input parameters such as sampleX, how are they used?

Thanks a lot
Best regards
Ali


################################################# code part
from yade import pack,export,qt,ymport

import numpy as np
import math
import random
######################################
O.materials.append(FrictMat(young=1e10,poisson=0.25,frictionAngle=radians(0.0),density=2500,label='frictionless')) #The normal and shear stifness values are determined in the IPhys functor, thus the young,

chosenR=0.0001


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/cubePBscaled',iterPeriod=10000,twoDimension=False,sampleX=50,sampleY=50,sampleZ=50,maxDimension=0.2,label='vtkRecorder')
]

################################## geometry part, by A.Rafiee
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[-0.0, -1.0, -0.0, -0.0, 1.0, -0.0], b=[-1.0, -0.0, -0.0, -0.0, -0.0, 1.0], c=[0.0, -0.0, -1.0, 1.0, -0.0, -0.0], d=[1.8749, 2.8124, 0.0624, 0.0624, 2.8124, 1.8749], id=0)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=True)
bbb.state.pos =[2.125, 0.25, -0.0625]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[-0.995184720391626, 0.0, -0.0, -0.0, -0.0, -0.19509018176012233, 1.0], b=[2.7205239199536258e-18, -1.0, -5.551115123125783e-17, 1.0, -0.0, 1.0829680583419728e-17, -1.1102230246251564e-16], c=[0.09801720409724536, -0.0, 1.0, -0.0, -1.0, -0.9807853083018742, -2.8454080613571164e-16], d=[0.337181872405393, 0.2499, 0.17967108333414306, 0.2499, 0.21030951666585695, 0.17888318179899965, 0.303692080616296], id=1)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[0.30379208061629603, 0.25, 0.17977108333414304]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.1950901817601223, 0.9569403497890105, -1.4555161670882268e-16, -0.38268355158955414, 2.262943718606007e-16, -0.9569403375852945], b=[-4.537043464545097e-17, 1.3428361705711876e-17, -0.9951847174017722, -1.466534115884631e-17, 0.9951847174017722, 2.0392625979676485e-16], c=[0.9807853083018742, -0.2902846309153932, 1.1777448297131143e-16, -0.9238794831268877, 4.976255189356365e-18, 0.290284671145658], d=[0.1717652880563909, 0.23684874980903367, 0.14917770761026583, 0.17176528561465593, 0.14917770761026589, 0.26054366159508413], id=2)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[0.44708096679737336, 0.25000000000000006, 0.5089911606262629]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.38268355158955414, 0.8819212004273606, 8.127355190878246e-17, -0.5555703541431359, 1.958258197514367e-16, -0.8819212357727806], b=[-1.2821403426828246e-16, 6.54194554658077e-17, -0.9951847260300383, -1.7972755132828346e-16, 0.9951847260300383, -1.1957524611753766e-16], c=[0.9238794831268877, -0.47139685641374757, 1.9621163966280541e-16, -0.8314695313703745, -1.0467111550412906e-16, 0.4713967902871334], d=[0.17176529181696487, 0.2368487673900063, 0.1491777089045058, 0.17176529360968104, 0.14917770890450577, 0.2605436475477011], id=3)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[0.5786209907389809, 0.25, 0.8265567947287535]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.5555703541431359, 0.7730105349646802, -3.5803953569760556e-18, -0.7071067811865477, 8.582140233584773e-17, -0.7730106376137247], b=[3.8463192416736605e-17, -2.934658001475229e-17, -0.9951847535586482, -1.3084103822364795e-16, 0.995184753558648, -1.4303570135982168e-16], c=[0.8314695313703745, -0.634393184731377, 9.407783687275172e-17, -0.7071067811865475, -7.043178622195482e-17, 0.6343930596531008], d=[0.17176528321389758, 0.23684876708531535, 0.1491777130337973, 0.1717652803907167, 0.1491777130337972, 0.2605436269756058], id=4)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[0.7695874613517345, 0.25, 1.1123583282186593]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.7071067811865478, 0.6343931847313773, 5.936831281291228e-17, -0.8314695313703748, -1.298001029743927e-16, -0.6343930596531011], b=[-5.233641528945917e-16, 8.325647318886739e-16, -0.9951847140642529, 3.08054519409162e-16, 0.995184714064253, -9.716725512485364e-17], c=[0.7071067811865474, -0.7730105349646799, 3.718747074082228e-16, -0.5555703541431357, -2.8605330027204803e-16, 0.7730106376137245], d=[0.1717652803907161, 0.23684876708531505, 0.14917770710963785, 0.17176528321389797, 0.1491777071096379, 0.26054362697560574], id=5)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[1.0126416717813402, 0.25, 1.3554125386482654]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.8314695313703745, 0.47139685641374734, -1.6347077095121204e-16, -0.9238794831268876, -6.588657534994284e-18, -0.47139679028713377], b=[2.6049271698971687e-17, -3.7280529721843463e-16, -0.9951847256846824, -9.609762509852285e-16, 0.9951847256846824, -1.9134732646077375e-16], c=[0.5555703541431363, -0.8819212004273607, -4.4143378261607424e-16, -0.38268355158955436, 4.606860979300525e-16, 0.8819212357727804], d=[0.17176529360968132, 0.2368487673900062, 0.1491777088527024, 0.17176529181696482, 0.1491777088527025, 0.2605436475477015], id=6)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[1.2984432052712465, 0.25000000000000006, 1.5463790092610195]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.9238794831268876, 0.2902846309153935, 1.6303580705062413e-16, -0.9807853083018743, -4.9289839508535835e-17, -0.29028467114565765], b=[-3.1257340906439395e-16, 3.0042562302002276e-16, -0.9951847092768998, 2.356301414989026e-16, 0.9951847092768997, -2.118908447279992e-16], c=[0.382683551589554, -0.9569403497890105, -5.2059346508324875e-17, -0.19509018176012224, -8.021203425885159e-17, 0.9569403375852945], d=[0.1717652856146558, 0.2368487498090334, 0.149177706391535, 0.17176528805639094, 0.14917770639153488, 0.26054366159508413], id=7)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[1.6160088393737368, 0.24999999999999997, 1.6779190332026268]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.9807853083018742, 0.09801705227898266, 6.399136854325753e-17, -1.0, -8.031448525403647e-17, -0.09801720409724561], b=[-1.8049467639032894e-17, 9.20730839112388e-17, -0.9951847320167924, -1.8503717077085946e-16, 0.9951847320167923, -1.8136826133024222e-17], c=[0.1950901817601225, -0.995184735344418, 6.90547993979119e-17, 3.3306690738754706e-16, 9.667673614731509e-17, 0.9951847203916262], d=[0.17176527403820857, 0.23684876474180003, 0.14917770980251885, 0.17176527838164274, 0.14917770980251882, 0.2605436253595993], id=8)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[1.9531347216183572, 0.25, 1.7449775064827124]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[1.0, -0.09801705227898319, -6.153106884084172e-16, -0.9807853083018743, 4.791663943962904e-16, 0.09801720409724606], b=[5.551115123125779e-16, -6.068488975904394e-16, -0.995184735344418, -6.537290837710836e-16, 0.995184735344418, 4.408396346434073e-16], c=[5.551115123125779e-16, -0.995184735344418, -4.971946531206894e-16, 0.19509018176012194, 5.524385034674323e-16, 0.995184720391626], d=[0.17176527838164363, 0.23684876474179992, 0.14917771030166288, 0.17176527403820796, 0.14917771030166294, 0.2605436253595999], id=9)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[2.2968652783816434, 0.25000000000000006, 1.7449775064827127]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.9807853083018743, -0.2902846309153928, -5.3318352810194274e-17, -0.9238794831268876, -4.976255189356427e-18, 0.2902846711456571], b=[1.0928386802567227e-16, -4.078525166657175e-16, -0.9951847174017724, -0.0, 0.9951847174017725, 0.0], c=[-0.19509018176012255, -0.9569403497890108, 6.693180533084786e-17, 0.3826835515895541, 2.262943718606008e-16, 0.9569403375852947], d=[0.171765288056391, 0.23684874980903325, 0.14917770761026583, 0.1717652856146561, 0.14917770761026597, 0.26054366159508446], id=10)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[2.633991160626263, 0.25000000000000006, 1.677919033202627]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.9238794831268876, -0.47139685641374807, -2.6167778876032296e-17, -0.8314695313703748, -3.9236101011569525e-17, 0.47139679028713394], b=[-0.0, 0.0, -0.9951847260300383, 2.5874781661336978e-17, 0.9951847260300379, 2.06801174502733e-16], c=[-0.3826835515895542, -0.8819212004273601, -4.895645493785917e-17, 0.5555703541431356, 7.604763890745331e-17, 0.8819212357727804], d=[0.17176529181696437, 0.2368487673900065, 0.14917770890450574, 0.1717652936096813, 0.14917770890450574, 0.26054364754770065], id=11)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[2.951556794728753, 0.25000000000000006, 1.546379009261019]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.8314695313703749, -0.6343931847313768, -9.407783687275171e-17, -0.7071067811865477, 4.6785735571157934e-17, 0.6343930596531009], b=[-2.5874781661336954e-17, -2.017288423954374e-16, -0.9951847535586482, -3.271025955591196e-17, 0.9951847535586482, 2.8976857250342004e-16], c=[-0.5555703541431356, -0.7730105349646803, -3.580395356976111e-18, 0.7071067811865476, 1.6806240931471946e-16, 0.7730106376137246], d=[0.17176528321389806, 0.23684876708531497, 0.14917771303379723, 0.17176528039071642, 0.14917771303379732, 0.26054362697560607], id=12)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[3.2373583282186598, 0.25000000000000006, 1.3554125386482656]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.7071067811865476, -0.7730105349646805, 1.4294539431761725e-17, -0.5555703541431365, -1.0011594656793655e-16, 0.7730106376137243], b=[-3.271025955591198e-17, 3.575892059148325e-17, -0.9951847140642529, -1.281524780432438e-16, 0.9951847140642531, -1.5314522225483436e-16], c=[-0.7071067811865477, -0.6343931847313765, -1.7054773672941695e-16, 0.8314695313703743, 1.0011594656793657e-16, 0.6343930596531013], d=[0.17176528039071673, 0.2368487670853149, 0.1491777071096379, 0.1717652832138976, 0.14917770710963804, 0.2605436269756061], id=13)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[3.480412538648266, 0.25000000000000006, 1.1123583282186595]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.5555703541431364, -0.8819212004273601, -5.940828355224751e-17, -0.3826835515895541, -9.791291418020404e-17, 0.8819212357727808], b=[-0.0, 0.0, -0.9951847256846824, -7.081068168667528e-17, 0.9951847256846825, 1.6318821031013536e-16], c=[-0.8314695313703744, -0.4713968564137484, 2.877832969195519e-16, 0.9238794831268876, -5.233556005286094e-17, 0.4713967902871328], d=[0.1717652936096816, 0.23684876739000565, 0.14917770885270232, 0.1717652918169646, 0.14917770885270248, 0.26054364754770154], id=14)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[3.67137900926102, 0.25000000000000006, 0.8265567947287534]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.3826835515895541, -0.9569403497890109, 1.3120987351899408e-16, -0.1950901817601222, -5.205934650832478e-17, 0.9569403375852948], b=[2.063573865343809e-16, -3.482132063787019e-17, -0.9951847092768996, -1.814817385818039e-16, 0.9951847092768998, -5.371345426694166e-17], c=[-0.9238794831268877, -0.2902846309153925, 2.6066774258432397e-16, 0.9807853083018743, -1.6303580705062395e-16, 0.2902846711456568], d=[0.17176528561465604, 0.23684874980903342, 0.1491777063915349, 0.17176528805639077, 0.14917770639153502, 0.2605436615950846], id=15)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[3.802919033202627, 0.25, 0.5089911606262629]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#####################
bbb=Body()
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=[0.9951847203916262, 0.19509018176012233, 0.0, -1.0, -0.0, -0.0, -8.881784197001253e-17], b=[-0.0, -0.0, -0.19509018176012233, -0.0, 0.19509018176012233, -0.0, -5.551115123125783e-17], c=[0.09801720409724574, -0.9807853083018744, -0.0, -0.0, 0.0, -1.0, 1.0], d=[0.33718187240539327, 0.17888318179899973, 0.04867254544003058, 0.30369208061629593, 0.04867254544003057, 0.21030951666585695, 0.17967108333414306], id=16)
utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=[0,0,0], fixed=False)
bbb.state.pos =[3.946207919383704, 0.25, 0.17977108333414304]
bbb.state.ori=Quaternion((0,1,0),pi)
O.bodies.append(bbb)
#########################################################################################################################

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