[cig-commits] r6530 - in short/3D/PyLith/trunk: modulesrc/materials pylith pylith/materials

brad at geodynamics.org brad at geodynamics.org
Mon Apr 9 08:56:25 PDT 2007


Author: brad
Date: 2007-04-09 08:56:24 -0700 (Mon, 09 Apr 2007)
New Revision: 6530

Added:
   short/3D/PyLith/trunk/pylith/materials/ElasticStrain1D.py
   short/3D/PyLith/trunk/pylith/materials/ElasticStress1D.py
Removed:
   short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic1D.py
Modified:
   short/3D/PyLith/trunk/modulesrc/materials/materials.pyxe.src
   short/3D/PyLith/trunk/pylith/Makefile.am
   short/3D/PyLith/trunk/pylith/materials/__init__.py
Log:
Updated materials module and Python code (ElasticIsotropic1D -> ElasticStress1D plus ElasticStrain1D added).

Modified: short/3D/PyLith/trunk/modulesrc/materials/materials.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/materials.pyxe.src	2007-04-09 06:41:41 UTC (rev 6529)
+++ short/3D/PyLith/trunk/modulesrc/materials/materials.pyxe.src	2007-04-09 15:56:24 UTC (rev 6530)
@@ -13,7 +13,8 @@
 #header{
 #include "pylith/materials/Material.hh"
 #include "pylith/materials/ElasticMaterial.hh"
-#include "pylith/materials/ElasticIsotropic1D.hh"
+#include "pylith/materials/ElasticStrain1D.hh"
+#include "pylith/materials/ElasticStress1D.hh"
 #include "pylith/materials/ElasticIsotropic3D.hh"
 #include "pylith/materials/ElasticPlaneStrain.hh"
 #include "pylith/materials/ElasticPlaneStress.hh"
@@ -223,17 +224,17 @@
 
 
 # ----------------------------------------------------------------------
-cdef class ElasticIsotropic1D(ElasticMaterial):
+cdef class ElasticStrain1D(ElasticMaterial):
 
   def __init__(self):
     """
     Constructor.
     """
     # create shim for constructor
