[cig-commits] r15791 - in short/3D/PyLith/branches/pylith-friction/libsrc: faults feassemble problems
brad at geodynamics.org
brad at geodynamics.org
Fri Oct 9 14:34:33 PDT 2009
Author: brad
Date: 2009-10-09 14:34:33 -0700 (Fri, 09 Oct 2009)
New Revision: 15791
Modified:
short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.cc
short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.hh
short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/Integrator.hh
short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/Integrator.icc
short/3D/PyLith/branches/pylith-friction/libsrc/problems/Formulation.cc
Log:
Added constrainSolnSpace to Integrator. Temporarily added call to constrainSolnSpace at beginning of Formulation::reformResidual().
Modified: short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.cc
===================================================================
--- short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.cc 2009-10-09 20:32:59 UTC (rev 15790)
+++ short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.cc 2009-10-09 21:34:33 UTC (rev 15791)
@@ -619,11 +619,11 @@
// ----------------------------------------------------------------------
// Constrain solution based on friction.
void
-pylith::faults::FaultCohesiveDynL::constrainSolution(
+pylith::faults::FaultCohesiveDynL::constrainSolnSpace(
topology::SolutionFields* const fields,
const double t,
const topology::Jacobian& jacobian)
-{ // constrainSolution
+{ // constrainSolnSpace
assert(0 != fields);
assert(0 != _quadrature);
assert(0 != _fields);
@@ -739,7 +739,7 @@
// FIX THIS
PetscLogFlops(cellsCohesiveSize*numConstraintVert*spaceDim*spaceDim*7);
-} // constrainSolution
+} // constrainSolnSpace
// ----------------------------------------------------------------------
// Verify configuration is acceptable.
Modified: short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.hh
===================================================================
--- short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.hh 2009-10-09 20:32:59 UTC (rev 15790)
+++ short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.hh 2009-10-09 21:34:33 UTC (rev 15791)
@@ -177,15 +177,15 @@
void updateStateVars(const double t,
topology::SolutionFields* const fields);
- /** Constrain solution based on friction.
+ /** Constrain solution space based on friction.
*
* @param fields Solution fields.
* @param t Current time.
* @param jacobian Sparse matrix for system Jacobian.
*/
- void constrainSolution(topology::SolutionFields* const fields,
- const double t,
- const topology::Jacobian& jacobian);
+ void constrainSolnSpace(topology::SolutionFields* const fields,
+ const double t,
+ const topology::Jacobian& jacobian);
/** Verify configuration is acceptable.
*
Modified: short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/Integrator.hh
===================================================================
--- short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/Integrator.hh 2009-10-09 20:32:59 UTC (rev 15790)
+++ short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/Integrator.hh 2009-10-09 21:34:33 UTC (rev 15791)
@@ -188,6 +188,17 @@
void updateStateVars(const double t,
topology::SolutionFields* const fields);
+ /** Constrain solution space.
+ *
+ * @param fields Solution fields.
+ * @param t Current time.
+ * @param jacobian Sparse matrix for system Jacobian.
+ */
+ virtual
+ void constrainSolnSpace(topology::SolutionFields* const fields,
+ const double t,
+ const topology::Jacobian& jacobian);
+
/** Verify configuration is acceptable.
*
* @param mesh Finite-element mesh
Modified: short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/Integrator.icc
===================================================================
--- short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/Integrator.icc 2009-10-09 20:32:59 UTC (rev 15790)
+++ short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/Integrator.icc 2009-10-09 21:34:33 UTC (rev 15791)
@@ -107,7 +107,17 @@
topology::SolutionFields* const fields) {
} // updateState
+// Constrain solution space.
+template<typename quadrature_type>
+inline
+void
+pylith::feassemble::Integrator<quadrature_type>::constrainSolnSpace(
+ topology::SolutionFields* const fields,
+ const double t,
+ const topology::Jacobian& jacobian) {
+} // constrainSolnSpace
+
#endif
// End of file
Modified: short/3D/PyLith/branches/pylith-friction/libsrc/problems/Formulation.cc
===================================================================
--- short/3D/PyLith/branches/pylith-friction/libsrc/problems/Formulation.cc 2009-10-09 20:32:59 UTC (rev 15790)
+++ short/3D/PyLith/branches/pylith-friction/libsrc/problems/Formulation.cc 2009-10-09 21:34:33 UTC (rev 15791)
@@ -117,12 +117,29 @@
solution.scatterVectorToSection(*tmpSolutionVec);
} // if
+ // ===================================================================
+ // :KLUDGE: WAITING FOR MATT TO IMPLEMENT DIFFERENT LINE SEARCH
+ int numIntegrators = _meshIntegrators.size();
+ assert(numIntegrators > 0); // must have at least 1 bulk integrator
+ for (int i=0; i < numIntegrators; ++i) {
+ _meshIntegrators[i]->timeStep(_dt);
+ _meshIntegrators[i]->constrainSolnSpace(_fields, _t, *_jacobian);
+ } // for
+ numIntegrators = _submeshIntegrators.size();
+ for (int i=0; i < numIntegrators; ++i) {
+ _submeshIntegrators[i]->timeStep(_dt);
+ _submeshIntegrators[i]->constrainSolnSpace(_fields, _t, *_jacobian);
+ } // for
+ // :KLUDGE: END
+ // ===================================================================
+
+
// Set residual to zero.
topology::Field<topology::Mesh>& residual = _fields->get("residual");
residual.zero();
// Add in contributions that require assembly.
- int numIntegrators = _meshIntegrators.size();
+ numIntegrators = _meshIntegrators.size();
assert(numIntegrators > 0); // must have at least 1 bulk integrator
for (int i=0; i < numIntegrators; ++i) {
_meshIntegrators[i]->timeStep(_dt);
More information about the CIG-COMMITS
mailing list