Author: cosurgi
Date: 2009-01-04 15:32:53 +0100 (Sun, 04 Jan 2009)
New Revision: 1603

Modified:
   trunk/core/Omega.cpp
   trunk/lib/serialization/IOFormatManager.tpp
   trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp
Log:
1. TriaxialStressController reads radius from interactingGeometry

2. I added .gz support back, please don't remove it:

   - I used .gz because files are only a bit bigger, but CPU usage is about 50 
smaller
   - so I generted about 2 GB of data with .gz, I'm not going to convert all of 
them into .bz2, even though it's as simple as 
   find -name "*.xml.gz" -exec unp {}; bzip2 {} \; or such.



Modified: trunk/core/Omega.cpp
===================================================================
--- trunk/core/Omega.cpp        2008-12-31 19:11:49 UTC (rev 1602)
+++ trunk/core/Omega.cpp        2009-01-04 14:32:53 UTC (rev 1603)
@@ -236,7 +236,7 @@
                //boost::mutex::scoped_lock 
lock1(rootBody->persistentInteractions->drawloopmutex);
                //boost::mutex::scoped_lock 
lock2(rootBody->transientInteractions->drawloopmutex);
                
-               if(algorithm::ends_with(simulationFileName,".xml") || 
algorithm::ends_with(simulationFileName,".xml.bz2")){
+               if(algorithm::ends_with(simulationFileName,".xml") || 
algorithm::ends_with(simulationFileName,".xml.gz") || 
algorithm::ends_with(simulationFileName,".xml.bz2")){
                        resetRootBody();
                        
IOFormatManager::loadFromFile("XMLFormatManager",simulationFileName,"rootBody",rootBody);
                }

Modified: trunk/lib/serialization/IOFormatManager.tpp
===================================================================
--- trunk/lib/serialization/IOFormatManager.tpp 2008-12-31 19:11:49 UTC (rev 
1602)
+++ trunk/lib/serialization/IOFormatManager.tpp 2009-01-04 14:32:53 UTC (rev 
1603)
@@ -18,6 +18,7 @@
 #include<boost/scoped_ptr.hpp>
 #include<boost/iostreams/filtering_stream.hpp>
 #include<boost/iostreams/filter/bzip2.hpp>
+#include<boost/iostreams/filter/gzip.hpp>
 #include<boost/iostreams/device/file.hpp>
 #include<boost/algorithm/string.hpp>
 
@@ -45,6 +46,7 @@
 void IOFormatManager::loadFromFile(const string& libName, const string& 
fileName,const string& name, Type& t){
        iostreams::filtering_istream in;
        if(boost::algorithm::ends_with(fileName,".bz2")) 
in.push(iostreams::bzip2_decompressor());
+       if(boost::algorithm::ends_with(fileName,".gz")) 
in.push(iostreams::gzip_decompressor());
        in.push(iostreams::file_source(fileName));
        if(!in.good()) throw 
SerializableError(IOManagerExceptions::FileNotGood);
 

Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp     
2008-12-31 19:11:49 UTC (rev 1602)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp     
2009-01-04 14:32:53 UTC (rev 1603)
@@ -228,8 +228,8 @@
                        const shared_ptr<Body>& b = *bi;
                        if ( b->isDynamic )
                        {
-                               const shared_ptr<Sphere>& sphere =
-                                               YADE_PTR_CAST<Sphere> ( 
b->geometricalModel );
+                               const shared_ptr<InteractingSphere>& sphere =
+                                               
YADE_PTR_CAST<InteractingSphere> ( b->interactingGeometry );
                                spheresVolume += 1.3333333*Mathr::PI*pow ( 
sphere->radius, 3 );
                        }
                }


_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to