Re: [Yade-users] [Question #641619]: strain - stress curve of three point bending test

2017-06-11 Thread Tina Asia
Question #641619 on Yade changed:
https://answers.launchpad.net/yade/+question/641619

Status: Answered => Open

Tina Asia is still having a problem:
Hi Jan,

Could you tell me the algorithm of calculating the stress-strain
relationship in YADE? I will do that by writing my own code.

Thanks in advance,

Tina

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


[Yade-users] [Question #641619]: strain - stress curve of three point bending test

2017-06-06 Thread Tina Asia
New question #641619 on Yade:
https://answers.launchpad.net/yade/+question/641619

Hi,

How to calculate the strain-stress curve in a three-point bending test?  I have 
read some similar questions about strain-stress curve, but still have no idea 
to do this. 

I created my sample using jcfpmmat. I have got the strain-stress curve when my 
sample was compressed in a uniaxial compression using UniaxialStrainer 
(https://yade-dem.org/doc/yade.wrapper.html?highlight=strain#yade.wrapper.UniaxialStrainer).
 However, in a three-point bending test, I really have no any idea to work out 
it.

Can anyone give me some hints or tips to do this?

Thanks in advance,

Tina

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #626814]: Calculate the particle size distribution after particle crushing

2017-05-09 Thread Tina Asia
Question #626814 on Yade changed:
https://answers.launchpad.net/yade/+question/626814

Status: Answered => Open

Tina Asia is still having a problem:
Hi Jan,

Sorry for my delay, I can not understand * in your former reply. I have
modified your function, but still got the ids of those particles rather
than their sizes because of their varied radius.

Your reply will be highly apperciated.
Many thanks,

Tina

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #625502]: How to get the minimum porosity of packing using randomDensePack

2017-05-04 Thread Tina Asia
Question #625502 on Yade changed:
https://answers.launchpad.net/yade/+question/625502

Status: Open => Answered

Tina Asia proposed the following answer:
Hi Huihuang,

I just posted a same question here:
https://answers.launchpad.net/yade/+question/630281
https://answers.launchpad.net/yade/+question/628632

Jan answered my two questions, and I have tried Jan's methods. They
really work well for my simulations.

Cheers,

Tina @ Yade

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #630281]: randomDensePack explodes because of penetrationDepth

2017-05-03 Thread Tina Asia
Question #630281 on Yade changed:
https://answers.launchpad.net/yade/+question/630281

Tina Asia confirmed that the question is solved:
Thanks Jan Stránský, that solved my question.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #630281]: randomDensePack explodes because of penetrationDepth

2017-05-03 Thread Tina Asia
Question #630281 on Yade changed:
https://answers.launchpad.net/yade/+question/630281

Status: Answered => Solved

Tina Asia confirmed that the question is solved:
Thanks Jan,

Sorry for my carelessness!

Thanks for your patience!

Tina

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #630281]: randomDensePack explodes because of penetrationDepth

2017-05-03 Thread Tina Asia
Question #630281 on Yade changed:
https://answers.launchpad.net/yade/+question/630281

Status: Answered => Open

Tina Asia is still having a problem:
Hi Jan,

Thanks for your help, but I still got a explosion. Here is my script:

from yade import pack
from yade import qt,utils

stone=CohFrictMat(young=5.0e10,poisson=0.25,density=2640,frictionAngle=radians(18),isCohesive=True,normalCohesion=4.5e6,shearCohesion=4.5e7,momentRotationLaw=True)
O.materials.append(stone)
steel=CohFrictMat(young=3.06e11,poisson=0.29,density=7861,frictionAngle=0.545,normalCohesion=0,shearCohesion=0)
O.materials.append(steel)

pred=pack.inSphere((0,0,0.5),0.25)
#sphs=pack.regularHexa(pred,radius=0.01,gap=0,material=stone)
sphs=pack.randomDensePack(pred,radius=0.025,rRelFuzz=0,material=stone)
O.bodies.append(sphs)

for i in sphs:
velocity=i.state.vel=(0,0,-25)

O.bodies.append(geom.facetBox((0,0,0.2),(0.3,0.3,0.003),material=steel))

O.engines=[
ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.5),Bo1_Facet_Aabb()]),
InteractionLoop(

[Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor=1.5),Ig2_Facet_Sphere_ScGeom6D()],
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True)],
[Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
#VTKRecorder(fileName='post/0deg-',recorders=['all'],iterPeriod=50),

#GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=5,timestepSafetyCoefficient=0.8,defaultDt=PWaveTimeStep()),
NewtonIntegrator(damping=0.3,gravity=(0,0,-9.81)),

]

