[cig-commits] r11469 - in short/3D/PyLith/trunk: libsrc/meshio modulesrc/meshio pylith/meshio unittests/libtests/meshio unittests/libtests/meshio/data

brad at geodynamics.org brad at geodynamics.org
Tue Mar 18 10:16:01 PDT 2008


Author: brad
Date: 2008-03-18 10:16:01 -0700 (Tue, 18 Mar 2008)
New Revision: 11469

Added:
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary_32on64.gmv
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary_32on64.pset
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary_64.gmv
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary_64.pset
Modified:
   short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.cc
   short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.hh
   short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.icc
   short/3D/PyLith/trunk/libsrc/meshio/PsetFileBinary.cc
   short/3D/PyLith/trunk/libsrc/meshio/PsetFileBinary.hh
   short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src
   short/3D/PyLith/trunk/pylith/meshio/MeshIOLagrit.py
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIOLagrit.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIOLagrit.hh
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/Makefile.am
Log:
Added ability to read gmv/pset LaGriT files for LaGriT built on 64-bit platforms.

Modified: short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.cc	2008-03-18 15:11:05 UTC (rev 11468)
+++ short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.cc	2008-03-18 17:16:01 UTC (rev 11469)
@@ -32,6 +32,7 @@
   _filenameGmv(""),
   _filenamePset(""),
   _flipEndian(false),
+  _ioInt32(true),
   _isRecordHeader32Bit(true)
 { // constructor
 } // constructor
@@ -83,7 +84,9 @@
       filein.read(&groups);
     } else {
       PsetFileBinary filein(_filenamePset.c_str(), 
-			    _flipEndian, _isRecordHeader32Bit);
+			    _flipEndian,
+			    _ioInt32,
+			    _isRecordHeader32Bit);
       filein.read(&groups);
     } // if/else
     GroupPtType type = VERTEX;

Modified: short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.hh	2008-03-18 15:11:05 UTC (rev 11468)
+++ short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.hh	2008-03-18 17:16:01 UTC (rev 11469)
@@ -86,6 +86,18 @@
    */
   bool flipEndian(void) const;
 
