tetra +facet

Asked by Martin Nie on 2013-12-11

hi all,
I'm looking for a possibilty to handle facet+tetra collision. I can find tetra+tetra collision [Ig2_Tetra_Tetra_TTetraSimpleGeom()], but there are no facet+tetra collision. https://github.com/yade/trunk/blob/master/pkg/dem/Tetra.hpp
Do you have any solutions?
Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2013-12-11
Last reply:
2014-01-08
Jan Stránský (honzik) said : #1

Hi Martin,

there are a few possible soutions:

1) somebody (most likely you :-) will implement this feature.
2) instead of facets you will use tetrahedrons
3) instead of facets and tetrahedrons you will use polyhedrons

The correct solution also depends on other circumstances, e.g. if you also
need interaction with spheres (only sphere-facet interaction is implemented
at the moment). Let us know if one of the solutions is suitable for you or
please privde us with more details about your problem.

cheers
Jan

2013/12/11 Martin Nie <email address hidden>

> New question #240620 on Yade:
> https://answers.launchpad.net/yade/+question/240620
>
> hi all,
> I'm looking for a possibilty to handle facet+tetra collision. I can find
> tetra+tetra collision [Ig2_Tetra_Tetra_TTetraSimpleGeom()], but there are
> no facet+tetra collision.
> https://github.com/yade/trunk/blob/master/pkg/dem/Tetra.hpp
> Do you have any solutions?
> Thanks
>
>
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Martin Nie (martin-niehoff) said : #2

I need tetra-tetra interaction plus facet-tetra interaction. I imported a cauldron shaped stl-file, which is my facet. So the tetra-particles shall move and interact in this cauldron.

Martin Nie (martin-niehoff) said : #3

how can I use polyhedrons or tetrahedrons in yade?

Christian Jakob (jakob-ifgt) said : #4

hi martin,

there are several examples in examples/tetra and examples/polyhedra folders.

good luck,

christian

Oguz Cebeci (oce1907) said : #5

Hi,
i tried to start the examples in the "examples/polyhedra" folder. But i always get the following error:
"ImportError: cannot import name polyhedra_utils"
Is there a solution to fix this?

from yade import plot, polyhedra_utils
from yade import qt

m = PolyhedraMat()
m.density = 2600 #kg/m^3
m.Ks = 20000
m.Kn = 1E6 #Pa
m.frictionAngle = 0.6 #rad

maxLoad = 3E6
minLoad = 1E3

O.bodies.append(utils.wall(0,axis=2,sense=1, material = m))

t = polyhedra_utils.polyhedralBall(0.025, 100, m, (0,0,0))
t.state.pos = (0,0,0.5)
O.bodies.append(t)

def checkUnbalanced():
  print "unbalanced forces = %.5f, position %f, %f, %f"%(utils.unbalancedForce(), t.state.pos[0], t.state.pos[1], t.state.pos[2])

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Wall_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
      [Ig2_Wall_Polyhedra_PolyhedraGeom(), Ig2_Polyhedra_Polyhedra_PolyhedraGeom(), Ig2_Facet_Polyhedra_PolyhedraGeom()],
      [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()], # collision "physics"
      [PolyhedraVolumetricLaw()] # contact law -- apply forces
   ),
   #GravityEngine(gravity=(0,0,-9.81)),
   NewtonIntegrator(damping=0.5,gravity=(0,0,-9.81)),
   PyRunner(command='checkUnbalanced()',realPeriod=3,label='checker')
]

#O.dt=0.025*polyhedra_utils.PWaveTimeStep()
O.dt=0.00025

qt.Controller()
V = qt.View()

O.saveTmp()
#O.run()

--------------------------------------------------------------------------------------------------------------------------------------------------

Another problem is in the "examples/tetra" folder:
"NameError: name 'tetraPoly' is not defined"

