[cig-commits] r22145 - in short/3D/PyLith/trunk: libsrc/pylith/faults libsrc/pylith/meshio pylith/feassemble unittests/libtests/bc/data unittests/libtests/faults unittests/libtests/faults/data unittests/libtests/meshio unittests/libtests/meshio/data unittests/pytests/feassemble

knepley at geodynamics.org knepley at geodynamics.org
Mon May 27 19:23:00 PDT 2013


Author: knepley
Date: 2013-05-27 19:23:00 -0700 (Mon, 27 May 2013)
New Revision: 22145

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveLagrange.cc
   short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc
   short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
   short/3D/PyLith/trunk/libsrc/pylith/meshio/MeshBuilder.cc
   short/3D/PyLith/trunk/libsrc/pylith/meshio/MeshIO.cc
   short/3D/PyLith/trunk/pylith/feassemble/FIATLagrange.py
   short/3D/PyLith/trunk/pylith/feassemble/FIATSimplex.py
   short/3D/PyLith/trunk/unittests/libtests/bc/data/BoundaryMeshDataTet4.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8b.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8c.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8d.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8e.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8f.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8g.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8h.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8i.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4Lagrange.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4c.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4f.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4g.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4h.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4i.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4e.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4f.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinSrcsDataTet4.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIO.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc.h5
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_cell.h5
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_cell_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_vertex.h5
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_vertex_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault.h5
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault_cell.h5
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault_cell_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault_vertex.h5
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault_vertex_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf.h5
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf_cell.h5
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf_cell_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf_vertex.h5
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf_vertex_t10.vtk
   short/3D/PyLith/trunk/unittests/pytests/feassemble/TestFIATLagrange.py
   short/3D/PyLith/trunk/unittests/pytests/feassemble/TestFIATSimplex.py
Log:
Fixed Pylith for new internal Plex orientation of tets and hexes

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveLagrange.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveLagrange.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveLagrange.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -603,9 +603,14 @@
   topology::VecVisitorMesh areaVisitor(area);
   const PetscScalar* areaArray = areaVisitor.localArray();
 
+  topology::Field& dispRel = _fields->get("relative disp");
+  PetscDM      dispDM = dispRel.dmMesh();
+  PetscSection dispGlobalSection = NULL;
+  PetscErrorCode err = DMGetDefaultGlobalSection(dispDM, &dispGlobalSection);PYLITH_CHECK_ERROR(err);
+
   PetscDM solnDM = fields->solution().dmMesh();
   PetscSection solnGlobalSection = NULL;
-  PetscErrorCode err = DMGetDefaultGlobalSection(solnDM, &solnGlobalSection);PYLITH_CHECK_ERROR(err);
+  err = DMGetDefaultGlobalSection(solnDM, &solnGlobalSection);PYLITH_CHECK_ERROR(err);
 
   _logger->eventEnd(setupEvent);
 #if !defined(DETAILED_EVENT_LOGGING)
@@ -679,10 +684,14 @@
 #endif
 
     // Set diagonal entries in preconditioned matrix.
+    // TODO Do we use v_lagrange, or v_negative?
+    PetscInt poff = 0;
+    err = PetscSectionGetOffset(dispGlobalSection, v_negative, &poff);PYLITH_CHECK_ERROR(err);
+
     for (int iDim=0; iDim < spaceDim; ++iDim)
       MatSetValue(*precondMatrix,
-		  gloff + iDim,
-		  gloff + iDim,
+		  poff + iDim,
+		  poff + iDim,
 		  precondVertexL[iDim],
 		  INSERT_VALUES);
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -173,6 +173,7 @@
     const PetscInt *gvertex = NULL;
     PetscVec cellVec = NULL;
     PetscScalar *vertices = NULL;
+    const PetscInt dim = mesh.dimension();
 
     err = DMPlexGetVertexNumbering(dmMesh, &globalVertexNumbers);PYLITH_CHECK_ERROR(err);
     err = ISGetIndices(globalVertexNumbers, &gvertex);PYLITH_CHECK_ERROR(err);
