[cig-commits] r16018 - in short/3D/PyLith/branches/pylith-friction: modulesrc/feassemble playpen/friction pylith pylith/feassemble
brad at geodynamics.org
brad at geodynamics.org
Fri Nov 20 11:31:15 PST 2009
Author: brad
Date: 2009-11-20 11:31:14 -0800 (Fri, 20 Nov 2009)
New Revision: 16018
Added:
short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/ElasticityExplicitLgDeform.i
short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/ElasticityImplicitLgDeform.i
short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/IntegratorElasticityLgDeform.i
short/3D/PyLith/branches/pylith-friction/pylith/feassemble/ElasticityExplicitLgDeform.py
short/3D/PyLith/branches/pylith-friction/pylith/feassemble/ElasticityImplicitLgDeform.py
short/3D/PyLith/branches/pylith-friction/pylith/feassemble/IntegratorElasticityLgDeform.py
Modified:
short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/IntegratorElasticity.i
short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/Makefile.am
short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/feassemble.i
short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-shear-dirichletBC.cfg
short/3D/PyLith/branches/pylith-friction/pylith/Makefile.am
short/3D/PyLith/branches/pylith-friction/pylith/feassemble/__init__.py
Log:
Added module and Python objects for large deformations.
Added: short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/ElasticityExplicitLgDeform.i
===================================================================
--- short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/ElasticityExplicitLgDeform.i (rev 0)
+++ short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/ElasticityExplicitLgDeform.i 2009-11-20 19:31:14 UTC (rev 16018)
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file modulesrc/feassemble/ElasticityExplicitLgDeform.i
+ *
+ * @brief Python interface to C++ ElasticityExplicitLgDeform object.
+ */
+
+namespace pylith {
+ namespace feassemble {
+
+ class ElasticityExplicitLgDeform : public IntegratorElasticityLgDeform
+ { // ElasticityExplicitLgDeform
+
+ // PUBLIC MEMBERS /////////////////////////////////////////////////
+ public:
+
+ /// Constructor
+ ElasticityExplicitLgDeform(void);
+
+ /// Destructor
+ ~ElasticityExplicitLgDeform(void);
+
+ /// Deallocate PETSc and local data structures.
+ void deallocate(void);
+
+ /** Set time step for advancing from time t to time t+dt.
+ *
+ * @param dt Time step
+ */
+ void timeStep(const double dt);
+
+ /** Set flag for setting constraints for total field solution or
+ * incremental field solution.
+ *
+ * @param flag True if using incremental solution, false otherwise.
+ */
+ void useSolnIncr(const bool flag);
+
+ /** Integrate contributions to residual term (r) for operator.
+ *
+ * @param residual Field containing values for residual
+ * @param t Current time
+ * @param fields Solution fields
+ */
+ void integrateResidual(const pylith::topology::Field<pylith::topology::Mesh>& residual,
+ const double t,
+ pylith::topology::SolutionFields* const fields);
+
+ /** Integrate contributions to Jacobian matrix (A) associated with
+ * operator.
+ *
+ * @param jacobian Sparse matrix for Jacobian of system.
+ * @param t Current time
+ * @param fields Solution fields
+ */
+ void integrateJacobian(pylith::topology::Jacobian* jacobian,
+ const double t,
+ pylith::topology::SolutionFields* const fields);
+
+ /** Integrate contributions to Jacobian matrix (A) associated with
+ * operator.
+ *
+ * @param jacobian Diagonal matrix (as field) for Jacobian of system.
+ * @param t Current time
+ * @param fields Solution fields
+ */
+ void integrateJacobian(const pylith::topology::Field<pylith::topology::Mesh>& jacobian,
+ const double t,
+ pylith::topology::SolutionFields* const fields);
+
+ }; // ElasticityExplicitLgDeform
+
+ } // feassemble
+} // pylith
Added: short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/ElasticityImplicitLgDeform.i
===================================================================
--- short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/ElasticityImplicitLgDeform.i (rev 0)
+++ short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/ElasticityImplicitLgDeform.i 2009-11-20 19:31:14 UTC (rev 16018)
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file modulesrc/feassemble/ElasticityImplicitLgDeform.i
+ *
+ * @brief Python interface to C++ ElasticityImplicitLgDeform object.
+ */
+
+namespace pylith {
+ namespace feassemble {
+
+ class ElasticityImplicitLgDeform : public IntegratorElasticityLgDeform
+ { // ElasticityImplicitLgDeform
+
+ // PUBLIC MEMBERS /////////////////////////////////////////////////
+ public:
+
+ /// Constructor
+ ElasticityImplicitLgDeform(void);
+
+ /// Destructor
+ ~ElasticityImplicitLgDeform(void);
+
+ /// Deallocate PETSc and local data structures.
+ void deallocate(void);
+
+ /** Set time step for advancing from time t to time t+dt.
+ *
+ * @param dt Time step
+ */
+ void timeStep(const double dt);
+
+ /** Get stable time step for advancing from time t to time t+dt.
+ *
+ * Default is current time step.
+ *
+ * @param mesh Finite-element mesh.
+ * @returns Time step
+ */
+ double stableTimeStep(const pylith::topology::Mesh& mesh) const;
+
+ /** Set flag for setting constraints for total field solution or
+ * incremental field solution.
+ *
+ * @param flag True if using incremental solution, false otherwise.
+ */
+ void useSolnIncr(const bool flag);
+
+ /** Integrate residual part of RHS for 3-D finite elements.
+ * Includes gravity and element internal force contribution.
+ *
+ * We assume that the effects of boundary conditions are already
+ * included in the residual (tractions, concentrated nodal forces,
+ * and contributions to internal force vector due to
+ * displacement/velocity BC). This routine computes the additional
+ * external loads due to body forces plus the
+ * element internal forces for the current stress state.
+ *
+ * @param residual Field containing values for residual
+ * @param t Current time
+ * @param fields Solution fields
+ */
+ void integrateResidual(const pylith::topology::Field<pylith::topology::Mesh>& residual,
+ const double t,
+ pylith::topology::SolutionFields* const fields);
+
+ /** Integrate contributions to Jacobian matrix (A) associated with
+ * operator.
+ *
+ * @param jacobian Sparse matrix for Jacobian of system.
+ * @param t Current time
+ * @param fields Solution fields
+ */
+ void integrateJacobian(pylith::topology::Jacobian* jacobian,
+ const double t,
+ pylith::topology::SolutionFields* const fields);
+
+ }; // ElasticityImplicitLgDeform
+
+ } // feassemble
+} // pylith
+
+
+// End of file
Modified: short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/IntegratorElasticity.i
===================================================================
--- short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/IntegratorElasticity.i 2009-11-20 18:00:19 UTC (rev 16017)
+++ short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/IntegratorElasticity.i 2009-11-20 19:31:14 UTC (rev 16018)
@@ -10,9 +10,9 @@
// ----------------------------------------------------------------------
//
-/** @file modulesrc/feassemble/Integrator.i
+/** @file modulesrc/feassemble/IntegratorElasticity.i
*
- * @brief Python interface to C++ abstract Integrator object.
+ * @brief Python interface to C++ abstract IntegratorElasticity object.
*/
%template(MeshIntegrator) pylith::feassemble::Integrator<pylith::feassemble::Quadrature<pylith::topology::Mesh> >;
Added: short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/IntegratorElasticityLgDeform.i
===================================================================
--- short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/IntegratorElasticityLgDeform.i (rev 0)
+++ short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/IntegratorElasticityLgDeform.i 2009-11-20 19:31:14 UTC (rev 16018)
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file modulesrc/feassemble/IntegratorElasticityLgDeform.i
+ *
+ * @brief Python interface to C++ abstract IntegratorElasticityLgDeform object.
+ */
+
+namespace pylith {
+ namespace feassemble {
+
+ class IntegratorElasticityLgDeform :
+ public pylith::feassemble::IntegratorElasticity
+ { // IntegratorElasticityLgDeform
+
+ // PUBLIC MEMBERS /////////////////////////////////////////////////
+ public :
+
+ /// Constructor
+ IntegratorElasticityLgDeform(void);
+
+ /// Destructor
+ virtual
+ ~IntegratorElasticityLgDeform(void);
+
+ /** Determine whether we need to recompute the Jacobian.
+ *
+ * @returns True if Jacobian needs to be recomputed, false otherwise.
+ */
+ bool needNewJacobian(void);
+
+ /** Update state variables as needed.
+ *
+ * @param t Current time
+ * @param fields Solution fields
+ * @param mesh Finite-element mesh
+ */
+ void updateStateVars(const double t,
+ pylith::topology::SolutionFields* const fields);
+
+ }; // IntegratorElasticityLgDeform
+
+ } // feassemble
+} // pylith
+
+
+// End of file
Modified: short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/Makefile.am 2009-11-20 18:00:19 UTC (rev 16017)
+++ short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/Makefile.am 2009-11-20 19:31:14 UTC (rev 16018)
@@ -37,7 +37,10 @@
Integrator.i \
IntegratorElasticity.i \
ElasticityImplicit.i \
- ElasticityExplicit.i
+ ElasticityExplicit.i \
+ IntegratorElasticityLgDeform.i \
+ ElasticityImplicitLgDeform.i \
+ ElasticityExplicitLgDeform.i
swig_generated = \
feassemble_wrap.cxx \
Modified: short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/feassemble.i
===================================================================
--- short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/feassemble.i 2009-11-20 18:00:19 UTC (rev 16017)
+++ short/3D/PyLith/branches/pylith-friction/modulesrc/feassemble/feassemble.i 2009-11-20 19:31:14 UTC (rev 16018)
@@ -35,6 +35,8 @@
#include "pylith/feassemble/Quadrature.hh"
#include "pylith/feassemble/ElasticityImplicit.hh"
#include "pylith/feassemble/ElasticityExplicit.hh"
+#include "pylith/feassemble/ElasticityImplicitLgDeform.hh"
+#include "pylith/feassemble/ElasticityExplicitLgDeform.hh"
%}
@@ -79,6 +81,9 @@
%include "IntegratorElasticity.i"
%include "ElasticityImplicit.i"
%include "ElasticityExplicit.i"
+%include "IntegratorElasticityLgDeform.i"
+%include "ElasticityImplicitLgDeform.i"
+%include "ElasticityExplicitLgDeform.i"
// Template instatiation
%template(MeshQuadrature) pylith::feassemble::Quadrature<pylith::topology::Mesh>;
Modified: short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-shear-dirichletBC.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-shear-dirichletBC.cfg 2009-11-20 18:00:19 UTC (rev 16017)
+++ short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-shear-dirichletBC.cfg 2009-11-20 19:31:14 UTC (rev 16018)
@@ -187,6 +187,7 @@
snes_view = true
ksp_converged_reason = true
snes_converged_reason = true
+snes_max_it = 200
# ----------------------------------------------------------------------
# output
Modified: short/3D/PyLith/branches/pylith-friction/pylith/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-friction/pylith/Makefile.am 2009-11-20 18:00:19 UTC (rev 16017)
+++ short/3D/PyLith/branches/pylith-friction/pylith/Makefile.am 2009-11-20 19:31:14 UTC (rev 16018)
@@ -42,11 +42,14 @@
feassemble/__init__.py \
feassemble/Constraint.py \
feassemble/ElasticityExplicit.py \
+ feassemble/ElasticityExplicitLgDeform.py \
feassemble/ElasticityImplicit.py \
+ feassemble/ElasticityImplicitLgDeform.py \
feassemble/FIATLagrange.py \
feassemble/FIATSimplex.py \
feassemble/Integrator.py \
feassemble/IntegratorElasticity.py \
+ feassemble/IntegratorElasticityLgDeform.py \
feassemble/ReferenceCell.py \
feassemble/Quadrature.py \
feassemble/CellGeometry.py \
Added: short/3D/PyLith/branches/pylith-friction/pylith/feassemble/ElasticityExplicitLgDeform.py
===================================================================
--- short/3D/PyLith/branches/pylith-friction/pylith/feassemble/ElasticityExplicitLgDeform.py (rev 0)
+++ short/3D/PyLith/branches/pylith-friction/pylith/feassemble/ElasticityExplicitLgDeform.py 2009-11-20 19:31:14 UTC (rev 16018)
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pylith/feassemble/ElasticityExplicitLgDeform.py
+##
+## @brief Python object for explicit time integration of dynamic
+## elasticity equation using finite-elements with large rigidy body
+## motion and small strains.
+##
+## Factory: integrator
+
+from IntegratorElasticityLgDeform import IntegratorElasticityLgDeform
+from feassemble import ElasticityExplicitLgDeform as ModuleElasticityExplicitLgDeform
+
+# ElasticityExplicitLgDeform class
+class ElasticityExplicitLgDeform(IntegratorElasticityLgDeform,
+ ModuleElasticityExplicitLgDeform):
+ """
+ Python object for explicit time integration of dynamic elasticity
+ equation using finite-elements with large rigid body motions and
+ small strains.
+ """
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ def __init__(self, name="elasticityexplicit"):
+ """
+ Constructor.
+ """
+ IntegratorElasticityLgDeform.__init__(self, name)
+ ModuleElasticityExplicitLgDeform.__init__(self)
+ self._loggingPrefix = "ElEx "
+ return
+
+
+ def initialize(self, totalTime, numTimeSteps, normalizer):
+ """
+ Do initialization.
+ """
+ logEvent = "%sinit" % self._loggingPrefix
+ self._eventLogger.eventBegin(logEvent)
+
+ IntegratorElasticityLgDeform.initialize(self, totalTime, numTimeSteps, normalizer)
+ ModuleElasticityExplicitLgDeform.initialize(self, self.mesh)
+ self._initializeOutput(totalTime, numTimeSteps, normalizer)
+
+ self._eventLogger.eventEnd(logEvent)
+ return
+
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def integrator():
+ """
+ Factory associated with ElasticityExplicitLgDeform.
+ """
+ return ElasticityExplicitLgDeform()
+
+
+# End of file
Added: short/3D/PyLith/branches/pylith-friction/pylith/feassemble/ElasticityImplicitLgDeform.py
===================================================================
--- short/3D/PyLith/branches/pylith-friction/pylith/feassemble/ElasticityImplicitLgDeform.py (rev 0)
+++ short/3D/PyLith/branches/pylith-friction/pylith/feassemble/ElasticityImplicitLgDeform.py 2009-11-20 19:31:14 UTC (rev 16018)
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pylith/feassemble/ElasticityImplicitLgDeform.py
+##
+## @brief Python object for implicit time integration of dynamic
+## elasticity equation using finite-elements.
+##
+## Factory: integrator
+
+from IntegratorElasticityLgDeform import IntegratorElasticityLgDeform
+from feassemble import ElasticityImplicitLgDeform as ModuleElasticityImplicitLgDeform
+
+# ElasticityImplicitLgDeform class
+class ElasticityImplicitLgDeform(IntegratorElasticityLgDeform,
+ ModuleElasticityImplicitLgDeform):
+ """
+ Python object for implicit time integration of elasticity
+ equation using finite-elements.
+ """
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ def __init__(self, name="elasticityimplicit"):
+ """
+ Constructor.
+ """
+ IntegratorElasticityLgDeform.__init__(self, name)
+ ModuleElasticityImplicitLgDeform.__init__(self)
+ self._loggingPrefix = "ElIm "
+ return
+
+
+ def initialize(self, totalTime, numTimeSteps, normalizer):
+ """
+ Do initialization.
+ """
+ logEvent = "%sinit" % self._loggingPrefix
+ self._eventLogger.eventBegin(logEvent)
+
+ IntegratorElasticityLgDeform.initialize(self, totalTime, numTimeSteps,
+ normalizer)
+ ModuleElasticityImplicitLgDeform.initialize(self, self.mesh)
+ self._initializeOutput(totalTime, numTimeSteps, normalizer)
+
+ self._eventLogger.eventEnd(logEvent)
+ return
+
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def integrator():
+ """
+ Factory associated with ElasticityImplicitLgDeform.
+ """
+ return ElasticityImplicitLgDeform()
+
+
+# End of file
Added: short/3D/PyLith/branches/pylith-friction/pylith/feassemble/IntegratorElasticityLgDeform.py
===================================================================
--- short/3D/PyLith/branches/pylith-friction/pylith/feassemble/IntegratorElasticityLgDeform.py (rev 0)
+++ short/3D/PyLith/branches/pylith-friction/pylith/feassemble/IntegratorElasticityLgDeform.py 2009-11-20 19:31:14 UTC (rev 16018)
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pylith/feassemble/IntegratorElasticityLgDeform.py
+##
+## @brief Python object implementing sgeneral methods for time
+## integration of the elasticity equation using finite-elements with
+## large rogid body motions and small strains.
+##
+## Factory: integrator
+
+from IntegratorElasticity import IntegratorElasticity
+
+# IntegratorElasticityLgDeform class
+class IntegratorElasticityLgDeform(IntegratorElasticity):
+ """
+ Python object implementing sgeneral methods for time integration of
+ the elasticity equation using finite-elements with large rigid body
+ motions and small strains.
+ """
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ def __init__(self, name="integratorelasticitylgdeform"):
+ """
+ Constructor.
+ """
+ IntegratorElasticity.__init__(self)
+ self.name = "Integrator ElasticityLgDeform"
+
+ return
+
+
+# End of file
Modified: short/3D/PyLith/branches/pylith-friction/pylith/feassemble/__init__.py
===================================================================
--- short/3D/PyLith/branches/pylith-friction/pylith/feassemble/__init__.py 2009-11-20 18:00:19 UTC (rev 16017)
+++ short/3D/PyLith/branches/pylith-friction/pylith/feassemble/__init__.py 2009-11-20 19:31:14 UTC (rev 16018)
@@ -17,10 +17,13 @@
__all__ = ['CellGeometry',
'Constraint',
'ElasticityExplicit',
+ 'ElasticityExplicitLgDeform',
'ElasticityImplicit',
+ 'ElasticityImplicitLgDeform',
'FIATLagrange',
'FIATSimplex',
'IntegratorElasticity',
+ 'IntegratorElasticityLgDeform',
'Integrator',
'Quadrature',
'ReferenceCell',
More information about the CIG-COMMITS
mailing list