[cig-commits] r11988 - in short/3D/PyLith/trunk/libsrc: feassemble materials meshio

knepley at geodynamics.org knepley at geodynamics.org
Tue May 20 08:01:36 PDT 2008


Author: knepley
Date: 2008-05-20 08:01:36 -0700 (Tue, 20 May 2008)
New Revision: 11988

Modified:
   short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc
   short/3D/PyLith/trunk/libsrc/materials/Material.cc
   short/3D/PyLith/trunk/libsrc/meshio/CellFilterAvg.cc
Log:
Fix for chart sizes


Modified: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc	2008-05-20 14:40:53 UTC (rev 11987)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc	2008-05-20 15:01:36 UTC (rev 11988)
@@ -327,7 +327,8 @@
   if (field->isNull() || 
       totalFiberDim != (*field)->getFiberDimension(*cells->begin())) {
     *field = new real_section_type(mesh->comm(), mesh->debug());
-    (*field)->setChart(real_section_type::chart_type(0, cells->size()));
+    (*field)->setChart(real_section_type::chart_type(*std::min_element(cells->begin(), cells->end()),
+                                                     *std::max_element(cells->begin(), cells->end())+1));
     (*field)->setFiberDimension(cells, totalFiberDim);
     mesh->allocate(*field);
   } // if
@@ -400,7 +401,8 @@
   if (field->isNull()) {
     const int fiberDim = numQuadPts * tensorSize;
     *field = new real_section_type(mesh->comm(), mesh->debug());
-    (*field)->setChart(real_section_type::chart_type(0, cells->size()));
+    (*field)->setChart(real_section_type::chart_type(*std::min_element(cells->begin(), cells->end()),
+                                                     *std::max_element(cells->begin(), cells->end())+1));
     (*field)->setFiberDimension(cells, fiberDim);
     mesh->allocate(*field);
   } // if

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc	2008-05-20 14:40:53 UTC (rev 11987)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc	2008-05-20 15:01:36 UTC (rev 11988)
@@ -279,7 +279,8 @@
   if (_precomputed) return;
   const Mesh::label_sequence::iterator end = cells->end();
 
-  _quadPtsPre->setChart(real_section_type::chart_type(0, cells->size()));
+  _quadPtsPre->setChart(real_section_type::chart_type(*std::min_element(cells->begin(), cells->end()),
+                                                      *std::max_element(cells->begin(), cells->end())+1));
   _quadPtsPre->setFiberDimension(cells, _numQuadPts*_spaceDim);
   _quadPtsPre->allocatePoint();
   _jacobianPre->getAtlas()->setAtlas(_quadPtsPre->getAtlas()->getAtlas());

Modified: short/3D/PyLith/trunk/libsrc/materials/Material.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.cc	2008-05-20 14:40:53 UTC (rev 11987)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.cc	2008-05-20 15:01:36 UTC (rev 11988)
@@ -81,7 +81,8 @@
   // Create sections to hold physical properties and state variables.
   _properties = new real_section_type(mesh->comm(), mesh->debug());
   assert(!_properties.isNull());
-  _properties->setChart(real_section_type::chart_type(0, cells->size()));
+  _properties->setChart(real_section_type::chart_type(*std::min_element(cells->begin(), cells->end()),
+                                                      *std::max_element(cells->begin(), cells->end())+1));
 
   const int numQuadPts = quadrature->numQuadPts();
   const int spaceDim = quadrature->spaceDim();
@@ -206,7 +207,8 @@
   if (field->isNull() || 
       totalFiberDim != (*field)->getFiberDimension(*cells->begin())) {
     *field = new real_section_type(mesh->comm(), mesh->debug());
-    (*field)->setChart(real_section_type::chart_type(0, cells->size()));
+    (*field)->setChart(real_section_type::chart_type(*std::min_element(cells->begin(), cells->end()),
+                                                     *std::max_element(cells->begin(), cells->end())+1));
     (*field)->setFiberDimension(cells, totalFiberDim);
     mesh->allocate(*field);
   } // if

Modified: short/3D/PyLith/trunk/libsrc/meshio/CellFilterAvg.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/CellFilterAvg.cc	2008-05-20 14:40:53 UTC (rev 11987)
+++ short/3D/PyLith/trunk/libsrc/meshio/CellFilterAvg.cc	2008-05-20 15:01:36 UTC (rev 11988)
@@ -76,7 +76,8 @@
   if (_fieldAvg.isNull() ||
       fiberDim != _fieldAvg->getFiberDimension(*cells->begin())) {
     _fieldAvg = new real_section_type(mesh->comm(), mesh->debug());
-    _fieldAvg->setChart(real_section_type::chart_type(0,cells->size()));
+    _fieldAvg->setChart(real_section_type::chart_type(*std::min_element(cells->begin(), cells->end()),
+                                                      *std::max_element(cells->begin(), cells->end())+1));
     _fieldAvg->setFiberDimension(cells, fiberDim);
     mesh->allocate(_fieldAvg);
   } // if



More information about the cig-commits mailing list