[cig-commits] r14704 - in short/3D/PyLith/branches/pylith-swig: libsrc/bc libsrc/faults unittests/libtests/meshio unittests/libtests/meshio/data

brad at geodynamics.org brad at geodynamics.org
Tue Apr 14 16:12:51 PDT 2009


Author: brad
Date: 2009-04-14 16:12:50 -0700 (Tue, 14 Apr 2009)
New Revision: 14704

Modified:
   short/3D/PyLith/branches/pylith-swig/libsrc/bc/AbsorbingDampers.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/bc/Neumann.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/faults/FaultCohesiveKin.cc
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/TestDataWriterVTKBCMeshTri3.cc
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/tri3.mesh
Log:
A little work on output unit tests.

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/bc/AbsorbingDampers.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/bc/AbsorbingDampers.cc	2009-04-14 22:15:55 UTC (rev 14703)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/bc/AbsorbingDampers.cc	2009-04-14 23:12:50 UTC (rev 14704)
@@ -84,11 +84,11 @@
   // Get 'surface' cells (1 dimension lower than top-level cells)
   const ALE::Obj<SieveSubMesh>& submesh = _boundaryMesh->sieveMesh();
   assert(!submesh.isNull());
+  const int boundaryDepth = submesh->depth()-1; // depth of bndry cells
   const ALE::Obj<SieveSubMesh::label_sequence>& cells = 
-    submesh->heightStratum(1);
+    submesh->depthStratum(boundaryDepth);
   assert(!cells.isNull());
   const SieveSubMesh::label_sequence::iterator cellsEnd = cells->end();
