[cig-commits] r14682 - in short/3D/PyLith/branches/pylith-swig: libsrc/feassemble tests/1d/line2

brad at geodynamics.org brad at geodynamics.org
Mon Apr 13 15:56:41 PDT 2009


Author: brad
Date: 2009-04-13 15:56:41 -0700 (Mon, 13 Apr 2009)
New Revision: 14682

Modified:
   short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/IntegratorElasticity.cc
   short/3D/PyLith/branches/pylith-swig/tests/1d/line2/TestAxial.py
Log:
Improved debugging info.

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/IntegratorElasticity.cc	2009-04-13 22:51:40 UTC (rev 14681)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/IntegratorElasticity.cc	2009-04-13 22:56:41 UTC (rev 14682)
@@ -302,12 +302,14 @@
     assert(0 != fields);
     _allocateTensorField(mesh);
     _calcStrainStressField(_bufferFieldTensor, name, fields);
+    _bufferFieldTensor->label(name);
     return *_bufferFieldTensor;
   } else if (0 == strcasecmp(name, "stress")) {
     assert(0 != fields);
     _allocateTensorField(mesh);
     _material->getField(_bufferFieldTensor, "total_strain");
     _calcStressFromStrain(_bufferFieldTensor);
+    _bufferFieldTensor->label(name);
     return *_bufferFieldTensor;
   } else {
     if (0 == _bufferFieldOther)
@@ -345,9 +347,9 @@
   if (0 == _bufferFieldTensor) {
     _bufferFieldTensor = new topology::Field<topology::Mesh>(mesh);
     assert(0 != _bufferFieldTensor);
-    _bufferFieldTensor->vectorFieldType(topology::FieldBase::MULTI_TENSOR);
     _bufferFieldTensor->newSection(cells, numQuadPts*tensorSize);
     _bufferFieldTensor->allocate();
+    _bufferFieldTensor->vectorFieldType(topology::FieldBase::MULTI_TENSOR);
   } // if
 } // _allocateTensorField
 

Modified: short/3D/PyLith/branches/pylith-swig/tests/1d/line2/TestAxial.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/tests/1d/line2/TestAxial.py	2009-04-13 22:51:40 UTC (rev 14681)
+++ short/3D/PyLith/branches/pylith-swig/tests/1d/line2/TestAxial.py	2009-04-13 22:56:41 UTC (rev 14682)
@@ -91,6 +91,7 @@
     diff = numpy.abs(1.0 - data['cell_fields']['mu']/muE)
     okay = diff < tolerance
     if numpy.sum(okay) != ncells:
+      print "Expected Lame's constant mu: ",muE
       print "Lame's constant mu: ",data['cell_fields']['mu']
       self.assertEqual(ncells, numpy.sum(okay))    
 
@@ -99,6 +100,7 @@
     diff = numpy.abs(1.0 - data['cell_fields']['lambda']/lambdaE)
     okay = diff < tolerance
     if numpy.sum(okay) != ncells:
+      print "Expected Lame's constant lambda: ",lambdaE
       print "Lame's constant lambda: ",data['cell_fields']['lambda']
       self.assertEqual(ncells, numpy.sum(okay))    
 
@@ -106,6 +108,7 @@
     diff = numpy.abs(1.0 - data['cell_fields']['density']/densityE)
     okay = diff < tolerance
     if numpy.sum(okay) != ncells:
+      print "Expected density: ",densityE
       print "Density: ",data['cell_fields']['density']
       self.assertEqual(ncells, numpy.sum(okay))    
     return



More information about the CIG-COMMITS mailing list