[cig-commits] r6066 - in short/3D/PyLith/trunk: examples/twotri3 libsrc/meshio unittests/libtests/meshio unittests/libtests/meshio/data

brad at geodynamics.org brad at geodynamics.org
Thu Feb 22 21:53:16 PST 2007


Author: brad
Date: 2007-02-22 21:53:14 -0800 (Thu, 22 Feb 2007)
New Revision: 6066

Modified:
   short/3D/PyLith/trunk/examples/twotri3/twotri3.mesh
   short/3D/PyLith/trunk/libsrc/meshio/MeshIO.cc
   short/3D/PyLith/trunk/libsrc/meshio/MeshIO.hh
   short/3D/PyLith/trunk/libsrc/meshio/MeshIOAscii.cc
   short/3D/PyLith/trunk/libsrc/meshio/MeshIOAscii.hh
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIO.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData.hh
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1D.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1D.hh
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din2D.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din2D.hh
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din3D.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din3D.hh
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2D.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2D.hh
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2Din3D.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2Din3D.hh
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData3D.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData3D.hh
Log:
Added setting material identifiers in PETSc Mesh. This includes reading/writing material identifiers from simple ASCII mesh files.

Modified: short/3D/PyLith/trunk/examples/twotri3/twotri3.mesh
===================================================================
--- short/3D/PyLith/trunk/examples/twotri3/twotri3.mesh	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/examples/twotri3/twotri3.mesh	2007-02-23 05:53:14 UTC (rev 6066)
@@ -17,5 +17,8 @@
       0  2  1
       1  2  3
     }
+    material-ids = {
+      1  1
+    }
   }
 }

Modified: short/3D/PyLith/trunk/libsrc/meshio/MeshIO.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/MeshIO.cc	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/libsrc/meshio/MeshIO.cc	2007-02-23 05:53:14 UTC (rev 6066)
@@ -35,6 +35,15 @@
 } // destructor
   
 // ----------------------------------------------------------------------
+// Get spatial dimension of mesh.
+int
+pylith::meshio::MeshIO::getMeshDim(void) const
+{ // getMeshDim
+  assert(0 != _mesh);
+  return (*_mesh)->getDimension();
+} // getMeshDim
+
+// ----------------------------------------------------------------------
 // Read mesh from file.
 void 
 pylith::meshio::MeshIO::read(ALE::Obj<Mesh>* mesh)
@@ -228,7 +237,7 @@
 // Get material identifiers for cells.
 void
 pylith::meshio::MeshIO::_getMaterials(int** pMaterialIds,
-				      int* pNumCells)
+				      int* pNumCells) const
 { // _getMaterials
   assert(0 != _mesh);
   ALE::Obj<Mesh>& mesh = *_mesh;

Modified: short/3D/PyLith/trunk/libsrc/meshio/MeshIO.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/MeshIO.hh	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/libsrc/meshio/MeshIO.hh	2007-02-23 05:53:14 UTC (rev 6066)
@@ -88,6 +88,12 @@
    */
   void useIndexZero(const bool flag);
 
+  /** Get spatial dimension of mesh.
+   *
+   * @returns Spatial dimension of mesh
+   */
+  int getMeshDim(void) const;
+
   /** Build mesh topology and set vertex coordinates.
    *
    * @param coordinates Array of coordinates of vertices
@@ -146,7 +152,7 @@
    * @param numCells Number of cells
    */
   void _getMaterials(int** pMaterialIds,
-		     int* pNumCells);
+		     int* pNumCells) const;
 
 // PRIVATE MEMBERS //////////////////////////////////////////////////////
 private :

Modified: short/3D/PyLith/trunk/libsrc/meshio/MeshIOAscii.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/MeshIOAscii.cc	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/libsrc/meshio/MeshIOAscii.cc	2007-02-23 05:53:14 UTC (rev 6066)
@@ -45,7 +45,8 @@
   int numCorners = 0;
   double* coordinates = 0;
   int* cells = 0;
