← Back to team overview

yade-users team mailing list archive

New version and old scripts

 

Hello, I'm trying to run my old script on 1691 version, I get this
error:

FATAL: This build of yade uses nex BexContainer instead of
PhysicalActionContainer.
FATAL: However, your simulation still uses PhysicalActionContainer.
FATAL: Update your code, see backtrace (if in debug build) to find where
the old container is used.
terminate called after throwing an instance of 'std::runtime_error'
  what():  Deprecated PhysicalActionContainer is not supported in this
build!
SIGSEGV/SIGABRT handler called; gdb batch file is `/home/marco/.yade-
svn1691/gdb_crash_batch-pid7332'

I understand that the new container is used, but how can I use it?
What is the wrong part and what I have to change in order to use Bex,
OpenMPI and all the other improvements.
Thank you very much for your fundamental help

My script is:

#!/usr/local/bin/yade-trunk -x
# -*- encoding=utf-8 -*-

from yade import utils
from math import *
from numpy import arange
import random

## Paametri fisici geometrie importate
Young = 15e3
Poisson = 0.3

#Parametri cilindro
rCyl=0.0401   ##Raggio superiore tronco cono
rCyl2=0.0401  ##Raggio inferiore tronco cono

hCyl=0.0202  ##altezza base inferiore cono
hCyl2=0.005 ##altezza base superiore cono

nPoly=28 ##Poligoni di cui è composto il contenitore

h1=-0.010
h2=0.032


hBox=hCyl/8


phiStep=2*pi/nPoly

#tolleranza contatti
#toll = 0.005

## Omega
o=Omega()

## Importa geometria testa
head =
utils.import_stl_geometry('TestaPiattaSim.stl',young=Young,poisson=Poisson,frictionAngle=radians(15),
color=[0,1,0],wire=True)

## Importa geometria elica
#auger =
utils.import_stl_geometry('auger.stl',young=Young,poisson=Poisson)

for n in range(nPoly):

        phi1,phi2=n*phiStep,(n+1)*phiStep

        def pt(angle,radius,z):

                return radius*sin(angle),radius*cos(angle),z

a,b,c,d=pt(phi1,rCyl,hCyl2),pt(phi2,rCyl,hCyl2),pt(phi1,rCyl2,hCyl),pt(phi2,rCyl2,hCyl)
        e,f=pt(phi1,rCyl,h1),pt(phi2,rCyl,h1)
        g,h=pt(phi1,rCyl2,h2),pt(phi2,rCyl2,h2)

        o.bodies.append([

                #utils.facet([a,b,c], color=[0.5,0.5,0.5]),

                #utils.facet([b,c,d], color=[0.5,0.5,0.5]),
                utils.facet([a,b,e], color=[0.5,0.5,0.5]),
                utils.facet([b,e,f], color=[0.5,0.5,0.5]),
                #utils.facet([c,d,g], color=[0.5,0.5,0.5]),
                #utils.facet([d,g,h], color=[0.5,0.5,0.5]),
])

for b in o.bodies: b['isDynamic']=False

box =
utils.box([0,0,hCyl2+hBox/2],[rCyl,rCyl,hBox/2],density=10000,frictionAngle=radians(15),wire=True,
color=[0,0,1])

boxId=o.bodies.append(box)

#o.bodies[boxId].phys['velocity']=[0,0,-10]

#for b in o.bodies: b['isDynamic']=False

rSphere=0.0005
Col=2
Color=0.8
divisioni=0
red=0
green=0
blue=0
Bande=5
LarghezzaBande=rCyl2/Bande
nSphere=0


for z in arange(rSphere,Col*2*rSphere,2*rSphere):
        red=0.2
        green=0.2
        blue=0.2

        for r in arange(2.2*rSphere,rCyl2-1*rSphere,2*rSphere):
                divisioni=2*pi*r/(rSphere*2)

                for n in arange(1,divisioni,1):

                        if r>LarghezzaBande and r<LarghezzaBande*2:
                                red=1
                                green=0
                                blue=0

                        if r>LarghezzaBande*2 and r<LarghezzaBande*3:
                                red=1
                                green=0.9
                                blue=0

                        if r>LarghezzaBande*3 and r<LarghezzaBande*4:
                                red=0.1
                                green=1
                                blue=0.1

                        if r>LarghezzaBande*4 and r<LarghezzaBande*5:
                                red=0
                                green=0
                                blue=1
                        theta=2*pi/divisioni*n
                        nSphere=nSphere+1


o.bodies.append(utils.sphere([r*sin(theta),r*cos(theta),hCyl2-z],rSphere*(1-.2*(random.random())),young=Young,poisson=Poisson,density=3500,color=[red,green,blue]))

print "Number of spheres: %d" % nSphere

## Timestep
o.dt=utils.PWaveTimeStep()

## Initializers
o.initializers=[
        ## Create and reset to zero container of all PhysicalActions
that will be used
        StandAloneEngine('PhysicalActionContainerInitializer'),
        ## Create bounding boxes. They are needed to zoom the 3d view
properly before we start the simulation.
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingFacet2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
## Engines
o.engines=[

        ## Resets forces and momenta the act on bodies
        #StandAloneEngine('TimeStepper'),

        ## Resets forces and momenta the act on bodies
        StandAloneEngine('PhysicalActionContainerReseter'),

        ## Associates bounding volume to each body.
        MetaEngine('BoundingVolumeMetaEngine',[
                EngineUnit('InteractingSphere2AABB'),
                EngineUnit('InteractingFacet2AABB'),
                EngineUnit('InteractingBox2AABB'),
                EngineUnit('MetaInteractingGeometry2AABB')
        ]),
        ## Using bounding boxes find possible body collisions.
        ##StandAloneEngine('SpatialQuickSortCollider'),
        StandAloneEngine('SAPCollider'),
        ## Create geometry information about each potential collision.
        MetaEngine('InteractionGeometryMetaEngine',[
EngineUnit('InteractingSphere2InteractingSphere4SpheresContactGeometry'),
EngineUnit('InteractingFacet2InteractingSphere4SpheresContactGeometry'),
EngineUnit('InteractingBox2InteractingSphere4SpheresContactGeometry')
        ]),
        ## Crea informazioni fisiche sui contatti.
MetaEngine('InteractionPhysicsMetaEngine',[EngineUnit('MacroMicroElasticRelationships')]),
        ## "Solver" of the contact
        StandAloneEngine('ElasticContactLaw'),

        ## Applica gravità
        DeusExMachina('GravityEngine',{'gravity':[0,0,9.810]}),
        ## Applica traslazione alla base
#DeusExMachina('DisplacementToForceEngine',{'subscribedBodies':[boxId],'displacement':0,
'translationAxis':[0,0,1], 'targetForce':[0,0,-0.3],
'targetForceMask':[0,0,-0.2] }),

        ## Applica forza alla base
        DeusExMachina('ForceEngine',{'subscribedBodies':[boxId],
'force':[0,0,-2.2]}),
DeusExMachina('FixedOrientationEngine',{'subscribedBodies':[boxId]}),

DeusExMachina('FixedPositionEngine',{'subscribedBodies':[boxId],'mask':[0.000001,0.000001,0]}),

        ## Sostituisce i motori di applicazione forze ai corpi,
smorzamento ed integrazione temporale
        DeusExMachina('NewtonsDampedLaw',{'damping':0.05}),

        ## Applica rotazione alla testa 1 giro/min = 0,1047 rad/s
        DeusExMachina('RotationEngine',{'subscribedBodies':head,
'rotationAxis':[0,0,1],'rotateAroundZero':True,'angularVelocity':0.2094}),

StandAloneEngine('SQLiteRecorder',{'recorders':['se3','rgb'],'dbFile':'/home/marco/replays/TestaPiatta.sqlite','virtPeriod':0.04})

]

## Salva la scena da simulare
o.save('/tmp/a.xml');
-- 
This message was sent from Launchpad by the user
MarcoDottor (https://launchpad.net/~marcodottor)
using the "Contact this team" link on the yade-users team page.
For more information see
https://help.launchpad.net/YourAccount/ContactingPeople



Follow ups