[cig-commits] r7175 - in short/3D/PyLith/trunk: . libsrc/faults pylith/problems unittests/libtests/faults unittests/pytests/faults

brad at geodynamics.org brad at geodynamics.org
Tue Jun 12 15:36:44 PDT 2007


Author: brad
Date: 2007-06-12 15:36:44 -0700 (Tue, 12 Jun 2007)
New Revision: 7175

Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
   short/3D/PyLith/trunk/pylith/problems/Explicit.py
   short/3D/PyLith/trunk/pylith/problems/Formulation.py
   short/3D/PyLith/trunk/pylith/problems/Implicit.py
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
   short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveKin.py
Log:
Updated integrators to use solution field access from FieldsManager (permits access independent of name of actual fields).

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2007-06-12 22:09:39 UTC (rev 7174)
+++ short/3D/PyLith/trunk/TODO	2007-06-12 22:36:44 UTC (rev 7175)
@@ -2,6 +2,10 @@
 MAIN PRIORITIES (Brad)
 ======================================================================
 
+tests/1d/line2
+
+  dislocation.cfg
+
 solutioniovtk
 
   need to write each time step to a different file.

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc	2007-06-12 22:09:39 UTC (rev 7174)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc	2007-06-12 22:36:44 UTC (rev 7175)
@@ -253,7 +253,7 @@
     cellsCohesive->end();
 
   // Get section information
-  const ALE::Obj<real_section_type>& disp = fields->getHistoryItem(1);
+  const ALE::Obj<real_section_type>& disp = fields->getSolution();
   assert(!disp.isNull());  
   
   // Allocate vector for cell values
@@ -318,7 +318,7 @@
     cellsCohesive->end();
 
   // Get section information
-  const ALE::Obj<real_section_type>& disp = fields->getHistoryItem(1);
+  const ALE::Obj<real_section_type>& disp = fields->getSolution();
   assert(!disp.isNull());  
 
   const int spaceDim = _quadrature->spaceDim();

Modified: short/3D/PyLith/trunk/pylith/problems/Explicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Explicit.py	2007-06-12 22:09:39 UTC (rev 7174)
+++ short/3D/PyLith/trunk/pylith/problems/Explicit.py	2007-06-12 22:36:44 UTC (rev 7175)
@@ -66,14 +66,7 @@
     Formulation.initialize(self, mesh, materials, boundaryConditions,
                            interfaceConditions, dimension, dt)
 
-    self._info.log("Creating fields and matrices.")
-    self.fields.addReal("dispT")
-    self.fields.setFiberDimension("dispT", dimension)
-    for constraint in self.constraints:
-      constraint.setConstraintSizes(self.fields.getReal("dispT"), mesh)
-    self.fields.allocate("dispT")
-    for constraint in self.constraints:
-      constraint.setConstraints(self.fields.getReal("dispT"), mesh)    
+    self._info.log("Creating other fields and matrices.")
     self.fields.addReal("dispTmdt")
     self.fields.addReal("dispTpdt")
     self.fields.addReal("residual")

Modified: short/3D/PyLith/trunk/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Formulation.py	2007-06-12 22:09:39 UTC (rev 7174)
+++ short/3D/PyLith/trunk/pylith/problems/Formulation.py	2007-06-12 22:36:44 UTC (rev 7175)
@@ -130,6 +130,17 @@
     for output in self.output.bin:
       output.open(mesh)
       output.writeTopology()
+
+    self._info.log("Creating solution field.")
+    solnName = self.solnField['name']
+    self.fields.addReal(solnName)
+    self.fields.solutionField(solnName)
+    self.fields.setFiberDimension(solnName, dimension)
+    for constraint in self.constraints:
+      constraint.setConstraintSizes(self.fields.getReal(solnName))
+    self.fields.allocate(solnName)
+    for constraint in self.constraints:
+      constraint.setConstraints(self.fields.getReal(solnName))
     return
 
 

Modified: short/3D/PyLith/trunk/pylith/problems/Implicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Implicit.py	2007-06-12 22:09:39 UTC (rev 7174)
+++ short/3D/PyLith/trunk/pylith/problems/Implicit.py	2007-06-12 22:36:44 UTC (rev 7175)
@@ -89,17 +89,10 @@
     Formulation.initialize(self, mesh, materials, boundaryConditions,
                            interfaceConditions, dimension, dt)
 
-    self._info.log("Creating fields and matrices.")
-    self.fields.addReal("dispTBctpdt")
-    self.fields.setFiberDimension("dispTBctpdt", dimension)
-    for constraint in self.constraints:
-      constraint.setConstraintSizes(self.fields.getReal("dispTBctpdt"))
-    self.fields.allocate("dispTBctpdt")
-    for constraint in self.constraints:
-      constraint.setConstraints(self.fields.getReal("dispTBctpdt"))
+    self._info.log("Creating other fields and matrices.")
     self.fields.addReal("dispIncr")
     self.fields.addReal("residual")
-    self.fields.copyLayout("dispTBctpdt")
+    self.fields.copyLayout(self.solnField['name'])
 
     dispTBctpdt = self.fields.getReal("dispTBctpdt")
     import pylith.topology.topology as bindings

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2007-06-12 22:09:39 UTC (rev 7174)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2007-06-12 22:36:44 UTC (rev 7175)
@@ -143,6 +143,7 @@
   fields.addReal("residual");
   fields.addReal("dispTpdt");
   fields.addReal("dispT");
+  fields.solutionField("dispT");
   const char* history[] = { "dispTpdt", "dispT" };
   const int historySize = 2;
   fields.createHistory(history, historySize);
@@ -215,6 +216,7 @@
   fields.addReal("residual");
   fields.addReal("dispTpdt");
   fields.addReal("dispT");
+  fields.solutionField("dispT");
   const char* history[] = { "dispTpdt", "dispT" };
   const int historySize = 2;
   fields.createHistory(history, historySize);

Modified: short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveKin.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveKin.py	2007-06-12 22:09:39 UTC (rev 7174)
+++ short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveKin.py	2007-06-12 22:36:44 UTC (rev 7175)
@@ -275,6 +275,7 @@
     fields.addReal("dispTpdt")
     fields.addReal("dispT")
     fields.addReal("dispTmdt")
+    fields.solutionField("dispT");
     fields.createHistory(["dispTpdt", "dispT", "dispTmdt"])
     fields.setFiberDimension("residual", cs.spaceDim)
     fields.allocate("residual")



More information about the cig-commits mailing list