[cig-commits] r15217 - in short/3D/PyLith/trunk/pylith: . materials

brad at geodynamics.org brad at geodynamics.org
Fri Jun 12 13:05:06 PDT 2009


Author: brad
Date: 2009-06-12 13:05:06 -0700 (Fri, 12 Jun 2009)
New Revision: 15217

Added:
   short/3D/PyLith/trunk/pylith/materials/PowerLaw3D.py
Modified:
   short/3D/PyLith/trunk/pylith/Makefile.am
Log:
Added SWIG and Python code for power-law.

Modified: short/3D/PyLith/trunk/pylith/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/pylith/Makefile.am	2009-06-12 20:04:17 UTC (rev 15216)
+++ short/3D/PyLith/trunk/pylith/Makefile.am	2009-06-12 20:05:06 UTC (rev 15217)
@@ -57,6 +57,7 @@
 	materials/Homogeneous.py \
 	materials/Material.py \
 	materials/MaxwellIsotropic3D.py \
+	materials/PowerLaw3D.py \
 	meshio/__init__.py \
 	meshio/CellFilter.py \
 	meshio/CellFilterAvgMesh.py \

Added: short/3D/PyLith/trunk/pylith/materials/PowerLaw3D.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/PowerLaw3D.py	                        (rev 0)
+++ short/3D/PyLith/trunk/pylith/materials/PowerLaw3D.py	2009-06-12 20:05:06 UTC (rev 15217)
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pylith/materials/PowerLaw1D.py
+##
+## @brief Python object implementing 3-D isotropic power-law
+## viscoelastic material.
+##
+## Factory: material.
+
+from ElasticMaterial import ElasticMaterial
+from materials import PowerLaw3D as ModulePowerLaw3D
+
+# PowerLaw3D class
+class PowerLaw3D(ElasticMaterial, ModulePowerLaw3D):
+  """
+  Python object implementing 3-D isotropic power-law viscoelastic material.
+
+  Factory: material.
+  """
+
+  # PUBLIC METHODS /////////////////////////////////////////////////////
+
+  def __init__(self, name="powerlaw3d"):
+    """
+    Constructor.
+    """
+    ElasticMaterial.__init__(self, name)
+    self.availableFields = \
+        {'vertex': \
+           {'info': [],
+            'data': []},
+         'cell': \
+           {'info': ["mu", "lambda", "density", 
+                     "viscosity_coeff", "power_law_exponent"],
+            'data': ["total_strain", "stress", "viscous_strain"]}}
+    self._loggingPrefix = "MaPL3D "
+    return
+
+
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _createModuleObj(self):
+    """
+    Call constructor for module object for access to C++ object.
+    """
+    ModulePowerLaw3D.__init__(self)
+    return
+  
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def material():
+  """
+  Factory associated with PowerLaw3D.
+  """
+  return PowerLaw3D()
+
+
+# End of file 



More information about the CIG-COMMITS mailing list