Discussion:
[deprecated list] Simulation model
Anton Gladky
2009-05-22 08:11:29 UTC
Permalink
Hello All!

I have a physical schema, which is here Loading Image...
(200Kb)
This is the peaces of mining rocks, which needs to be destructed.

I would like to know your opinion according implementation this schema in
YADE.
Is it a good idea to use the lattice model, placing in the middle of nodes
spheres?

Thank you ahead

Best Regards / Mit freundlichen GrÌßen / С МаОлучшОЌО пПжелаМОяЌО

Anton Gladkyy
Václav Šmilauer
2009-05-22 09:15:55 UTC
Permalink
Post by Anton Gladky
I have a physical schema, which is here http://geom.com.ua/schema.png
(200Kb)
This is the peaces of mining rocks, which needs to be destructed.
I would like to know your opinion according implementation this schema
in YADE.
Is it a good idea to use the lattice model, placing in the middle of
nodes spheres?
I would just use DEM spheres for everything (IMHO what distinguishes
lattice models from DEM is that they have not collision detection for
nodes and most the time also no inertia within nodes).

You will have 2 different constitutive laws, one between spheres within
one cluster, which will be cohesive, and another one (or the same one
with a bool isCohesive or something like that) for the interactions of
spheres from 2 different clusters.

HTH, Vaclav



_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users-oU9gvf+***@public.gmane.org
Unsubscribe : https://launchpad.net/~yade-users
More help : https://help.launchpad.net/ListHelp
Anton Gladky
2009-05-22 13:40:21 UTC
Permalink
Thank you, Vaclav

I think I will solve my task by your supposed way.

In attachment there is the diff-file. I'v added 1 function. Hope it will be
useful.
I would like also to ask to inspect the code. Is it suitable, or corrections
are needed?
How often do you usually commit the code?

Thank you

Best Regards / Mit freundlichen GrÌßen / С МаОлучшОЌО пПжелаМОяЌО / З
МайкращОЌО пПбажаММяЌО

Anton Gladkyy
Post by Václav Šmilauer
Post by Anton Gladky
I have a physical schema, which is here http://geom.com.ua/schema.png
(200Kb)
This is the peaces of mining rocks, which needs to be destructed.
I would like to know your opinion according implementation this schema
in YADE.
Is it a good idea to use the lattice model, placing in the middle of
nodes spheres?
I would just use DEM spheres for everything (IMHO what distinguishes
lattice models from DEM is that they have not collision detection for
nodes and most the time also no inertia within nodes).
You will have 2 different constitutive laws, one between spheres within
one cluster, which will be cohesive, and another one (or the same one
with a bool isCohesive or something like that) for the interactions of
spheres from 2 different clusters.
HTH, Vaclav
_______________________________________________
Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
More help : https://help.launchpad.net/ListHelp
Václav Šmilauer
2009-05-23 10:30:39 UTC
Permalink
Post by Anton Gladky
In attachment there is the diff-file. I'v added 1 function. Hope it
will be useful.
I would like also to ask to inspect the code. Is it suitable, or
corrections are needed?
You write like a c-guy :-) I wrote it in a more python way (lists,
lists, tuples, etc), in particular using the numpy.arange function to
create list of values. Find it in r1774, utils.regularSphereOrthoPack
and scripts/test/regular-sphere-pack.py.
Post by Anton Gladky
How often do you usually commit the code?
Depends, not so often if I make bigger changes as to not break anything
for others; to make the commit a logical whole.

HTH



_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users-oU9gvf+***@public.gmane.org
Unsubscribe : https://launchpad.net/~yade-users
More help : https://help.launchpad.net/ListHelp
Anton Gladky
2009-05-25 06:30:18 UTC
Permalink
Ok, thank you.

Will check it today. Python is a new program language for me, so I just used
examples to write new function.


