[cig-commits] [commit] knepley/upgrade-petsc-interface: Fixed some subfield setup errors in Python unit tests. (9a0a280)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri Jan 24 12:34:26 PST 2014


Repository : ssh://geoshell/pylith

On branch  : knepley/upgrade-petsc-interface
Link       : https://github.com/geodynamics/pylith/compare/edfb2b64844b53495d10786111ea7ed92696de4a...9a0a28045ef49182f2589a1d386880379bc55ab7

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

commit 9a0a28045ef49182f2589a1d386880379bc55ab7
Author: Brad Aagaard <baagaard at usgs.gov>
Date:   Fri Jan 24 12:34:22 2014 -0800

    Fixed some subfield setup errors in Python unit tests.


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

9a0a28045ef49182f2589a1d386880379bc55ab7
 unittests/pytests/feassemble/TestElasticityExplicit.py       | 12 +++++++++---
 .../pytests/feassemble/TestElasticityExplicitLgDeform.py     | 12 +++++++++---
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/unittests/pytests/feassemble/TestElasticityExplicit.py b/unittests/pytests/feassemble/TestElasticityExplicit.py
index 2fcdbbf..170292c 100644
--- a/unittests/pytests/feassemble/TestElasticityExplicit.py
+++ b/unittests/pytests/feassemble/TestElasticityExplicit.py
@@ -193,9 +193,15 @@ class TestElasticityExplicit(unittest.TestCase):
 
     from pylith.topology.Field import Field
     jacobian = Field(mesh)
-    jacobian.newSection(jacobian.VERTICES_FIELD, mesh.coordsys().spaceDim())
-    jacobian.allocate()
-    jacobian.zero()
+    spaceDim = mesh.coordsys().spaceDim()
+    jacobian.subfieldAdd("displacement", spaceDim, jacobian.VECTOR);
+    jacobian.subfieldAdd("lagrange_multiplier", spaceDim, jacobian.VECTOR);
+
+    jacobian.subfieldsSetup();
+    jacobian.setupSolnChart();
+    jacobian.setupSolnDof(spaceDim);
+    jacobian.allocate();
+    jacobian.zeroAll();
 
     t = 7.3
     self.assertEqual(True, integrator.needNewJacobian())
diff --git a/unittests/pytests/feassemble/TestElasticityExplicitLgDeform.py b/unittests/pytests/feassemble/TestElasticityExplicitLgDeform.py
index 7a61b33..5a292ec 100644
--- a/unittests/pytests/feassemble/TestElasticityExplicitLgDeform.py
+++ b/unittests/pytests/feassemble/TestElasticityExplicitLgDeform.py
@@ -187,9 +187,15 @@ class TestElasticityExplicitLgDeform(unittest.TestCase):
 
     from pylith.topology.Field import Field
     jacobian = Field(mesh)
-    jacobian.newSection(jacobian.VERTICES_FIELD, mesh.coordsys().spaceDim())
-    jacobian.allocate()
-    jacobian.zero()
+    spaceDim = mesh.coordsys().spaceDim()
+    jacobian.subfieldAdd("displacement", spaceDim, jacobian.VECTOR);
+    jacobian.subfieldAdd("lagrange_multiplier", spaceDim, jacobian.VECTOR);
+
+    jacobian.subfieldsSetup();
+    jacobian.setupSolnChart();
+    jacobian.setupSolnDof(spaceDim);
+    jacobian.allocate();
+    jacobian.zeroAll();
 
     t = 7.3
     self.assertEqual(True, integrator.needNewJacobian())



More information about the CIG-COMMITS mailing list