[cig-commits] r19609 - short/3D/PyLith/trunk/unittests/libtests/meshio

brad at geodynamics.org brad at geodynamics.org
Fri Feb 10 09:01:51 PST 2012


Author: brad
Date: 2012-02-10 09:01:51 -0800 (Fri, 10 Feb 2012)
New Revision: 19609

Modified:
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.cc
Log:
More work on unit tests for OutputSolnPoints.

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.cc	2012-02-10 14:17:26 UTC (rev 19608)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.cc	2012-02-10 17:01:51 UTC (rev 19609)
@@ -51,20 +51,22 @@
 void
 pylith::meshio::TestOutputSolnPoints::testSetupInterpolator2D(void)
 { // testSetupInterpolator2D
-  const char* filename = "data/quad4.mesh";
-  const int numPoints = 5;
-  const PylithScalar points[10] = { 
-    0.0,  0.1,
+  const char* meshFilename = "data/quad4.mesh";
+  const int numPoints = 7;
+  const PylithScalar points[14] = { 
+    0.0,  0.1, // interior points
     0.3,  0.4,
    -0.6, -0.7,
    -1.0,  0.9,
    -0.3,  0.8,
+    0.3,  0.99999, // edge point
+   -0.999999,  0.99999, // vertex point
   };
   const int nvertices = numPoints;
-  const int verticesE[5] = { 5, 6, 7, 8, 9 };
+  const int verticesE[7] = { 7, 8, 9, 10, 11, 12, 13 };
   const int ncells = numPoints;
   const int ncorners = 1;
-  const int cellsE[5] = { 5, 6, 7, 8, 9 };
+  const int cellsE[7] = { 7, 8, 9, 10, 11, 12, 13 };
   const int spaceDim = 2;
 
   topology::Mesh mesh;
@@ -73,7 +75,7 @@
   cs.initialize();
   mesh.coordsys(&cs);
   MeshIOAscii iohandler;
-  iohandler.filename("data/quad4.mesh");
+  iohandler.filename(meshFilename);
   iohandler.read(&mesh);
 
   OutputSolnPoints output;
@@ -124,20 +126,22 @@
 void
 pylith::meshio::TestOutputSolnPoints::testSetupInterpolator3D(void)
 { // testSetupInterpolator3D
-  const char* filename = "data/quad4.mesh";
-  const int numPoints = 5;
-  const PylithScalar points[15] = { 
-    0.0,  0.1,  0.2,
+  const char* meshFilename = "data/hex8.mesh";
+  const int numPoints = 7;
+  const PylithScalar points[21] = { 
+    0.0,  0.1,  0.2, // interior points
     0.3, -0.4,  0.5,
     0.6,  0.7, -0.8,
    -1.0,  0.1, -0.3,
     0.3,  0.8,  0.5,
+    0.3,  0.9999,  0.9999, // edge point
+    0.0,  0.9999,  -0.999999, // vertex point
   };
   const int nvertices = numPoints;
-  const int verticesE[5] = { 5, 6, 7, 8, 9 };
+  const int verticesE[7] = { 7, 8, 9, 10, 11, 12, 13 };
   const int ncells = numPoints;
   const int ncorners = 1;
-  const int cellsE[5] = { 5, 6, 7, 8, 9 };
+  const int cellsE[7] = { 7, 8, 9, 10, 11, 12, 13 };
   const int spaceDim = 3;
 
   topology::Mesh mesh;
@@ -146,7 +150,7 @@
   cs.initialize();
   mesh.coordsys(&cs);
   MeshIOAscii iohandler;
-  iohandler.filename("data/hex8.mesh");
+  iohandler.filename(meshFilename);
   iohandler.read(&mesh);
 
   OutputSolnPoints output;
@@ -156,6 +160,8 @@
   const ALE::Obj<SieveMesh>& sievePointsMesh = pointsMesh.sieveMesh();
   CPPUNIT_ASSERT(!sievePointsMesh.isNull());
 
+  pointsMesh.view("POINTS MESH");
+
   // Check vertices
   const ALE::Obj<SieveMesh::label_sequence>& vertices = 
     sievePointsMesh->depthStratum(0);



More information about the CIG-COMMITS mailing list