yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #02313
[Branch ~yade-dev/yade/trunk] Rev 1816: 1. TranslationEngine and PressTestEngines are activated
------------------------------------------------------------
revno: 1816
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: trunk
timestamp: Tue 2009-11-24 15:08:28 +0100
message:
1. TranslationEngine and PressTestEngines are activated
2. regular-sphere-pack.py is updated according to new material class
modified:
pkg/common/Engine/DeusExMachina/PressTestEngine.cpp
pkg/common/Engine/DeusExMachina/TranslationEngine.cpp
scripts/test/regular-sphere-pack.py
--
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.
=== modified file 'pkg/common/Engine/DeusExMachina/PressTestEngine.cpp'
--- pkg/common/Engine/DeusExMachina/PressTestEngine.cpp 2009-11-23 09:17:52 +0000
+++ pkg/common/Engine/DeusExMachina/PressTestEngine.cpp 2009-11-24 14:08:28 +0000
@@ -51,4 +51,3 @@
CREATE_LOGGER(PressTestEngine);
YADE_PLUGIN((PressTestEngine));
-YADE_REQUIRE_FEATURE(physpar)
=== modified file 'pkg/common/Engine/DeusExMachina/TranslationEngine.cpp'
--- pkg/common/Engine/DeusExMachina/TranslationEngine.cpp 2009-11-21 10:36:08 +0000
+++ pkg/common/Engine/DeusExMachina/TranslationEngine.cpp 2009-11-24 14:08:28 +0000
@@ -7,26 +7,17 @@
*************************************************************************/
#include"TranslationEngine.hpp"
-#include<yade/pkg-common/ParticleParameters.hpp>
#include<yade/core/MetaBody.hpp>
void TranslationEngine::applyCondition(MetaBody * ncb){
- shared_ptr<BodyContainer>& bodies=ncb->bodies;
-
Real dt=Omega::instance().getTimeStep();
- const int sign = 1; // ?
FOREACH(body_id_t id,subscribedBodies){
assert(id<(body_id_t)bodies->size());
- if(ParticleParameters* p = dynamic_cast<ParticleParameters*>((*bodies)[id]->physicalParameters.get())){
- p->se3.position+=sign*dt*velocity*translationAxis;
- p->velocity=sign*velocity*translationAxis;
- } else{
- Body::byId(id,ncb)->physicalParameters->se3.position+=sign*dt*velocity*translationAxis;
- }
+ Body* b=Body::byId(id,ncb).get();
+ if(!b) continue;
+ b->state->pos+=dt*velocity*translationAxis;
+ b->state->vel=velocity*translationAxis;
}
}
YADE_PLUGIN((TranslationEngine));
-
-YADE_REQUIRE_FEATURE(PHYSPAR);
-
=== modified file 'scripts/test/regular-sphere-pack.py'
--- scripts/test/regular-sphere-pack.py 2009-11-21 08:48:42 +0000
+++ scripts/test/regular-sphere-pack.py 2009-11-24 14:08:28 +0000
@@ -16,17 +16,23 @@
rad,gap=.15,.02
rho=1e3
-kw={'density':rho,'frictionAngle':.1}
+
+#Add material
+O.materials.append([GranularMat(young=1e8,frictionAngle=0.5,density=rho,label='materialZero')])
+
+#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}
O.bodies.append(
pack.regularHexa(
(pack.inSphere((0,0,4),2)-pack.inSphere((0,-2,5),2)) & pack.notInNotch(centerPoint=(0,0,4),edge=(0,1,0),normal=(-1,1,-1),aperture=.2)
- ,radius=rad,gap=gap,color=(0,1,0),density=10*rho
- ) # head
- +[utils.sphere((.8,1.9,5),radius=.2,color=(.6,.6,.6),density=rho),utils.sphere((-.8,1.9,5),radius=.2,color=(.6,.6,.6),density=rho),utils.sphere((0,2.4,4),radius=.4,color=(1,0,0),density=rho)] # eyes and nose
- +[utils.facet([(12,0,-6),(0,12,-6,),(-12,-12,-6)],dynamic=False)] # ground
- +pack.regularHexa(pack.inCylinder((-1,2.2,3.3),(1,2.2,3.3),2*rad),radius=rad,gap=gap/3,color=(0.929,0.412,0.412),density=10*rho) #mouth
+ ,radius=rad,gap=gap,color=(0,1,0),material=0) # head
+ +[utils.sphere((.8,1.9,5),radius=.2,color=(.6,.6,.6),material=0),utils.sphere((-.8,1.9,5),radius=.2,color=(.6,.6,.6),material=0),utils.sphere((0,2.4,4),radius=.4,color=(1,0,0),material=0)] # eyes and nose
+ +pack.regularHexa(pack.inCylinder((-1,2.2,3.3),(1,2.2,3.3),2*rad),radius=rad,gap=gap/3,color=(0.929,0.412,0.412),material=0) #mouth
)
+groundId=O.bodies.append(utils.facet([(12,0,-6),(0,12,-6,),(-12,-12,-6)],dynamic=False)) # ground
for part in [
pack.regularHexa (
@@ -39,7 +45,7 @@
]: O.bodies.appendClumped(part)
-kwBoxes={'frictionAngle':0.5,'color':[1,0,0],'wire':False,'dynamic':False}
+
q1 = Quaternion(Vector3(0,0,1),(3.14159/3))
o1,o_angl = q1.ToAxisAngle()
O.bodies.append(utils.facetBox((12,0,-6+0.9),(1,0.7,0.9),(o1[0],o1[1],o1[2],o_angl),**kwBoxes))
@@ -52,7 +58,6 @@
"""Import regular-sphere-pack.mesh into the YADE simulation"""
-kwMeshes={'frictionAngle':0.5,'color':[1,1,0],'wire':True,'dynamic':False}
O.bodies.append(utils.import_mesh_geometry('regular-sphere-pack.mesh',**kwMeshes))#generates facets from the mesh file
"""Import regular-sphere-pack-LSMGegGeo.geo into the YADE simulation"""
@@ -79,4 +84,4 @@
]
# we don't care about physical accuracy here, over-critical step is fine as long as the simulation doesn't explode
O.dt=3*utils.PWaveTimeStep()
-O.saveTmp()
+#O.saveTmp()
Follow ups