Best Regards / Mit freundlichen GrÌßen / С МаОлучшОЌО пПжелаМОяЌО / З
МайкращОЌО пПбажаММяЌО

Anton Gladkyy
Post by Václav Šmilauer
Post by Anton Gladky
In attachment there is the diff-file. I'v added 1 function. Hope it
will be useful.
I would like also to ask to inspect the code. Is it suitable, or
corrections are needed?
You write like a c-guy :-) I wrote it in a more python way (lists,
lists, tuples, etc), in particular using the numpy.arange function to
create list of values. Find it in r1774, utils.regularSphereOrthoPack
and scripts/test/regular-sphere-pack.py.
Post by Anton Gladky
How often do you usually commit the code?
Depends, not so often if I make bigger changes as to not break anything
for others; to make the commit a logical whole.
HTH
_______________________________________________
Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
More help : https://help.launchpad.net/ListHelp
Anton Gladky
2009-05-25 13:51:49 UTC
Permalink
Ok, works! Thank you!

But how can I add such parameters for spheres as velocity, density,
frictionAngle etc?


Best Regards / Mit freundlichen GrÌßen / С МаОлучшОЌО пПжелаМОяЌО / З
МайкращОЌО пПбажаММяЌО

Anton Gladkyy
Post by Anton Gladky
Ok, thank you.
Will check it today. Python is a new program language for me, so I just
used examples to write new function.
Best Regards / Mit freundlichen GrÌßen / С МаОлучшОЌО пПжелаМОяЌО / З
МайкращОЌО пПбажаММяЌО
Anton Gladkyy
Post by Anton Gladky
In attachment there is the diff-file. I'v added 1 function. Hope it
Post by Anton Gladky
will be useful.
I would like also to ask to inspect the code. Is it suitable, or
corrections are needed?
You write like a c-guy :-) I wrote it in a more python way (lists,
lists, tuples, etc), in particular using the numpy.arange function to
create list of values. Find it in r1774, utils.regularSphereOrthoPack
and scripts/test/regular-sphere-pack.py.
Post by Anton Gladky
How often do you usually commit the code?
Depends, not so often if I make bigger changes as to not break anything
for others; to make the commit a logical whole.
HTH
_______________________________________________
Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
More help : https://help.launchpad.net/ListHelp
Václav Šmilauer
2009-05-25 15:13:37 UTC
Permalink
Post by Anton Gladky
Ok, works! Thank you!
But how can I add such parameters for spheres as velocity, density,
frictionAngle etc?
All keyword parameters that are not specified in the def(...) argument
list will end up in the **kw dictionary, which is passed as-is to
utils.sphere. Therefore, you can use those as usually.

V.


_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users-oU9gvf+***@public.gmane.org
Unsubscribe : https://launchpad.net/~yade-users
More help : https://help.launchpad.net/ListHelp
Anton Gladky
2009-05-26 07:04:25 UTC
Permalink
I'm sorry, I have played with different syntax, but still problems with
adding velocity to these particles.
How can I Add, for example, velocity?

temp_vel = {'velocity': [0,-1,0]}
O.bodies.append(utils.regularSphereOrthoPack([0,0,4],extents=2,radius=.1,gap=.1,color=(0,1,0)))

Thank you very much,

PS Sorry, for novice questions

Best Regards / Mit freundlichen GrÌßen / С МаОлучшОЌО пПжелаМОяЌО / З
МайкращОЌО пПбажаММяЌО

Anton Gladkyy
Post by Anton Gladky
Ok, works! Thank you!
Post by Anton Gladky
But how can I add such parameters for spheres as velocity, density,
frictionAngle etc?
All keyword parameters that are not specified in the def(...) argument list
will end up in the **kw dictionary, which is passed as-is to utils.sphere.
Therefore, you can use those as usually.
V.
_______________________________________________
Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
More help : https://help.launchpad.net/ListHelp
Václav Šmilauer
2009-05-26 07:49:40 UTC
Permalink
Post by Anton Gladky
I'm sorry, I have played with different syntax, but still problems
with adding velocity to these particles.
How can I Add, for example, velocity?
temp_vel = {'velocity': [0,-1,0]}
O.bodies.append(utils.regularSphereOrthoPack([0,0,4],extents=2,radius=.1,gap=.1,color=(0,1,0)))
Dont look for complexities where there are none ;-)