@@ -184,7 +185,7 @@
     err = VecGetArray(cellVec, &vertices);PYLITH_CHECK_ERROR(err);
     for(PetscInt cell = cStart, v = 0; cell < cEnd; ++cell) {
       PetscInt *closure = NULL;
-      PetscInt  closureSize, p;
+      PetscInt  closureSize, nC = 0, p;
 
       if (label) {
         PetscInt value;
@@ -192,14 +193,17 @@
         if (value != labelId) continue;
       } // if
 
-      // TODO: VERTEX ORDER
       err = DMPlexGetTransitiveClosure(dmMesh, cell, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
       for(p = 0; p < closureSize*2; p += 2) {
         if ((closure[p] >= vStart) && (closure[p] < vEnd)) {
-          const PetscInt gv = gvertex[closure[p] - vStart];
-          vertices[v++] = gv < 0 ? -(gv+1) : gv;
+          closure[nC++] = closure[p];
         } // if
       } // for
+      err = DMPlexInvertCell(dim, nC, closure);PYLITH_CHECK_ERROR(err);
+      for (p = 0; p < nC; ++p) {
+        const PetscInt gv = gvertex[closure[p] - vStart];
+        vertices[v++] = gv < 0 ? -(gv+1) : gv;
+      }
       err = DMPlexRestoreTransitiveClosure(dmMesh, cell, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
       //assert(v == (cell-cStart+1)*numCorners); Would be true without the label check
     } // for

Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -220,6 +220,7 @@
     const PetscInt *gvertex = NULL;
     PetscVec cellVec = NULL;
     PetscScalar *vertices = NULL;
+    const PetscInt meshDim = mesh.dimension();
 
     err = DMPlexGetVertexNumbering(dmMesh, &globalVertexNumbers);PYLITH_CHECK_ERROR(err);
     err = ISGetIndices(globalVertexNumbers, &gvertex);PYLITH_CHECK_ERROR(err);
@@ -231,7 +232,7 @@
     err = VecGetArray(cellVec, &vertices);PYLITH_CHECK_ERROR(err);
     for(PetscInt cell = cStart, v = 0; cell < cEnd; ++cell) {
       PetscInt *closure = NULL;
-      PetscInt closureSize, p;
+      PetscInt  closureSize, nC = 0, p;
 
       if (label) {
         PetscInt value;
@@ -239,14 +240,17 @@
         err = DMPlexGetLabelValue(dmMesh, label, cell, &value);PYLITH_CHECK_ERROR(err);
         if (value != labelId) continue;
       } // if
-      // TODO: VERTEX ORDER
       err = DMPlexGetTransitiveClosure(dmMesh, cell, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
       for(p = 0; p < closureSize*2; p += 2) {
         if ((closure[p] >= vStart) && (closure[p] < vEnd)) {
-          const PetscInt gv = gvertex[closure[p] - vStart];
-          vertices[v++] = gv < 0 ? -(gv+1) : gv;
+          closure[nC++] = closure[p];
         } // if
       } // for
+      err = DMPlexInvertCell(meshDim, nC, closure);PYLITH_CHECK_ERROR(err);
+      for (p = 0; p < nC; ++p) {
+        const PetscInt gv = gvertex[closure[p] - vStart];
+        vertices[v++] = gv < 0 ? -(gv+1) : gv;
+      }
       err = DMPlexRestoreTransitiveClosure(dmMesh, cell, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
       //assert(v == (cell-cStart+1)*numCorners); Would be true without label check
     } // for

Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/MeshBuilder.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/MeshBuilder.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/MeshBuilder.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -72,10 +72,14 @@
   } // check
 
   /* DMPlex */
-  PetscDM dmMesh;
+  PetscDM   dmMesh;
   PetscBool pInterpolate = interpolate ? PETSC_TRUE : PETSC_FALSE;
+  PetscInt  bound        = numCells*numCorners, coff;
 
   err = MPI_Bcast(&dim, 1, MPIU_INT, 0, comm);PYLITH_CHECK_ERROR(err);
+  for (coff = 0; coff < bound; coff += numCorners) {
+    err = DMPlexInvertCell(dim, numCorners, (int *) &cells[coff]);PYLITH_CHECK_ERROR(err);
+  }
   err = DMPlexCreateFromCellList(comm, dim, numCells, numVertices, numCorners, pInterpolate, &cells[0], spaceDim, &(*coordinates)[0], &dmMesh);PYLITH_CHECK_ERROR(err);
   mesh->dmMesh(dmMesh);
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/MeshIO.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/MeshIO.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/MeshIO.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -184,7 +184,6 @@
   for (PetscInt c = cStart, index = 0; c < cEnd; ++c) {
     PetscInt nC = 0, closureSize, *closure = NULL;
 
-    // TODO: VERTEX ORDER
     err = DMPlexGetTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
     for (PetscInt cl = 0; cl < closureSize*2; cl += 2) {
       if ((closure[cl] >= vStart) && (closure[cl] < vEnd)) {
@@ -194,6 +193,7 @@
       }
     } // for
     err = DMPlexRestoreTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
+    err = DMPlexInvertCell(*meshDim, nC, &(*cells)[index-nC]);PYLITH_CHECK_ERROR(err);
     assert(nC == *numCorners);
   } // for  
 

Modified: short/3D/PyLith/trunk/pylith/feassemble/FIATLagrange.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/FIATLagrange.py	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/pylith/feassemble/FIATLagrange.py	2013-05-28 02:23:00 UTC (rev 22145)
@@ -229,7 +229,7 @@
       elif dim == 3:
         # Set order of vertices and basis functions.
         # Corners
-        vertexOrder = [(0,0,0), (1,0,0), (1,1,0), (0,1,0),
+        vertexOrder = [(0,0,0), (0,1,0), (1,1,0), (1,0,0),
                        (0,0,1), (1,0,1), (1,1,1), (0,1,1)]
         # Edges
         #   Bottom front

Modified: short/3D/PyLith/trunk/pylith/feassemble/FIATSimplex.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/FIATSimplex.py	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/pylith/feassemble/FIATSimplex.py	2013-05-28 02:23:00 UTC (rev 22145)
@@ -200,7 +200,12 @@
       for face in ids[2]:
         permutation.extend(ids[2][face])
     elif dim == 3:
-      for vertex in ids[0]:
+      # Flip vertices 0 and 1
+      vids = [v for v in ids[0]]
+      tmp     = vids[0]
+      vids[0] = vids[1]
+      vids[1] = tmp
+      for vertex in vids:
         permutation.extend(ids[0][vertex])
       for edge in [2, 0, 1, 3]:
         permutation.extend(ids[1][edge])

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/BoundaryMeshDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/BoundaryMeshDataTet4.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/BoundaryMeshDataTet4.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -34,7 +34,7 @@
 };
 const int pylith::bc::BoundaryMeshDataTet4::_cellsNoFault[] = {
   5, 4, 2,
-  2, 6, 5,
+  5, 2, 6,
 };
 
 const int pylith::bc::BoundaryMeshDataTet4::_numVerticesFault = 6;
@@ -43,7 +43,7 @@
 };
 const int pylith::bc::BoundaryMeshDataTet4::_cellsFault[] = {
   6, 5, 3,
-  8, 7, 10,
+  10, 8, 7,
 };
 
 pylith::bc::BoundaryMeshDataTet4::BoundaryMeshDataTet4(void)

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -739,14 +739,22 @@
   const PetscInt cEnd = cellsStratum.end();
   CPPUNIT_ASSERT_EQUAL(data.numCells, cellsStratum.size());
   for (PetscInt c = cStart, cell = 0, i = 0; c < cEnd; ++c, ++cell) {
-    const PetscInt *cone = NULL;
-    PetscInt coneSize = 0;
-    err = DMPlexGetConeSize(dmMesh, c, &coneSize);PYLITH_CHECK_ERROR(err);
-    err = DMPlexGetCone(dmMesh, c, &cone);PYLITH_CHECK_ERROR(err);
-    CPPUNIT_ASSERT_EQUAL(data.numCorners[cell], coneSize);
-    for (PetscInt p = 0; p < coneSize; ++p, ++i) {
-      CPPUNIT_ASSERT_EQUAL(data.cells[i], cone[p]);
+    PetscInt *closure = PETSC_NULL;
+    PetscInt  closureSize, numCorners = 0;
+
+    err = DMPlexGetTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
+    for(PetscInt p = 0; p < closureSize*2; p += 2) {
+      const PetscInt point = closure[p];
+      if ((point >= vStart) && (point < vEnd)) {
+        closure[numCorners++] = point;
+      } // if
     } // for
+    err = DMPlexInvertCell(data.cellDim, numCorners, closure);PYLITH_CHECK_ERROR(err);
+    CPPUNIT_ASSERT_EQUAL(data.numCorners[cell], numCorners);
+    for (PetscInt p = 0; p < numCorners; ++p, ++i) {
+      CPPUNIT_ASSERT_EQUAL(data.cells[i], closure[p]);
+    } // for
+    err = DMPlexRestoreTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
   } // for
 
   // check materials

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -72,7 +72,7 @@
 const int pylith::faults::CohesiveDataHex8::_cells[] = {
   3,  4,  6,  5, 15, 16, 18, 17,
   7,  8, 10,  9, 11, 12, 14, 13,
-  7,  9, 10,  8, 15, 17, 18, 16,
+  7,  8, 10,  9, 15, 17, 18, 16,
 };
 
 const int pylith::faults::CohesiveDataHex8::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8b.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8b.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8b.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -72,7 +72,7 @@
 const int pylith::faults::CohesiveDataHex8b::_cells[] = {
   3, 15, 16,  4,  5, 17, 18,  6,
   7, 11, 12,  8,  9, 13, 14, 10,
-  7,  9, 10,  8, 15, 17, 18, 16,
+  7,  8, 10,  9, 15, 17, 18, 16,
 };
 
 const int pylith::faults::CohesiveDataHex8b::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8c.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8c.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8c.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -72,7 +72,7 @@
 const int pylith::faults::CohesiveDataHex8c::_cells[] = {
   7,  9, 10,  8,  3,  5,  6,  4,
  11, 13, 14, 12, 15, 17, 18, 16,
-  8, 10,  9,  7, 16, 18, 17, 15,
+  8,  7,  9, 10, 16, 18, 17, 15,
 };
 
 const int pylith::faults::CohesiveDataHex8c::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8d.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8d.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8d.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -72,7 +72,7 @@
 const int pylith::faults::CohesiveDataHex8d::_cells[] = {
   5,  9,  7,  3,  6, 10,  8,  4,
  17, 13, 11, 15, 18, 14, 12, 16,
-  9,  7,  8, 10, 17, 15, 16, 18,
+  9, 10,  8,  7, 17, 15, 16, 18,
 };
 
 const int pylith::faults::CohesiveDataHex8d::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8e.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8e.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8e.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -72,7 +72,7 @@
 const int pylith::faults::CohesiveDataHex8e::_cells[] = {
   6, 10,  9,  5,  4,  8,  7,  3,
  18, 14, 13, 17, 16, 12, 11, 15,
- 10,  9,  7,  8, 18, 17, 15, 16,
+ 10,  8,  7,  9, 18, 17, 15, 16,
 };
 
 const int pylith::faults::CohesiveDataHex8e::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8f.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8f.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8f.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -72,7 +72,7 @@
 const int pylith::faults::CohesiveDataHex8f::_cells[] = {
   4, 16, 18,  6,  3, 15, 17,  5,
   8, 12, 14, 10,  7, 11, 13,  9,
-  8,  7,  9, 10, 16, 15, 17, 18,
+  8, 10,  9,  7, 16, 15, 17, 18,
 };
 
 const int pylith::faults::CohesiveDataHex8f::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8g.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8g.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8g.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -98,8 +98,8 @@
    8, 26, 27,  9, 10, 28, 29, 11,
   12, 18, 19, 13, 14, 20, 21, 15,
   14, 20, 21, 15, 16, 22, 23, 17,
-  12, 14, 15, 13, 24, 26, 27, 25,
-  14, 16, 17, 15, 26, 28, 29, 27,
+  12, 13, 15, 14, 24, 26, 27, 25,
+  14, 15, 17, 16, 26, 28, 29, 27,
 };
 
 const int pylith::faults::CohesiveDataHex8g::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8h.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8h.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8h.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -97,8 +97,8 @@
   21, 20, 22, 23, 15, 14, 16, 17,
   13, 19, 21, 15, 12, 18, 20, 14,
   29, 28, 10, 11, 27, 26,  8,  9,
-  12, 14, 15, 13, 24, 26, 27, 25,
-  15, 14, 16, 17, 27, 26, 28, 29,
+  12, 13, 15, 14, 24, 26, 27, 25,
+  15, 17, 16, 14, 27, 26, 28, 29,
 };
 
 const int pylith::faults::CohesiveDataHex8h::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8i.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8i.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataHex8i.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -90,8 +90,8 @@
    43, 37, 32, 40, 44, 38, 33, 41,
    29, 30, 40, 39, 34, 35, 43, 42,
    17, 16, 15, 26, 21, 20, 19, 28,
-   22, 23, 26, 25, 39, 40, 43, 42,
-   26, 23, 24, 27, 43, 40, 41, 44,
+   22, 25, 26, 23, 39, 40, 43, 42,
+   26, 27, 24, 23, 43, 40, 41, 44,
 };
 
 const int pylith::faults::CohesiveDataHex8i::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -63,7 +63,7 @@
 const int pylith::faults::CohesiveDataTet4::_cells[] = {
   4,  5,  6,  3,
   8, 10,  9,  7,
-  6,  5,  4, 10,  9,  8
+  5,  4,  6,  9,  8, 10
 };
 
 const int pylith::faults::CohesiveDataTet4::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4Lagrange.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4Lagrange.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4Lagrange.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -66,7 +66,7 @@
 const int pylith::faults::CohesiveDataTet4Lagrange::_cells[] = {
   4,  5,  6,  3,
   8, 10,  9,  7,
-  6,  5,  4, 10,  9,  8, 13, 12, 11
+  5,  4,  6,  9,  8, 10, 12, 11, 13
 };
 
 const int pylith::faults::CohesiveDataTet4Lagrange::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4c.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4c.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4c.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -63,7 +63,7 @@
 const int pylith::faults::CohesiveDataTet4c::_cells[] = {
   6,  5,  3,  4,
   7,  9, 10,  8,
-  6,  5,  4, 10,  9,  8,
+  4,  6,  5,  8, 10,  9,
 };
 
 const int pylith::faults::CohesiveDataTet4c::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4f.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4f.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4f.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -63,7 +63,7 @@
 const int pylith::faults::CohesiveDataTet4f::_cells[] = {
   4,  6,  5,  7,
   8,  9, 10,  3,
-  5,  6,  4,  9, 10,  8
+  6,  4,  5, 10,  8,  9
 };
 
 const int pylith::faults::CohesiveDataTet4f::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4g.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4g.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4g.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -63,7 +63,7 @@
 const int pylith::faults::CohesiveDataTet4g::_cells[] = {
   4,  6,  5,  7,
   8, 10,  3,  9,
-  5,  6,  4,  9, 10,  8
+  6,  4,  5, 10,  8,  9
 };
 
 const int pylith::faults::CohesiveDataTet4g::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4h.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4h.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4h.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -63,7 +63,7 @@
 const int pylith::faults::CohesiveDataTet4h::_cells[] = {
  10,  9,  3,  8,
   6,  5,  4,  7,
-  6,  4,  5, 10,  8,  9
+  4,  5,  6,  8,  9, 10
 };
 
 const int pylith::faults::CohesiveDataTet4h::_materialIds[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4i.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4i.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4i.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -70,7 +70,7 @@
  12, 14, 13, 11,
  15, 11, 14, 12,
   6,  7, 10,  9,
-  9,  8,  7, 14, 13, 12,
+  8,  7,  9, 13, 12, 14,
   7, 10,  9, 12, 15, 14,
 };
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -137,16 +137,16 @@
 
 const int pylith::faults::CohesiveKinDataTet4::_numFaultVertices = 3;
 const int pylith::faults::CohesiveKinDataTet4::_verticesFault[] = {
-   4,  3,  2
+   3,  2,  4
 };
 const int pylith::faults::CohesiveKinDataTet4::_verticesLagrange[] = {
-  13, 12, 11
+  12, 11, 13
 };
 const int pylith::faults::CohesiveKinDataTet4::_verticesNegative[] = {
-   6,  5,  4
+   5,  4,  6
 };
 const int pylith::faults::CohesiveKinDataTet4::_verticesPositive[] = {
-  10,  9,  8
+   9,  8, 10
 };
 
 const int pylith::faults::CohesiveKinDataTet4::_numCohesiveCells = 1;

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4e.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4e.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4e.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -161,16 +161,16 @@
 
 const int pylith::faults::CohesiveKinDataTet4e::_numFaultVertices = 4;
 const int pylith::faults::CohesiveKinDataTet4e::_verticesFault[] = {
-   6,  5,  4,  7
+   5,  4,  6,  7
 };
 const int pylith::faults::CohesiveKinDataTet4e::_verticesLagrange[] = {
-  18, 17, 16, 19
+  17, 16, 18, 19
 };
 const int pylith::faults::CohesiveKinDataTet4e::_verticesNegative[] = {
-   9,  8,  7, 10
+   8,  7,  9, 10
 };
 const int pylith::faults::CohesiveKinDataTet4e::_verticesPositive[] = {
-  14, 13, 12, 15
+  13, 12, 14, 15
 };
 
 const int pylith::faults::CohesiveKinDataTet4e::_numCohesiveCells = 2;

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4f.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4f.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4f.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -150,16 +150,16 @@
 
 const int pylith::faults::CohesiveKinDataTet4f::_numFaultVertices = 3;
 const int pylith::faults::CohesiveKinDataTet4f::_verticesFault[] = {
-   3,  4,  2
+   4,  2,  3
 };
 const int pylith::faults::CohesiveKinDataTet4f::_verticesLagrange[] = {
-  12, 13, 11
+  13, 11, 12
 };
 const int pylith::faults::CohesiveKinDataTet4f::_verticesNegative[] = {
-   5,  6,  4
+   6,  4,  5
 };
 const int pylith::faults::CohesiveKinDataTet4f::_verticesPositive[] = {
-   9, 10,  8
+  10,  8,  9
 };
 
 const int pylith::faults::CohesiveKinDataTet4f::_numCohesiveCells = 1;

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinSrcsDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinSrcsDataTet4.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinSrcsDataTet4.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -149,16 +149,16 @@
 
 const int pylith::faults::CohesiveKinSrcsDataTet4::_numFaultVertices = 3;
 const int pylith::faults::CohesiveKinSrcsDataTet4::_verticesFault[] = {
-   4,  3,  2
+   3,  2,  4
 };
 const int pylith::faults::CohesiveKinSrcsDataTet4::_verticesLagrange[] = {
-  13, 12, 11
+  12, 11, 13
 };
 const int pylith::faults::CohesiveKinSrcsDataTet4::_verticesNegative[] = {
-   6,  5,  4
+   5,  4,  6
 };
 const int pylith::faults::CohesiveKinSrcsDataTet4::_verticesPositive[] = {
-  10,  9,  8
+   9,  8, 10
 };
 
 const int pylith::faults::CohesiveKinSrcsDataTet4::_numCohesiveCells = 1;

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIO.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIO.cc	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestMeshIO.cc	2013-05-28 02:23:00 UTC (rev 22145)
@@ -86,9 +86,17 @@
   const bool interpolate = false;
   PetscDM dmMesh = NULL;
   PetscBool interpolateMesh = interpolate ? PETSC_TRUE : PETSC_FALSE;
