[cig-commits] r16267 - in short/3D/PyLith/trunk: libsrc/faults libsrc/problems unittests/libtests/faults

brad at geodynamics.org brad at geodynamics.org
Tue Feb 16 12:17:45 PST 2010


Author: brad
Date: 2010-02-16 12:17:44 -0800 (Tue, 16 Feb 2010)
New Revision: 16267

Modified:
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.cc
   short/3D/PyLith/trunk/libsrc/problems/Explicit.cc
   short/3D/PyLith/trunk/libsrc/problems/Formulation.cc
   short/3D/PyLith/trunk/libsrc/problems/Implicit.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.cc
Log:
Enabled computational of velocity field when needed (performed in reformResidual()).

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.cc	2010-02-16 16:56:23 UTC (rev 16266)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.cc	2010-02-16 20:17:44 UTC (rev 16267)
@@ -662,7 +662,7 @@
   const ALE::Obj<RealSection>& slipSection = _fields->get("slip").section();
   assert(!slipSection.isNull());
 
-  //_updateSlipRate(*fields); // waiting for velocity field to be defined
+  _updateSlipRate(*fields);
   double_array slipRateVertex(spaceDim);
   const ALE::Obj<RealSection>& slipRateSection =
       _fields->get("slip rate").section();

Modified: short/3D/PyLith/trunk/libsrc/problems/Explicit.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/Explicit.cc	2010-02-16 16:56:23 UTC (rev 16266)
+++ short/3D/PyLith/trunk/libsrc/problems/Explicit.cc	2010-02-16 20:17:44 UTC (rev 16267)
@@ -50,7 +50,7 @@
   const int spaceDim = cs->spaceDim();
   
   if (!_fields->hasField("velocity(t)")) {
-    _fields->add("velocity(t)", "velocity(t)");
+    _fields->add("velocity(t)", "velocity");
     topology::Field<topology::Mesh>& velocity = _fields->get("velocity(t)");
     velocity.cloneSection(dispIncr);
   } // if

Modified: short/3D/PyLith/trunk/libsrc/problems/Formulation.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/Formulation.cc	2010-02-16 16:56:23 UTC (rev 16266)
+++ short/3D/PyLith/trunk/libsrc/problems/Formulation.cc	2010-02-16 20:17:44 UTC (rev 16267)
@@ -122,13 +122,13 @@
   numIntegrators = _meshIntegrators.size();
   for (int i=0; i < numIntegrators; ++i) {
     assert(0 != _meshIntegrators[i]);
-    if (_meshIntegrators[i]->needJacobianDiag())
+    if (_meshIntegrators[i]->needVelocity())
       _needVelocity = true;
   } // fpr
   numIntegrators = _submeshIntegrators.size();
   for (int i=0; i < numIntegrators; ++i) {
     assert(0 != _submeshIntegrators[i]);
-    if (_submeshIntegrators[i]->needJacobianDiag())
+    if (_submeshIntegrators[i]->needVelocity())
       _needVelocity = true;
   } // for
 } // initialize
@@ -185,6 +185,10 @@
     solution.scatterVectorToSection(*tmpSolutionVec);
   } // if
 
+  // Compute velocity if necessary.
+  if (_needVelocity)
+    _calcVelocity();
+
   // Set residual to zero.
   topology::Field<topology::Mesh>& residual = _fields->get("residual");
   residual.zero();
@@ -238,6 +242,10 @@
     solution.scatterVectorToSection(*tmpSolutionVec);
   } // if
 
+  // Compute velocity if necessary.
+  if (_needVelocity)
+    _calcVelocity();
+
   // Set residual to zero.
   topology::Field<topology::Mesh>& residual = _fields->get("residual");
   residual.zero();

Modified: short/3D/PyLith/trunk/libsrc/problems/Implicit.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/Implicit.cc	2010-02-16 16:56:23 UTC (rev 16266)
+++ short/3D/PyLith/trunk/libsrc/problems/Implicit.cc	2010-02-16 20:17:44 UTC (rev 16267)
@@ -50,7 +50,7 @@
   const int spaceDim = cs->spaceDim();
   
   if (!_fields->hasField("velocity(t)")) {
-    _fields->add("velocity(t)", "velocity(t)");
+    _fields->add("velocity(t)", "velocity");
     topology::Field<topology::Mesh>& velocity = _fields->get("velocity(t)");
     velocity.cloneSection(dispIncr);
   } // if

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.cc	2010-02-16 16:56:23 UTC (rev 16266)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.cc	2010-02-16 20:17:44 UTC (rev 16267)
@@ -740,6 +740,7 @@
   // Setup fields
   fields->add("disp(t)", "displacement");
   fields->add("dispIncr(t->t+dt)", "displacement_increment");
+  fields->add("velocity(t)", "velocity");
   fields->solutionName("dispIncr(t->t+dt)");
   
   const int spaceDim = _data->spaceDim;



More information about the CIG-COMMITS mailing list