O.dt = 0
for i in O.interactions:
i.phys.unp = i.geom.penetrationDepth
O.dt=0.3e-7

qt.Controller()
qt.View()


Recently, I have tried many methods:
As it was posted in https://answers.launchpad.net/yade/+question/266828, I 
added this code segment into my script, but also failed:

O.bodies.dynamic=False
O.step()
for j in O.interactions:
j.phys.unp = j.geom.penetrationDepth
O.bodies.dynamic=True
O.dt=0.3e-7

I guess the explosion was a consequence of the repulsive force was
greater than the bonded strength between contacting particles.

Thanks for your patience!

Tina @ Yade

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #628632]: Modeling particle breakage in YADE

2017-04-30 Thread Tina Asia
Question #628632 on Yade changed:
https://answers.launchpad.net/yade/+question/628632

Status: Open => Solved

Tina Asia confirmed that the question is solved:
Thanks Jan,

I have got a desired porosity (about 0.27) packing using randomDensePack and 
growParticles. Thus, there is no need to write a function compressing irregular 
shapes. But, this packing always ‘explodes’ because of particles' 
penetrationDepth. I have searched some questions in LaunchPad, but those 
methods all failed. As my new question was posted here:
https://answers.launchpad.net/yade/+question/630281


Thanks for your patience.
Regards,

Tina @ Yade

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #628632]: Modeling particle breakage in YADE

2017-04-29 Thread Tina Asia
Question #628632 on Yade changed:
https://answers.launchpad.net/yade/+question/628632

Status: Answered => Open

Tina Asia is still having a problem:
Thanks Jan,

I am a new user of Yade, and I have studied yade just over 2 months, but
I still have a great passion and interests on Yade. I have studied the
source code of randomDensePack, but I have no any idea to write my own
code compressing the packing using arbitrary shape. Can you give me some
hints.

Many thanks!

Tina @yade

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


[Yade-users] [Question #630281]: randomDensePack explodes because of penetrationDepth

2017-04-29 Thread Tina Asia
New question #630281 on Yade:
https://answers.launchpad.net/yade/+question/630281

Hi,

I have created a spherical packing using randomDensePack without giving 
spheresInCell, but when I using this packing in my simulation, this packing 
explodes. 

I add i.phys.unp=i.geom.penetrationDepth, but this method also failed. Here is 
my code:

from yade import pack
from yade import qt,utils

stone=CohFrictMat(young=5.0e10,poisson=0.25,density=2640,frictionAngle=radians(18),isCohesive=True,normalCohesion=4.5e6,shearCohesion=4.5e7,momentRotationLaw=True)
O.materials.append(stone)
steel=CohFrictMat(young=3.06e11,poisson=0.29,density=7861,frictionAngle=0.545,normalCohesion=0,shearCohesion=0)
O.materials.append(steel)

pred=pack.inSphere((0,0,0.5),0.25)
#sphs=pack.regularHexa(pred,radius=0.01,gap=0,material=stone)
sphs=pack.randomDensePack(pred,radius=0.025,rRelFuzz=0,material=stone)
O.bodies.append(sphs)

for i in sphs:
 #global velocity
 velocity=i.state.vel=(0,0,-25)

O.bodies.append(geom.facetBox((0,0,0.2),(0.3,0.3,0.003),material=steel))

O.engines=[
ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.5),Bo1_Facet_Aabb()]),
InteractionLoop(

[Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor=1.5),Ig2_Facet_Sphere_ScGeom6D()],
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True)],
[Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
VTKRecorder(fileName='post/0deg-',recorders=['all'],iterPeriod=50),

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=5,timestepSafetyCoefficient=0.8,defaultDt=PWaveTimeStep()),
NewtonIntegrator(damping=0.3,gravity=(0,0,-9.81)),

]