-
+  int* materialIds = 0;
+  
   std::ifstream filein(_filename.c_str());
   if (!filein.is_open() || !filein.good()) {
     std::ostringstream msg;
@@ -89,7 +90,7 @@
       readVertices = true;
     } else if (0 == strcasecmp(token.c_str(), "cells")) {
       filein.ignore(maxIgnore, '{');
-      _readCells(filein, &cells, &numCells, &numCorners);
+      _readCells(filein, &cells, &materialIds, &numCells, &numCorners);
       readCells = true;
     } else if (0 == strcasecmp(token.c_str(), "group")) {
       if (!builtMesh)
@@ -107,8 +108,10 @@
       // Can now build mesh
       _buildMesh(coordinates, numVertices, spaceDim,
 		 cells, numCells, numCorners, meshDim);
+      _setMaterials(materialIds, numCells);
       delete[] coordinates; coordinates = 0;
       delete[] cells; cells = 0;
+      delete[] materialIds; materialIds = 0;
       builtMesh = true;
     } // if
 
@@ -130,33 +133,19 @@
     throw std::runtime_error(msg.str());
   } // if
 
-  int meshDim = 0;
-  int spaceDim = 0;
-  int numVertices = 0;
-  int numCells = 0;
-  int numCorners = 0;
-  double* coordinates = 0;
-  int* cells = 0;
-
-  _getVertices(&coordinates, &numVertices, &spaceDim);
-  _getCells(&cells, &numCells, &numCorners, &meshDim);
-  
   fileout
     << "mesh = {\n"
-    << "  dimension = " << meshDim << "\n"
+    << "  dimension = " << getMeshDim() << "\n"
     << "  use-index-zero = " << (useIndexZero() ? "true" : "false") << "\n";
 
-  _writeVertices(fileout, coordinates, numVertices, spaceDim);
-  _writeCells(fileout, cells, numCells, numCorners);
+  _writeVertices(fileout);
+  _writeCells(fileout);
 
   // LOOP OVER GROUPS
   // _writeGroup(fileout, mesh, nameIter->c_str());
 
   fileout << "}\n";
   fileout.close();
-
-  delete[] coordinates; coordinates = 0;
-  delete[] cells; cells = 0;
 } // write
 
 // ----------------------------------------------------------------------
@@ -184,9 +173,9 @@
     } else if (0 == strcasecmp(token.c_str(), "coordinates")) {
       const int size = numVertices*numDims;
       if (0 == size) {
-	std::ostringstream msg;
-	msg << "Tokens 'dimension' and 'count' must precede 'coordinates'.";
-	throw std::runtime_error(msg.str());
+	const char* msg = 
+	  "Tokens 'dimension' and 'count' must precede 'coordinates'.";
+	throw std::runtime_error(msg);
       } // if
       
       filein.ignore(maxIgnore, '{');
@@ -216,11 +205,13 @@
 // ----------------------------------------------------------------------
 // Write mesh vertices.
 void
-pylith::meshio::MeshIOAscii::_writeVertices(std::ostream& fileout,
-					    const double* coordinates,
-					    const int numVertices,
-					    const int spaceDim) const
+pylith::meshio::MeshIOAscii::_writeVertices(std::ostream& fileout) const
 { // _writeVertices
+  int spaceDim = 0;
+  int numVertices = 0;
+  double* coordinates = 0;
+  _getVertices(&coordinates, &numVertices, &spaceDim);
+
   fileout
     << "  vertices = {\n"
     << "    dimension = " << spaceDim << "\n"
@@ -238,17 +229,21 @@
   fileout
     << "    }\n"
     << "  }\n";
+
+  delete[] coordinates; coordinates = 0;
 } // _writeVertices
   
 // ----------------------------------------------------------------------
 // Read mesh cells.
 void
 pylith::meshio::MeshIOAscii::_readCells(std::istream& filein,
-					   int** pCells,
-					   int* pNumCells, 
-					   int* pNumCorners) const
+					int** pCells,
+					int** pMaterialIds,
+					int* pNumCells, 
+					int* pNumCorners) const
 { // _readCells
   int* cells = 0;
+  int* materialIds = 0;
   int numCells = 0;
   int numCorners = 0;
   int dimension = 0;
@@ -266,9 +261,9 @@
     } else if (0 == strcasecmp(token.c_str(), "simplices")) {
       const int size = numCells*numCorners;
       if (0 == size) {
-	std::ostringstream msg;
-	msg << "Tokens 'num-corners' and 'count' must precede 'cells'.";
-	throw std::runtime_error(msg.str());
+	const char* msg = 
+	  "Tokens 'num-corners' and 'count' must precede 'cells'.";
+	throw std::runtime_error(msg);
       } // if
       
       filein.ignore(maxIgnore, '{');
@@ -284,6 +279,19 @@
       } // if
       
       filein.ignore(maxIgnore, '}');