################################################################################
#
# Script to test tetra gl functions and prescribed motion
#
################################################################################
v1 = (0,0,0)
v2 = (1,0,0)
v3 = (0,1,0)
v4 = (0,0,1)

t1 = tetraPoly((v1,v2,v3,v4),color=(0,1,0))
O.bodies.append((t1))

def changeVelocity():
 if O.iter == 50000:
  t1.state.vel = (-1,0,0)
 if O.iter == 100000:
  t1.state.vel = (0,1,-1)
 if O.iter == 150000:
  t1.state.vel = (0,0,0)
  t1.state.angMom = (0,0,10)
 if O.iter == 200000:
  O.pause()

O.engines = [
 ForceResetter(),
 InsertionSortCollider([Bo1_Polyhedra_Aabb()]),
 InteractionLoop([],[],[]),
 NewtonIntegrator(),
 PyRunner(iterPeriod=1,command="changeVelocity()"),
]
O.step()

try:
 from yade import qt
 qt.View()
except:
 pass

O.dt = 1e-5
t1.state.vel = (1,0,0)
O.run()

Jan Stránský (honzik) said : #6

Hi Oguz,
I have no problem with the scripts.. what version of Yade do you use?
cheers
Jan

2013/12/12 Oguz Cebeci <email address hidden>

> Question #240620 on Yade changed:
> https://answers.launchpad.net/yade/+question/240620
>
> Oguz Cebeci posted a new comment:
> Hi,
> i tried to start the examples in the "examples/polyhedra" folder. But i
> always get the following error:
> "ImportError: cannot import name polyhedra_utils"
> Is there a solution to fix this?
>
> from yade import plot, polyhedra_utils
> from yade import qt
>
> m = PolyhedraMat()
> m.density = 2600 #kg/m^3
> m.Ks = 20000
> m.Kn = 1E6 #Pa
> m.frictionAngle = 0.6 #rad
>
> maxLoad = 3E6
> minLoad = 1E3
>
> O.bodies.append(utils.wall(0,axis=2,sense=1, material = m))
>
> t = polyhedra_utils.polyhedralBall(0.025, 100, m, (0,0,0))
> t.state.pos = (0,0,0.5)
> O.bodies.append(t)
>
> def checkUnbalanced():
> print "unbalanced forces = %.5f, position %f, %f,
> %f"%(utils.unbalancedForce(), t.state.pos[0], t.state.pos[1],
> t.state.pos[2])
>
>
>
> O.engines=[
> ForceResetter(),
>
> InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Wall_Aabb(),Bo1_Facet_Aabb()]),
> InteractionLoop(
> [Ig2_Wall_Polyhedra_PolyhedraGeom(),
> Ig2_Polyhedra_Polyhedra_PolyhedraGeom(),
> Ig2_Facet_Polyhedra_PolyhedraGeom()],
> [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()], # collision
> "physics"
> [PolyhedraVolumetricLaw()] # contact law -- apply forces
> ),
> #GravityEngine(gravity=(0,0,-9.81)),
> NewtonIntegrator(damping=0.5,gravity=(0,0,-9.81)),
> PyRunner(command='checkUnbalanced()',realPeriod=3,label='checker')
> ]
>
>
> #O.dt=0.025*polyhedra_utils.PWaveTimeStep()
> O.dt=0.00025
>
>
> qt.Controller()
> V = qt.View()
>
>
> O.saveTmp()
> #O.run()
>
>
>
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
> Another problem is in the "examples/tetra" folder:
> "NameError: name 'tetraPoly' is not defined"
>
>
>
> ################################################################################
> #
> # Script to test tetra gl functions and prescribed motion
> #
>
> ################################################################################
> v1 = (0,0,0)
> v2 = (1,0,0)
> v3 = (0,1,0)
> v4 = (0,0,1)
>
> t1 = tetraPoly((v1,v2,v3,v4),color=(0,1,0))
> O.bodies.append((t1))
>
> def changeVelocity():
> if O.iter == 50000:
> t1.state.vel = (-1,0,0)
> if O.iter == 100000:
> t1.state.vel = (0,1,-1)
> if O.iter == 150000:
> t1.state.vel = (0,0,0)
> t1.state.angMom = (0,0,10)
> if O.iter == 200000:
> O.pause()
>
> O.engines = [
> ForceResetter(),
> InsertionSortCollider([Bo1_Polyhedra_Aabb()]),
> InteractionLoop([],[],[]),
> NewtonIntegrator(),
> PyRunner(iterPeriod=1,command="changeVelocity()"),
> ]
> O.step()
>
>
> try:
> from yade import qt
> qt.View()
> except:
> pass
>
> O.dt = 1e-5
> t1.state.vel = (1,0,0)
> O.run()
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Oguz Cebeci (oce1907) said : #7

