[cig-commits] r14807 - short/3D/PyLith/branches/pylith-swig/libsrc/faults

brad at geodynamics.org brad at geodynamics.org
Mon Apr 27 17:25:24 PDT 2009


Author: brad
Date: 2009-04-27 17:25:23 -0700 (Mon, 27 Apr 2009)
New Revision: 14807

Modified:
   short/3D/PyLith/branches/pylith-swig/libsrc/faults/CohesiveTopology.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/faults/FaultCohesiveKin.cc
Log:
Fixed some bugs in the fault implementation.

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/faults/CohesiveTopology.cc	2009-04-27 22:58:21 UTC (rev 14806)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/faults/CohesiveTopology.cc	2009-04-28 00:25:23 UTC (rev 14807)
@@ -642,7 +642,6 @@
   const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
   assert(!sieveMesh.isNull());
   ALE::Obj<SieveSubMesh>& faultSieveMesh = faultMesh->sieveMesh();
-  faultSieveMesh.destroy();
 
   const ALE::Obj<SieveMesh::sieve_type>& sieve = sieveMesh->getSieve();
   assert(!sieve.isNull());
@@ -710,6 +709,8 @@
   // Convert fault to an IMesh
   SieveSubMesh::renumbering_type& fRenumbering =
     faultSieveMesh->getRenumbering();
+  const SieveSubMesh::renumbering_type::const_iterator fRenumberingEnd = 
+    fRenumbering.end();
   faultSieveMesh->setSieve(ifaultSieve);
   //ALE::ISieveConverter::convertMesh(*fault, *faultSieveMesh, fRenumbering, true);
   {
@@ -735,10 +736,6 @@
       ++c_iter, ++f_iter)
     (*cohesiveToFault)[*c_iter] = *f_iter;
     
-#if 0
-  faultSieveMesh->setRealSection("coordinates", 
-				 sieveMesh->getRealSection("coordinates"));
-#else
   const ALE::Obj<topology::Mesh::RealSection>& coordinates =
     sieveMesh->getRealSection("coordinates");
   assert(!coordinates.isNull());
@@ -755,7 +752,7 @@
   for (SieveMesh::label_sequence::iterator v_iter = vBegin;
       v_iter != vEnd;
       ++v_iter) {
-    if (fRenumbering.find(*v_iter) == fRenumbering.end())
+    if (fRenumbering.find(*v_iter) == fRenumberingEnd)
       continue;
     fCoordinates->setFiberDimension(fRenumbering[*v_iter],
 				    coordinates->getFiberDimension(*v_iter));
@@ -764,11 +761,11 @@
   for(SieveMesh::label_sequence::iterator v_iter = vBegin;
       v_iter != vEnd;
       ++v_iter) {
-    if (fRenumbering.find(*v_iter) == fRenumbering.end()) continue;
+    if (fRenumbering.find(*v_iter) == fRenumberingEnd)
+      continue;
     fCoordinates->updatePoint(fRenumbering[*v_iter], 
 			      coordinates->restrictPoint(*v_iter));
   }
-#endif
   //faultSieveMesh->view("Parallel fault mesh");
 
   // Create the parallel overlap
@@ -799,7 +796,7 @@
   faultSieveMesh->setCalculatedOverlap(true);
   //sendParallelMeshOverlap->view("Send parallel fault overlap");
   //recvParallelMeshOverlap->view("Recv parallel fault overlap");
-}
+} // createFaultParallel
 
 
 // End of file

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/faults/FaultCohesiveKin.cc	2009-04-27 22:58:21 UTC (rev 14806)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/faults/FaultCohesiveKin.cc	2009-04-28 00:25:23 UTC (rev 14807)
@@ -93,9 +93,13 @@
   delete _faultMesh; _faultMesh = new topology::SubMesh();
   CohesiveTopology::createFaultParallel(_faultMesh, &_cohesiveToFault, 
 					mesh, id(), _useLagrangeConstraints());
-  //_faultMesh->getLabel("height")->view("Fault mesh height");
-  //_faultMesh->view("FAULT MESH");
 
+  { // TEMPORARY
+  const ALE::Obj<SieveSubMesh>& faultSieveMesh = _faultMesh->sieveMesh();
+  faultSieveMesh->getLabel("height")->view("Fault mesh height");
+  faultSieveMesh->view("FAULT MESH");
+  } // TEMPORARY
+
   delete _fields; 
   _fields = new topology::Fields<topology::Field<topology::SubMesh> >(*_faultMesh);
 
@@ -110,6 +114,7 @@
 
   // Allocate slip field
   const ALE::Obj<SieveSubMesh>& faultSieveMesh = _faultMesh->sieveMesh();
+  assert(!faultSieveMesh.isNull());
   const ALE::Obj<SieveSubMesh::label_sequence>& vertices =
     faultSieveMesh->depthStratum(0);
   assert(!vertices.isNull());
@@ -128,6 +133,13 @@
   // of Jacobian matrix
   _calcConditioning(cs, matDB);
 
+  const ALE::Obj<SieveSubMesh::label_sequence>& cells = 
+    faultSieveMesh->heightStratum(0);
+  assert(!cells.isNull());
+  const SieveSubMesh::label_sequence::iterator cellsBegin = cells->begin();
+  const SieveSubMesh::label_sequence::iterator cellsEnd = cells->end();
+  _quadrature->computeGeometry(*_faultMesh, cells);
+
   // Compute orientation at vertices in fault mesh.
   _calcOrientation(upDir, normalDir);
 
@@ -808,7 +820,7 @@
   
   // Get fault cells (1 dimension lower than top-level cells)
   const ALE::Obj<SieveSubMesh::label_sequence>& cells = 
-    faultSieveMesh->heightStratum(1);
+    faultSieveMesh->heightStratum(0);
   assert(!cells.isNull());
   const SieveSubMesh::label_sequence::iterator cellsBegin = cells->begin();
   const SieveSubMesh::label_sequence::iterator cellsEnd = cells->end();
@@ -1062,15 +1074,12 @@
   double_array areaCell(numBasis);
   double_array verticesCell(numBasis*spaceDim);
 
-  // Get fault cells (1 dimension lower than top-level cells)
   const ALE::Obj<SieveSubMesh::label_sequence>& cells = 
-    faultSieveMesh->heightStratum(1);
+    faultSieveMesh->heightStratum(0);
   assert(!cells.isNull());
   const SieveSubMesh::label_sequence::iterator cellsBegin = cells->begin();
   const SieveSubMesh::label_sequence::iterator cellsEnd = cells->end();
 
-  _quadrature->computeGeometry(*_faultMesh, cells);
-
   // Loop over cells in fault mesh, compute area
   for(SieveSubMesh::label_sequence::iterator c_iter = cellsBegin;
       c_iter != cellsEnd;
@@ -1098,10 +1107,10 @@
   // Assemble area information
   area.complete();
 
-#if 0 // DEBUGGING
+#if 1 // DEBUGGING
   area.view("AREA");
-  _faultMesh->getSendOverlap()->view("Send fault overlap");
-  _faultMesh->getRecvOverlap()->view("Receive fault overlap");
+  //_faultMesh->getSendOverlap()->view("Send fault overlap");
+  //_faultMesh->getRecvOverlap()->view("Receive fault overlap");
 #endif
 } // _calcArea
 



More information about the CIG-COMMITS mailing list