+    } else if (0 == strcasecmp(token.c_str(), "material-ids")) {
+      if (0 == numCells) {
+	const char* msg =
+	  "Token 'count' must precede 'material-ids'.";
+	throw std::runtime_error(msg);
+      } // if
+      const int size = numCells;
+      filein.ignore(maxIgnore, '{');
+      delete[] materialIds; materialIds = new int[size];
+      assert(0 != materialIds);
+      for (int i=0; i < size; ++i)
+	filein >> materialIds[i];      
+      filein.ignore(maxIgnore, '}');
     } else {
       std::ostringstream msg;
       msg << "Could not parse '" << token << "' into an cells setting.";
@@ -294,22 +302,35 @@
   if (!filein.good())
     throw std::runtime_error("I/O error while parsing cells settings.");
 
+  // If no materials given, assign each cell material identifier of 0
+  if (0 == materialIds && numCells > 0) {
+    const int size = numCells;
+    materialIds = new int[size];
+    for (int i=0; i < size; ++i)
+      materialIds[i] = 0;
+  } // if
+
   if (0 != pCells)
     *pCells = cells;
   if (0 != pNumCells)
     *pNumCells = numCells;
   if (0 != pNumCorners)
     *pNumCorners = numCorners;
+  if (0 != pMaterialIds)
+    *pMaterialIds = materialIds;
 } // _readCells
 
 // ----------------------------------------------------------------------
 // Write mesh cells.
 void
-pylith::meshio::MeshIOAscii::_writeCells(std::ostream& fileout,
-					 const int* cells,
-					 const int numCells,
-					 const int numCorners) const
+pylith::meshio::MeshIOAscii::_writeCells(std::ostream& fileout) const
 { // _writeCells
+  int meshDim = 0;
+  int numCells = 0;
+  int numCorners = 0;
+  int* cells = 0;
+  _getCells(&cells, &numCells, &numCorners, &meshDim);
+  
   fileout
     << "  cells = {\n"
     << "    count = " << numCells << "\n"
@@ -324,7 +345,23 @@
     fileout << "\n";
   } // for
   fileout
-    << "    }\n"
+    << "    }\n";
+  delete[] cells; cells = 0;
+
+  // Write material identifiers
+  int* materialIds = 0;
+  _getMaterials(&materialIds, &numCells);
+  assert( (0 != materialIds && 0 < numCells) ||
+	  (0 == materialIds && 0 == numCells) );
+  fileout
+    << "    material-ids = {\n";
+  for(int iCell=0, i=0; iCell < numCells; ++iCell)
+    fileout << "      " << materialIds[iCell] << "\n";
+  fileout
+    << "    }\n";  
+  delete[] materialIds; materialIds = 0;
+
+  fileout
     << "  }\n";
 } // _writeCells
 

Modified: short/3D/PyLith/trunk/libsrc/meshio/MeshIOAscii.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/MeshIOAscii.hh	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/libsrc/meshio/MeshIOAscii.hh	2007-02-23 05:53:14 UTC (rev 6066)
@@ -74,24 +74,20 @@
   /** Write mesh vertices.
    *
    * @param fileout Output stream
-   * @param coordinates Array of vertex coordinates
-   * @param numVertices Number of vertices
-   * @param spaceDim Dimension of coordinates vector space
    */
