yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00568
[svn] r1474 - eudoxos
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Wed, 20 Aug 2008 12:07:31 +0200
-
Face:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEUBAQEtLS1KSkpRUVFXV1dYWFhjY2Nzc3N3d3eHh4eKioqdnZ24uLjLy8vc3NxVIagyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AIVEzgS1fgQtQAAAjRJREFUOMtt1DFv00AUAOAzFQNbjigSyoQaRaBMhKgLUyKXpVNNeUpk9vyDqFJhQ1kiBuaqAwJCqvPtSLY7RlTn5+5IdnYkkt/AOyfxXVLe5vf53Z1875kd34tOEax8djmj6GyjhB5bxz50GdsVZr9fqRjZwAtKOJw5Wqs2MMZ16ALHsaDncF7xAHix1oEFHAB8f+pRjcO4gfZDykcYzbiucRolOLUJ6kjA0xtVt+A6TySlM0RajIpK6DzwKZ/nOYbF/gclHMo1ZOHYY/+Ha+AWuM+3oMS4eeqYzZ8FiCltgUqI8cd2wwAVpJk+8LWYjBtnJdQpHQqJMd4Oxt4bU9ESiFGc5hkqaH74asAX4iabP5I5gZ+qjgGlJCqZa3h3lxhoeVcSE1qLQC4sqKOK9MGW9E3izFqqHokoztLFEgXg31sbZEKnWi2T74A4NxfVQqlkjKtcAWD+zcArFEES01dR0E/nnV0IgugmDd/2L84sOAouRBBHEc7gtc8teDkRlE0iNQPo2w3Xhh/D4TCIQ4LRLoTvgwjj6RRgavdurxYGMaIuGOyAW/PpNlCcU9/93AHenAWYjPoAwa+G3e3to/MgFNTAEKvKDjzuCzHTnY3qqdXtx24VijzQfZ0yewZ5cwRFQaa+mIYr1uI0I76+3W4xhlvoVRwOA0Fdl64HlJnxP6T8YpX/Lga4Wv4A3ErrU5oTfN7Mu/llXMl8RXEPji/lQkN3H7qXqgC2By47EXeU/7PJ/wPxRKMnuZwIeAAAAABJRU5ErkJggg==
------------------------------------------------------------------------
r1474 | eudoxos | 2008-08-19 13:19:34 +0200 (wto, 19 sie 2008) | 2 lines
Changed paths:
M /trunk/SConstruct
M /trunk/extra/Brefcom.cpp
M /trunk/extra/Brefcom.hpp
1. Kill building threads if the master thread is interruped in multi-builds (profile=a,b)
------------------------------------------------------------------------
Index: extra/Brefcom.hpp
===================================================================
--- extra/Brefcom.hpp (revision 1473)
+++ extra/Brefcom.hpp (revision 1474)
@@ -32,6 +32,7 @@
virtual void action(MetaBody* rb){compute(rb,useMaxForce);}
BrefcomGlobalCharacteristics(){};
void registerAttributes(){ PeriodicEngine::registerAttributes(); REGISTER_ATTRIBUTE(unbalancedForce); REGISTER_ATTRIBUTE(useMaxForce);}
+ DECLARE_LOGGER;
REGISTER_CLASS_NAME(BrefcomGlobalCharacteristics);
REGISTER_BASE_CLASS_NAME(PeriodicEngine);
};
@@ -145,7 +146,7 @@
//! number of contacts with this body
int numContacts;
BrefcomPhysParams(): epsVolumetric(0.), numBrokenCohesive(0), numContacts(0) {createIndex();};
- virtual void registerAttributes(){BodyMacroParameters::registerAttributes(); REGISTER_ATTRIBUTE(epsVolumetric); REGISTER_ATTRIBUTE(numBrokenCohesive);}
+ virtual void registerAttributes(){BodyMacroParameters::registerAttributes(); REGISTER_ATTRIBUTE(epsVolumetric); REGISTER_ATTRIBUTE(numBrokenCohesive); REGISTER_ATTRIBUTE(numContacts); }
REGISTER_CLASS_NAME(BrefcomPhysParams);
REGISTER_BASE_CLASS_NAME(BodyMacroParameters);
};
Index: extra/Brefcom.cpp
===================================================================
--- extra/Brefcom.cpp (revision 1473)
+++ extra/Brefcom.cpp (revision 1474)
@@ -8,6 +8,8 @@
YADE_PLUGIN("BrefcomMakeContact","BrefcomContact","BrefcomLaw","GLDrawBrefcomContact","BrefcomDamageColorizer", "BrefcomPhysParams", "BrefcomGlobalCharacteristics" /* ,"BrefcomStiffnessComputer"*/ );
+CREATE_LOGGER(BrefcomGlobalCharacteristics);
+
void BrefcomGlobalCharacteristics::compute(MetaBody* rb, bool useMaxForce){
Shop::Bex::initCache();
@@ -15,7 +17,7 @@
// 2. get maximum force on a body and sum of all forces (for averaging)
Real sumF=0,maxF=0,currF;
FOREACH(const shared_ptr<Body>& b, *rb->bodies){
- BrefcomPhysParams* bpp(YADE_CAST<BrefcomPhysParams*>(b->physicalParameters.get()));
+ BrefcomPhysParams* bpp(YADE_CAST<BrefcomPhysParams*>(b->physicalParameters.get()));
bpp->epsVolumetric=0;
bpp->numContacts=0;
currF=Shop::Bex::force(b->id,rb).Length(); maxF=max(currF,maxF); sumF+=currF;
@@ -41,8 +43,10 @@
shared_ptr<BrefcomContact> BC=YADE_PTR_CAST<BrefcomContact>(I->interactionPhysics); assert(BC);
BrefcomPhysParams* bpp1(YADE_CAST<BrefcomPhysParams*>(Body::byId(I->getId1())->physicalParameters.get()));
BrefcomPhysParams* bpp2(YADE_CAST<BrefcomPhysParams*>(Body::byId(I->getId2())->physicalParameters.get()));
- Real epsVolAvg=.5*((3/bpp1->numContacts)*bpp1->epsVolumetric+(3/bpp2->numContacts)*bpp2->epsVolumetric);
+ Real epsVolAvg=.5*((3./bpp1->numContacts)*bpp1->epsVolumetric+(3./bpp2->numContacts)*bpp2->epsVolumetric);
BC->epsTrans=(epsVolAvg-BC->epsN)/2.;
+ //TRVAR5(I->getId1(),I->getId2(),BC->epsTrans,(3./bpp1->numContacts)*bpp1->epsVolumetric,(3./bpp2->numContacts)*bpp2->epsVolumetric);
+ //TRVAR4(bpp1->numContacts,bpp1->epsVolumetric,bpp2->numContacts,bpp2->epsVolumetric);
}
#if 0
FOREACH(const shared_ptr<Body>& b, *rb->bodies){
Index: SConstruct
===================================================================
--- SConstruct (revision 1473)
+++ SConstruct (revision 1474)
@@ -87,6 +87,11 @@
t=threading.Thread(target=runProfile,name='profile_'+p,args=(p,))
t.start()
profileThreads.append(t)
+ import atexit
+ def killAllProfileThreads():
+ for t in profileThreads:
+ t.join(0.1)
+ atexit.register(killAllProfileThreads)
for t in profileThreads:
t.join()
Exit()