[cig-commits] r19221 - short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/problems

brad at geodynamics.org brad at geodynamics.org
Mon Nov 21 09:50:42 PST 2011


Author: brad
Date: 2011-11-21 09:50:42 -0800 (Mon, 21 Nov 2011)
New Revision: 19221

Modified:
   short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/problems/Solver.cc
Log:
Fixed bug in setting up field split with fault. Name of fault field depends on the number of components in the solution (which depends on the spatial dimension).

Modified: short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/problems/Solver.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/problems/Solver.cc	2011-11-21 01:40:16 UTC (rev 19220)
+++ short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/problems/Solver.cc	2011-11-21 17:50:42 UTC (rev 19221)
@@ -210,7 +210,21 @@
 
     _ctx.pc = *pc;
     _ctx.A = jacobian.matrix();
-    _ctx.faultFieldName = "3";
+    switch (spaceDim) {
+    case 1 :
+      _ctx.faultFieldName = "1";
+      break;
+    case 2 :
+      _ctx.faultFieldName = "2";
+      break;
+    case 3 :
+      _ctx.faultFieldName = "3";
+      break;
+    default:
+      assert(0);
+      throw std::logic_error("Unknown space dimension in "
+			     "Problems::_setupFieldSplit().");
+    } // switch
     _ctx.faultA = _jacobianPCFault;
   } // if
 } // _setupFieldSplit



More information about the CIG-COMMITS mailing list