O.trackEnergy=True


O.dt=utils.PWaveTimeStep()
O.usesTimeStepper=True

qt.Controller()
qt.View()

O.run(1,True)
for i in O.interactions:
  i.phys.unp=i.geom.penetrationDepth

BTW: when i using regularHexa packing, there is no error.
Thanks in advances.

Tina


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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #628632]: Modeling particle breakage in YADE

2017-04-27 Thread Tina Asia
Question #628632 on Yade changed:
https://answers.launchpad.net/yade/+question/628632

Tina Asia gave more information on the question:
Hi Jan,

Thanks for your reply, I tried randomDensePack withous gives
spheresInCell, but I got a very unstable simulation, once it run, all
spheres fly around. The simulation just gave some warnings without
errors. Here is my code:

from yade import pack
from yade import qt,utils

stone=CohFrictMat(young=5.0e10,poisson=0.25,density=2640,frictionAngle=radians(18),isCohesive=True,normalCohesion=4.5e6,shearCohesion=4.5e7,momentRotationLaw=True)
O.materials.append(stone)
steel=CohFrictMat(young=3.06e11,poisson=0.29,density=7861,frictionAngle=0.545,normalCohesion=0,shearCohesion=0)
O.materials.append(steel)

pred=pack.inSphere((0,0,0.5),0.25)
#sphs=pack.regularHexa(pred,radius=0.01,gap=0,material=stone)
sphs=pack.randomDensePack(pred,radius=0.025,rRelFuzz=0,material=stone)
O.bodies.append(sphs)

for i in sphs:
 #global velocity
 velocity=i.state.vel=(0,0,-25)

O.bodies.append(geom.facetBox((0,0,0.2),(0.3,0.3,0.003),material=steel))

O.engines=[
ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.5),Bo1_Facet_Aabb()]),
InteractionLoop(

[Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor=1.5),Ig2_Facet_Sphere_ScGeom6D()],
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True)],
[Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
VTKRecorder(fileName='post/0deg-',recorders=['all'],iterPeriod=50),

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=5,timestepSafetyCoefficient=0.8,defaultDt=PWaveTimeStep()),
NewtonIntegrator(damping=0.3,gravity=(0,0,-9.81)),

]

O.trackEnergy=True
O.step()

O.dt=utils.PWaveTimeStep()
O.usesTimeStepper=True

qt.Controller()
qt.View()

But when I tried regularHexa packing, I got a very stable simulation.

Thanks in advance.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #628632]: Modeling particle breakage in YADE

2017-04-27 Thread Tina Asia
Question #628632 on Yade changed:
https://answers.launchpad.net/yade/+question/628632

Status: Answered => Open

Tina Asia is still having a problem:
Hi Tina,

Thanks for your reply, I tried randomDensePack withous gives
spheresInCell, but I got a very unstable simulation, once it run, all
spheres fly around. The simulation just gave some warnings without
errors. Here is my code:

from yade import pack
from yade import qt,utils

stone=CohFrictMat(young=5.0e10,poisson=0.25,density=2640,frictionAngle=radians(18),isCohesive=True,normalCohesion=4.5e6,shearCohesion=4.5e7,momentRotationLaw=True)
O.materials.append(stone)
steel=CohFrictMat(young=3.06e11,poisson=0.29,density=7861,frictionAngle=0.545,normalCohesion=0,shearCohesion=0)
O.materials.append(steel)

pred=pack.inSphere((0,0,0.5),0.25)
#sphs=pack.regularHexa(pred,radius=0.01,gap=0,material=stone)
sphs=pack.randomDensePack(pred,radius=0.025,rRelFuzz=0,material=stone)
O.bodies.append(sphs)

for i in sphs:
#global velocity
velocity=i.state.vel=(0,0,-25)

O.bodies.append(geom.facetBox((0,0,0.2),(0.3,0.3,0.003),material=steel))

O.engines=[
ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.5),Bo1_Facet_Aabb()]),
InteractionLoop(

[Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor=1.5),Ig2_Facet_Sphere_ScGeom6D()],
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True)],
[Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
VTKRecorder(fileName='post/0deg-',recorders=['all'],iterPeriod=50),

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=5,timestepSafetyCoefficient=0.8,defaultDt=PWaveTimeStep()),
NewtonIntegrator(damping=0.3,gravity=(0,0,-9.81)),

]