-  void _writeVertices(std::ostream& fileout,
-		      const double* coordinates,
-		      const int numVertices,
-		      const int spaceDim) const;
+  void _writeVertices(std::ostream& fileout) const;
   
   /** Read mesh cells.
    *
    * @param filein Input stream
    * @param pCells Pointer to array of indices of cell vertices
+   * @param pMaterialIds Pointer to array of material identifiers
    * @param pNumCells Pointer to number of cells
    * @param pNumCorners Pointer to number of corners
    */
   void _readCells(std::istream& filein,
 		  int** pCells,
+		  int** pMaterialIds,
 		  int* pNumCells,
 		  int* pNumCorners) const;
   
@@ -102,10 +98,7 @@
    * @param numCells Number of cells
    * @param numCorners Number of corners
    */
-  void _writeCells(std::ostream& fileout,
-		   const int* cells,
-		   const int numCells,
-		   const int numCorners) const;
+  void _writeCells(std::ostream& fileout) const;
 
   // PRIVATE MEMBERS ----------------------------------------------------
 private :

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIO.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIO.cc	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIO.cc	2007-02-23 05:53:14 UTC (rev 6066)
@@ -25,6 +25,7 @@
 { // createMesh
   typedef ALE::Mesh::topology_type topology_type;
   typedef topology_type::sieve_type sieve_type;
+  typedef ALE::Sifter<int, sieve_type::point_type, int> patch_label_type;
 
   // buildTopology() requires zero based index
   assert(true == data.useIndexZero);
@@ -36,8 +37,10 @@
   const int numCells = data.numCells;
   const double* vertCoords = data.vertices;
   const int* cells = data.cells;
+  const int* materialIds = data.materialIds;
   CPPUNIT_ASSERT(0 != vertCoords);
   CPPUNIT_ASSERT(0 != cells);
+  CPPUNIT_ASSERT(0 != materialIds);
 
   ALE::Obj<ALE::Mesh>* meshHandle = new ALE::Obj<ALE::Mesh>;
   *meshHandle = new ALE::Mesh(PETSC_COMM_WORLD, cellDim);
@@ -55,6 +58,20 @@
   ALE::New::SieveBuilder<sieve_type>::buildCoordinates(
 		    mesh->getRealSection("coordinates"), spaceDim, vertCoords);
 
+  const Mesh::real_section_type::patch_type patch = 0;
+  const ALE::Obj<Mesh::topology_type::label_sequence>& cellsMesh = 
+    topology->heightStratum(patch, 0);
+
+  const ALE::Obj<patch_label_type>& labelMaterials = 
+    topology->createLabel(patch, "material-id");
+  
+  int i = 0;
+  for(Mesh::topology_type::label_sequence::iterator e_iter = 
+	cellsMesh->begin();
+      e_iter != cellsMesh->end();
+      ++e_iter)
+    topology->setValue(labelMaterials, *e_iter, materialIds[i++]);
+
   return meshHandle;
 } // createMesh
 
@@ -64,6 +81,8 @@
 pylith::meshio::TestMeshIO::checkVals(const ALE::Obj<ALE::Mesh>& mesh,
 				      const MeshData& data)
 { // checkVals
+  typedef ALE::Sifter<int, sieve_type::point_type, int> patch_label_type;
+
   const Mesh::real_section_type::patch_type patch = 0;
   const ALE::Obj<topology_type>& topology = mesh->getTopology();
 
@@ -122,6 +141,22 @@
 			   vNumbering->getIndex(*c_iter) + offset);
   } // for
 