+  /** Set flag indicating LaGriT Pset files use 32-bit integers.
+   *
+   * @param flag True if using 32-bit integers, false if using 64-bit integers.
+   */
+  void ioInt32(const bool flag);
+
+  /** Get flag indicating LaGriT Pset files use 32-bit integers.
+   *
+   * @returns True if using 32-bit integers, false if using 64-bit integers.
+   */
+  bool ioInt32(void) const;
+
   /** Set Fortran record header size flag.
    *
    * @param flag True if Fortran record header size is 32-bit, false if 64-bit.
@@ -146,6 +158,7 @@
   std::string _filenamePset; ///< Name of PSET file.
   bool _writeAscii; ///< True if writing ASCII, false if writing binary.
   bool _flipEndian; ///< True if need to change endian when reading/writing.
+  bool _ioInt32; ///< True if using 64-bit integers in Pset files.
   bool _isRecordHeader32Bit; ///< True if Fortran record header is 32-bit.
 
 }; // MeshIOLagrit

Modified: short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.icc	2008-03-18 15:11:05 UTC (rev 11468)
+++ short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.icc	2008-03-18 17:16:01 UTC (rev 11469)
@@ -70,6 +70,20 @@
   return _flipEndian;
 }
 
+// Set flag indicating LaGriT Pset files use 32-bit integers.
+inline
+void
+pylith::meshio::MeshIOLagrit::ioInt32(const bool flag) {
+  _ioInt32 = flag;
+}
+
+// Get flag indicating LaGriT Pset files use 32-bit integers.
+inline
+bool
+pylith::meshio::MeshIOLagrit::ioInt32(void) const {
+  return _ioInt32;
+}
+
 // Set Fortran record header size flag.
 inline
 void

Modified: short/3D/PyLith/trunk/libsrc/meshio/PsetFileBinary.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/PsetFileBinary.cc	2008-03-18 15:11:05 UTC (rev 11468)
+++ short/3D/PyLith/trunk/libsrc/meshio/PsetFileBinary.cc	2008-03-18 17:16:01 UTC (rev 11469)
@@ -10,6 +10,8 @@
 // ======================================================================
 //
 
+#include <portinfo>
+
 #include "PsetFileBinary.hh" // implementation of class methods
 
 #include "BinaryIO.hh" // USES readString()
@@ -24,6 +26,8 @@
 #include <sstream> // USES std::ostringstream
 #include <stdexcept> // USES std::exception
 
+#include <iostream>
+
 // ----------------------------------------------------------------------
 const char* pylith::meshio::PsetFileBinary::_HEADER = "pset unformatted";
 
@@ -31,10 +35,12 @@
 // Constructor with name of Pset file.
 pylith::meshio::PsetFileBinary::PsetFileBinary(const char* filename,
 					       const bool flipEndian,
+					       const bool ioInt32,
 					       const bool isRecordHeader32Bit) :
   PsetFile(filename),
+  _recordHeaderSize(isRecordHeader32Bit ? 4 : 8),
   _flipEndian(flipEndian),
-  _recordHeaderSize(isRecordHeader32Bit ? 4 : 8)
+  _ioInt32(ioInt32)
 { // constructor
 } // constructor
 
@@ -67,20 +73,37 @@
 
   _readHeader(fin);
 
-  // Read number of psets
-  int numGroups = 0;
-  fin.read((char*) &numGroups, sizeof(int));
-  if (_flipEndian)
-    BinaryIO::swapByteOrder((char*) &numGroups, 1, sizeof(int));
-  assert(numGroups >= 0);
-  groups->resize(numGroups);
-  std::string extra = BinaryIO::readString(fin, 2*_recordHeaderSize);
+  if (_ioInt32) {
+    // Read number of psets
+    int numGroups = 0;
+    fin.read((char*) &numGroups, sizeof(int));
+    if (_flipEndian)
+      BinaryIO::swapByteOrder((char*) &numGroups, 1, sizeof(int));
+    assert(numGroups >= 0);
+    groups->resize(numGroups);
+    std::string extra = BinaryIO::readString(fin, 2*_recordHeaderSize);
 
-  // Read groups
-  info << journal::at(__HERE__)
-       << "Reading " << numGroups << " point sets from file." << journal::endl;
-  for (int iGroup=0; iGroup < numGroups; ++iGroup)
-    _readPset(fin, &(*groups)[iGroup]);
+    // Read groups
+    info << journal::at(__HERE__)
+	 << "Reading " << numGroups << " point sets from file." << journal::endl;
+    for (int iGroup=0; iGroup < numGroups; ++iGroup)
+      _readPset32(fin, &(*groups)[iGroup]);
+  } else {
+    // Read number of psets
+    long numGroups = 0;
+    fin.read((char*) &numGroups, sizeof(numGroups));
+    if (_flipEndian)
+      BinaryIO::swapByteOrder((char*) &numGroups, 1, sizeof(numGroups));
+    assert(numGroups >= 0);
+    groups->resize(numGroups);
+    std::string extra = BinaryIO::readString(fin, 2*_recordHeaderSize);
+
+    // Read groups
+    info << journal::at(__HERE__)
+	 << "Reading " << numGroups << " point sets from file." << journal::endl;
+    for (int iGroup=0; iGroup < numGroups; ++iGroup)
+      _readPset64(fin, &(*groups)[iGroup]);
+  } // if/else
 } // read
 
 // ----------------------------------------------------------------------
@@ -104,17 +127,31 @@
 
   _writeHeader(fout);
 
-  // Write number of groups
-  int numGroups = groups.size();
-  if (_flipEndian)
-    BinaryIO::swapByteOrder((char*) &numGroups, 1, sizeof(numGroups));
-  fout.write((char*) &numGroups, sizeof(numGroups));
-
-  // Write groups
-  info << journal::at(__HERE__)
-       << "Writing " << numGroups << " point sets to file." << journal::endl;
-  for (int iGroup=0; iGroup < numGroups; ++iGroup)
-    _writePset(fout, groups[iGroup]);
+  if (_ioInt32) {
+    // Write number of groups
+    int numGroups = groups.size();
+    if (_flipEndian)
+      BinaryIO::swapByteOrder((char*) &numGroups, 1, sizeof(numGroups));
+    fout.write((char*) &numGroups, sizeof(numGroups));
+    
+    // Write groups
+    info << journal::at(__HERE__)
+	 << "Writing " << numGroups << " point sets to file." << journal::endl;
+    for (int iGroup=0; iGroup < numGroups; ++iGroup)
+      _writePset32(fout, groups[iGroup]);
+  } else {
+    // Write number of groups
+    long numGroups = groups.size();
+    if (_flipEndian)
+      BinaryIO::swapByteOrder((char*) &numGroups, 1, sizeof(numGroups));
+    fout.write((char*) &numGroups, sizeof(numGroups));
+    
+    // Write groups
+    info << journal::at(__HERE__)
+	 << "Writing " << numGroups << " point sets to file." << journal::endl;
+    for (int iGroup=0; iGroup < numGroups; ++iGroup)
+      _writePset64(fout, groups[iGroup]);
+  } // if/else
 } // write
 
 // ----------------------------------------------------------------------
@@ -144,9 +181,9 @@
 
 // ----------------------------------------------------------------------
 void
-pylith::meshio::PsetFileBinary::_readPset(std::ifstream& fin,
-					 Pset* group)
-{ // _readPset
+pylith::meshio::PsetFileBinary::_readPset32(std::ifstream& fin,
+					    Pset* group)
+{ // _readPset32
   assert(0 != group);
 
   journal::info_t info("psetfile");
@@ -178,13 +215,13 @@
 
   info << journal::at(__HERE__)
        << "Done." << journal::endl;
-} // _readPset
+} // _readPset32
 
 // ----------------------------------------------------------------------
 void
-pylith::meshio::PsetFileBinary::_writePset(std::ofstream& fout,
+pylith::meshio::PsetFileBinary::_writePset32(std::ofstream& fout,
 					   const Pset& group)
-{ // _writePset
+{ // _writePset32
   journal::info_t info("psetfile");
   const int size = group.points.size();
   info << journal::at(__HERE__)
@@ -211,7 +248,82 @@
 
   info << journal::at(__HERE__)
        << "Done." << journal::endl;
-} // _writePset
+} // _writePset32
 
+// ----------------------------------------------------------------------
+void
+pylith::meshio::PsetFileBinary::_readPset64(std::ifstream& fin,
+					    Pset* group)
+{ // _readPset64
+  assert(0 != group);
 
+  journal::info_t info("psetfile");
+
+  group->name = BinaryIO::readString(fin, 32);
+
+  long id = 0;
+  fin.read((char*) &id, sizeof(id));
+  if (_flipEndian)
+    BinaryIO::swapByteOrder((char*) &id, 1, sizeof(id));
+
+  long size = 0;
+  fin.read((char*) &size, sizeof(size));
+  if (_flipEndian)
+    BinaryIO::swapByteOrder((char*) &size, 1, sizeof(size));
+  assert(size >= 0);
+  std::string extra = BinaryIO::readString(fin, 2*_recordHeaderSize);
+  info << journal::at(__HERE__)
+       << "Reading point set '" << group->name << "' with " << size
+       << " points." << journal::endl;
+
+  group->points.resize(size);
+  std::valarray<long> pointsIO(size);
+  fin.read((char*) &pointsIO[0], size*sizeof(long));
+  extra = BinaryIO::readString(fin, 2*_recordHeaderSize);
+  if (_flipEndian)
+    BinaryIO::swapByteOrder((char*) &pointsIO[0], size, sizeof(long));
+
+  for (int i=0; i < size; ++i)
+    group->points[i] = pointsIO[i];
+
+  group->points -= 1; // use zero base
+
+  info << journal::at(__HERE__)
+       << "Done." << journal::endl;
+} // _readPset64
+
+// ----------------------------------------------------------------------
+void
+pylith::meshio::PsetFileBinary::_writePset64(std::ofstream& fout,
+					     const Pset& group)
+{ // _writePset64
+  journal::info_t info("psetfile");
+  const int size = group.points.size();
+  info << journal::at(__HERE__)
+       << "Writing point set '" << group.name << "' with " << size
+       << " points." << journal::endl;
+
+  fout.write((char*) group.name.c_str(), 32);
+
+  long id = group.id;
+  if (_flipEndian)
+    BinaryIO::swapByteOrder((char*) &id, 1, sizeof(id));
+  fout.write((char*) &id, sizeof(int));
+
+  long sizeIO = size;
+  if (_flipEndian)
+    BinaryIO::swapByteOrder((char*) &sizeIO, 1, sizeof(sizeIO));
+  fout.write((char*) &sizeIO, sizeof(int));
+
+  std::valarray<long> pointsIO(size);
+  pointsIO += 1; // switch from zero base to one base
+  if (_flipEndian)
+    BinaryIO::swapByteOrder((char*) &pointsIO[0], size, sizeof(long));
+  fout.write((char*) &pointsIO[0], size*sizeof(long));
+
+  info << journal::at(__HERE__)
+       << "Done." << journal::endl;
+} // _writePset64
+
+
 // End of file 

Modified: short/3D/PyLith/trunk/libsrc/meshio/PsetFileBinary.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/PsetFileBinary.hh	2008-03-18 15:11:05 UTC (rev 11468)
+++ short/3D/PyLith/trunk/libsrc/meshio/PsetFileBinary.hh	2008-03-18 17:16:01 UTC (rev 11469)
@@ -34,10 +34,12 @@
    *
    * @param filename Name of Pset file
    * @param flipEndian Flip endian type when reading/writing.
+   * @param ioInt32 True if Pset file uses 64-bit integers.
    * @param isRecordHeader32Bit True if Fortran record header size is 32-bit.
    */
   PsetFileBinary(const char* name,
 		 const bool flipEndian,
+		 const bool ioInt32,
 		 const bool isRecordHeader32Bit);
 
   /// Default destructor 