O.trackEnergy=True
O.step()

O.dt=utils.PWaveTimeStep()
O.usesTimeStepper=True

qt.Controller()
qt.View()

But when I tried regularHexa packing, I got a very  stable simulation.


Thanks in advance.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


[Yade-users] [Question #628632]: Modeling particle breakage in YADE

2017-04-26 Thread Tina Asia
New question #628632 on Yade:
https://answers.launchpad.net/yade/+question/628632

HI,

I created a complex structure in a CAD code and exported it as *.gts. In YADE, 
I filled this *.gts using cohfrictmat model and randomdensepack. But to my 
disappointment, the porosity of this packing is greater than 0.7. 

Actually, I want to model breakage of this brittle material whose porosity is 
no greater than 0.3. Besides, I also tried regularHexa, but this approach also 
got a lower solid fraction.

Recently, I checked the following questions: 
https://answers.launchpad.net/yade/+question/473518 and 
https://answers.launchpad.net/yade/+question/625502, in those questions, 
triaxial compression was recommanded to get a desired porosity, but ,in my 
simulations, a irregular boundary was used, triaxial compression also works on 
irregular packing??

Besides, I tried filterSpherePack function proposed in 
https://answers.launchpad.net/yade/+question/246971, but after the generation 
of a compressed cubic packing, I failed filter my irregular packing from the 
cubic packing and exported my packing. 

https://answers.launchpad.net/yade/+question/625502 shares a very similar 
problem with me, but this question has not be solved  yet.

Thanks in advance,

Tina



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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


[Yade-users] [Question #626814]: Calculate the particle size distribution after particle crushing

2017-04-24 Thread Tina Asia
New question #626814 on Yade:
https://answers.launchpad.net/yade/+question/626814

Hello,

In my simulation, a cohfrictmat was used to define cohesive bonds between 
discrete elements which consist of a packing.
After this packing crushing under dynamic loads, whether the particle size 
distribution can be calculated??
 https://answers.launchpad.net/yade/+question/292911, gives a reference, but I 
tried add this function to my code, it only got set[n1,n2], not the particle 
size distribution.

Can you help me solve this problem?

Thanks!

Tina,
NTU

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #432617]: How to plot damage ratio curve

2017-03-14 Thread Tina Asia
Question #432617 on Yade changed:
https://answers.launchpad.net/yade/+question/432617

Status: Answered => Solved

Tina Asia confirmed that the question is solved:
Thanks Luc Scholtès, that solved my question.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #432617]: How to plot damage ratio curve

2017-03-09 Thread Tina Asia
Question #432617 on Yade changed:
https://answers.launchpad.net/yade/+question/432617

Status: Answered => Open

Tina Asia is still having a problem:
Hi Luc,

Thanks for your patience, I adjusted my code and It goes well, but the
output is wrong,because the number of broken bonds does not grow
gradually with the increase of computation time (number of broken bonds:
1,23,42,32,15...). Here is a segment of my code.

O.step()
# calculate the total intact cohesive bonds
global sumCohBonds
sumCohBonds=0
for b in O.interactions: 
if b.phys.cohesionBroken==True:
continue
sumCohBonds+=1
print 'first time:{}'.format(sumCohBonds)

numBroCohBonds=0
def damageRatio():
for br in O.interactions: 
if br.phys.cohesionBroken==False:
continue
numBroCohBonds+=1# calculate broken bonds
damageRatio=numBroCohBonds/float(sumCohBonds)
print numBroCohBonds,damageRatio
print 'second time:{}'.format(sumCohBonds)

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #432617]: How to plot damage ratio curve

2017-03-08 Thread Tina Asia
Question #432617 on Yade changed:
https://answers.launchpad.net/yade/+question/432617

Status: Answered => Open

Tina Asia is still having a problem:
Thanks Luc,

According to your code, I wrote the following script, but got an error (File 
"impact.py", line 104, in 
damageRatio=numBroCohBonds/sumCohBonds
ZeroDivisionError: integer division or modulo by zero)

Here is a segment of my code:

#calculate total intact cohesive bonds
global sumCohBonds
sumCohBonds=0
for b in O.interactions: 
if b.phys.cohesionBroken==True:
continue
sumCohBonds+=1

#define a function to calculate broken cohesive bonds
global damageRatio
numBroCohBonds=0
def damageRatio():
for b in O.interactions:
if not b.isReal:
continue 
if b.phys.cohesionBroken==True:
numBroCohBonds+=1
damageRatio=numBroCohBonds/sumCohBonds
plot.saveDataTxt('data/damageratio.txt')

#define a function to plot damage ratio
def addPlotData(): 
plot.addData(t=O.time,dr=damageRatio)
plot.plots={'t':('dr')}
plot.plot()


Thanks in advance.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #497350]: Export a polyhedron into a *.stl or * .gts file

2017-03-03 Thread Tina Asia
Question #497350 on Yade changed:
https://answers.launchpad.net/yade/+question/497350

Tina Asia posted a new comment:
Hi Jan,

I have tried this code in Yade 1.20, and It gets a correct result.
Anyway, thank you very much. The latest version (2017.01a) may contain a
bug.

Best regards,

Tina

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #497350]: Export a polyhedron into a *.stl or * .gts file

2017-03-03 Thread Tina Asia
Question #497350 on Yade changed:
https://answers.launchpad.net/yade/+question/497350

Status: Answered => Solved

Tina Asia confirmed that the question is solved:
Thanks Jan Stránský, that solved my question.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #497350]: Export a polyhedron into a *.stl or * .gts file

2017-03-03 Thread Tina Asia
Question #497350 on Yade changed:
https://answers.launchpad.net/yade/+question/497350

Tina Asia posted a new comment:
Thanks Jan,

I just ran this code in my yade2017.01a, but it still failed. I guess
something wrong happens when I copy the code, please send this code in
.py format to my E-mail:1014198...@qq.com


Thanks for your patience,
Best regards.

Tina

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #497350]: Export a polyhedron into a *.stl or * .gts file

2017-03-03 Thread Tina Asia
Question #497350 on Yade changed:
https://answers.launchpad.net/yade/+question/497350

Status: Answered => Open

Tina Asia is still having a problem:
Jan,

Thanks for your patience, but the error---"Can't open file: tina.st" still 
exists. I guess there is something wrong with the code---"poly2stl" ,although 
the *.stl can be displayed in Meshlab and looks identical with polyhedron 
generated in Yade.
Besides, I converted *.stl to *.gts using stl2gts, and using the following code 
to fill this polyhedron, but it got a cuboid package.
I replaced this *.gts with horse.coarse.gts, and this one got correct result.  
Thus, I guess the poly2stl outputs something wrong, please check this 
code---poly2stl.

Many thanks.

My code was as following:

from yade import ymport
from yade import pack
surface=gts.read(open('poly.gts'))
pred=pack.inGtsSurface(surface)
assembly=pack.randomDensePack(pred,radius=0.001,rRelFuzz=0.3,spheresInCell=500)
O.bodies.append(assembly)

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #497350]: Export a polyhedron into a *.stl or * .gts file

2017-03-02 Thread Tina Asia
Question #497350 on Yade changed:
https://answers.launchpad.net/yade/+question/497350

Status: Answered => Open

Tina Asia is still having a problem:
Hi Jan,

Thanks for your patience, but I got an error by importing the *.stl file
generated by the above code. The error and my new code are as follows.

from yade import ymport
from yade import pack
from yade import qt

pred=O.bodies.append(ymport.stl('tina.stl'))
spheres=pack.randomDensePack(pred,radius=0.001,rRelFuzz=0.3,spheresInCell=500,color=(1,0,1))
O.bodies.append(spheres)

qt.View()
qt.Controller()

I got this error:

$ yade fillsphere.pyWelcome to Yade 2017.01a 
TCP python prompt on localhost:9000, auth cookie `sdcaek'
XMLRPC info provider on http://localhost:21000
Running script fillsphere.py
ERROR /home/tina/YADE/trunk/pkg/dem/STLImporter.cpp:23 import: Can't open file: 
tina.stl
Traceback (most recent call last):
  File "/home/tina/YADE/install/bin/yade", line 182, in runScript
execfile(script,globals())
  File "fillsphere.py", line 6, in 

spheres=pack.randomDensePack(pred,radius=0.001,rRelFuzz=0.3,spheresInCell=500,color=(1,0,1))
  File "/home/tina/YADE/install/lib/x86_64-linux-gnu/yade/py/yade/pack.py", 
line 490, in randomDensePack
if not dim: dim=predicate.dim()
AttributeError: 'list' object has no attribute 'dim'
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view (use h-key for 
showing help), F10 both, F9 generator, F8 plot. ]]

Besides, I also tried pack.inConvexPolyhedron (https://www.yade-
dem.org/doc/yade.pack.html?highlight=pack.in#yade.pack.inConvexPolyhedron)
to fill a polyhedron with many sub-particles, but this one got error
too:

This is my code:

from yade import polyhedra_utils

rock = PolyhedraMat()
rock.IsSplitable = True
rock.strength = 6e3

poly = polyhedra_utils.polyhedra(rock, size=(0.01,0.02,0.01), seed=1)
O.bodies.append(poly)

pred=pack.inConvexPolyhedron(poly)
aabb=pred.aabb()
dim0=aabb[1][0]-aabb[0][0]
spheres=O.bodies.append(pack.randomDensePack(pred,radius=0.001,rRelFuzz=0.3,spheresInCell=300))
O.bodies.append(spheres)

from yade import qt
qt.View()
qt.Controller()

and this is the error:

~/Desktop/polyhedra$ yade poly.py
Welcome to Yade 2017.01a 
TCP python prompt on localhost:9000, auth cookie `yudssc'
XMLRPC info provider on http://localhost:21000
Running script poly.py
Traceback (most recent call last):
  File "/home/tina/YADE/install/bin/yade", line 182, in runScript
execfile(script,globals())
  File "poly.py", line 10, in 
pred=pack.inConvexPolyhedron(poly)
  File "/home/tina/YADE/install/lib/x86_64-linux-gnu/yade/py/yade/pack.py", 
line 208, in __init__
self._inHalfSpaces = [inHalfSpace(c,d) for c,d in planes]
TypeError: 'Body' object is not iterable
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view (use h-key for 
showing help), F10 both, F9 generator, F8 plot. ]]

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #497350]: Export a polyhedron into a *.stl or * .gts file