I'm using yade daily ( Yade 5+3730+52~ubuntu12.04.1) on a virtual machine. Martin told me, that it works on a normal Desktop Computer. Maybe it's a bug on the virtuel machine. I will try it later.

Christian Jakob (jakob-ifgt) said : #8

Polyhedra code was implemented with 3715, so the examples should work at 3730

http://bazaar.launchpad.net/~yade-pkg/yade/git-trunk/revision/3715

Mathias (luers) said : #9

I tried to import the polyhedra_utils module. Unfortunately, I do get this error. Any ideas?

Welcome to Yade 2013-12-05.git-5680886
TCP python prompt on localhost:9002, auth cookie `ckudes'
XMLRPC info provider on http://localhost:21002
[[ ^L clears screen, ^U kills line. F8 plot. ]]
Yade [1]: from yade import polyhedra_utils
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)

/rwthfs/rz/cluster/home/ml706312/workspace/yadetest2/installFolder/bin/yade-2013-12-05.git-5680886 in <module>()
----> 1
      2
      3
      4
      5

/home/ml706312/workspace/yadetest2/installFolder/lib64/yade-2013-12-05.git-5680886/py/yade/polyhedra_utils.py in <module>()
     18
     19 # c++ implementations for performance reasons

---> 20 from yade._polyhedra_utils import *
     21
     22 #**********************************************************************************

ImportError: dynamic module does not define init function (init_polyhedra_utils)

Thanks for your help.

Regards,
Mathias

Hi, I get the same error when running free-fall.py script in examples/polyhedra

 "ImportError: cannot import name polyhedra_utils"

I used the daily build version and the latest version built from sources. (it's strange that yade tells me that the self-built version is from 09-09-2013. But I pulled the latest version before building it)

Anton Gladky (gladky-anton) said : #11

> I used the daily build version

From Launchpad (an old one) or updated from yade-dem server?

https://yade-dem.org/doc/installation.html#packages

Anton

Hi Anton,
I used the latest version which I got via: apt-get install yade-daily
On the other hand I built the sources which I pulled via github.

Anton Gladky (gladky-anton) said : #13

There was a bug, which can affect this yade-daily version [1].
Remove both packages yade-daily and yade (if you installed it from the
main repository), install "yadedaily" according to the link above and check
your script again.

[1] https://bugs.launchpad.net/yade/+bug/1254708

Anton

I'm using Ubuntu 12.04 LTS so it's not exactly like in the bug report. But I' ll try to do as you advice.

I see that there is no uninstall rule implemented in the makefile, because
make uninstall doesn't work
Is it sufficient to delete the folder I installed my yade built to or are there more things to take care of?

Anton Gladky (gladky-anton) said : #15

> I'm using Ubuntu 12.04 LTS so it's not exactly like in the bug report

This bug can affect all Ubuntu-distros.

 > Is it sufficient to delete the folder I installed my yade built to or
are there more things to take care of?

It is sufficient. "Installation" is only a copy-paste operation from
buildDir to installDir in our case.
Bruno

Can you help with this problem?

Provide an answer of your own, or ask Martin Nie for more information if necessary.

To post a message you must log in.