[Yade-users] [Question #403695]: RotationEngine can't work

2016-10-31 Thread xjin
New question #403695 on Yade:
https://answers.launchpad.net/yade/+question/403695

I am trying to model a rigid body consisted by particles which are clumped. And 
when I try to use RotationEngine to make it rotate, I get a problem.
The script is like this:

bodylist=[]
bodylist.append(O.bodies.append(sphere([0,0,0],1)))
for ix in range(0,10):
bodylist.append(O.bodies.append(sphere([0.5+ix,0,0],0.5)))
bodylist.append(O.bodies.append(sphere([-0.5-ix,0,0],0.5)))

for iy in range(0,10):
bodylist.append(O.bodies.append(sphere([0,0.5+iy,0],0.5)))
bodylist.append(O.bodies.append(sphere([0,-0.5-iy,0],0.5))) 

idclump=O.bodies.clump(bodylist)
q=O.bodies[len(O.bodies)-1]

globals()['q']=locals()['q']
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_L3Geom(),Ig2_Facet_Sphere_L3Geom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_L3Geom_FrictPhys_ElPerfPl()]
),   
NewtonIntegrator(gravity=(0,0,-9.8),damping=0.4),
RotationEngine(ids=q.id,
angularVelocity=1,
rotationAxis=(1,1,0),
rotateAroundZero=1,
zeroPoint=(1,1,1))
]
O.dt=0.05*PWaveTimeStep()



When I type the script, the termination notice me a problem before the O.dt.
 It tells me that :

---
TypeError Traceback (most recent call last)
/home/dj/yade/install/bin/yade in ()
 12 rotationAxis=(1,1,0),
 13 rotateAroundZero=1,
---> 14 zeroPoint=(1,1,1))
 15 ]

TypeError: No registered converter was able to produce a C++ rvalue of type 
std::vector > from this Python object of type int


I type it following the information in your website, and I try some ways but 
all failed.Can you tell me how to use RotationEngine correctly?
Thanks for any suggestions
xjin

-- 
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 #372295]: specific number of spheres in randomDennsePack

2016-10-31 Thread Jérôme Duriez
Question #372295 on Yade changed:
https://answers.launchpad.net/yade/+question/372295

Status: Open => Answered

Jérôme Duriez proposed the following answer:
Hi,

In case you're still facing issues (have you tried this above script and see 
what it gives ?), you may now refer to 
https://answers.launchpad.net/yade/+question/403663

Jerome

-- 
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 #403684]: Access to the global coordinates of polyhedra vertices

2016-10-31 Thread Ákos Orosz
Question #403684 on Yade changed:
https://answers.launchpad.net/yade/+question/403684

Status: Answered => Solved

Ákos Orosz 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 #403684]: Access to the global coordinates of polyhedra vertices

2016-10-31 Thread Jan Stránský
Question #403684 on Yade changed:
https://answers.launchpad.net/yade/+question/403684

Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Ákos,

for single body, you have to multiply the vertex by orientation and add
position. It is then easy to do it in a loop.
##
b = somePolyhedron
pos = b.state.pos
ori = b.state.ori
for vLocal in b.shape.v:
   vGlobal = pos + ori*vLocal
###

cheers
Jan


2016-10-31 21:33 GMT+01:00 Ákos Orosz 
:

> New question #403684 on Yade:
> https://answers.launchpad.net/yade/+question/403684
>
> Hi all,
>
> I’m trying to create an oedometric test (yadedaily (2016.06a)), similar to
> the tutorial [1] with polyhedral particles. After gravitational deposition,
> to put the top plate exactly on the top of the pile, I have to access to
> the global coordinates of all vertices of polyhedral particles (and then
> find the highest). For this, I used:
>
> ver=[i.shape.v for i in O.bodies if isinstance(i.shape,Polyhedra)]
>
> It seems, it returns with local coordinates, instead of globals (as stated
> in the docs [2]). Can you help, how to get the global ones?
>
> Thanks in advance,
> Ákos
>
> [1] https://yade-dem.org/doc/tutorial-examples.html#oedometric-test
> [2] https://yade-dem.org/doc/yade.wrapper.html?highlight=v#yade.
> wrapper.Polyhedra.v
>
>
> --
> 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
>

-- 
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 #403684]: Access to the global coordinates of polyhedra vertices

2016-10-31 Thread Ákos Orosz
New question #403684 on Yade:
https://answers.launchpad.net/yade/+question/403684

Hi all,

I’m trying to create an oedometric test (yadedaily (2016.06a)), similar to the 
tutorial [1] with polyhedral particles. After gravitational deposition, to put 
the top plate exactly on the top of the pile, I have to access to the global 
coordinates of all vertices of polyhedral particles (and then find the 
highest). For this, I used:

ver=[i.shape.v for i in O.bodies if isinstance(i.shape,Polyhedra)]

It seems, it returns with local coordinates, instead of globals (as stated in 
the docs [2]). Can you help, how to get the global ones?

Thanks in advance,
Ákos

[1] https://yade-dem.org/doc/tutorial-examples.html#oedometric-test
[2] 
https://yade-dem.org/doc/yade.wrapper.html?highlight=v#yade.wrapper.Polyhedra.v


