[cig-commits] r14460 - in short/3D/PyLith/trunk: . libsrc/faults libsrc/topology

knepley at geodynamics.org knepley at geodynamics.org
Wed Mar 25 17:03:30 PDT 2009


Author: knepley
Date: 2009-03-25 17:03:30 -0700 (Wed, 25 Mar 2009)
New Revision: 14460

Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
   short/3D/PyLith/trunk/libsrc/topology/FieldsManager.cc
Log:
Added checks for empty mesh corner cases


Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2009-03-25 23:58:33 UTC (rev 14459)
+++ short/3D/PyLith/trunk/TODO	2009-03-26 00:03:30 UTC (rev 14460)
@@ -35,10 +35,12 @@
 5. Power-law nonlinear rheology [Charles]
 
 6. Savage-Presscott benchmark [Charles]
+   2D viscoelastic models for plane strain
 
 7. Interface with PETSc nonlinear solvers [Brad and Matt]
 
 8. Modularize output? [Matt]
+   HDF5 output
 
 -- Release (v1.4) --
 

Modified: short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc	2009-03-25 23:58:33 UTC (rev 14459)
+++ short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc	2009-03-26 00:03:30 UTC (rev 14460)
@@ -893,7 +893,7 @@
   MPI_Scan((void *) &numFaces, (void *) &globalFaceOffset, 1, MPI_INT, MPI_SUM, sieve->comm());
   int face = globalSieveEnd + globalFaceOffset - numFaces;
 
-  ALE::ISieveVisitor::PointRetriever<sieve_type> cV(sieve->getMaxConeSize());
+  ALE::ISieveVisitor::PointRetriever<sieve_type> cV(std::max(sieve->getMaxConeSize(), 1));
 
   for(Mesh::label_sequence::iterator c_iter = cBegin; c_iter != cEnd; ++c_iter) {
     sieve->cone(*c_iter, cV);

Modified: short/3D/PyLith/trunk/libsrc/topology/FieldsManager.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/FieldsManager.cc	2009-03-25 23:58:33 UTC (rev 14459)
+++ short/3D/PyLith/trunk/libsrc/topology/FieldsManager.cc	2009-03-26 00:03:30 UTC (rev 14460)
@@ -99,11 +99,21 @@
   assert(!_real[name].isNull());
   if (0 == strcasecmp(points, "vertices")) {
     const ALE::Obj<Mesh::label_sequence>& vertices = _mesh->depthStratum(0);
-    _real[name]->setChart(real_section_type::chart_type(*std::min_element(vertices->begin(),vertices->end()),*std::max_element(vertices->begin(),vertices->end())+1));
+
+    if (vertices->size() > 0) {
+      _real[name]->setChart(real_section_type::chart_type(*std::min_element(vertices->begin(),vertices->end()),*std::max_element(vertices->begin(),vertices->end())+1));
+    } else {
+      _real[name]->setChart(real_section_type::chart_type(0,0));
+    }
     _real[name]->setFiberDimension(vertices, fiberDim);
   } else if (0 == strcasecmp(points, "cells")) {
     const ALE::Obj<Mesh::label_sequence>& cells = _mesh->heightStratum(0);
-    _real[name]->setChart(real_section_type::chart_type(*std::min_element(cells->begin(),cells->end()),*std::max_element(cells->begin(),cells->end())+1));
+
+    if (cells->size() > 0) {
+      _real[name]->setChart(real_section_type::chart_type(*std::min_element(cells->begin(),cells->end()),*std::max_element(cells->begin(),cells->end())+1));
+    } else {
+      _real[name]->setChart(real_section_type::chart_type(0,0));
+    }
     _real[name]->setFiberDimension(cells, fiberDim);
   } else {
     std::ostringstream msg;



More information about the CIG-COMMITS mailing list