[cig-commits] r9349 - short/3D/PyLith/trunk/libsrc/materials

brad at geodynamics.org brad at geodynamics.org
Thu Feb 14 14:28:47 PST 2008


Author: brad
Date: 2008-02-14 14:28:47 -0800 (Thu, 14 Feb 2008)
New Revision: 9349

Modified:
   short/3D/PyLith/trunk/libsrc/materials/Material.cc
Log:
Fixed getting property sections for materials. Need to check to make sure section is not null AND size is okay.

Modified: short/3D/PyLith/trunk/libsrc/materials/Material.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.cc	2008-02-14 22:15:29 UTC (rev 9348)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.cc	2008-02-14 22:28:47 UTC (rev 9349)
@@ -197,9 +197,11 @@
   assert(!cells.isNull());
   const Mesh::label_sequence::iterator cellsEnd = cells->end();
   
+  const int totalFiberDim = numQuadPts * fiberDim;
+
   // Allocate buffer for property field.
-  if (field->isNull()) {
-    const int totalFiberDim = numQuadPts * fiberDim;
+  if (field->isNull() || 
+      totalFiberDim != (*field)->getFiberDimension(*cells->begin())) {
     *field = new real_section_type(mesh->comm(), mesh->debug());
     (*field)->setFiberDimension(cells, totalFiberDim);
     mesh->allocate(*field);



More information about the cig-commits mailing list