O.bodies.append(utils.regularSphereOrthoPack([0,0,4],extents=2,radius=.1,gap=.1,color=(0,1,0),velocity=[0,-1,0])



_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users-oU9gvf+***@public.gmane.org
Unsubscribe : https://launchpad.net/~yade-users
More help : https://help.launchpad.net/ListHelp
Anton Gladky
2009-05-26 07:55:50 UTC
Permalink
Thank you! Works!

Best Regards / Mit freundlichen GrÌßen / С МаОлучшОЌО пПжелаМОяЌО / З
МайкращОЌО пПбажаММяЌО

Anton Gladkyy
Post by Anton Gladky
Post by Anton Gladky
I'm sorry, I have played with different syntax, but still problems
with adding velocity to these particles.
How can I Add, for example, velocity?
temp_vel = {'velocity': [0,-1,0]}
O.bodies.append(utils.regularSphereOrthoPack([0,0,4],extents=2,radius=.1,gap=.1,color=(0,1,0)))
Dont look for complexities where there are none ;-)
O.bodies.append(utils.regularSphereOrthoPack([0,0,4],extents=2,radius=.1,gap=.1,color=(0,1,0),velocity=[0,-1,0])
_______________________________________________
Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
More help : https://help.launchpad.net/ListHelp
Anton Gladky
2009-06-12 20:43:21 UTC
Permalink
There is a new function for utils. Would like you to ask to check and commit
it. I know, that you dont like this style, but I was trying to do it by
your way with no success: difficult to get indexes of Z-axis array.

Thank you

______________________________
[ENG] Best Regards
[GER] Mit freundlichen GrÌßen
[RUS] С МаОлучшОЌО пПжелаМОяЌО
[UKR] З МайкращОЌО пПбажаММяЌО

Anton Gladkyy
Post by Anton Gladky
Thank you! Works!
Best Regards / Mit freundlichen GrÌßen / С МаОлучшОЌО пПжелаМОяЌО / З
МайкращОЌО пПбажаММяЌО
Anton Gladkyy
Post by Anton Gladky
Post by Anton Gladky
I'm sorry, I have played with different syntax, but still problems
with adding velocity to these particles.
How can I Add, for example, velocity?
temp_vel = {'velocity': [0,-1,0]}
O.bodies.append(utils.regularSphereOrthoPack([0,0,4],extents=2,radius=.1,gap=.1,color=(0,1,0)))
Dont look for complexities where there are none ;-)
O.bodies.append(utils.regularSphereOrthoPack([0,0,4],extents=2,radius=.1,gap=.1,color=(0,1,0),velocity=[0,-1,0])
_______________________________________________
Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
More help : https://help.launchpad.net/ListHelp
Václav Šmilauer
2009-06-13 15:19:29 UTC
Permalink
Post by Anton Gladky
There is a new function for utils. Would like you to ask to check and
commit it. I know, that you dont like this style, but I was trying to
do it by your way with no success: difficult to get indexes of Z-axis
array.
Hi, I found a better approach for this type of problems: separately
define function that generates the grid within given part of space and
separately have function that clips the resulting grid to the exact
solid shape ("predicate", because it tells whether a point is inside or
outside). For example:

from yade import pack
pack.regularHexa(pack.inSphere((0,0,4),2),radius=.1,gap=0)

will return list of spheres of radius .1 hexagonaly arranged (without
gaps) within spherical domain centered at 0,0,4 and with radius 2.

I am sorry that it will probably break your older code, but it seems
just so much more elegant and extensible.

If you want to define new shape that you want to fill with spheres (e.g.
an ellipsoid), you only have to define a new ellipsoid predicate and
pass it to the pack.regularOrtho / pack.regularHexa functions. They ask
the predicate for its bounding box, generate orthogonal/hexagonal grid
and return sphere at points of the grid where the predicate was true
(i.e. points inside the solid).

If you want to define new packing type (e.g. orthogonal in plane but
planes moved at every layer to make it denser; or even irregular
packing, e.g. from a periodic packing that you have ready somewhere),
you can use already existing predicates with the new one.

For packing, we have ortho/hexa now, for predicates, there is sphere,
axis-aligned box and non-aligned cylinder. It is demonstrated in
scripts/test/regular-sphere-pack.py.

Best, Vaclav


_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users-oU9gvf+***@public.gmane.org
Unsubscribe : https://launchpad.net/~yade-users
More help : https://help.launchpad.net/ListHelp
Anton Gladky
2009-06-15 09:05:54 UTC
Permalink
Thank you very much, Vaclav for that suggestions and realization! Sure it
will be very helpful!
Later I will add some more shapes.

I have attached the patch, which adds euclid module to the Yade. Please,
commit it.

______________________________
[ENG] Best Regards
[GER] Mit freundlichen GrÌßen
[RUS] С МаОлучшОЌО пПжелаМОяЌО
[UKR] З МайкращОЌО пПбажаММяЌО

Anton Gladkyy
Post by Václav Šmilauer
Post by Anton Gladky
There is a new function for utils. Would like you to ask to check and
commit it. I know, that you dont like this style, but I was trying to
do it by your way with no success: difficult to get indexes of Z-axis
array.
Hi, I found a better approach for this type of problems: separately
define function that generates the grid within given part of space and
separately have function that clips the resulting grid to the exact
solid shape ("predicate", because it tells whether a point is inside or
from yade import pack
pack.regularHexa(pack.inSphere((0,0,4),2),radius=.1,gap=0)
will return list of spheres of radius .1 hexagonaly arranged (without
gaps) within spherical domain centered at 0,0,4 and with radius 2.
I am sorry that it will probably break your older code, but it seems
just so much more elegant and extensible.
If you want to define new shape that you want to fill with spheres (e.g.
an ellipsoid), you only have to define a new ellipsoid predicate and
pass it to the pack.regularOrtho / pack.regularHexa functions. They ask
the predicate for its bounding box, generate orthogonal/hexagonal grid
and return sphere at points of the grid where the predicate was true
(i.e. points inside the solid).
If you want to define new packing type (e.g. orthogonal in plane but
planes moved at every layer to make it denser; or even irregular
packing, e.g. from a periodic packing that you have ready somewhere),
you can use already existing predicates with the new one.
For packing, we have ortho/hexa now, for predicates, there is sphere,
axis-aligned box and non-aligned cylinder. It is demonstrated in
scripts/test/regular-sphere-pack.py.
Best, Vaclav
_______________________________________________
Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
More help : https://help.launchpad.net/ListHelp
Anton Gladky
2009-06-15 16:10:49 UTC
Permalink
I would like to add ellipsoid, but what is the best way to test it during
code writing. How can I compile just _packPredicates.cpp?

Sorry for simple questions.
______________________________
[ENG] Best Regards
[GER] Mit freundlichen GrÌßen
[RUS] С МаОлучшОЌО пПжелаМОяЌО
[UKR] З МайкращОЌО пПбажаММяЌО

Anton Gladkyy
Post by Anton Gladky
Thank you very much, Vaclav for that suggestions and realization! Sure it
will be very helpful!
Later I will add some more shapes.
I have attached the patch, which adds euclid module to the Yade. Please,
commit it.
______________________________
[ENG] Best Regards
[GER] Mit freundlichen GrÌßen
[RUS] С МаОлучшОЌО пПжелаМОяЌО
[UKR] З МайкращОЌО пПбажаММяЌО
Anton Gladkyy
Post by Václav Šmilauer
Post by Anton Gladky
There is a new function for utils. Would like you to ask to check and
commit it. I know, that you dont like this style, but I was trying to
do it by your way with no success: difficult to get indexes of Z-axis
array.
Hi, I found a better approach for this type of problems: separately
define function that generates the grid within given part of space and
separately have function that clips the resulting grid to the exact
solid shape ("predicate", because it tells whether a point is inside or
from yade import pack
pack.regularHexa(pack.inSphere((0,0,4),2),radius=.1,gap=0)
will return list of spheres of radius .1 hexagonaly arranged (without
gaps) within spherical domain centered at 0,0,4 and with radius 2.
I am sorry that it will probably break your older code, but it seems
just so much more elegant and extensible.
If you want to define new shape that you want to fill with spheres (e.g.
an ellipsoid), you only have to define a new ellipsoid predicate and
pass it to the pack.regularOrtho / pack.regularHexa functions. They ask
the predicate for its bounding box, generate orthogonal/hexagonal grid
and return sphere at points of the grid where the predicate was true
(i.e. points inside the solid).
If you want to define new packing type (e.g. orthogonal in plane but
planes moved at every layer to make it denser; or even irregular
packing, e.g. from a periodic packing that you have ready somewhere),
you can use already existing predicates with the new one.
For packing, we have ortho/hexa now, for predicates, there is sphere,
axis-aligned box and non-aligned cylinder. It is demonstrated in
scripts/test/regular-sphere-pack.py.
Best, Vaclav
_______________________________________________
Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
More help : https://help.launchpad.net/ListHelp
Václav Šmilauer
2009-06-15 17:24:25 UTC
Permalink
Post by Anton Gladky
I would like to add ellipsoid, but what is the best way to test it
during code writing. How can I compile just _packPredicates.cpp?
Run "scons pretty=0", then copy the compilation & installation command
to the terminal.

Alternatively, run
scons /usr/local/lib/yade-trunk-opt/py/yade/_packPredicates.so (put your
own path) to ask for just that target to be compiled & installed.

V



_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users-oU9gvf+***@public.gmane.org
Unsubscribe : https://launchpad.net/~yade-users
More help : https://help.launchpad.net/ListHelp
Anton Gladky
2009-06-15 17:32:27 UTC
Permalink
Thank you, will try tomorrow.
______________________________
[ENG] Best Regards
[GER] Mit freundlichen GrÌßen
[RUS] С МаОлучшОЌО пПжелаМОяЌО
[UKR] З МайкращОЌО пПбажаММяЌО

Anton Gladkyy
Post by Václav Šmilauer
Post by Anton Gladky
I would like to add ellipsoid, but what is the best way to test it
during code writing. How can I compile just _packPredicates.cpp?
Run "scons pretty=0", then copy the compilation & installation command
to the terminal.
Alternatively, run
scons /usr/local/lib/yade-trunk-opt/py/yade/_packPredicates.so (put your
own path) to ask for just that target to be compiled & installed.
V
_______________________________________________
Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
More help : https://help.launchpad.net/ListHelp
Václav Šmilauer
2009-06-17 13:03:07 UTC
Permalink
Seems OK here:

In [4]: yade.pack.inSphere((2,0,0),1).aabb()
Out[4]: ((1.0, -1.0, -1.0), (3.0, 1.0, 1.0))

In [6]: yade.pack.inAlignedBox((0,0,0),(2,2,2)).aabb()
Out[6]: ((0.0, 0.0, 0.0), (2.0, 2.0, 2.0))

(PS you can post to yade-dev instead of yade-users for this kind of
things, perhaps?)


_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users-oU9gvf+***@public.gmane.org
Unsubscribe : https://launchpad.net/~yade-users
More help : https://help.launchpad.net/ListHelp

Loading...