+  // check materials
+  const int size = numCells;
+  int* materialIds = (size > 0) ? new int[size] : 0;
+  const ALE::Obj<patch_label_type>& labelMaterials = 
+    topology->getLabel(patch, "material-id");
+  const int idDefault = -999;
+
+  i = 0;
+  for(Mesh::topology_type::label_sequence::iterator e_iter = cells->begin();
+      e_iter != cells->end();
+      ++e_iter)
+    materialIds[i++] = topology->getValue(labelMaterials, *e_iter, idDefault);
+  
+  for (int iCell=0; iCell < numCells; ++iCell)
+    CPPUNIT_ASSERT_EQUAL(data.materialIds[iCell], materialIds[iCell]);
+
   // :TODO: Check groups of vertices
 } // checkVals
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData.cc	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData.cc	2007-02-23 05:53:14 UTC (rev 6066)
@@ -22,6 +22,7 @@
   numCorners(0),
   vertices(0),
   cells(0),
+  materialIds(0),
   useIndexZero(true)
 { // constructor
 } // constructor

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData.hh	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData.hh	2007-02-23 05:53:14 UTC (rev 6066)
@@ -42,6 +42,7 @@
 
   double* vertices; ///< Pointer to coordinates of vertices
   int* cells; ///< Pointer to indices of vertices in cells
+  int* materialIds; ///< Pointer to cell material identifiers
 
   bool useIndexZero; ///< Indices start with 0 if true, 1 if false
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1D.cc	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1D.cc	2007-02-23 05:53:14 UTC (rev 6066)
@@ -33,6 +33,10 @@
        2,  1,
 };
 
+const int pylith::meshio::MeshData1D::_materialIds[] = {
+  2,  1
+};
+
 const bool pylith::meshio::MeshData1D::_useIndexZero = true;
 
 pylith::meshio::MeshData1D::MeshData1D(void)
@@ -44,6 +48,7 @@
   numCorners = _numCorners;
   vertices = const_cast<double*>(_vertices);
   cells = const_cast<int*>(_cells);
+  materialIds = const_cast<int*>(_materialIds);
   useIndexZero = _useIndexZero;
 } // constructor
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1D.hh	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1D.hh	2007-02-23 05:53:14 UTC (rev 6066)
@@ -44,6 +44,7 @@
 
   static const double _vertices[]; ///< Pointer to coordinates of vertices
   static const int _cells[]; ///< Pointer to indices of vertices in cells
+  static const int _materialIds[]; ///< Pointer to cell material identifiers
 
   static const bool _useIndexZero; ///< First vertex is 0 if true, 1 if false
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din2D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din2D.cc	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din2D.cc	2007-02-23 05:53:14 UTC (rev 6066)
@@ -34,6 +34,9 @@
        0,  1,
        1,  2
 };
+const int pylith::meshio::MeshData1Din2D::_materialIds[] = {
+  1, 0, 1
+};
 
 const bool pylith::meshio::MeshData1Din2D::_useIndexZero = true;
 
@@ -46,6 +49,7 @@
   numCorners = _numCorners;
   vertices = const_cast<double*>(_vertices);
   cells = const_cast<int*>(_cells);
+  materialIds = const_cast<int*>(_materialIds);
   useIndexZero = _useIndexZero;
 } // constructor
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din2D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din2D.hh	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din2D.hh	2007-02-23 05:53:14 UTC (rev 6066)
@@ -44,6 +44,7 @@
 
   static const double _vertices[]; ///< Pointer to coordinates of vertices
   static const int _cells[]; ///< Pointer to indices of vertices in cells
+  static const int _materialIds[]; ///< Pointer to cell material identifiers
 
   static const bool _useIndexZero; ///< First vertex is 0 if true, 1 if false
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din3D.cc	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din3D.cc	2007-02-23 05:53:14 UTC (rev 6066)
@@ -34,6 +34,9 @@
        0,  1,
        1,  2
 };
+const int pylith::meshio::MeshData1Din3D::_materialIds[] = {
+  1, 1, 0
+};
 
 const bool pylith::meshio::MeshData1Din3D::_useIndexZero = true;
 
@@ -46,6 +49,7 @@
   numCorners = _numCorners;
   vertices = const_cast<double*>(_vertices);
   cells = const_cast<int*>(_cells);
