yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #07802
[Branch ~yade-dev/yade/trunk] Rev 2890: Add ids-parameter to SphereFactory to get the ids of newly created bodies
------------------------------------------------------------
revno: 2890
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: yade
timestamp: Tue 2011-07-19 09:06:08 +0200
message:
Add ids-parameter to SphereFactory to get the ids of newly created bodies
modified:
pkg/dem/SpheresFactory.cpp
pkg/dem/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
=== modified file 'pkg/dem/SpheresFactory.cpp'
--- pkg/dem/SpheresFactory.cpp 2011-07-19 06:28:58 +0000
+++ pkg/dem/SpheresFactory.cpp 2011-07-19 07:06:08 +0000
@@ -82,6 +82,7 @@
if (mask>0) {b->groupMask=mask;}
// insert particle in the simulation
scene->bodies->insert(b);
+ ids.push_back(b->getId());
// increment total mass we've spit out
totalMass+=state->mass;
numParticles++;
=== modified file 'pkg/dem/SpheresFactory.hpp'
--- pkg/dem/SpheresFactory.hpp 2011-07-19 06:28:58 +0000
+++ pkg/dem/SpheresFactory.hpp 2011-07-19 07:06:08 +0000
@@ -22,6 +22,7 @@
((Vector3r,normal,Vector3r(NaN,NaN,NaN),,"Spitting direction (and orientation of the region's geometry)."))
((int,materialId,-1,,"Shared material id to use for newly created spheres (can be negative to count from the end)"))
((int,mask,-1,,"groupMask to apply for newly created spheres "))
+ ((vector<int>,ids,,,"ids of created bodies"))
((Real,totalMass,0,,"Mass of spheres that was produced so far. |yupdate|"))
((Real,goalMass,0,,"Total mass that should be attained at the end of the current step. |yupdate|"))
((int,maxParticles,100,,"The number of particles at which to stop generating new ones (regardless of massFlowRate"))