[Yade-dev] [svn] r1658 - in trunk: core gui/py gui/qt3 pkg/common/Engine/DeusExMachina pkg/dem/Engine/EngineUnit

2009-02-06 Thread eudoxos at BerliOS
Author: eudoxos
Date: 2009-02-06 21:46:33 +0100 (Fri, 06 Feb 2009)
New Revision: 1658

Modified:
   trunk/core/yade.cpp
   trunk/gui/py/_eudoxos.cpp
   trunk/gui/py/_utils.cpp
   trunk/gui/py/utils.py
   trunk/gui/qt3/GLViewer.cpp
   trunk/gui/qt3/QtGUI-python.cpp
   trunk/gui/qt3/QtSimulationPlayer.cpp
   trunk/pkg/common/Engine/DeusExMachina/RotationEngine.cpp
   trunk/pkg/common/Engine/DeusExMachina/RotationEngine.hpp
   
trunk/pkg/dem/Engine/EngineUnit/InteractingFacet2InteractingSphere4SpheresContactGeometry.cpp
Log:
1. Beautify no-debug code in main
2. SpiralEngine now saves angle it has turned so far
3. Remove failing assertion from IFacet2ISphere4SCG?\194?\160(why it fails? it 
was a 
(I-isRealI-interactionGeometry)||(!I-isReal!I-interactionGeometry)...)
4. Improve the utils.spiralproject function to specify period (moderately 
tested, but seems to work)
5. Adjust locks in GLViewer. Fixes my crashes on nvidia for both player and 3d 
view (didn't dare to try 2nd view). Next step will be to move this lock to 
Omega and lock it when loading/resetting simulation etc.
6. Change theora video quality to 63 (maximum) instead of medium 32 in 
utils.encodeVideoFromFrames. Makes the video about 3x bigger.



Modified: trunk/core/yade.cpp
===
--- trunk/core/yade.cpp 2009-02-04 21:45:01 UTC (rev 1657)
+++ trunk/core/yade.cpp 2009-02-06 20:46:33 UTC (rev 1658)
@@ -31,8 +31,6 @@
 
 using namespace std;
 
-bool dontUseGdb(false);
-
 #ifdef LOG4CXX
// provides parent logger for everybody
log4cxx::LoggerPtr logger=log4cxx::Logger::getLogger(yade);
@@ -61,8 +59,7 @@
case SIGSEGV:
signal(SIGSEGV,SIG_DFL); signal(SIGABRT,SIG_DFL); // 
prevent loops - default handlers
cerrSIGSEGV/SIGABRT handler called; gdb batch file 
is `Omega::instance().gdbCrashBatch'endl;
-   if(!dontUseGdb)
-   std::system((string(gdb -x 
)+Omega::instance().gdbCrashBatch).c_str());
+   std::system((string(gdb -x 
)+Omega::instance().gdbCrashBatch).c_str());
unlink(Omega::instance().gdbCrashBatch.c_str()); // 
delete the crash batch file
raise(sig); // reemit signal after exiting gdb
break;
@@ -152,6 +149,8 @@
filesystem::path::default_name_check(filesystem::native);
 
string configPath=string(getenv(HOME)) + /.yade SUFFIX; // this is 
the default, may be overridden by -c / -C
+
+   bool useGdb=true;

int ch; string gui=; string simulationFileName=; bool setup=false; 
int verbose=0; bool coreOptions=true; bool explicitUI=false;
while(coreOptions  (ch=getopt(argc,argv,hnN:wC:cxvS:))!=-1)
@@ -162,7 +161,7 @@
case 'w': setup=true; break;
case 'C': configPath=optarg; break;
case 'c': configPath=.; break;
-   case 'x': dontUseGdb=true; break;
+   case 'x': useGdb=false; break;
case 'v': verbose+=1; break;
case 'S': simulationFileName=optarg; break;
case '-': coreOptions=false; break;
@@ -221,13 +220,15 @@
}
 
#ifdef YADE_DEBUG
-   // postponed until the config dir has been created
-   ofstream gdbBatch;
-   
Omega::instance().gdbCrashBatch=(yadeConfigPath/gdb_crash_batch-pid).string()+lexical_caststring(getpid());
-   gdbBatch.open(Omega::instance().gdbCrashBatch.c_str()); 
gdbBatchattach lexical_caststring(getpid())\nset pagination 
off\nthread info\nthread apply all backtrace\ndetach\nquit\n; gdbBatch.close();
-   signal(SIGABRT,sigHandler);
-   signal(SIGSEGV,sigHandler);
-   LOG_DEBUG(ABRT/SEGV signal handlers set, crash batch created 
as Omega::instance().gdbCrashBatch);
+   if(useGdb){
+   // postponed until the config dir has been created
+   ofstream gdbBatch;
+   
Omega::instance().gdbCrashBatch=(yadeConfigPath/gdb_crash_batch-pid).string()+lexical_caststring(getpid());
+   gdbBatch.open(Omega::instance().gdbCrashBatch.c_str()); 
gdbBatchattach lexical_caststring(getpid())\nset pagination 
off\nthread info\nthread apply all backtrace\ndetach\nquit\n; gdbBatch.close();
+   signal(SIGABRT,sigHandler);
+   signal(SIGSEGV,sigHandler);
+   LOG_DEBUG(ABRT/SEGV signal handlers set, crash batch 
created as Omega::instance().gdbCrashBatch);
+   }
#endif

LOG_INFO(Loading yadeConfigFile.string()); 
IOFormatManager::loadFromFile(XMLFormatManager,yadeConfigFile.string(),preferences,Omega::instance().preferences);
@@ -270,9 +271,11 @@
// Py_Finalize();
   

Re: [Yade-dev] r1658 - graphic display

2009-02-06 Thread Janek Kozicki
 commit 1658
 5. Adjust locks in GLViewer. Fixes my crashes on nvidia for both
 player and 3d view (didn't dare to try 2nd view). Next step will be
 to move this lock to Omega and lock it when loading/resetting
 simulation etc.

well. it still doesn't work for me. At least it doesn't hang, that's
an improvement. The 3d view is simply black. I have to work on snow
so I'm not working on it, I'm still simply just commenting out the
locks, because I need it to work :)


eudoxos said: (by the date of Tue, 03 Feb 2009 13:30:44 +0100)

  commenting out that lock in GLViewer::paintGL(void) solves the problem.
 
 That doesn't solve the problem I was trying to solve, i.e. concurrent
 access from different threads.
 
 Did you try running scripts/gl-test.py (and enable second view therein)?
 There is the problem demonstrated. Please try rather commenting out
 makeCurrent/doneCurrent in lock constructor/desctructor. The lock itself is
 neede, see those threads on the subject:
 
 http://www.vtk.org/pipermail/vtkusers/2008-July/096077.html
 http://lists.trolltech.com/qt-interest/2006-06/thread00248-0.html
 http://doc.trolltech.com/qq/qq06-glimpsing.html

I'll check this out in few weeks, sorry. In fact I hope that you will
figure it out before it catches my attention ;

-- 
Janek Kozicki |

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] r1659 - commit message

2009-02-06 Thread sega

r1659 | sega | 2009-02-07 03:27:15 +0300 (Сбт, 07 Фев 2009) | 16 lines

ColorizedVelocityFilter counts a scale for each frame, without using previous 
min,max values.

1/ SimpleViscoelasticBodyParameters, 
SimpleViscoelasticInteraction,SimpleViscoelasticRelationships: 
'setViscoelastic' is renamed to 'getViscoelasticFromSpheresInteraction' and 
moved to Shop; 'mu' is renamed to 'frictionAngle' according to the settled YADE 
practice. 

2/ MembraneTest and TestSimpleViscoelastic are brought into accord with this 
changes.

3/ SimpleViscoelasticContactLaw is updated in order to take into account shear 
interaction with facets.

4/ Shop: add getViscoelasticFromSpheresInteraction. It is accessible from 
python console also. 

5/ utils.py: add 'spheres_v2', 'facet_v2', 'import_stl_geometry_v2' in order to 
allow any PhysicalParameters class, not only BodyMacroParameters descendan as 
for first versions.

6/ add examples/dynamic_simulation_tests for SimpleViscoelastic and 
CundallDamping contact models; add comment to NewtonsDampedLaw about Cundall 
damping affect dynamic simulations.

-- 
Best regards, Sergei D.

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp