[cig-commits] r20904 - short/3D/PyLith/trunk/libsrc/pylith/feassemble

brad at geodynamics.org brad at geodynamics.org
Wed Oct 24 09:33:55 PDT 2012


Author: brad
Date: 2012-10-24 09:33:54 -0700 (Wed, 24 Oct 2012)
New Revision: 20904

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc
Log:
Fixed bug in setting values in new section in IntegratorElasticity (ADD_VALUES -> INSERT_VALUES).

Modified: short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc	2012-10-24 15:48:52 UTC (rev 20903)
+++ short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc	2012-10-24 16:33:54 UTC (rev 20904)
@@ -331,8 +331,7 @@
       // total strain is available as a state variable
       assert(0 != fields);
       _allocateTensorField(mesh);
-      topology::Field<topology::Mesh>& buffer = 
-        _outputFields->get("buffer (tensor)");    
+      topology::Field<topology::Mesh>& buffer = _outputFields->get("buffer (tensor)");    
       _material->getField(&buffer, "total_strain");
       buffer.addDimensionOkay(true);
       return buffer;
@@ -340,8 +339,7 @@
     } else { // must calculate total strain
       assert(0 != fields);
       _allocateTensorField(mesh);
-      topology::Field<topology::Mesh>& buffer = 
-        _outputFields->get("buffer (tensor)");
+      topology::Field<topology::Mesh>& buffer = _outputFields->get("buffer (tensor)");
       buffer.label("total_strain");
       buffer.scale(1.0);
       buffer.addDimensionOkay(true);
@@ -355,8 +353,7 @@
       // stress is available as a state variable
       assert(0 != fields);
       _allocateTensorField(mesh);
-      topology::Field<topology::Mesh>& buffer = 
-        _outputFields->get("buffer (tensor)");    
+      topology::Field<topology::Mesh>& buffer = _outputFields->get("buffer (tensor)");    
       _material->getField(&buffer, "stress");
       buffer.addDimensionOkay(true);
       return buffer;
@@ -606,11 +603,11 @@
     calcTotalStrainFn(&strainCell, basisDeriv, dispTCell, numBasis, numQuadPts);
     
     if (!calcStress) {
-      err = DMComplexVecSetClosure(dmMesh, fieldSection, fieldVec, cell, &strainCell[0], ADD_VALUES);CHECK_PETSC_ERROR(err);
+      err = DMComplexVecSetClosure(dmMesh, fieldSection, fieldVec, cell, &strainCell[0], INSERT_VALUES);CHECK_PETSC_ERROR(err);
     } else {
       _material->retrievePropsAndVars(cell);
       stressCell = _material->calcStress(strainCell);
-      err = DMComplexVecSetClosure(dmMesh, fieldSection, fieldVec, cell, &stressCell[0], ADD_VALUES);CHECK_PETSC_ERROR(err);
+      err = DMComplexVecSetClosure(dmMesh, fieldSection, fieldVec, cell, &stressCell[0], INSERT_VALUES);CHECK_PETSC_ERROR(err);
     } // else
   } // for
   err = ISRestoreIndices(cellIS, &cells);CHECK_PETSC_ERROR(err);
@@ -667,7 +664,7 @@
 
     _material->retrievePropsAndVars(cell);
     stressCell = _material->calcStress(strainCell);
-    err = DMComplexVecSetClosure(dmMesh, fieldSection, PETSC_NULL, cell, &stressCell[0], ADD_VALUES);CHECK_PETSC_ERROR(err);
+    err = DMComplexVecSetClosure(dmMesh, fieldSection, PETSC_NULL, cell, &stressCell[0], INSERT_VALUES);CHECK_PETSC_ERROR(err);
   } // for
   err = ISRestoreIndices(cellIS, &cells);CHECK_PETSC_ERROR(err);
   err = ISDestroy(&cellIS);CHECK_PETSC_ERROR(err);



More information about the CIG-COMMITS mailing list