-- 
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 #403669]: Uniaxial compression simulation disappeared suddenly in Yade

2016-10-31 Thread Jérôme Duriez
Question #403669 on Yade changed:
https://answers.launchpad.net/yade/+question/403669

Status: Open => Answered

Jérôme Duriez proposed the following answer:
Hello,

Your first error:
**
TranslationEngine(translationAxis=(0,0,-1),velocity=(0,0,0.005),id=20),
TypeError: No registered converter was able to produce a C++ rvalue of type 
double from this Python object of type tuple
**
is because velocity attribute of TranslationEngine should be a scalar (it's 
true it's quite surprising and not in the doc).

The right syntax is:
TranslationEngine(translationAxis=(0,0,-1),velocity=0.005,ids=[20]) # note the 
list for "ids" attribute (and not id)

Anyway, I recommend to follow the method described here: 
https://yade-dem.org/doc/user.html#imposing-conditions
to impose controlled motions, rather than engines such as TranslationEngine


You have a second error 

InsertionSortCollider::spatialOverlapPeri(Body::id_t, Body::id_t, Scene*, 
Vector3i&) const: Assertion `maxima[3*id2+axis]-minima[3*id2+axis]<.99*dim' 
failed.
*
but let's go step by step.


Also, it is possible the crash you get in the end:
**
Aborted (core dumped)
***
comes from another issue.


For instance, it is weird you include "Ip2_FrictMat_FrictMat_FrictPhys()" in 
your InteractionLoop in addition to 
"Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(..}", even though you do not have any 
"FrictMat" material properties in your simulation...
I'd strongly recommend you closely read 
https://yade-dem.org/doc/user.html#base-engines (at least..) to understand how 
to correctly define your engines list.

Since you're a beginner and you're facing several issues here (which is
normal for a beginner) reading closely the whole "User's manual" part of
the doc would obviously be very beneficial.


Jerome

-- 
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 #403663]: Modeling 2 materilas by CPM model

2016-10-31 Thread Seti
Question #403663 on Yade changed:
https://answers.launchpad.net/yade/+question/403663

Seti posted a new comment:
Thanks heaps Jan, it is working quite well.

-- 
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 #403663]: Modeling 2 materilas by CPM model

2016-10-31 Thread Seti
Question #403663 on Yade changed:
https://answers.launchpad.net/yade/+question/403663

Status: Answered => Solved

Seti 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


[Yade-users] [Question #403669]: Uniaxial compression simulation disappeared suddenly in Yade

2016-10-31 Thread Huihuang Xia
New question #403669 on Yade:
https://answers.launchpad.net/yade/+question/403669

Hi,
I am a beginning learner of Yade, I performed a uniaxial compression in 
Yade, but this simulation disappeared suddenly. Can you help me to solve this 
peoblem?
   Thanks in advance.
  My codes is as followings:



from yade import pack
O.periodic=True
O.cell.refSize=(0.05,0.05,0.15)

#specify materials for wall & particles
spheres=O.materials.append(CohFrictMat(young=5.98e7,density=2.7e3,poisson=0.3,frictionAngle=0.6))
wallMat=O.materials.append(CohFrictMat(young=2.06e17,density=7.9e3,poisson=0.29,frictionAngle=0.8))
O.bodies.append(

pack.regularHexa(pack.inAlignedBox((0,0,0),(0.05,0.05,0.15)),radius=0.001,gap=0,color=(0,1,0),material=spheres)
 
)

#creat upper & lower platens
from yade import utils
O.bodies.append(utils.geom.facetBox((0.025,0.025,0.15),(0.055,0.055,0),wallMask=20,material=wallMat,color=(1,0,1),dynamic=1))
O.bodies.append(utils.geom.facetBox((0.025,0.025,0),(0.055,0.055,0),wallMask=21,material=wallMat,color=(0,0,1),dynamic=0,fixed=1))

#Engines

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
   InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D()],
  
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
   ),
TranslationEngine(translationAxis=(0,0,-1),velocity=(0,0,0.005),id=20),
NewtonIntegrator(damping=0.2,gravity=[0,0,-9.81]),
VTKRecorder(fileName='post/comp-',recorders=['all'],iterPeriod=100)
]

#set a suitable timestep for this simulation

O.dt=0.01*PWaveTimeStep()

#3D view & controller
from yade import qt
qt.View()
qt.Controller()
O.run()


And here is the error:

huihuang@huihuang-Presario-CQ42-Notebook-PC:~$ cd Desktop/test
huihuang@huihuang-Presario-CQ42-Notebook-PC:~/Desktop/test$ yade 
compression_test.py
Welcome to Yade 1.20.0 
TCP python prompt on localhost:9002, auth cookie `ykasde'
XMLRPC info provider on http://localhost:21002
XmbTextListToTextProperty result code -2
XmbTextListToTextProperty result code -2
XmbTextListToTextProperty result code -2
Running script compression_test.py
WARN  /build/yade-KKgSmd/yade-1.20.0/core/Cell.hpp:115 setRefSize: Setting 
Cell.refSize is deprecated, use Cell.setBox(...) instead.
Traceback (most recent call last):
  File "/usr/bin/yade", line 182, in runScript
execfile(script,globals())
  File "compression_test.py", line 31, in 
TranslationEngine(translationAxis=(0,0,-1),velocity=(0,0,0.005),id=20),
TypeError: No registered converter was able to produce a C++ rvalue of type 
double from this Python object of type tuple
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view (use h-key for 
showing help), F10 both, F9 generator, F8 plot. ]]
[0;34mYade [[1;34m1[0;34m]: [0mXmbTextListToTextProperty result code -2
XmbTextListToTextProperty result code -2
XmbTextListToTextProperty result code -2
python: 
/build/yade-KKgSmd/yade-1.20.0/pkg/common/InsertionSortCollider.cpp:493: bool 
InsertionSortCollider::spatialOverlapPeri(Body::id_t, Body::id_t, Scene*, 
Vector3i&) const: Assertion `maxima[3*id2+axis]-minima[3*id2+axis]<.99*dim' 
failed.
Aborted (core dumped)

-- 
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 #403663]: Modeling 2 materilas by CPM model

2016-10-31 Thread Jan Stránský
Question #403663 on Yade changed:
https://answers.launchpad.net/yade/+question/403663

Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Seti,

random.random() returns uniform distribution random number in the range
(0,1), so random.random()<0.2 means that 0.2=20/100=20% of spheres will
have mat1, the rest 80% mat2. You can use of course any other value than
0.2.

The indentation error comes from your script, probably from copy-paste
process. I will rewrite the code with only spaces (I used tabs originally)
co copy-paste again should work. Please try it and let us know.

##
from yade import pack
import random

mat1 = CpmMat() # ...
mat2 = CpmMat() # ...

sp = pack.randomDensePack(pack.inAlignedBox((0,0,0),(1,1,1)),
radius=.05,spheresInCell=500,returnSpherePack=True)
sp.toSimulation()

for b in O.bodies:
  if random.random() < 0.2:
b.mat = mat1
b.shape.color = (1,0,0)
  else:
b.mat = mat2
  b.shape.color = (0,1,1)
##

cheers
Jan


2016-10-31 13:23 GMT+01:00 Seti :

> Question #403663 on Yade changed:
> https://answers.launchpad.net/yade/+question/403663
>
> Status: Answered => Open
>
> Seti is still having a problem:
> Hi Jan,
>
> Thanks so much for your reply,  would you please let me know what is
> meaning of " if random.random() < 0.2:" commend in your example?
>
> I have tried  to do a quick test based on your recommendation, below
> error will be pop up related to  "if random.random() < 0.2:" line
>
> "IndentationError: expected an indented block"
>
>
> Cheers,
> Seti
>
> --
> 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
>

-- 
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 #403663]: Modeling 2 materilas by CPM model

2016-10-31 Thread Seti
Question #403663 on Yade changed:
https://answers.launchpad.net/yade/+question/403663

Status: Answered => Open

Seti is still having a problem:
Hi Jan,

Thanks so much for your reply,  would you please let me know what is
meaning of " if random.random() < 0.2:" commend in your example?

I have tried  to do a quick test based on your recommendation, below
error will be pop up related to  "if random.random() < 0.2:" line

"IndentationError: expected an indented block"


Cheers,
Seti

-- 
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 #403663]: Modeling 2 materilas by CPM model

2016-10-31 Thread Jan Stránský
Question #403663 on Yade changed:
https://answers.launchpad.net/yade/+question/403663

Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Seti,

something like this?
##
from yade import pack
import random

mat1 = CpmMat() # ...
mat2 = CpmMat() # ...

sp =
pack.randomDensePack(pack.inAlignedBox((0,0,0),(1,1,1)),radius=.05,spheresInCell=500,returnSpherePack=True)
sp.toSimulation()

for b in O.bodies:
if random.random() < 0.2:
b.mat = mat1
b.shape.color = (1,0,0)
else:
b.mat = mat2
b.shape.color = (0,1,1)
##

cheers
Jan


2016-10-31 12:14 GMT+01:00 Seti :

> New question #403663 on Yade:
> https://answers.launchpad.net/yade/+question/403663
>
> Hi All,
>
> I have the same question which has been asked in  Q # 372295. I really
> need to know how I can control the percentage of spheres when I am
> modelling  different materials through CPM model.
>
> Can you please shed some lights on this issue?
>
>
> Cheers,
> Seti
>
> --
> 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
>

-- 
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 #403663]: Modeling 2 materilas by CPM model

2016-10-31 Thread Seti
New question #403663 on Yade:
https://answers.launchpad.net/yade/+question/403663

Hi All,

I have the same question which has been asked in  Q # 372295. I really need to 
know how I can control the percentage of spheres when I am modelling  different 
materials through CPM model.

Can you please shed some lights on this issue? 


Cheers,
Seti

-- 
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 #403385]: Micro and Macro relation in CPM pararmeters

2016-10-31 Thread mohsen
Question #403385 on Yade changed:
https://answers.launchpad.net/yade/+question/403385

Status: Answered => Solved

mohsen 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