[cig-commits] r15541 - in short/3D/PyLith/trunk: . libsrc/faults libsrc/meshio modulesrc/utils pylith/topology

knepley at geodynamics.org knepley at geodynamics.org
Wed Aug 12 20:25:56 PDT 2009


Author: knepley
Date: 2009-08-12 20:25:55 -0700 (Wed, 12 Aug 2009)
New Revision: 15541

Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc
   short/3D/PyLith/trunk/libsrc/meshio/CellFilterAvg.cc
   short/3D/PyLith/trunk/libsrc/meshio/MeshBuilder.cc
   short/3D/PyLith/trunk/modulesrc/utils/petsc_memory.i
   short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py
Log:
Changes to fix UCD faults


Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2009-08-13 02:27:16 UTC (rev 15540)
+++ short/3D/PyLith/trunk/TODO	2009-08-13 03:25:55 UTC (rev 15541)
@@ -48,6 +48,8 @@
       problems C++, SWIG
       topology C++, SWIG
 
+Student
+      Create a spatial database for the PREM model
 
 1. Savage-Presscott benchmark
     Tet mesh

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc	2009-08-13 02:27:16 UTC (rev 15540)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc	2009-08-13 03:25:55 UTC (rev 15541)
@@ -86,6 +86,13 @@
     meshio::UCDFaultFile::read(_faultMeshFilename.c_str(),
 			       &faultMesh, faultBoundary, *mesh);
 
+    // TODO: This is a kludge. We need to make UCD faults report their size
+    const int numFaultVertices = faultMesh.sieveMesh()->depthStratum(0)->size();
+    *firstFaultCell += numFaultVertices;
+    if (useLagrangeConstraints()) {
+      *firstFaultCell += numFaultVertices;
+    }
+
     // Set coordinates in fault mesh
     const ALE::Obj<topology::SubMesh::SieveMesh>& faultSieveMesh = 
       faultMesh.sieveMesh();

Modified: short/3D/PyLith/trunk/libsrc/meshio/CellFilterAvg.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/CellFilterAvg.cc	2009-08-13 02:27:16 UTC (rev 15540)
+++ short/3D/PyLith/trunk/libsrc/meshio/CellFilterAvg.cc	2009-08-13 03:25:55 UTC (rev 15541)
@@ -118,7 +118,7 @@
     _fieldAvg->newSection(fieldIn, fiberDim);
     _fieldAvg->allocate();
   } else if (_fieldAvg->sectionSize() != cells->size()*fiberDim) {
-#if 0 // :BUG: Avoid memory leak in section->clear()
+#if 1 // :BUG: Avoid memory leak in section->clear()
     _fieldAvg->clear();
 #else
     delete _fieldAvg; _fieldAvg = new field_type(fieldIn.mesh());

Modified: short/3D/PyLith/trunk/libsrc/meshio/MeshBuilder.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/MeshBuilder.cc	2009-08-13 02:27:16 UTC (rev 15540)
+++ short/3D/PyLith/trunk/libsrc/meshio/MeshBuilder.cc	2009-08-13 03:25:55 UTC (rev 15541)
@@ -231,7 +231,7 @@
 						0,
 						fault->getArrowSection("orientation"),
 						firstCell);
-    
+
     // Add in cells
     for(int c = 0; c < numCells; ++c) {
       s->addArrow(c+firstCell, faceCells[c*2+0]);

Modified: short/3D/PyLith/trunk/modulesrc/utils/petsc_memory.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/utils/petsc_memory.i	2009-08-13 02:27:16 UTC (rev 15540)
+++ short/3D/PyLith/trunk/modulesrc/utils/petsc_memory.i	2009-08-13 03:25:55 UTC (rev 15541)
@@ -39,6 +39,7 @@
     int getAllocationTotal(const char *stage);
     int getDeallocationTotal();
     int getDeallocationTotal(const char *stage);
+    void show();
   };
 }
 

Modified: short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py
===================================================================
--- short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py	2009-08-13 02:27:16 UTC (rev 15540)
+++ short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py	2009-08-13 03:25:55 UTC (rev 15541)
@@ -99,7 +99,7 @@
         if interface.useLagrangeConstraints():
           firstFaultCell += interface.faultSize(mesh)
       for interface in interfaces:
-        self._info.log("Adjusting topology for fault '%s'." % interface.label)
+        self._info.log("Adjusting topology for fault '%s' of size %d." % (interface.label, interface.faultSize(mesh)))
         firstFaultVertex, firstFaultCell = interface.adjustTopology(mesh, firstFaultVertex, firstFaultCell)
 
     self._eventLogger.eventEnd(logEvent)



More information about the CIG-COMMITS mailing list