yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00551
[svn] r1476 - cosurgi
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Wed, 20 Aug 2008 12:08:29 +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==
------------------------------------------------------------------------
r1476 | cosurgi | 2008-08-19 21:14:23 +0200 (wto, 19 sie 2008) | 5 lines
Changed paths:
M /trunk/core/yade.cpp
M /trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp
M /trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessCounter.cpp
No idea why dynamic_cast fails while static_cast works in TriaxialCompressionEngine:275 and GlobalStiffnessCounter:63 when casting to NormalShearInteraction. We will use static_cast for now...
Added informative message in case when log4cxx enters infinite loop while crashing on exit
------------------------------------------------------------------------
Index: pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp
===================================================================
--- pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp (revision 1475)
+++ pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp (revision 1476)
@@ -272,7 +272,9 @@
const shared_ptr<BodyMacroParameters>& sdec1 = YADE_PTR_CAST<BodyMacroParameters>((*bodies)[(body_id_t) ((*ii)->getId1())]->physicalParameters);
const shared_ptr<BodyMacroParameters>& sdec2 = YADE_PTR_CAST<BodyMacroParameters>((*bodies)[(body_id_t) ((*ii)->getId2())]->physicalParameters);
- const shared_ptr<ElasticContactInteraction>& contactPhysics = YADE_PTR_CAST<ElasticContactInteraction>((*ii)->interactionPhysics);
+ //FIXME - why dynamic_cast fails here?
+ //const shared_ptr<ElasticContactInteraction>& contactPhysics = YADE_PTR_CAST<ElasticContactInteraction>((*ii)->interactionPhysics);
+ const shared_ptr<ElasticContactInteraction>& contactPhysics = static_pointer_cast<ElasticContactInteraction>((*ii)->interactionPhysics);
Real fa = sdec1->frictionAngle;
Real fb = sdec2->frictionAngle;
Index: pkg/dem/Engine/StandAloneEngine/GlobalStiffnessCounter.cpp
===================================================================
--- pkg/dem/Engine/StandAloneEngine/GlobalStiffnessCounter.cpp (revision 1475)
+++ pkg/dem/Engine/StandAloneEngine/GlobalStiffnessCounter.cpp (revision 1476)
@@ -58,10 +58,11 @@
if(!contact->isReal) continue;
SpheresContactGeometry* geom=YADE_CAST<SpheresContactGeometry*>(contact->interactionGeometry.get()); assert(geom);
- // FIXME: for some reason, the following cast is not successful. Please help!
+ // FIXME: for some reason, the following dynamic cast is not successful. Please help!
//cerr<<__FILE__<<":"<<__LINE__<<" Interaction physics of type "<<contact->interactionPhysics->getClassName()<<" ("<<typeid(*contact->interactionPhysics).name()<<")"<<endl;
+ NormalShearInteraction* phys=static_cast<NormalShearInteraction*>(contact->interactionPhysics.get()); assert(phys);
//NormalShearInteraction* phys=YADE_CAST<NormalShearInteraction*>(contact->interactionPhysics.get()); assert(phys);
- ElasticContactInteraction* phys=YADE_CAST<ElasticContactInteraction*>(contact->interactionPhysics.get()); assert(phys);
+ //ElasticContactInteraction* phys=YADE_CAST<ElasticContactInteraction*>(contact->interactionPhysics.get()); assert(phys);
// all we need for getting stiffness
Vector3r& normal=geom->normal; Real& kn=phys->kn; Real& ks=phys->ks; Real& radius1=geom->radius1; Real& radius2=geom->radius2;
// FIXME? NormalShearInteraction knows nothing about whether the contact is "active" (force!=0) or not;
Index: core/yade.cpp
===================================================================
--- core/yade.cpp (revision 1475)
+++ core/yade.cpp (revision 1476)
@@ -37,7 +37,7 @@
#endif
void nullHandler(int sig){
- cerr<<"WARN: nullHandler, signal "<<(sig==SIGSEGV?"SEGV":"[other]")<<endl;
+ cerr<<"WARN: nullHandler (probably log4cxx error, if it's infinite loop then press Ctrl-C or Ctrl-\\ to stop), signal "<<(sig==SIGSEGV?"SEGV":"[other]")<<endl;
}
void
@@ -168,8 +168,8 @@
// read logging configuration from file and watch it (creates a separate thread)
std::string logConf=configPath+"/logging.conf";
if(filesystem::exists(logConf)){
+ log4cxx::PropertyConfigurator::configure(logConf);
LOG_INFO("Loading "<<logConf);
- log4cxx::PropertyConfigurator::configure(logConf);
} else { // otherwise use simple console-directed logging
log4cxx::BasicConfigurator::configure();
logger->setLevel(log4cxx::Level::WARN);