[cig-commits] r7782 - in short/3D/PyLith/trunk: libsrc/bc unittests/libtests/bc

willic3 at geodynamics.org willic3 at geodynamics.org
Tue Aug 7 14:45:20 PDT 2007


Author: willic3
Date: 2007-08-07 14:45:19 -0700 (Tue, 07 Aug 2007)
New Revision: 7782

Modified:
   short/3D/PyLith/trunk/libsrc/bc/Neumann.cc
   short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumann.cc
Log:
Fixed problem where I was mixing up the boundary mesh with the global
mesh.  Things are now blowing up where I compare the global load
vector.



Modified: short/3D/PyLith/trunk/libsrc/bc/Neumann.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/Neumann.cc	2007-08-07 15:48:24 UTC (rev 7781)
+++ short/3D/PyLith/trunk/libsrc/bc/Neumann.cc	2007-08-07 21:45:19 UTC (rev 7782)
@@ -94,7 +94,7 @@
   for (Mesh::label_sequence::iterator c_iter=cellsBegin;
        c_iter != cellsEnd;
        ++c_iter) {
-    const int cellNumCorners = sieve->nCone(*c_iter, mesh->depth())->size();
+    const int cellNumCorners = sieve->nCone(*c_iter, _boundaryMesh->depth()-1)->size();
     if (numCorners != cellNumCorners) {
       std::ostringstream msg;
       msg << "Quadrature is incompatible with cell for Neumann traction "
@@ -129,7 +129,7 @@
   // Get mesh coordinates.
   const ALE::Obj<real_section_type>& coordinates =
     mesh->getRealSection("coordinates");
-  coordinates->view("Mesh coordinates from Neumann::initialize");
+  // coordinates->view("Mesh coordinates from Neumann::initialize");
 
   // open database with traction information
   // NEED TO SET NAMES BASED ON DIMENSION OF BOUNDARY
@@ -175,20 +175,19 @@
   for(Mesh::label_sequence::iterator c_iter = cellsBegin;
       c_iter != cellsEnd;
       ++c_iter) {
-    std::cout << "c_iter:  " << *c_iter << std::endl;
+    // std::cout << "c_iter:  " << *c_iter << std::endl;
     _quadrature->computeGeometry(_boundaryMesh, coordinates, *c_iter);
     const double_array& quadPts = _quadrature->quadPts();
-    const real_section_type::value_type* cellVert = mesh->restrict(coordinates, *c_iter);
-    // For some reason this method doesn' work.  I need to find out why.
-    // mesh->restrict(coordinates, *c_iter, &cellVertices[0], cellVertices.size());
+    _boundaryMesh->restrict(coordinates, *c_iter, &cellVertices[0], cellVertices.size());
+    /* Debugging stuff
     std::cout << "cellVertices:  " << std::endl;
     for(int iTest = 0; iTest < numBasis; ++iTest) {
       for(int iDim = 0; iDim < spaceDim; ++iDim) {
-	cellVertices[iDim+spaceDim*iTest] = cellVert[iDim+spaceDim*iTest];
 	std::cout << "  " << cellVertices[iDim+spaceDim*iTest];
       } // for
       std::cout << std::endl;
     } // for
+    */
 
     for(int iQuad = 0, iRef=0, iSpace=0; iQuad < numQuadPts; ++iQuad, iRef+=cellDim, iSpace+=spaceDim) {
       // Get traction vector in local coordinate system at quadrature point
@@ -232,7 +231,7 @@
     } // for
 
       // Update tractionGlobal
-      mesh->update(_tractionGlobal, *c_iter, &cellTractionsGlobal[0]);
+      _boundaryMesh->update(_tractionGlobal, *c_iter, &cellTractionsGlobal[0]);
   } // for
 
   _db->close();

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumann.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumann.cc	2007-08-07 15:48:24 UTC (rev 7781)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumann.cc	2007-08-07 21:45:19 UTC (rev 7782)
@@ -84,14 +84,15 @@
   for(Mesh::label_sequence::iterator c_iter = cells->begin();
       c_iter != cells->end();
       ++c_iter) {
-    const int numCorners = sieve->nCone(*c_iter, mesh->depth())->size();
+    const int numCorners = sieve->nCone(*c_iter, bc._boundaryMesh->depth()-1)->size();
     CPPUNIT_ASSERT_EQUAL(_data->numCorners[iCell++], numCorners);
-    const real_section_type::value_type* cellVert = mesh->restrict(coordinates, *c_iter);
+    bc._boundaryMesh->restrict(coordinates, *c_iter, &cellVertices[0], cellVertices.size());
     std::cout << "c_iter " << *c_iter << " vertex coords:" << std::endl;
     for(int iVert = 0; iVert < numCorners; ++iVert) {
       for(int iDim = 0; iDim < spaceDim; ++iDim) {
-	cellVertices[iDim+spaceDim*iVert] = cellVert[iDim+spaceDim*iVert];
         std::cout << "  " << cellVertices[iDim+spaceDim*iVert];
+	// Need to get vertex info and put it in data, then put in a
+	// CPPUNIT_ASSERT_DOUBLES_EQUAL
       } // for
     std::cout << std::endl;
     } // for



More information about the cig-commits mailing list