2017-03-01 Thread Tina Asia
Question #497350 on Yade changed:
https://answers.launchpad.net/yade/+question/497350

Status: Answered => Open

Tina Asia is still having a problem:
Thanks Jan,

My goal is to fill this polyhedron with some sub-particles, export *.stl
may be an unwise decision.  Is there any better method to finish this
task??

Tina,
NTU

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #497350]: Export a polyhedron into a *.stl or * .gts file

2017-02-28 Thread Tina Asia
Question #497350 on Yade changed:
https://answers.launchpad.net/yade/+question/497350

Status: Answered => Open

Tina Asia is still having a problem:
Hi,

Jan, I have tried your code, but the *.stl only contains some triangles,
My code is as follows (My YADE is the latest vision):

from yade import polyhedra_utils
from yade import export
from yade import plot
from yade import qt

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

#create a polyhedron
poly=polyhedra_utils.polyhedra(material=gravel,size=(0.05,0.05,0.05),seed=1)
O.bodies.append(poly)
poly.state.pos=(0,0,0.025)

def polyhedra2stl(stl): # stl is string file name, e.g. 'test.stl'
# get triangles
trisCoords = []
for b in O.bodies:
if not isinstance(b.shape,Polyhedra): # skip non-polyhedra bodies
continue
vs = [b.state.pos + b.state.ori*v for v in b.shape.v] # vertices in 
global coords
trisIds = b.shape.GetSurfaceTriangulation() # "triangles" in one array
l = len(trisIds) / 3
trisIds = [trisIds[3*i:3*i+3] for i in range(l)] # triangles as array 
of three indices
for t in trisIds:
trisCoords.append([vs[i] for i in t]) # triangles as coords of its 
vertices
# generate content of stl file, see [1]
lines = ['solid polyhedra']
for v1,v2,v3 in trisCoords:
n = (v2-v1).cross(v3-v1)
lines.append('facet normal {} {} {}'.format(n[0],n[1],n[2]))
lines.append(' outer loop')
for v in (v1,v2,v3):
lines.append(' vertex {} {} {}'.format(v[0],v[1],v[2]))
lines.append(' endloop')
lines.append('endfacet')
lines.append('endsolid polyhedra')
# write to file
with open(stl,'w') as f:
f.writelines(l+'\n' for l in lines)