+  PetscInt  bound           = data.numCells*data.numCorners;
   PetscErrorCode err;
 
-  err = DMPlexCreateFromCellList(_mesh->comm(), data.cellDim, data.numCells, data.numVertices, data.numCorners, interpolateMesh, data.cells, data.spaceDim, data.vertices, &dmMesh);PYLITH_CHECK_ERROR(err);
+
+  int *cells = new int[bound];
+  for (PetscInt coff = 0; coff < bound; ++coff) {cells[coff] = data.cells[coff];}
+  for (PetscInt coff = 0; coff < bound; coff += data.numCorners) {
+    err = DMPlexInvertCell(data.cellDim, data.numCorners, &cells[coff]);PYLITH_CHECK_ERROR(err);
+  }
+  err = DMPlexCreateFromCellList(_mesh->comm(), data.cellDim, data.numCells, data.numVertices, data.numCorners, interpolateMesh, cells, data.spaceDim, data.vertices, &dmMesh);PYLITH_CHECK_ERROR(err);
+  delete [] cells;
   _mesh->dmMesh(dmMesh);
 
   // Material ids
@@ -183,12 +191,22 @@
   PetscInt coneSize = 0;
   PetscErrorCode err = 0;
   for(PetscInt c = cStart, index = 0; c < cEnd; ++c) {
-    err = DMPlexGetConeSize(dmMesh, c, &coneSize);PYLITH_CHECK_ERROR(err);
-    err = DMPlexGetCone(dmMesh, c, &cone);PYLITH_CHECK_ERROR(err);
-    CPPUNIT_ASSERT_EQUAL(data.numCorners, coneSize);
-    for(PetscInt p = 0; p < coneSize; ++p, ++index) {
-      CPPUNIT_ASSERT_EQUAL(data.cells[index], cone[p]-offset);
+    PetscInt *closure = PETSC_NULL;
+    PetscInt  closureSize, numCorners = 0;
+
+    err = DMPlexGetTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
+    for(PetscInt p = 0; p < closureSize*2; p += 2) {
+      const PetscInt point = closure[p];
+      if ((point >= vStart) && (point < vEnd)) {
+        closure[numCorners++] = point;
+      } // if
     } // for
+    err = DMPlexInvertCell(data.cellDim, numCorners, closure);PYLITH_CHECK_ERROR(err);
+    CPPUNIT_ASSERT_EQUAL(data.numCorners, numCorners);
+    for(PetscInt p = 0; p < numCorners; ++p, ++index) {
+      CPPUNIT_ASSERT_EQUAL(data.cells[index], closure[p]-offset);
+    } // for
+    err = DMPlexRestoreTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
   } // for
 
   // check materials

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc.h5
===================================================================
(Binary files differ)

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_cell.h5
===================================================================
(Binary files differ)

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_cell_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_cell_t10.vtk	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_cell_t10.vtk	2013-05-28 02:23:00 UTC (rev 22145)
@@ -11,7 +11,7 @@
 0.000000e+00 1.000000e+00 0.000000e+00
 CELLS 2 8
 3  0 2 1
-3  4 5 3
+3  3 4 5
 CELL_TYPES 2
 5
 5

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_vertex.h5
===================================================================
(Binary files differ)

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_vertex_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_vertex_t10.vtk	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_vertex_t10.vtk	2013-05-28 02:23:00 UTC (rev 22145)
@@ -11,7 +11,7 @@
 0.000000e+00 1.000000e+00 0.000000e+00
 CELLS 2 8
 3  0 2 1
-3  4 5 3
+3  3 4 5
 CELL_TYPES 2
 5
 5

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault.h5
===================================================================
(Binary files differ)

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault_cell.h5
===================================================================
(Binary files differ)

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault_cell_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault_cell_t10.vtk	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault_cell_t10.vtk	2013-05-28 02:23:00 UTC (rev 22145)
@@ -7,7 +7,7 @@
 0.000000e+00 0.000000e+00 1.000000e+00
 0.000000e+00 1.000000e+00 0.000000e+00
 CELLS 1 4
-3  2 1 0
+3  1 0 2
 CELL_TYPES 1
 5
 CELL_DATA 1

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault_vertex.h5
===================================================================
(Binary files differ)

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault_vertex_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault_vertex_t10.vtk	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_fault_vertex_t10.vtk	2013-05-28 02:23:00 UTC (rev 22145)
@@ -7,7 +7,7 @@
 0.000000e+00 0.000000e+00 1.000000e+00
 0.000000e+00 1.000000e+00 0.000000e+00
 CELLS 1 4
-3  2 1 0
+3  1 0 2
 CELL_TYPES 1
 5
 POINT_DATA 3

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf.h5
===================================================================
(Binary files differ)

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf_cell.h5
===================================================================
(Binary files differ)

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf_cell_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf_cell_t10.vtk	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf_cell_t10.vtk	2013-05-28 02:23:00 UTC (rev 22145)
@@ -9,7 +9,7 @@
 1.000000e+00 0.000000e+00 0.000000e+00
 CELLS 2 8
 3  0 2 1
-3  1 2 3
+3  3 1 2
 CELL_TYPES 2
 5
 5

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf_vertex.h5
===================================================================
(Binary files differ)

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf_vertex_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf_vertex_t10.vtk	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_surf_vertex_t10.vtk	2013-05-28 02:23:00 UTC (rev 22145)
@@ -9,7 +9,7 @@
 1.000000e+00 0.000000e+00 0.000000e+00
 CELLS 2 8
 3  0 2 1
-3  1 2 3
+3  3 1 2
 CELL_TYPES 2
 5
 5

Modified: short/3D/PyLith/trunk/unittests/pytests/feassemble/TestFIATLagrange.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/feassemble/TestFIATLagrange.py	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/pytests/feassemble/TestFIATLagrange.py	2013-05-28 02:23:00 UTC (rev 22145)
@@ -435,9 +435,9 @@
     Setup hex8 cell.
     """
     vertices = numpy.array([[-1.0, -1.0, -1.0],
+                            [-1.0, +1.0, -1.0],
+                            [+1.0, +1.0, -1.0],
                             [+1.0, -1.0, -1.0],
-                            [+1.0, +1.0, -1.0],
-                            [-1.0, +1.0, -1.0],
                             [-1.0, -1.0, +1.0],
                             [+1.0, -1.0, +1.0],
                             [+1.0, +1.0, +1.0],
@@ -457,15 +457,15 @@
     basisDeriv = numpy.zeros( (8, 8, 3), dtype=numpy.float64)
     iQuad = 0
     for q in quadPts:
-      basis[iQuad] = numpy.array([self.N0(q), self.N1(q),
-                                  self.N2(q), self.N3(q),
+      basis[iQuad] = numpy.array([self.N0(q), self.N3(q),
+                                  self.N2(q), self.N1(q),
                                   self.N4(q), self.N5(q),
                                   self.N6(q), self.N7(q)],
                                  dtype=numpy.float64).reshape( (8,) )
       deriv = numpy.array([[self.N0p(q), self.N0q(q), self.N0r(q)],
+                           [self.N3p(q), self.N3q(q), self.N3r(q)],
+                           [self.N2p(q), self.N2q(q), self.N2r(q)],
                            [self.N1p(q), self.N1q(q), self.N1r(q)],
-                           [self.N2p(q), self.N2q(q), self.N2r(q)],
-                           [self.N3p(q), self.N3q(q), self.N3r(q)],
                            [self.N4p(q), self.N4q(q), self.N4r(q)],
                            [self.N5p(q), self.N5q(q), self.N5r(q)],
                            [self.N6p(q), self.N6q(q), self.N6r(q)],
@@ -589,9 +589,9 @@
     Setup hex8 cell.
     """
     vertices = numpy.array([[-1.0, -1.0, -1.0],
+                            [-1.0, +1.0, -1.0],
+                            [+1.0, +1.0, -1.0],
                             [+1.0, -1.0, -1.0],
-                            [+1.0, +1.0, -1.0],
-                            [-1.0, +1.0, -1.0],
                             [-1.0, -1.0, +1.0],
                             [+1.0, -1.0, +1.0],
                             [+1.0, +1.0, +1.0],
@@ -611,15 +611,15 @@
     basisDeriv = numpy.zeros( (8, 8, 3), dtype=numpy.float64)
     iQuad = 0
     for q in quadPts:
-      basis[iQuad] = numpy.array([self.N0(q), self.N1(q),
-                                  self.N2(q), self.N3(q),
+      basis[iQuad] = numpy.array([self.N0(q), self.N3(q),
+                                  self.N2(q), self.N1(q),
                                   self.N4(q), self.N5(q),
                                   self.N6(q), self.N7(q)],
                                  dtype=numpy.float64).reshape( (8,) )
       deriv = numpy.array([[self.N0p(q), self.N0q(q), self.N0r(q)],
+                           [self.N3p(q), self.N3q(q), self.N3r(q)],
+                           [self.N2p(q), self.N2q(q), self.N2r(q)],
                            [self.N1p(q), self.N1q(q), self.N1r(q)],
-                           [self.N2p(q), self.N2q(q), self.N2r(q)],
-                           [self.N3p(q), self.N3q(q), self.N3r(q)],
                            [self.N4p(q), self.N4q(q), self.N4r(q)],
                            [self.N5p(q), self.N5q(q), self.N5r(q)],
                            [self.N6p(q), self.N6q(q), self.N6r(q)],
@@ -646,9 +646,9 @@
     Setup hex8 cell.
     """
     vertices = numpy.array([[-1.0, -1.0, -1.0], # Corners
+                            [-1.0, +1.0, -1.0],
+                            [+1.0, +1.0, -1.0],
                             [+1.0, -1.0, -1.0],
-                            [+1.0, +1.0, -1.0],
-                            [-1.0, +1.0, -1.0],
                             [-1.0, -1.0, +1.0],
                             [+1.0, -1.0, +1.0],
                             [+1.0, +1.0, +1.0],
@@ -714,7 +714,7 @@
     basisDeriv = numpy.zeros( (27, 27, 3), dtype=numpy.float64)
     iQuad = 0
     for q in quadPts:
-      basis[iQuad] = numpy.array([self.N0(q), self.N1(q), self.N2(q), self.N3(q), # Corners
+      basis[iQuad] = numpy.array([self.N0(q), self.N3(q), self.N2(q), self.N1(q), # Corners
                                   self.N4(q), self.N5(q), self.N6(q), self.N7(q),
                                   self.N8(q), self.N9(q), self.N10(q), self.N11(q), # Edges
                                   self.N12(q), self.N13(q), self.N14(q), self.N15(q),
@@ -725,9 +725,9 @@
                                   self.N25(q), self.N26(q)],
                                  dtype=numpy.float64).reshape( (27,) )
       deriv = numpy.array([[self.N0p(q), self.N0q(q), self.N0r(q)],
+                           [self.N3p(q), self.N3q(q), self.N3r(q)],
+                           [self.N2p(q), self.N2q(q), self.N2r(q)],
                            [self.N1p(q), self.N1q(q), self.N1r(q)],
-                           [self.N2p(q), self.N2q(q), self.N2r(q)],
-                           [self.N3p(q), self.N3q(q), self.N3r(q)],
                            [self.N4p(q), self.N4q(q), self.N4r(q)],
                            [self.N5p(q), self.N5q(q), self.N5r(q)],
                            [self.N6p(q), self.N6q(q), self.N6r(q)],

Modified: short/3D/PyLith/trunk/unittests/pytests/feassemble/TestFIATSimplex.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/feassemble/TestFIATSimplex.py	2013-05-27 23:11:20 UTC (rev 22144)
+++ short/3D/PyLith/trunk/unittests/pytests/feassemble/TestFIATSimplex.py	2013-05-28 02:23:00 UTC (rev 22145)
@@ -381,8 +381,8 @@
     """
     Setup tri33 cell.
     """
-    vertices = numpy.array([[-1.0, -1.0, -1.0],
-                            [+1.0, -1.0, -1.0],
+    vertices = numpy.array([[+1.0, -1.0, -1.0],
+                            [-1.0, -1.0, -1.0],
                             [-1.0, +1.0, -1.0],
                             [-1.0, -1.0, +1.0]])
     quadPts = numpy.array([ [-1.0/2.0, -1.0/2.0, -1.0/2.0] ])
@@ -393,11 +393,11 @@
     basisDeriv = numpy.zeros( (1, 4, 3), dtype=numpy.float64)
     iQuad = 0
     for q in quadPts:
-      basis[iQuad] = numpy.array([self.N0(q), self.N1(q), 
+      basis[iQuad] = numpy.array([self.N1(q), self.N0(q), 
                                   self.N2(q), self.N3(q)],
                                  dtype=numpy.float64).reshape( (4,) )
-      deriv = numpy.array([[self.N0p(q), self.N0q(q), self.N0r(q)],
-                           [self.N1p(q), self.N1q(q), self.N1r(q)],
+      deriv = numpy.array([[self.N1p(q), self.N1q(q), self.N1r(q)],
+                           [self.N0p(q), self.N0q(q), self.N0r(q)],
                            [self.N2p(q), self.N2q(q), self.N2r(q)],
                            [self.N3p(q), self.N3q(q), self.N3r(q)]])      
       basisDeriv[iQuad] = deriv.reshape((4, 3))
@@ -470,11 +470,14 @@
     """
     Setup tri33 cell.
     """
-    vertices = numpy.array([[-1.0, -1.0, -1.0],
+    vertices = numpy.array([[+1.0, -1.0, -1.0],
+                            [-1.0, -1.0, -1.0],
+                            [-1.0, +1.0, -1.0],
+                            [-1.0, -1.0, +1.0]])
+    quadPts = numpy.array([[-1.0, -1.0, -1.0],
                             [+1.0, -1.0, -1.0],
                             [-1.0, +1.0, -1.0],
                             [-1.0, -1.0, +1.0]])
-    quadPts = vertices[:]
     quadWts = numpy.array( [1.0/3.0, 1.0/3.0, 1.0/3.0, 1.0/3.0])
 
     # Compute basis fns and derivatives at quadrature points
@@ -482,11 +485,11 @@
     basisDeriv = numpy.zeros( (4, 4, 3), dtype=numpy.float64)
     iQuad = 0
     for q in quadPts:
-      basis[iQuad] = numpy.array([self.N0(q), self.N1(q), 
+      basis[iQuad] = numpy.array([self.N1(q), self.N0(q), 
                                   self.N2(q), self.N3(q)],
                                  dtype=numpy.float64).reshape( (4,) )
-      deriv = numpy.array([[self.N0p(q), self.N0q(q), self.N0r(q)],
-                           [self.N1p(q), self.N1q(q), self.N1r(q)],
+      deriv = numpy.array([[self.N1p(q), self.N1q(q), self.N1r(q)],
+                           [self.N0p(q), self.N0q(q), self.N0r(q)],
                            [self.N2p(q), self.N2q(q), self.N2r(q)],
                            [self.N3p(q), self.N3q(q), self.N3r(q)]])      
       basisDeriv[iQuad] = deriv.reshape((4, 3))



More information about the CIG-COMMITS mailing list