yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #01905
[Branch ~yade-dev/yade/trunk] Rev 1739: 1. Remove garbage from examples.
------------------------------------------------------------
revno: 1739
committer: Václav Šmilauer <vaclav@flux>
branch nick: trunk
timestamp: Wed 2009-08-26 12:34:11 +0200
message:
1. Remove garbage from examples.
2. Fix SpheresFactory, fix examples/SpheresFactory/model.py
removed:
examples/README
examples/cmdGui1.py
modified:
examples/SpheresFactory/model.py
pkg/common/Engine/StandAloneEngine/SpheresFactory.cpp
pkg/common/Engine/StandAloneEngine/SpheresFactory.hpp
--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== removed file 'examples/README'
--- examples/README 2008-03-31 15:56:52 +0000
+++ examples/README 1970-01-01 00:00:00 +0000
@@ -1,23 +0,0 @@
-This directory contains some examples for filegenerators:
-
-2 examples for FEM
-1 example for SDEC Impact test
-
-Other filegenerators work without need for any input file. They generate examples
-just by parameters given to them.
-
-
-By default yade filegenerators are looking for those files in ../data directory.
-You can specify another directory in filegenerator, but for now you would have to
-change it every time (bug #004853). To avoid the hassle you can just copy content
-of this directory to ../data relative to path from where you are starting yade
-( most probably bin/ ).
-
-For example my directory tree with yade looks like this:
-
-YADE
-|-- bin
-|-- data
-|-- include
-`-- lib
-
=== modified file 'examples/SpheresFactory/model.py'
--- examples/SpheresFactory/model.py 2009-03-30 16:10:27 +0000
+++ examples/SpheresFactory/model.py 2009-08-26 10:34:11 +0000
@@ -2,9 +2,6 @@
from yade import utils
-## Omega
-o=Omega()
-
## PhysicalParameters
Young = 0.15e9
Poisson = 0.3
@@ -17,56 +14,29 @@
factory3 = utils.import_stl_geometry('square.stl',color=[0.4,0.4,0.7],noInteractingGeometry=True)
## Timestep
-o.dt=0.0001
+O.dt=0.0001
## Initializers
-o.initializers=[
- MetaEngine('BoundingVolumeMetaEngine',
- [EngineUnit('InteractingSphere2AABB'),
- EngineUnit('InteractingFacet2AABB'),
- EngineUnit('MetaInteractingGeometry2AABB')]),
+O.initializers=[
+ BoundingVolumeMetaEngine([InteractingSphere2AABB(),InteractingFacet2AABB(),MetaInteractingGeometry2AABB()])
]
## Engines
-o.engines=[
- StandAloneEngine('PhysicalActionContainerReseter'),
- MetaEngine('BoundingVolumeMetaEngine',[
- EngineUnit('InteractingSphere2AABB'),
- EngineUnit('InteractingFacet2AABB'),
- EngineUnit('MetaInteractingGeometry2AABB')
- ]),
- StandAloneEngine('PersistentSAPCollider'),
-
+O.engines=[
+ BexResetter(),
+ BoundingVolumeMetaEngine([InteractingSphere2AABB(),InteractingFacet2AABB(),MetaInteractingGeometry2AABB()]),
+ InsertionSortCollider(),
## Spheres factory engine
- StandAloneEngine('SpheresFactory',{'factoryFacets':factory1,'virtPeriod':0.005,'radius':0.07,'radiusRange':0.03,'young':Young,'color':[1,0,0]}),
- StandAloneEngine('SpheresFactory',{'factoryFacets':factory2,'virtPeriod':0.01,'radius':0.08,'young':Young,'color':[0,1,0]}),
- StandAloneEngine('SpheresFactory',{'factoryFacets':factory3,'virtPeriod':0.01,'radius':0.05,'young':Young,'color':[0,0,1]}),
-
- MetaEngine('InteractionGeometryMetaEngine',[
- EngineUnit('InteractingSphere2InteractingSphere4SpheresContactGeometry'),
- EngineUnit('InteractingFacet2InteractingSphere4SpheresContactGeometry')
- ]),
- MetaEngine('InteractionPhysicsMetaEngine',[EngineUnit('MacroMicroElasticRelationships')]),
-
- DeusExMachina('GravityEngine',{'gravity':[0,0,-9.81]}),
-
- StandAloneEngine('ElasticContactLaw'),
-
- MetaEngine('PhysicalActionDamper',[
- EngineUnit('CundallNonViscousForceDamping',{'damping':0.3}),
- EngineUnit('CundallNonViscousMomentumDamping',{'damping':0.3})
- ]),
-
- MetaEngine('PhysicalActionApplier',[
- EngineUnit('NewtonsForceLaw'),
- EngineUnit('NewtonsMomentumLaw'),
- ]),
-
- MetaEngine('PhysicalParametersMetaEngine',[EngineUnit('LeapFrogPositionIntegrator')]),
- MetaEngine('PhysicalParametersMetaEngine',[EngineUnit('LeapFrogOrientationIntegrator')]),
-
+ SpheresFactory(factoryFacets=factory1,virtPeriod=0.005,radius=0.07,radiusRange=0.03,young=Young,color=(1,0,0)),
+ SpheresFactory(factoryFacets=factory2,virtPeriod= 0.01,radius=0.08,young=Young,color=(0,1,0)),
+ SpheresFactory(factoryFacets=factory3,virtPeriod= 0.01,radius=0.05,young=Young,color=(0,0,1)),
+
+ InteractionGeometryMetaEngine([ef2_Facet_Sphere_Dem3DofGeom(),ef2_Sphere_Sphere_Dem3DofGeom()]),
+ InteractionPhysicsMetaEngine([SimpleElasticRelationships()]),
+ ConstitutiveLawDispatcher([Law2_Dem3Dof_Elastic_Elastic()]),
+
+ GravityEngine(gravity=(0,0,-9.81)),
+ NewtonsDampedLaw(damping=0.3)
]
-
-## Save the scene to file, so that it can be loaded later. Supported extension are: .xml, .xml.gz, .xml.bz2.
-o.save('/tmp/a.xml');
+O.saveTmp()
=== removed file 'examples/cmdGui1.py'
--- examples/cmdGui1.py 2008-05-15 15:59:06 +0000
+++ examples/cmdGui1.py 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
-# sample rc script for PythonUI
-#
-p=Preprocessor("BoxStack")
-# changing attributes
-p['nbBoxes']=[3,5,5]
-p['boxDensity']=4000
-# run the generator, returns status
-p.generate('/tmp/scene.xml')
-#
-# create Omega instance, which controls simulation
-#
-o=Omega()
-# load simulation
-o.load("/tmp/scene.xml")
-# run the simulation
-o.run()
-# !! views currently broken
-# open one View (more views will crash...)
-# v=View()
-# get iteration number
-print o.iter
-# stop somewhere after iteration 10000
-import time
-while True:
- time.sleep(1)
- print "iteration %d\tsimulation time %gs\treal time %gs"%(o.iter,o.time,o.realtime)
- if o.iter>1000:
- o.pause()
- break
-# quit yade
-sys.exit(0)
=== modified file 'pkg/common/Engine/StandAloneEngine/SpheresFactory.cpp'
--- pkg/common/Engine/StandAloneEngine/SpheresFactory.cpp 2009-05-29 13:35:22 +0000
+++ pkg/common/Engine/StandAloneEngine/SpheresFactory.cpp 2009-08-26 10:34:11 +0000
@@ -15,6 +15,8 @@
#include<yade/pkg-dem/BodyMacroParameters.hpp>
#include"SpheresFactory.hpp"
+YADE_PLUGIN((SpheresFactory));
+
CREATE_LOGGER(SpheresFactory);
namespace {
=== modified file 'pkg/common/Engine/StandAloneEngine/SpheresFactory.hpp'
--- pkg/common/Engine/StandAloneEngine/SpheresFactory.hpp 2009-03-01 20:35:11 +0000
+++ pkg/common/Engine/StandAloneEngine/SpheresFactory.hpp 2009-08-26 10:34:11 +0000
@@ -106,7 +106,6 @@
(frictionAngle)
(color))
REGISTER_CLASS_AND_BASE(SpheresFactory, StandAloneEngine);
-
};
REGISTER_SERIALIZABLE(SpheresFactory);