@@ -81,17 +83,33 @@
    * @param fin Input file stream.
    * @param group Point set
    */
-  void _readPset(std::ifstream& fin,
-		 Pset* group);
+  void _readPset32(std::ifstream& fin,
+		   Pset* group);
 
   /** Write point set.
    *
    * @param fout Output file stream.
    * @param group Point set
    */
-  void _writePset(std::ofstream& fout,
-		  const Pset& group);
+  void _writePset32(std::ofstream& fout,
+		    const Pset& group);
 
+  /** Read point set.
+   *
+   * @param fin Input file stream.
+   * @param group Point set
+   */
+  void _readPset64(std::ifstream& fin,
+		   Pset* group);
+
+  /** Write point set.
+   *
+   * @param fout Output file stream.
+   * @param group Point set
+   */
+  void _writePset64(std::ofstream& fout,
+		    const Pset& group);
+
 // PRIVATE MEMBERS //////////////////////////////////////////////////////
 private :
   
@@ -101,6 +119,7 @@
   int _recordHeaderSize; ///< Size of Fortran record header in bytes.
 
   bool _flipEndian; ///< True if need to change endian when reading/writing.
+  bool _ioInt32; ///< True if I/O uses pset file uses 32-bit integers.
 
 }; // PsetFileInBinary
 

