[cig-commits] [commit] knepley/upgrade-petsc-interface: Fixed setting up Jacobian field for interpolated meshes. (469a389)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Nov 14 15:39:52 PST 2013


Repository : ssh://geoshell/pylith

On branch  : knepley/upgrade-petsc-interface
Link       : https://github.com/geodynamics/pylith/compare/03bb552c194562c46f162b594767dd78ecd2b624...469a38928082279d92e8dca12193bf4292e5c05c

>---------------------------------------------------------------

commit 469a38928082279d92e8dca12193bf4292e5c05c
Author: Brad Aagaard <baagaard at usgs.gov>
Date:   Thu Nov 14 15:42:32 2013 -0800

    Fixed setting up Jacobian field for interpolated meshes.


>---------------------------------------------------------------

469a38928082279d92e8dca12193bf4292e5c05c
 pylith/problems/Explicit.py | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/pylith/problems/Explicit.py b/pylith/problems/Explicit.py
index 114249f..cccb1e6 100644
--- a/pylith/problems/Explicit.py
+++ b/pylith/problems/Explicit.py
@@ -151,10 +151,22 @@ class Explicit(Formulation, ModuleExplicit):
       self._info.log("Creating lumped Jacobian matrix.")
     from pylith.topology.Field import Field
     jacobian = Field(self.mesh())
-    jacobian.newSection(jacobian.VERTICES_FIELD, dimension)
-    jacobian.allocate()
     jacobian.label("jacobian")
+
+    # Setup section manually. Cloning the solution field includes
+    # constraints which messes up the solve for constrained DOF.
+    pressureScale = normalizer.pressureScale()
+    jacobian.subfieldAdd("displacement", dimension, jacobian.VECTOR, lengthScale.value)
+    jacobian.subfieldAdd("lagrange_multiplier", dimension, jacobian.VECTOR, pressureScale.value)
+    jacobian.subfieldsSetup()
+    jacobian.setupSolnChart()
+    jacobian.setupSolnDof(dimension)
+    # Loop over integrators to adjust DOF layout
+    for integrator in self.integrators:
+      integrator.setupSolnDof(jacobian)
     jacobian.vectorFieldType(jacobian.VECTOR)
+    jacobian.allocate()
+    jacobian.zero()
     self.jacobian = jacobian
     self._debug.log(resourceUsageString())
 



More information about the CIG-COMMITS mailing list