← Back to team overview

yade-dev team mailing list archive

Re: [Yade-users] Optimized contact detection available

 

Hi,

Thanks for the script Anton. This is what I found:
- A crash sometimes (not very often) occurs in GLrender(), it is
apparently due to deleted body. i could reproduce it before and after
bzr3001. I never crashed without opening the GL view.
- There was a typo in the modified probe(), it is fixed. There was also
the problem of comparing the ref. positions of aabb instead of current
position of body, it is fixed too.
- One problem in your script it there are no spheres at startup, hence
the collider can't determine a verletDist and then it runs at each
iteration, which take a lot of time. I got a significant speedup by
setting verletDist explicitely to something positive (e.g. 0.002). I
added a message warning the user at runtime when the collider fails
finding a valid verletDist.
- I saved a bit more cpu by removing gravityEngine and using
Newton::gravity instead.

I'm sending the fixed script.
Please let me know how bzr3007 works in your true working scripts.

Klaus,
I found that clumps were still using an old function from Newton. As a
consequence, striding was broken and the collider was acting at each
iteration. I get speedup on your script with bzr3007, give it a try.
(Don't use Newton::gravity though, it breaks something in your script
and I'm still investigating).

Bruno



On 27/01/12 21:03, Anton Gladky wrote:
> Hi, Bruno,
> I have prepared a small test-script from "examples/packs.py". It is
> similar to one, which is crashes in my case,I could not "catch" a
> crash with this test-script, but it seems, BoxFactory creates new
> spheres not in the right places:some of particles are "jumping", it
> can be caused by the initial overlapping.
> Anton
>
>
>
> On Fri, Jan 27, 2012 at 7:43 AM, Anton Gladky <gladky.anton@xxxxxxxxx> wrote:
>> Ok, I have got a "segmentation fault".
>>
>> Will try to prepare a simple test-script.
>>
>> Anton
>>
>>
>>
>> On Thu, Jan 26, 2012 at 12:22 PM, Bruno Chareyre
>> <bruno.chareyre@xxxxxxxxxxx> wrote:
>>> Could you please try bzr3006?
>>>
>>> B
>>>>> I have tried one of my working scripts and the results are not good.
>>>>> The new version is dramatically slower. Not sure what is the reason,
>>>>> but it seems
>>>>> the bottleneck is SpheresFactory which is working with new version
>>>>> incorrectly and
>>>>> cannot find places for new bodies.
>>>>>
>>>>> Bruno, is there an opportunity to use both algorithms: old and new one?
>>>>>
>>>> It is very difficult to keep both logics Anton, it would combine
>>>> disadvantages from each side. I should understand what the problem is in
>>>> SpheresFactory and fix it. Since I didn't touch this code, I'm really
>>>> curious about the problem. Are you doing operations in SpheresFactory at
>>>> runtime?
>>>> Could you send an example script?
>>>>
>>>> Bruno
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~yade-users
>>>> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~yade-users
>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>
>>> --
>>> _______________
>>> Bruno Chareyre
>>> Associate Professor
>>> ENSE³ - Grenoble INP
>>> 11, rue des Mathématiques
>>> BP 46
>>> 38402 St Martin d'Hères, France
>>> Tél : +33 4 56 52 86 21
>>> Fax : +33 4 76 82 70 43
>>> ________________
>>>
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~yade-users
>>> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~yade-users
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~yade-dev
>>> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~yade-dev
>>> More help   : https://help.launchpad.net/ListHelp


-- 
_______________
Bruno Chareyre
Associate Professor
ENSE³ - Grenoble INP
11, rue des Mathématiques
BP 46
38402 St Martin d'Hères, France
Tél : +33 4 56 52 86 21
Fax : +33 4 76 82 70 43
________________

#!/usr/bin/python
# -*- coding: utf-8 -*-
from yade import pack,ymport,export,log,geom,bodiesHandling
import math

""" This script demonstrates how to use 2 components of creating packings:

1. packing generators pack.regularHexa, pack.regularOrtho etc. generate vertices and filter them
using predicates. (Note that this will be enhanced to irregular packings in the future)

2. predicates are functors returning True/False for points that are given by the packing generator.
Their names are mostly self-explanatory, see their docstrings for meaning of their arguments.

Predicates can be combined using set arithmetics to get their Intersection (p1 & p2), union (p1 | p2),
difference (p1 - p2) and symmetric difference (XOR, p1 ^ p2). This is demontrated on the head (which
has sphere taken off at the back and also a notch) and the body (with cylidrical hole inside).

"""

rad,gap=.15,.02

#Add material
O.materials.append(FrictMat(young=10e9,poisson=.25,frictionAngle=0.5,density=1e3))

#Parameters, which will be passed into spheres and facets creators
kw={'material':0}
kwBoxes={'color':[1,0,0],'wire':False,'dynamic':False,'material':0}
kwMeshes={'color':[1,1,0],'wire':True,'dynamic':False,'material':0}



#Demonstration of HarmonicRotationEngine
#O.bodies.append(pack.regularHexa(pack.inSphere((-15,5,-5),1.5),radius=rad*2.0,gap=rad/3.0,color=(0.5,0.5,0.1),material=0))

oriBody = Quaternion(Vector3(0,0,1),(math.pi/4))
#O.bodies.append(geom.facetBox((0,0,0),(0.5,0.5,1.0),wallMask=15,**kwMeshes))
O.bodies.append(geom.facetBunker((0,0,-1.2),dBunker=1.5,dOutput=0.6,hBunker=1.2,hOutput=0.5,hPipe=0.1,orientation=oriBody,segmentsNumber=4,**kwMeshes))


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

#log.setLevel('SubdomainBalancer',log.TRACE)

O.engines=[
	#SubdomainBalancer(colorize=True,initRun=True,iterPeriod=100),
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()],verletDist=0.002,label='collider'),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys()],
		[Law2_ScGeom_FrictPhys_CundallStrack()],
	),
	NewtonIntegrator(damping=.3,gravity=(0,0,-100)),
		BoxFactory(maxParticles=-1, extents=(0.5,0.5,1.0),center=(0.0,0.0,0.0),vMin=1.0,vMax=1.5,
		rMin=0.025, rMax=0.030,
		vAngle=math.pi/3.0,massFlowRate=150.0,normal=(0.0,0.0,-1.0),label='factory',stopIfFailed=False),
	DomainLimiter(lo=[-0.6,-0.6,-1.2], hi=[0.6,0.6,1.2], iterPeriod=10000)
]


O.dt=1e-5
O.saveTmp()
O.timingEnabled=True
O.run(50000,True)
from yade import timing
timing.stats()

Follow ups

References