Modified: short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src	2008-03-18 15:11:05 UTC (rev 11468)
+++ short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src	2008-03-18 17:16:01 UTC (rev 11469)
@@ -553,6 +553,50 @@
       return MeshIOLagrit_flipEndian_get(self.thisptr)
 
 
+  property ioInt32:
+    def __set__(self, flag):
+      """Set flip endian flag."""
+      # create shim for method 'ioInt32'
+      #embed{ void MeshIOLagrit_ioInt32_set(void* objVptr, int flag)
+      try {
+        assert(0 != objVptr);
+        ((pylith::meshio::MeshIOLagrit*) objVptr)->ioInt32(flag);
+      } catch (const std::exception& err) {
+        PyErr_SetString(PyExc_RuntimeError,
+                        const_cast<char*>(err.what()));
+      } catch (const ALE::Exception& err) {
+        PyErr_SetString(PyExc_RuntimeError,
+                        const_cast<char*>(err.msg().c_str()));
+      } catch (...) {
+        PyErr_SetString(PyExc_RuntimeError,
+                        "Caught unknown C++ exception.");
+      } // try/catch
+      #}embed
+      MeshIOLagrit_ioInt32_set(self.thisptr, flag)
+
+    def __get__(self):
+      """Get flip endian flag."""
+      # create shim for method 'ioInt32'
+      #embed{ int MeshIOLagrit_ioInt32_get(void* objVptr)
+      int result = 0;
+      try {
+        assert(0 != objVptr);
+        result = ((pylith::meshio::MeshIOLagrit*) objVptr)->ioInt32();
+      } catch (const std::exception& err) {
+        PyErr_SetString(PyExc_RuntimeError,
+                        const_cast<char*>(err.what()));
+      } catch (const ALE::Exception& err) {
+        PyErr_SetString(PyExc_RuntimeError,
+                        const_cast<char*>(err.msg().c_str()));
+      } catch (...) {
+        PyErr_SetString(PyExc_RuntimeError,
+                        "Caught unknown C++ exception.");
+      } // try/catch
+      return result;
+      #}embed
+      return MeshIOLagrit_ioInt32_get(self.thisptr)
+
+
   property isRecordHeader32Bit:
     def __set__(self, flag):
       """Set Fortran record header size flag."""

