[cig-commits] r22124 - short/3D/PyLith/trunk/libsrc/pylith/problems

knepley at geodynamics.org knepley at geodynamics.org
Tue May 21 16:08:51 PDT 2013


Author: knepley
Date: 2013-05-21 16:08:51 -0700 (Tue, 21 May 2013)
New Revision: 22124

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/problems/Solver.cc
Log:
Fixed DM handling in null space creation

Modified: short/3D/PyLith/trunk/libsrc/pylith/problems/Solver.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/problems/Solver.cc	2013-05-21 19:43:56 UTC (rev 22123)
+++ short/3D/PyLith/trunk/libsrc/pylith/problems/Solver.cc	2013-05-21 23:08:51 UTC (rev 22124)
@@ -153,7 +153,7 @@
 { // _createNullSpace
   PYLITH_METHOD_BEGIN;
 
-  PetscDM dmMesh = fields.mesh().dmMesh();assert(dmMesh);
+  PetscDM dmMesh = fields.solution().dmMesh();assert(dmMesh);
   PetscErrorCode err;
 
   const spatialdata::geocoords::CoordSys* cs = fields.mesh().coordsys();assert(cs);
@@ -232,6 +232,9 @@
   } // if
   
   PetscObject field = NULL;
+  PetscInt    numFields;
+  err = DMGetNumFields(dmMesh, &numFields);PYLITH_CHECK_ERROR(err);
+  if (!numFields) {err = DMSetNumFields(dmMesh, 1);PYLITH_CHECK_ERROR(err);}
   err = DMGetField(dmMesh, 0, &field);PYLITH_CHECK_ERROR(err);
   err = PetscObjectCompose(field, "nearnullspace", (PetscObject) nullsp);PYLITH_CHECK_ERROR(err);
   err = MatNullSpaceDestroy(&nullsp);PYLITH_CHECK_ERROR(err);



More information about the CIG-COMMITS mailing list