+  materialIds = const_cast<int*>(_materialIds);
   useIndexZero = _useIndexZero;
 } // constructor
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din3D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din3D.hh	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData1Din3D.hh	2007-02-23 05:53:14 UTC (rev 6066)
@@ -44,6 +44,7 @@
 
   static const double _vertices[]; ///< Pointer to coordinates of vertices
   static const int _cells[]; ///< Pointer to indices of vertices in cells
+  static const int _materialIds[]; ///< Pointer to cell material identifiers
 
   static const bool _useIndexZero; ///< First vertex is 0 if true, 1 if false
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2D.cc	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2D.cc	2007-02-23 05:53:14 UTC (rev 6066)
@@ -39,6 +39,9 @@
   4,  3,  6,  5,
   3,  7,  8,  6
 };
+const int pylith::meshio::MeshData2D::_materialIds[] = {
+  1, 0, 1
+};
 
 const bool pylith::meshio::MeshData2D::_useIndexZero = true;
 
@@ -51,6 +54,7 @@
   numCorners = _numCorners;
   vertices = const_cast<double*>(_vertices);
   cells = const_cast<int*>(_cells);
+  materialIds = const_cast<int*>(_materialIds);
   useIndexZero = _useIndexZero;
 } // constructor
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2D.hh	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2D.hh	2007-02-23 05:53:14 UTC (rev 6066)
@@ -44,6 +44,7 @@
 
   static const double _vertices[]; ///< Pointer to coordinates of vertices
   static const int _cells[]; ///< Pointer to indices of vertices in cells
+  static const int _materialIds[]; ///< Pointer to cell material identifiers
 
   static const bool _useIndexZero; ///< First vertex is 0 if true, 1 if false
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2Din3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2Din3D.cc	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2Din3D.cc	2007-02-23 05:53:14 UTC (rev 6066)
@@ -39,6 +39,9 @@
   4,  3,  6,  5,
   3,  7,  8,  6
 };
+const int pylith::meshio::MeshData2Din3D::_materialIds[] = {
+  0, 1, 0
+};
 
 const bool pylith::meshio::MeshData2Din3D::_useIndexZero = true;
 
@@ -51,6 +54,7 @@
   numCorners = _numCorners;
   vertices = const_cast<double*>(_vertices);
   cells = const_cast<int*>(_cells);
+  materialIds = const_cast<int*>(_materialIds);
   useIndexZero = _useIndexZero;
 } // constructor
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2Din3D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2Din3D.hh	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData2Din3D.hh	2007-02-23 05:53:14 UTC (rev 6066)
@@ -44,6 +44,7 @@
 
   static const double _vertices[]; ///< Pointer to coordinates of vertices
   static const int _cells[]; ///< Pointer to indices of vertices in cells
+  static const int _materialIds[]; ///< Pointer to cell material identifiers
 
   static const bool _useIndexZero; ///< First vertex is 0 if true, 1 if false
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData3D.cc	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData3D.cc	2007-02-23 05:53:14 UTC (rev 6066)
@@ -43,6 +43,9 @@
   6, 12, 13, 11,  7,  9, 10,  8,
   0,  2,  6,  5,  1,  3,  7,  4
 };
+const int pylith::meshio::MeshData3D::_materialIds[] = {
+  1, 0
+};
 
 const bool pylith::meshio::MeshData3D::_useIndexZero = true;
 
@@ -55,6 +58,7 @@
   numCorners = _numCorners;
   vertices = const_cast<double*>(_vertices);
   cells = const_cast<int*>(_cells);
+  materialIds = const_cast<int*>(_materialIds);
   useIndexZero = _useIndexZero;
 } // constructor
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData3D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData3D.hh	2007-02-23 05:37:32 UTC (rev 6065)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/MeshData3D.hh	2007-02-23 05:53:14 UTC (rev 6066)
@@ -44,6 +44,7 @@
 
   static const double _vertices[]; ///< Pointer to coordinates of vertices
   static const int _cells[]; ///< Pointer to indices of vertices in cells
+  static const int _materialIds[]; ///< Pointer to cell material identifiers
 
   static const bool _useIndexZero; ///< First vertex is 0 if true, 1 if false
 



More information about the cig-commits mailing list