yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00555
[svn] r1467 - cosurgi
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Wed, 20 Aug 2008 12:03:08 +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==
------------------------------------------------------------------------
r1467 | cosurgi | 2008-08-14 19:02:33 +0200 (czw, 14 sie 2008) | 3 lines
Changed paths:
M /trunk/pkg/common/Engine/DeusExMachina/GravityEngines.cpp
M /trunk/pkg/common/Engine/MetaEngine/BoundingVolumeMetaEngine.cpp
M /trunk/pkg/dem/PreProcessor/DirectShearCis.cpp
M /trunk/pkg/dem/PreProcessor/DirectShearCis.hpp
M /trunk/pkg/dem/PreProcessor/HydraulicTest.cpp
M /trunk/pkg/dem/PreProcessor/SDECImpactTest.cpp
M /trunk/pkg/dem/PreProcessor/SDECLinkedSpheres.cpp
M /trunk/pkg/dem/PreProcessor/STLImporterTest.cpp
M /trunk/pkg/dem/PreProcessor/ThreePointBending.cpp
M /trunk/pkg/fem/PreProcessor/FEMBeam.cpp
M /trunk/pkg/mass-spring/PreProcessor/HangingCloth.cpp
some small bugfixes that allow all non-broken filegenerators to run. Those based on SDECLinks will never work, so just put "return false;" there to indicate failure.
------------------------------------------------------------------------
Index: pkg/mass-spring/PreProcessor/HangingCloth.cpp
===================================================================
--- pkg/mass-spring/PreProcessor/HangingCloth.cpp (revision 1466)
+++ pkg/mass-spring/PreProcessor/HangingCloth.cpp (revision 1467)
@@ -438,6 +438,10 @@
}
}
}
+ #ifndef YADE_DEBUG
+ message="HangingCloth currently works only in not optimized debug mode and needs to be fixed. If want to try it you must compile with option 'scons optimize=0'";
+ return false;
+ #endif
message="total number of permament links created: " + lexical_cast<string>(linksNum);
return true;
Index: pkg/dem/PreProcessor/ThreePointBending.cpp
===================================================================
--- pkg/dem/PreProcessor/ThreePointBending.cpp (revision 1466)
+++ pkg/dem/PreProcessor/ThreePointBending.cpp (revision 1467)
@@ -252,7 +252,7 @@
+ lexical_cast<string>(rootBody->persistentInteractions->size())
+ "\nWARNING: link bonds are nearly working, but the formulas are waiting for total rewrite!"+
+"\nWARNING: The results are meaningless, since ElasticCohesiveLaw works only with (unused) SDECLinkGeometry.";
- return true;
+ return false;
}
Index: pkg/dem/PreProcessor/DirectShearCis.cpp
===================================================================
--- pkg/dem/PreProcessor/DirectShearCis.cpp (revision 1466)
+++ pkg/dem/PreProcessor/DirectShearCis.cpp (revision 1467)
@@ -63,6 +63,7 @@
#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include <boost/filesystem/convenience.hpp>
+#include <utility>
using namespace std;
@@ -191,7 +192,7 @@
// GenerateCloud(sphere_list,Vector3r(0,0,-profondeur/2.0),Vector3r(width,height,profondeur/2.0),nBilles,0.3,porosite);
// to use a text file :
- ImportCloud(sphere_list,filename);
+ std::pair<string,bool> res=ImportCloud(sphere_list,filename);
vector<BasicSphere>::iterator it = sphere_list.begin();
vector<BasicSphere>::iterator it_end = sphere_list.end();
@@ -203,8 +204,8 @@
rootBody->bodies->insert(body);
}
-
- return true;
+ message =res.first;
+ return res.second;
}
void DirectShearCis::createSphere(shared_ptr<Body>& body, Vector3r position, Real radius)
@@ -448,7 +449,7 @@
+ lexical_cast<string>(dimensions[2]) + ").";
}
-string DirectShearCis::ImportCloud(vector<BasicSphere>& sphere_list,string importFilename)
+std::pair<string,bool> DirectShearCis::ImportCloud(vector<BasicSphere>& sphere_list,string importFilename)
{
sphere_list.clear();
int nombre=0;
@@ -467,12 +468,12 @@
sphere_list.push_back(s);
nombre++;
}
- return "Echantillon correctement genere : " + lexical_cast<string>(nombre) + " billes";
+ return std::make_pair(std::string("Echantillon correctement genere : " + lexical_cast<string>(nombre) + " billes"),true);
}
else
{
- cerr << "PROBLEME AVEC LE FICHIER D ENTREE" << endl;
- return "PROBLEME AVEC LE FICHIER D ENTREE";
+ cerr << "Cannot find input file" << endl;
+ return std::make_pair("Cannot find input file",false);
}
}
Index: pkg/dem/PreProcessor/SDECLinkedSpheres.cpp
===================================================================
--- pkg/dem/PreProcessor/SDECLinkedSpheres.cpp (revision 1466)
+++ pkg/dem/PreProcessor/SDECLinkedSpheres.cpp (revision 1467)
@@ -215,7 +215,7 @@
+ lexical_cast<string>(rootBody->persistentInteractions->size())
+ "\nWARNING: link bonds are nearly working, but the formulas are waiting for total rewrite!"
+"\nWARNING: interactions will not generate any force since we use SpheresContactGeometry instead of SDECLinkGeometry now.";
- return true;
+ return false;
}
Index: pkg/dem/PreProcessor/DirectShearCis.hpp
===================================================================
--- pkg/dem/PreProcessor/DirectShearCis.hpp (revision 1466)
+++ pkg/dem/PreProcessor/DirectShearCis.hpp (revision 1467)
@@ -67,7 +67,7 @@
//method to create a list (containing the positions of centers and radii) of n non interpenetrating spheres, occupying a rectangle with a given (rather high) porosity (issued from TriaxialTest) :
string GenerateCloud(vector<BasicSphere>& sphere_list,Vector3r lowerCorner,Vector3r upperCorner,long number,Real rad_std_dev, Real porosity);
// to create the same list but by reading a text file containing the informations :
- string ImportCloud(vector<BasicSphere>& sphere_list,string importFilename);
+ std::pair<string,bool> ImportCloud(vector<BasicSphere>& sphere_list,string importFilename);
public :
Index: pkg/dem/PreProcessor/SDECImpactTest.cpp
===================================================================
--- pkg/dem/PreProcessor/SDECImpactTest.cpp (revision 1466)
+++ pkg/dem/PreProcessor/SDECImpactTest.cpp (revision 1467)
@@ -241,6 +241,11 @@
}
}
+ else
+ {
+ message="Cannot find input file, you can copy it from examples/ directory";
+ return false;
+ }
// create bigBall
Vector3r position = (upperCorner+lowerCorner)*0.5 + Vector3r(0,bigBallDropHeight,0);
Index: pkg/dem/PreProcessor/STLImporterTest.cpp
===================================================================
--- pkg/dem/PreProcessor/STLImporterTest.cpp (revision 1466)
+++ pkg/dem/PreProcessor/STLImporterTest.cpp (revision 1467)
@@ -123,6 +123,7 @@
if (!imp.open(stlFileName.c_str()))
{
cerr << "ERROR: Bad file: " << stlFileName << endl;
+ message="Input file not found, you can copy it from examples/ directory or make one using blender 3D modelling";
return false;
}
imp.set_imported_stuff(verticesImport,edgesImport,facetsImport);
Index: pkg/dem/PreProcessor/HydraulicTest.cpp
===================================================================
--- pkg/dem/PreProcessor/HydraulicTest.cpp (revision 1466)
+++ pkg/dem/PreProcessor/HydraulicTest.cpp (revision 1467)
@@ -132,7 +132,10 @@
}
}
else
- return "Error: cannot load the file that should contain spheres";
+ {
+ message="Error: cannot load the file that should contain spheres";
+ return false;
+ }
/////////////////////////////////////
Vector3r min ( 10000,10000,10000 ),max ( -10000,-10000,-10000 );
{// calc min/max
Index: pkg/fem/PreProcessor/FEMBeam.cpp
===================================================================
--- pkg/fem/PreProcessor/FEMBeam.cpp (revision 1466)
+++ pkg/fem/PreProcessor/FEMBeam.cpp (revision 1467)
@@ -129,7 +129,21 @@
imposeTranslation(rootBody,regionMin1,regionMax1,translationAxis1,velocity1);
imposeTranslation(rootBody,regionMin2,regionMax2,translationAxis2,velocity2);
- message="\nNOTE: if it explodes, set smaller time step."; return true;
+ #ifndef YADE_DEBUG
+ message="FEM currently works only in not optimized debug mode and needs to be fixed. If want to try it you must compile with option 'scons optimize=0'";
+ return false;
+ #endif
+
+ if(filesystem::exists(femTxtFile))
+ {
+ message="NOTE: if it explodes, set smaller time step.";
+ return true;
+ }
+ else
+ {
+ message="Cannot find input file, you can copy it from examples/ directory";
+ return false;
+ }
}
Index: pkg/common/Engine/MetaEngine/BoundingVolumeMetaEngine.cpp
===================================================================
--- pkg/common/Engine/MetaEngine/BoundingVolumeMetaEngine.cpp (revision 1466)
+++ pkg/common/Engine/MetaEngine/BoundingVolumeMetaEngine.cpp (revision 1467)
@@ -20,8 +20,11 @@
const long numBodies=(long)bodies->size();
//#pragma omp parallel for
for(int id=0; id<numBodies; id++){
- const shared_ptr<Body>& b=(*bodies)[id];
- if(b->interactingGeometry && b->boundingVolume) operator()(b->interactingGeometry,b->boundingVolume,b->physicalParameters->se3,b.get());
+ if(bodies->exists(id)) // don't delete this check - Janek
+ {
+ const shared_ptr<Body>& b=(*bodies)[id];
+ if(b->interactingGeometry && b->boundingVolume) operator()(b->interactingGeometry,b->boundingVolume,b->physicalParameters->se3,b.get());
+ }
}
operator()(ncb->interactingGeometry,ncb->boundingVolume,ncb->physicalParameters->se3,ncb);
}
Index: pkg/common/Engine/DeusExMachina/GravityEngines.cpp
===================================================================
--- pkg/common/Engine/DeusExMachina/GravityEngines.cpp (revision 1466)
+++ pkg/common/Engine/DeusExMachina/GravityEngines.cpp (revision 1467)
@@ -23,8 +23,8 @@
FOREACH(const shared_ptr<Body>& b, *ncb->bodies){
if(b->isClumpMember()) continue;
shared_ptr<ParticleParameters> p=YADE_PTR_CAST<ParticleParameters>(b->physicalParameters);
- assert(p);
- static_cast<Force*>(ncb->physicalActions->find(b->getId(),cachedForceClassIndex).get())->force+=gravity*p->mass;
+ if(p!=0) //not everything derives from ParticleParameters; this line was assert(p); - Janek
+ static_cast<Force*>(ncb->physicalActions->find(b->getId(),cachedForceClassIndex).get())->force+=gravity*p->mass;
}
}