-    #embed{ void* ElasticIsotropic1D_constructor()
+    #embed{ void* ElasticStrain1D_constructor()
     void* result = 0;
     try {
-      result = (void*)(new pylith::materials::ElasticIsotropic1D);
+      result = (void*)(new pylith::materials::ElasticStrain1D);
     } catch (const std::exception& err) {
       PyErr_SetString(PyExc_RuntimeError,
                       const_cast<char*>(err.what()));
@@ -245,12 +246,40 @@
     #}embed
 
     ElasticMaterial.__init__(self)
-    self.thisptr = ElasticIsotropic1D_constructor()
+    self.thisptr = ElasticStrain1D_constructor()
     self.handle = self._createHandle()
     return
 
 
 # ----------------------------------------------------------------------
+cdef class ElasticStress1D(ElasticMaterial):
+
+  def __init__(self):
+    """
+    Constructor.
+    """
+    # create shim for constructor
+    #embed{ void* ElasticStress1D_constructor()
+    void* result = 0;
+    try {
+      result = (void*)(new pylith::materials::ElasticStress1D);
+    } catch (const std::exception& err) {
+      PyErr_SetString(PyExc_RuntimeError,
+                      const_cast<char*>(err.what()));
+    } catch (...) {
+      PyErr_SetString(PyExc_RuntimeError,
+                      "Caught unknown C++ exception.");
+    } // try/catch
+    return result;
+    #}embed
+
+    ElasticMaterial.__init__(self)
+    self.thisptr = ElasticStress1D_constructor()
+    self.handle = self._createHandle()
+    return
+
+
+# ----------------------------------------------------------------------
 cdef class ElasticPlaneStrain(ElasticMaterial):
 
   def __init__(self):

Modified: short/3D/PyLith/trunk/pylith/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/pylith/Makefile.am	2007-04-09 06:41:41 UTC (rev 6529)
+++ short/3D/PyLith/trunk/pylith/Makefile.am	2007-04-09 15:56:24 UTC (rev 6530)
@@ -29,10 +29,11 @@
 	feassemble/quadrature/Quadrature3D.py \
 	feassemble/quadrature/__init__.py \
 	materials/__init__.py \
-	materials/ElasticIsotropic1D.py \
 	materials/ElasticIsotropic3D.py \
 	materials/ElasticPlaneStrain.py \
 	materials/ElasticPlaneStress.py \
+	materials/ElasticStrain1D.py \
+	materials/ElasticStress1D.py \
 	materials/Homogeneous.py \
 	materials/Material.py \
 	materials/MaterialsBin.py \

Deleted: short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic1D.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic1D.py	2007-04-09 06:41:41 UTC (rev 6529)
+++ short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic1D.py	2007-04-09 15:56:24 UTC (rev 6530)
@@ -1,52 +0,0 @@
-#!/usr/bin/env python
-#
-# ----------------------------------------------------------------------
-#
-#                           Brad T. Aagaard
-#                        U.S. Geological Survey
-#
-# <LicenseText>
-#
-# ----------------------------------------------------------------------
-#
-
-## @file pylith/materials/ElasticIsotropic1D.py
-##
-## @brief Python object implementing 1-D isotropic linear elastic material.
-##
-## Factory: material.
-
-from Material import Material
-
-import pylith.materials.materials as bindings
-
-
-# ElasticIsotropic1D class
-class ElasticIsotropic1D(Material):
-  """
-  Python object implementing 1-D isotropic linear elastic material.
-
-  Factory: material.
-  """
-
-  # PUBLIC METHODS /////////////////////////////////////////////////////
-
-  def __init__(self, name="elasticisotropic1d"):
-    """
-    Constructor.
-    """
-    Material.__init__(self, name)
-    self.cppHandle = bindings.ElasticIsotropic1D()
-    return
-
-
-# FACTORIES ////////////////////////////////////////////////////////////
-
-def material():
-  """
-  Factory associated with ElasticIsotropic1D.
-  """
-  return ElasticIsotropic1D()
-
-
-# End of file 

Copied: short/3D/PyLith/trunk/pylith/materials/ElasticStrain1D.py (from rev 6529, short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic1D.py)
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic1D.py	2007-04-09 06:41:41 UTC (rev 6529)
+++ short/3D/PyLith/trunk/pylith/materials/ElasticStrain1D.py	2007-04-09 15:56:24 UTC (rev 6530)
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pylith/materials/ElasticStrain1D.py
+##
+## @brief Python object implementing 1-D linear elastic material with
+## axial strain.
+##
+## Factory: material.
+
+from Material import Material
+
+import pylith.materials.materials as bindings
+
+
+# ElasticStrain1D class
+class ElasticStrain1D(Material):
+  """
+  Python object implementing 1-D linear elastic material with axial strain.
+
+  Factory: material.
+  """
+
+  # PUBLIC METHODS /////////////////////////////////////////////////////
+
+  def __init__(self, name="elasticstrain1d"):
+    """
+    Constructor.
+    """
+    Material.__init__(self, name)
+    self.cppHandle = bindings.ElasticStrain1D()
+    return
+
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def material():
+  """
+  Factory associated with ElasticStrain1D.
+  """
+  return ElasticStrain1D()
+
+
+# End of file 

Added: short/3D/PyLith/trunk/pylith/materials/ElasticStress1D.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/ElasticStress1D.py	2007-04-09 06:41:41 UTC (rev 6529)
+++ short/3D/PyLith/trunk/pylith/materials/ElasticStress1D.py	2007-04-09 15:56:24 UTC (rev 6530)
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pylith/materials/ElasticStress1D.py
+##
+## @brief Python object implementing 1-D linear elastic material with
+## axial stress.
+##
+## Factory: material.
+
+from Material import Material
+
+import pylith.materials.materials as bindings
+
+
+# ElasticStress1D class
+class ElasticStress1D(Material):
+  """
+  Python object implementing 1-D linear elastic material with axial stress.
+
+  Factory: material.
+  """
+
+  # PUBLIC METHODS /////////////////////////////////////////////////////
+
+  def __init__(self, name="elasticstress1d"):
+    """
+    Constructor.
+    """
+    Material.__init__(self, name)
+    self.cppHandle = bindings.ElasticStress1D()
+    return
+
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def material():
+  """
+  Factory associated with ElasticStress1D.
+  """
+  return ElasticStress1D()
+
+
+# End of file 

Modified: short/3D/PyLith/trunk/pylith/materials/__init__.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/__init__.py	2007-04-09 06:41:41 UTC (rev 6529)
+++ short/3D/PyLith/trunk/pylith/materials/__init__.py	2007-04-09 15:56:24 UTC (rev 6530)
@@ -14,10 +14,11 @@
 
 ## @brief Python PyLith materials module initialization
 
-__all__ = ['ElasticIsotropic1D',
-           'ElasticIsotropic3D',
+__all__ = ['ElasticIsotropic3D',
            'ElasticPlaneStrain',
            'ElasticPlaneStress',
+           'ElasticStrain1D',
+           'ElasticStress1D',
            'Homogeneous',
            'Material',
            'MaterialsBin']



More information about the cig-commits mailing list