-  const int boundaryDepth = submesh->depth()-1; // depth of bndry cells
 
   // Make sure surface cells are compatible with quadrature.
   for (SieveSubMesh::label_sequence::iterator c_iter=cells->begin();
@@ -267,8 +267,9 @@
   // Get cell information
   const ALE::Obj<SieveSubMesh>& submesh = _boundaryMesh->sieveMesh();
   assert(!submesh.isNull());
+  const int boundaryDepth = submesh->depth()-1; // depth of bndry cells
   const ALE::Obj<SieveSubMesh::label_sequence>& cells = 
-    submesh->heightStratum(1);
+    submesh->depthStratum(boundaryDepth);
   assert(!cells.isNull());
   const SieveSubMesh::label_sequence::iterator cellsEnd = cells->end();
 
@@ -373,8 +374,9 @@
   // Get cell information
   const ALE::Obj<SieveSubMesh>& submesh = _boundaryMesh->sieveMesh();
   assert(!submesh.isNull());
+  const int boundaryDepth = submesh->depth()-1; // depth of bndry cells
   const ALE::Obj<SieveSubMesh::label_sequence>& cells = 
-    submesh->heightStratum(1);
+    submesh->depthStratum(boundaryDepth);
   assert(!cells.isNull());
   const SieveSubMesh::label_sequence::iterator cellsEnd = cells->end();
 

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/bc/Neumann.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/bc/Neumann.cc	2009-04-14 22:15:55 UTC (rev 14703)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/bc/Neumann.cc	2009-04-14 23:12:50 UTC (rev 14704)
@@ -81,11 +81,11 @@
   // Get 'surface' cells (1 dimension lower than top-level cells)
   const ALE::Obj<SieveSubMesh>& submesh = _boundaryMesh->sieveMesh();
   assert(!submesh.isNull());
+  const int boundaryDepth = submesh->depth()-1; // depth of bndry cells
   const ALE::Obj<SieveSubMesh::label_sequence>& cells = 
-    submesh->heightStratum(1);
+    submesh->depthStratum(boundaryDepth);
   assert(!cells.isNull());
   const SieveSubMesh::label_sequence::iterator cellsEnd = cells->end();
-  const int boundaryDepth = submesh->depth()-1; // depth of bndry cells
 
   // Make sure surface cells are compatible with quadrature.
   for (SieveSubMesh::label_sequence::iterator c_iter=cells->begin();
@@ -266,8 +266,9 @@
   // Get cell information
   const ALE::Obj<SieveSubMesh>& submesh = _boundaryMesh->sieveMesh();
   assert(!submesh.isNull());
+  const int boundaryDepth = submesh->depth()-1; // depth of bndry cells
   const ALE::Obj<SieveSubMesh::label_sequence>& cells = 
-    submesh->heightStratum(1);
+    submesh->depthStratum(boundaryDepth);
   assert(!cells.isNull());
   const SieveSubMesh::label_sequence::iterator cellsEnd = cells->end();
 

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/faults/FaultCohesiveKin.cc	2009-04-14 22:15:55 UTC (rev 14703)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/faults/FaultCohesiveKin.cc	2009-04-14 23:12:50 UTC (rev 14704)
@@ -742,14 +742,14 @@
   double_array faceVertices(numBasis*spaceDim);
   
   // Get fault cells (1 dimension lower than top-level cells)
+  const int faultDepth = _faultMesh->depth()-1; // depth of fault cells
   const ALE::Obj<SubMesh::label_sequence>& cells = 
-    _faultMesh->heightStratum(0);
+    _faultMesh->depthStratum(faultDepth);
   assert(!cells.isNull());
   const SubMesh::label_sequence::iterator cellsEnd = cells->end();
 
   const ALE::Obj<sieve_type>& sieve = _faultMesh->getSieve();
   assert(!sieve.isNull());
-  const int faultDepth = _faultMesh->depth();  // depth of fault cells
   typedef ALE::SieveAlg<Mesh> SieveAlg;
 
   ALE::ISieveVisitor::NConeRetriever<sieve_type> ncV(*sieve, (size_t) pow(sieve->getMaxConeSize(), std::max(0, _faultMesh->depth())));
@@ -953,8 +953,9 @@
   _faultMesh->allocate(_area);
   
   // Get fault cells (1 dimension lower than top-level cells)
+  const int faultDepth = submesh->depth()-1; // depth of bndry cells
   const ALE::Obj<SubMesh::label_sequence>& cells = 
-    _faultMesh->heightStratum(0);
+    _faultMesh->depthStratum(faultDepth);
   assert(!cells.isNull());
   const SubMesh::label_sequence::iterator cellsEnd = cells->end();
 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc	2009-04-14 22:15:55 UTC (rev 14703)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc	2009-04-14 23:12:50 UTC (rev 14704)
@@ -288,8 +288,9 @@
     const ALE::Obj<topology::SubMesh::SieveMesh>& sieveSubMesh =
       _submesh->sieveMesh();
     CPPUNIT_ASSERT(!sieveSubMesh.isNull());
+    const int cellDepth = sieveSubMesh->depth()-1;
     const ALE::Obj<topology::SubMesh::SieveMesh::label_sequence>& cells = 
-      sieveSubMesh->heightStratum(1);
+      sieveSubMesh->depthStratum(cellDepth);
     assert(!cells.isNull());
     const topology::SubMesh::SieveMesh::label_sequence::iterator cellsEnd = 
       cells->end();
@@ -303,7 +304,6 @@
       field.newSection(topology::FieldBase::CELLS_FIELD, fiberDim);
       field.allocate();
       field.vectorFieldType(_data->cellFieldsInfo[i].field_type);
-      field.view(name);
 
       const ALE::Obj<topology::SubMesh::RealSection>& section = field.section();
       CPPUNIT_ASSERT(!section.isNull());
@@ -313,7 +313,6 @@
 	   ++c_iter, ++icell) {
 	const double* values = &_data->cellFields[i][icell*fiberDim];
 	section->updatePoint(*c_iter, values);
-	std::cout << "c_iter: " << *c_iter << std::endl;
       } // for
       CPPUNIT_ASSERT_EQUAL(_data->numCells, icell);
     } // for

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/TestDataWriterVTKBCMeshTri3.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/TestDataWriterVTKBCMeshTri3.cc	2009-04-14 22:15:55 UTC (rev 14703)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/TestDataWriterVTKBCMeshTri3.cc	2009-04-14 23:12:50 UTC (rev 14704)
@@ -17,7 +17,7 @@
 #include "data/DataWriterVTKDataBCMeshTri3.hh" // USES DataWriterVTKDataBCMeshTri3
 
 // ----------------------------------------------------------------------
-//CPPUNIT_TEST_SUITE_REGISTRATION( pylith::meshio::TestDataWriterVTKBCMeshTri3 );
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::meshio::TestDataWriterVTKBCMeshTri3 );
 
 // ----------------------------------------------------------------------
 // Setup testing data.

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/tri3.mesh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/tri3.mesh	2009-04-14 22:15:55 UTC (rev 14703)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/tri3.mesh	2009-04-14 23:12:50 UTC (rev 14704)
@@ -16,6 +16,15 @@
 //    \  |   |  /
 //       4-6-1 
 //
+// Mesh with fault (Sieve labels)
+//       7-9-4
+//    /  |   |  \
+//   /   |   |   \
+//  2  0 |   | 1  5
+//   \   |   |   /
+//    \  |   |  /
+//       6-8-3 
+//
 mesh = {
   dimension = 2
   use-index-zero = true



More information about the CIG-COMMITS mailing list