Modified: short/3D/PyLith/trunk/pylith/meshio/MeshIOLagrit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/MeshIOLagrit.py	2008-03-18 15:11:05 UTC (rev 11468)
+++ short/3D/PyLith/trunk/pylith/meshio/MeshIOLagrit.py	2008-03-18 17:16:01 UTC (rev 11469)
@@ -41,6 +41,7 @@
     ## @li \b filename_gmv Name of mesh GMV file.
     ## @li \b filename_pset Name of mesh PSET file.
     ## @li \b flip_endian Flip endian type when reading/writing binary files.
+    ## @li \b io_int32 PSET files use 64-bit integers.
     ## @li \b record_header_32bit Fortran record header is 32-bit.
     ##
     ## \b Facilities
@@ -58,7 +59,11 @@
     flipEndian.meta['tip'] = "Flip endian type when reading/writing binary " \
                              "files."
 
-    isRecordHeader32Bit = pyre.inventory.bool("record_header_32bit", default=True)
+    ioInt32 = pyre.inventory.bool("io_int32", default=True)
+    ioInt32.meta['tip'] = "PSTE files use 32-bit integers."
+
+    isRecordHeader32Bit = pyre.inventory.bool("record_header_32bit",
+                                              default=True)
     isRecordHeader32Bit.meta['tip'] = "Fortran record header is 32-bit."
 
     from spatialdata.geocoords.CSCart import CSCart
@@ -88,6 +93,7 @@
     self.filenamePset = self.inventory.filenamePset
     self.coordsys = self.inventory.coordsys
     self.flipEndian = self.inventory.flipEndian
+    self.ioInt32 = self.inventory.ioInt32
     self.isRecordHeader32Bit = self.inventory.isRecordHeader32Bit
     return
 
@@ -104,6 +110,7 @@
     self.cppHandle.filenameGmv = self.filenameGmv
     self.cppHandle.filenamePset = self.filenamePset
     self.cppHandle.flipEndian = self.flipEndian
+    self.cppHandle.ioInt32 = self.ioInt32
     self.cppHandle.isRecordHeader32Bit = self.isRecordHeader32Bit
     return
   

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIOLagrit.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIOLagrit.cc	2008-03-18 15:11:05 UTC (rev 11468)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIOLagrit.cc	2008-03-18 17:16:01 UTC (rev 11469)
@@ -95,15 +95,45 @@
 } // testReadTetBinary
 
 // ----------------------------------------------------------------------
