yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #01418
[svn] r1844 - in trunk: examples/triax-perf py/yadeWrapper
Author: eudoxos
Date: 2009-07-07 20:48:15 +0200 (Tue, 07 Jul 2009)
New Revision: 1844
Modified:
trunk/examples/triax-perf/triax-perf.py
trunk/examples/triax-perf/triax-perf.table
trunk/py/yadeWrapper/yadeWrapper.cpp
Log:
1. Update triax-perf.py
2. Add Omega().tmpToString returning string of :memory: saved simluation
Modified: trunk/examples/triax-perf/triax-perf.py
===================================================================
--- trunk/examples/triax-perf/triax-perf.py 2009-07-07 14:26:59 UTC (rev 1843)
+++ trunk/examples/triax-perf/triax-perf.py 2009-07-07 18:48:15 UTC (rev 1844)
@@ -12,8 +12,8 @@
#
# You have to collect the results by hand from log files.
#
-utils.readParamsFromTable(parallel=False,noTableOk=True)
-p=Preprocessor('TriaxialTest',{'numberOfGrains':8000,'parallel':parallel}).load()
+utils.readParamsFromTable(fast=False,noTableOk=True)
+p=Preprocessor('TriaxialTest',{'numberOfGrains':8000,'fast':fast}).load()
O.run(10,True) # filter out initialization
O.timingEnabled=True
O.run(1000,True)
Modified: trunk/examples/triax-perf/triax-perf.table
===================================================================
--- trunk/examples/triax-perf/triax-perf.table 2009-07-07 14:26:59 UTC (rev 1843)
+++ trunk/examples/triax-perf/triax-perf.table 2009-07-07 18:48:15 UTC (rev 1844)
@@ -1,4 +1,4 @@
-!OMP_NUM_THREADS parallel description
+!OMP_NUM_THREADS fast description
1 False ser1
2 False ser2
3 False ser3
Modified: trunk/py/yadeWrapper/yadeWrapper.cpp
===================================================================
--- trunk/py/yadeWrapper/yadeWrapper.cpp 2009-07-07 14:26:59 UTC (rev 1843)
+++ trunk/py/yadeWrapper/yadeWrapper.cpp 2009-07-07 18:48:15 UTC (rev 1844)
@@ -532,9 +532,11 @@
LOG_INFO("Saving :memory:"<<mark<<" to "<<filename);
out<<OMEGA.memSavedSimulations[":memory:"+mark];
}
+ string tmpToString(string mark){
+ if(OMEGA.memSavedSimulations.count(":memory:"+mark)==0) throw runtime_error("No memory-saved simulation named "+mark);
+ return OMEGA.memSavedSimulations[":memory:"+mark];
+ }
-
-
void reset(){Py_BEGIN_ALLOW_THREADS; OMEGA.reset(); Py_END_ALLOW_THREADS; }
void resetTime(){ OMEGA.getRootBody()->currentIteration=0; OMEGA.getRootBody()->simulationTime=0; OMEGA.timeInit(); }
void switchWorld(){ std::swap(OMEGA.rootBody,OMEGA.rootBodyAnother); }
@@ -708,6 +710,7 @@
.def("loadTmp",&pyOmega::loadTmp,omega_loadTmp_overloads(python::args("mark")))
.def("saveTmp",&pyOmega::saveTmp,omega_saveTmp_overloads(python::args("mark")))
.def("tmpToFile",&pyOmega::tmpToFile)
+ .def("tmpToString",&pyOmega::tmpToString)
.def("saveSpheres",&pyOmega::saveSpheres)
.def("run",&pyOmega::run,omega_run_overloads())
.def("pause",&pyOmega::pause)