polyhedra2stl('tina.stl')

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #497350]: Export a polyhedron into a *.stl or * .gts file

2017-02-28 Thread Tina Asia
Question #497350 on Yade changed:
https://answers.launchpad.net/yade/+question/497350

Status: Answered => Open

Tina Asia is still having a problem:
Hi,

Thanks Jan, I tried some methods to convert *.txt to *.stl, but all
failed, Can you give me a help?

Thanks in advance,

Tina

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #406774]: Translation engine can not work

2016-12-20 Thread Tina Asia
Question #406774 on Yade changed:
https://answers.launchpad.net/yade/+question/406774

Status: Answered => Solved

Tina Asia confirmed that the question is solved:
Thanks Jan Stránský, that solved my question.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #406774]: Translation engine can not work

2016-12-18 Thread Tina Asia
Question #406774 on Yade changed:
https://answers.launchpad.net/yade/+question/406774

Status: Answered => Open

Tina Asia is still having a problem:
Hello,
Thanks Jan, 'can not move' means that the upper platen can not move downwoards 
with a  velocity which is set in the translationEngine. According to your 
advice, .mesh files were attached as follows. Thanks for your patience.

bottom_platen.mesh:

  MeshVersionFormatted 2
 Dimension
 3
 Vertices
 108
0 010  1
  44.6841506958015.32229280471810  1
  43.741031646729   10.56987190246610  1
  42.183883666992   15.66907405853310  1
  40.034568786621   20.54831504821810  1
  37.32325744628925.1391048431410  1
  34.08800506591829.3769950866710  1
  30.374235153198   33.20249938964810  1
  26.234077453613   36.56190872192410  1
  21.725648880005   39.40807342529310  1
  16.912240982056   41.70103073120110  1
  11.861422538757   43.40859985351610  1
  6.6440954208374   44.50680923461910  1
   1.333499789238   44.98023605346710  1
 -3.9958152770996   44.82224273681610  1
 -9.2690382003784   44.03504180908210  1
 -14.412143707275   42.62968444824210  1
 -19.352933883667   40.62590408325210  1
 -24.022052764893   38.05181884765610  1
 -28.353952407837   34.94357299804710  1
 -32.287826538086   31.34479713439910  1
 -35.768451690674   27.30600738525410  1
 -38.746963500977   22.88389968872110  1
 -41.181552886963   18.14055442810110  1
  -43.03804397583   13.14255428314210  1
 -44.290374755859   7.960062503814710  1
 -44.920967102051   2.665828227996810  1
 -44.920967102051  -2.665828227996810  1
 -44.290374755859  -7.960062503814710  1
  -43.03804397583  -13.14255428314210  1
 -41.181552886963  -18.14055442810110  1
 -38.746963500977  -22.88389968872110  1
 -35.768451690674  -27.30600738525410  1
 -32.287826538086  -31.34479713439910  1
 -28.353952407837  -34.94357299804710  1
 -24.022052764893  -38.05181884765610  1
 -19.352933883667  -40.62590408325210  1
 -14.412143707275  -42.62968444824210  1
 -9.2690382003784  -44.03504180908210  1
 -3.9958152770996  -44.82224273681610  1
   1.333499789238  -44.98023605346710  1
  6.6440954208374  -44.50680923461910  1
  11.861422538757  -43.40859985351610  1
  16.912240982056  -41.70103073120110  1
  21.725648880005  -39.40807342529310  1
  26.234077453613  -36.56190872192410  1
  30.374235153198  -33.20249938964810  1
  34.088005065918   -29.3769950866710  1
  37.323257446289   -25.1391048431410  1
  40.034568786621  -20.54831504821810  1
  42.183883666992  -15.66907405853310  1
  43.741031646729  -10.56987190246610  1
  44.684150695801   -5.32229280471810  1
   45 010  1
   45 0 0  1
  44.6841506958015.322292804718   