+// Test read() for mesh with binary files.
+void
+pylith::meshio::TestMeshIOLagrit::testReadTetBinary32on64(void)
+{ // testReadTetBinary32on64
+  MeshDataLagritTet data;
+  const char* filenameGmv = "data/cube2_binary_32on64.gmv";
+  const char* filenamePset = "data/cube2_binary_32on64.pset";
+  const bool ioInt32 = true;
+  const bool isRecordHeader32Bit = false;
+  _testRead(data, filenameGmv, filenamePset, ioInt32, isRecordHeader32Bit);
+} // testReadTetBinary32on64
+
+// ----------------------------------------------------------------------
+// Test read() for mesh with binary files using 64-bit LaGriT.
+void
+pylith::meshio::TestMeshIOLagrit::testReadTetBinary64(void)
+{ // testReadTetBinary64
+  MeshDataLagritTet data;
+  const char* filenameGmv = "data/cube2_binary_64.gmv";
+  const char* filenamePset = "data/cube2_binary_64.pset";
+  const bool ioInt32 = false;
+  const bool isRecordHeader32Bit = false;
+  _testRead(data, filenameGmv, filenamePset, ioInt32, isRecordHeader32Bit);
+} // testReadTetBinary64
+
+// ----------------------------------------------------------------------
 // Build mesh, perform read(), and then check values.
 void
 pylith::meshio::TestMeshIOLagrit::_testRead(const MeshData& data,
 					    const char* filenameGmv,
-					    const char* filenamePset)
+					    const char* filenamePset,
+					    const bool ioInt32,
+					    const bool isRecordHeader32Bit)
 { // _testRead
   MeshIOLagrit iohandler;
   iohandler.filenameGmv(filenameGmv);
   iohandler.filenamePset(filenamePset);
+  iohandler.ioInt32(ioInt32);
+  iohandler.isRecordHeader32Bit(isRecordHeader32Bit);
   
   // LaGriT file was created on little endian machine, so flip endian if
   // running test on big endian machine.

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIOLagrit.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIOLagrit.hh	2008-03-18 15:11:05 UTC (rev 11468)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIOLagrit.hh	2008-03-18 17:16:01 UTC (rev 11469)
@@ -43,6 +43,8 @@
   CPPUNIT_TEST( testFilename );
   CPPUNIT_TEST( testReadTetAscii );
   CPPUNIT_TEST( testReadTetBinary );
+  CPPUNIT_TEST( testReadTetBinary32on64 );
+  CPPUNIT_TEST( testReadTetBinary64 );
   CPPUNIT_TEST( testOrientAsciiTet );
   CPPUNIT_TEST( testOrientBinaryTet );
   CPPUNIT_TEST_SUITE_END();
@@ -68,6 +70,13 @@
   /// Test read() for mesh with binary files.
   void testReadTetBinary(void);
 
+  /// Test read() for mesh with binary files for 32-bit LaGrit built 
+  /// on 64-bit platform.
+  void testReadTetBinary32on64(void);
+
+  /// Test read() for mesh with binary files for 64-bit LaGriT.
+  void testReadTetBinary64(void);
+
   /// Test _orientCellsAscii with tet cells.
   void testOrientAsciiTet(void);
 
@@ -82,10 +91,14 @@
    * @param data Mesh data
    * @param filenameGmv Name of mesh GMV file to read
    * @param filenamePset Name of mesh Pset file to read
+   * @param ioInt32 True if Pset uses 32-bit integers.
+   * @param isRecordHeader32Bit True if Fortran record headers are 32-bit.
    */
   void _testRead(const MeshData& data,
 		 const char* filenameGmv,
-		 const char* filenamePset);
+		 const char* filenamePset,
+		 const bool ioInt32 =true,
+		 const bool isRecordHeader32Bit =true);
 
 }; // class TestMeshIOLagrit
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/Makefile.am	2008-03-18 15:11:05 UTC (rev 11468)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/Makefile.am	2008-03-18 17:16:01 UTC (rev 11469)
@@ -15,6 +15,10 @@
 	cube2_ascii.pset \
 	cube2_binary.gmv \
 	cube2_binary.pset \
+	cube2_binary_32on64.gmv \
+	cube2_binary_32on64.pset \
+	cube2_binary_64.gmv \
+	cube2_binary_64.pset \
 	mesh3DIndexOne.txt \
 	twotri3.exo \
 	twoquad4.exo \

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary_32on64.gmv
===================================================================
(Binary files differ)


Property changes on: short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary_32on64.gmv
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary_32on64.pset
===================================================================
(Binary files differ)


Property changes on: short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary_32on64.pset
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary_64.gmv
===================================================================
(Binary files differ)


Property changes on: short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary_64.gmv
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary_64.pset
===================================================================
(Binary files differ)


Property changes on: short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary_64.pset
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream



More information about the cig-commits mailing list