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

knepley at geodynamics.org knepley at geodynamics.org
Sat Sep 15 22:19:58 PDT 2012


Author: knepley
Date: 2012-09-15 22:19:58 -0700 (Sat, 15 Sep 2012)
New Revision: 20716

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc
Log:
Put in local vector

Modified: short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc	2012-09-16 05:00:17 UTC (rev 20715)
+++ short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc	2012-09-16 05:19:58 UTC (rev 20716)
@@ -568,7 +568,8 @@
 #endif
 
   PetscSection fieldSection = field->petscSection();
-  assert(fieldSection);
+  Vec          fieldVec     = field->localVector();
+  assert(fieldSection);assert(fieldVec);
 
   // Loop over cells
   for(PetscInt c = 0; c < numCells; ++c) {
@@ -599,11 +600,11 @@
     calcTotalStrainFn(&strainCell, basisDeriv, dispTCell, numBasis, numQuadPts);
     
     if (!calcStress) {
-      err = DMComplexVecSetClosure(dmMesh, fieldSection, PETSC_NULL, cell, &strainCell[0], ADD_VALUES);CHECK_PETSC_ERROR(err);
+      err = DMComplexVecSetClosure(dmMesh, fieldSection, fieldVec, cell, &strainCell[0], ADD_VALUES);CHECK_PETSC_ERROR(err);
     } else {
       _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, fieldVec, cell, &stressCell[0], ADD_VALUES);CHECK_PETSC_ERROR(err);
     } // else
   } // for
   err = ISRestoreIndices(cellIS, &cells);CHECK_PETSC_ERROR(err);



More information about the CIG-COMMITS mailing list