Re: [Yade-users] [Question #406774]: Translation engine can not work

2016-12-16 Thread Tina Asia
Question #406774 on Yade changed:
https://answers.launchpad.net/yade/+question/406774

Status: Answered => Open

Tina Asia is still having a problem:
Hello,
Thanks Jerome and Jan, my code got no error but the upper platen still fixed. 
According to Jan's advice, my code got an error and the particle assembly 
disintegrated, sub-particles flew here and there. The error is here:
huihuang@huihuang-Aspire-F5-572G:~$ cd Desktop/single_particle
huihuang@huihuang-Aspire-F5-572G:~/Desktop/single_particle$ yade BPM.py
Welcome to Yade 1.20.0 
TCP python prompt on localhost:9000, auth cookie `skcsyd'
XMLRPC info provider on http://localhost:21000
Running script BPM.py
No suitable packing in database found, running PERIODIC compression
/usr/lib/x86_64-linux-gnu/yade/py/yade/pack.py:296: FutureWarning: The default 
behavior will change; specify returnSpherePack=True for the new behavior, and 
False to get rid of this warning (your code will break in the future, however). 
The returned SpherePack object can be added to the simulation using 
SpherePack.toSimulation()
  warnings.warn('The default behavior will change; specify 
returnSpherePack=True for the new behavior, and False to get rid of this 
warning (your code will break in the future, however). The returned SpherePack 
object can be added to the simulation using 
SpherePack.toSimulation()',category=FutureWarning)
Traceback (most recent call last):
  File "/usr/bin/yade", line 182, in runScript
execfile(script,globals())
  File "BPM.py", line 26, in 

TranslationEngine(translationAxis=(0,0,-1),velocity=0.09,ids=[upper_platen],label='trans'),
TypeError: No registered converter was able to produce a C++ rvalue of type int 
from this Python object of type list
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view (use h-key for 
showing help), F10 both, F9 generator, F8 plot. ]]

Yade [1]:

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


[Yade-users] [Question #406774]: Translation engine can not work

2016-12-15 Thread Tina Asia
New question #406774 on Yade:
https://answers.launchpad.net/yade/+question/406774

Hi,
I am a new user of YADE, and I want to simulate a single particle crushing 
under compression. But, the upper platen can not move without any error.my code 
is as follows:
please help me to solve this trouble, many thanks.


from yade import ymport
from yade import pack
from yade import qt
# define materials for particles assembly and rigid platen #
rock=O.materials.append(CohFrictMat(young=5.98e7,poisson=0.3,density=2678,frictionAngle=0.5,normalCohesion=7.9e6,shearCohesion=7.9e6,momentRotationLaw=True))
steel=O.materials.append(FrictMat(young=3.06e11,poisson=0.29,density=7861,frictionAngle=0.545))
# create a partcicle assembly in a sphere
pred=pack.inSphere((0,0,0.05),0.035)
spheres=pack.randomDensePack(pred,radius=0.001,spheresInCell=100,rRelFuzz=0.2)
O.bodies.append(spheres)
# import platens for this simulation
bottom_platen=O.bodies.append(ymport.gmsh('Desktop/single_particle/bottom_platen.mesh',scale=0.001,color=(1,1,0),material=steel))
upper_platen=O.bodies.append(ymport.gmsh('Desktop/single_particle/upper_platen.mesh',scale=0.001,color=(1,0,0),material=steel))
# engines #
O.engines=[
ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
InteractionLoop(

[Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor=1.1),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],

[Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True)],

[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),

TranslationEngine(translationAxis=(0,0,-1),velocity=0.09,ids=upper_platen,label='trans'),
NewtonIntegrator(gravity=(0,0,-9.81)),
#VTKRecorder(fileName='post/comp-',recorders=['all'],iterPeriod=100)
]
# 3D view & controller
qt.View()
qt.Controller()
# set timestep & run this simulation
O.dt=0.3*PWaveTimeStep()
#O.run()

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp