[cig-commits] r14316 - in short/3D/PyLith/branches/pylith-swig: . modulesrc/materials pylith/bc pylith/materials unittests/pytests/materials unittests/pytests/meshio unittests/pytests/topology

brad at geodynamics.org brad at geodynamics.org
Fri Mar 13 16:52:54 PDT 2009


Author: brad
Date: 2009-03-13 16:52:54 -0700 (Fri, 13 Mar 2009)
New Revision: 14316

Added:
   short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticIsotropic3D.i
   short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticPlaneStrain.i
   short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticPlaneStress.i
   short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticStress1D.i
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testcubit.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testmeshio.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testtopology.py
Removed:
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testdriver.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testdriver_cubit.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testdriver.py
Modified:
   short/3D/PyLith/branches/pylith-swig/TODO
   short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticStrain1D.i
   short/3D/PyLith/branches/pylith-swig/modulesrc/materials/Makefile.am
   short/3D/PyLith/branches/pylith-swig/modulesrc/materials/materials.i
   short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py
   short/3D/PyLith/branches/pylith-swig/pylith/bc/BoundaryCondition.py
   short/3D/PyLith/branches/pylith-swig/pylith/bc/DirichletBC.py
   short/3D/PyLith/branches/pylith-swig/pylith/bc/DirichletBoundary.py
   short/3D/PyLith/branches/pylith-swig/pylith/bc/Neumann.py
   short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticIsotropic3D.py
   short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticMaterial.py
   short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticPlaneStrain.py
   short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticPlaneStress.py
   short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticStrain1D.py
   short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticStress1D.py
   short/3D/PyLith/branches/pylith-swig/pylith/materials/Material.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticIsotropic3D.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStrain.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStress.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStrain1D.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStress1D.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/testmaterials.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/Makefile.am
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/Makefile.am
Log:
Finished SWIG stuff for elastic materials.

Modified: short/3D/PyLith/branches/pylith-swig/TODO
===================================================================
--- short/3D/PyLith/branches/pylith-swig/TODO	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/TODO	2009-03-13 23:52:54 UTC (rev 14316)
@@ -17,6 +17,9 @@
   libtests/bc/TestDirichletBoundary::testVertexField()
   libtests/bc/TestDirichletBoundary::testBoundaryMesh()
 
+  pytests/bc/TestDirichletBoundary
+  pytests/bc/TestNeumann (output)
+
   DirichletPoints (Python) - rate == None -> dbRate == 0
   DirichletBoundary (Python) - rate == None -> dbRate == 0
 

Added: short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticIsotropic3D.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticIsotropic3D.i	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticIsotropic3D.i	2009-03-13 23:52:54 UTC (rev 14316)
@@ -0,0 +1,158 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file modulesrc/materials/ElasticIsotropic3D.i
+ *
+ * Python interface to C++ ElasticIsotropic3D object.
+ */
+
+namespace pylith {
+  namespace materials {
+
+    class ElasticIsotropic3D : public ElasticMaterial
+    { // class ElasticIsotropic3D
+
+      // PUBLIC METHODS /////////////////////////////////////////////////
+    public :
+
+      /// Default constructor
+      ElasticIsotropic3D(void);
+      
+      /// Destructor
+      ~ElasticIsotropic3D(void);
+      
+      // PROTECTED METHODS //////////////////////////////////////////////
+    protected :
+
+      /** Compute properties from values in spatial database.
+       *
+       * Order of values in arrays matches order used in dbValues() and
+       * parameterNames().
+       *
+       * @param propValues Array of property values.
+       * @param dbValues Array of database values.
+       */
+      void _dbToProperties(double* const propValues,
+			   const double_array& dbValues) const;
+
+      /** Nondimensionalize properties.
+       *
+       * @param values Array of property values.
+       * @param nvalues Number of values.
+       */
+      void _nondimProperties(double* const values,
+			     const int nvalues) const;
+
+      /** Dimensionalize properties.
+       *
+       * @param values Array of property values.
+       * @param nvalues Number of values.
+       */
+      void _dimProperties(double* const values,
+			  const int nvalues) const;
+
+      /** Compute density from properties.
+       *
+       * @param density Array for density.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       */
+      void _calcDensity(double* const density,
+			const double* properties,
+			const int numProperties,
+			const double* stateVars,
+			const int numStateVars);
+
+      /** Compute stress tensor from properties and state variables. If
+       * the state variables are from the previous time step, then the
+       * computeStateVars flag should be set to true so that the state
+       * variables are updated (but not stored) when computing the
+       * stresses.
+       *
+       * @param stress Array for stress tensor.
+       * @param stressSize Size of stress tensor.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       * @param totalStrain Total strain at location.
+       * @param strainSize Size of strain tensor.
+       * @param initialStress Initial stress tensor at location.
+       * @param initialStressSize Size of initial stress array.
+       * @param initialStrain Initial strain tensor at location.
+       * @param initialStrainSize Size of initial strain array.
+       * @param computeStateVars Flag indicating to compute updated
+       * state variables.
+       */
+      void _calcStress(double* const stress,
+		       const int stressSize,
+		       const double* properties,
+		       const int numProperties,
+		       const double* stateVars,
+		       const int numStateVars,
+		       const double* totalStrain,
+		       const int strainSize,
+		       const double* initialStress,
+		       const int initialStressSize,
+		       const double* initialStrain,
+		       const int initialStrainSize,
+		       const bool computeStateVars);
+
+      /** Compute derivatives of elasticity matrix from properties.
+       *
+       * @param elasticConsts Array for elastic constants.
+       * @param numElasticConsts Number of elastic constants.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       * @param totalStrain Total strain at location.
+       * @param strainSize Size of strain tensor.
+       * @param initialStress Initial stress tensor at location.
+       * @param initialStressSize Size of initial stress array.
+       * @param initialStrain Initial strain tensor at location.
+       * @param initialStrainSize Size of initial strain array.
+       */
+      void _calcElasticConsts(double* const elasticConsts,
+			      const int numElasticConsts,
+			      const double* properties,
+			      const int numProperties,
+			      const double* stateVars,
+			      const int numStateVars,
+			      const double* totalStrain,
+			      const int strainSize,
+			      const double* initialStress,
+			      const int initialStressSize,
+			      const double* initialStrain,
+			      const int initialStrainSize);
+
+      /** Get stable time step for implicit time integration.
+       *
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       *
+       * @returns Time step
+       */
+      double _stableTimeStepImplicit(const double* properties,
+				     const int numProperties,
+				     const double* stateVars,
+				     const int numStateVars) const;
+
+    }; // class ElasticIsotropic3D
+
+  } // materials
+} // pylith
+
+
+// End of file 

Added: short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticPlaneStrain.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticPlaneStrain.i	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticPlaneStrain.i	2009-03-13 23:52:54 UTC (rev 14316)
@@ -0,0 +1,158 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file modulesrc/materials/ElasticPlaneStrain.i
+ *
+ * Python interface to C++ ElasticPlaneStrain object.
+ */
+
+namespace pylith {
+  namespace materials {
+
+    class ElasticPlaneStrain : public ElasticMaterial
+    { // class ElasticPlaneStrain
+
+      // PUBLIC METHODS /////////////////////////////////////////////////
+    public :
+      
+      /// Default constructor
+      ElasticPlaneStrain(void);
+      
+      /// Destructor
+      ~ElasticPlaneStrain(void);
+      
+      // PROTECTED METHODS //////////////////////////////////////////////
+    protected :
+
+      /** Compute properties from values in spatial database.
+       *
+       * Order of values in arrays matches order used in dbValues() and
+       * parameterNames().
+       *
+       * @param propValues Array of property values.
+       * @param dbValues Array of database values.
+       */
+      void _dbToProperties(double* const propValues,
+			   const double_array& dbValues) const;
+
+      /** Nondimensionalize properties.
+       *
+       * @param values Array of property values.
+       * @param nvalues Number of values.
+       */
+      void _nondimProperties(double* const values,
+			     const int nvalues) const;
+
+      /** Dimensionalize properties.
+       *
+       * @param values Array of property values.
+       * @param nvalues Number of values.
+       */
+      void _dimProperties(double* const values,
+			  const int nvalues) const;
+
+      /** Compute density from properties.
+       *
+       * @param density Array for density.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       */
+      void _calcDensity(double* const density,
+			const double* properties,
+			const int numProperties,
+			const double* stateVars,
+			const int numStateVars);
+
+      /** Compute stress tensor from properties and state variables. If
+       * the state variables are from the previous time step, then the
+       * computeStateVars flag should be set to true so that the state
+       * variables are updated (but not stored) when computing the
+       * stresses.
+       *
+       * @param stress Array for stress tensor.
+       * @param stressSize Size of stress tensor.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       * @param totalStrain Total strain at location.
+       * @param strainSize Size of strain tensor.
+       * @param initialStress Initial stress tensor at location.
+       * @param initialStressSize Size of initial stress array.
+       * @param initialStrain Initial strain tensor at location.
+       * @param initialStrainSize Size of initial strain array.
+       * @param computeStateVars Flag indicating to compute updated
+       * state variables.
+       */
+      void _calcStress(double* const stress,
+		       const int stressSize,
+		       const double* properties,
+		       const int numProperties,
+		       const double* stateVars,
+		       const int numStateVars,
+		       const double* totalStrain,
+		       const int strainSize,
+		       const double* initialStress,
+		       const int initialStressSize,
+		       const double* initialStrain,
+		       const int initialStrainSize,
+		       const bool computeStateVars);
+
+      /** Compute derivatives of elasticity matrix from properties.
+       *
+       * @param elasticConsts Array for elastic constants.
+       * @param numElasticConsts Number of elastic constants.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       * @param totalStrain Total strain at location.
+       * @param strainSize Size of strain tensor.
+       * @param initialStress Initial stress tensor at location.
+       * @param initialStressSize Size of initial stress array.
+       * @param initialStrain Initial strain tensor at location.
+       * @param initialStrainSize Size of initial strain array.
+       */
+      void _calcElasticConsts(double* const elasticConsts,
+			      const int numElasticConsts,
+			      const double* properties,
+			      const int numProperties,
+			      const double* stateVars,
+			      const int numStateVars,
+			      const double* totalStrain,
+			      const int strainSize,
+			      const double* initialStress,
+			      const int initialStressSize,
+			      const double* initialStrain,
+			      const int initialStrainSize);
+
+      /** Get stable time step for implicit time integration.
+       *
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       *
+       * @returns Time step
+       */
+      double _stableTimeStepImplicit(const double* properties,
+				     const int numProperties,
+				     const double* stateVars,
+				     const int numStateVars) const;
+
+    }; // class ElasticPlaneStrain
+
+  } // materials
+} // pylith
+
+
+// End of file 

Added: short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticPlaneStress.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticPlaneStress.i	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticPlaneStress.i	2009-03-13 23:52:54 UTC (rev 14316)
@@ -0,0 +1,158 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file modulesrc/materials/ElasticPlaneStress.i
+ *
+ * Python interface to C++ ElasticPlaneStress object.
+ */
+
+namespace pylith {
+  namespace materials {
+
+    class ElasticPlaneStress : public ElasticMaterial
+    { // class ElasticPlaneStress
+
+      // PUBLIC METHODS /////////////////////////////////////////////////
+    public :
+      
+      /// Default constructor
+      ElasticPlaneStress(void);
+      
+      /// Destructor
+      ~ElasticPlaneStress(void);
+      
+      // PROTECTED METHODS //////////////////////////////////////////////
+    protected :
+
+      /** Compute properties from values in spatial database.
+       *
+       * Order of values in arrays matches order used in dbValues() and
+       * parameterNames().
+       *
+       * @param propValues Array of property values.
+       * @param dbValues Array of database values.
+       */
+      void _dbToProperties(double* const propValues,
+			   const double_array& dbValues) const;
+
+      /** Nondimensionalize properties.
+       *
+       * @param values Array of property values.
+       * @param nvalues Number of values.
+       */
+      void _nondimProperties(double* const values,
+			     const int nvalues) const;
+
+      /** Dimensionalize properties.
+       *
+       * @param values Array of property values.
+       * @param nvalues Number of values.
+       */
+      void _dimProperties(double* const values,
+			  const int nvalues) const;
+
+      /** Compute density from properties.
+       *
+       * @param density Array for density.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       */
+      void _calcDensity(double* const density,
+			const double* properties,
+			const int numProperties,
+			const double* stateVars,
+			const int numStateVars);
+
+      /** Compute stress tensor from properties and state variables. If
+       * the state variables are from the previous time step, then the
+       * computeStateVars flag should be set to true so that the state
+       * variables are updated (but not stored) when computing the
+       * stresses.
+       *
+       * @param stress Array for stress tensor.
+       * @param stressSize Size of stress tensor.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       * @param totalStrain Total strain at location.
+       * @param strainSize Size of strain tensor.
+       * @param initialStress Initial stress tensor at location.
+       * @param initialStressSize Size of initial stress array.
+       * @param initialStrain Initial strain tensor at location.
+       * @param initialStrainSize Size of initial strain array.
+       * @param computeStateVars Flag indicating to compute updated
+       * state variables.
+       */
+      void _calcStress(double* const stress,
+		       const int stressSize,
+		       const double* properties,
+		       const int numProperties,
+		       const double* stateVars,
+		       const int numStateVars,
+		       const double* totalStrain,
+		       const int strainSize,
+		       const double* initialStress,
+		       const int initialStressSize,
+		       const double* initialStrain,
+		       const int initialStrainSize,
+		       const bool computeStateVars);
+
+      /** Compute derivatives of elasticity matrix from properties.
+       *
+       * @param elasticConsts Array for elastic constants.
+       * @param numElasticConsts Number of elastic constants.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       * @param totalStrain Total strain at location.
+       * @param strainSize Size of strain tensor.
+       * @param initialStress Initial stress tensor at location.
+       * @param initialStressSize Size of initial stress array.
+       * @param initialStrain Initial strain tensor at location.
+       * @param initialStrainSize Size of initial strain array.
+       */
+      void _calcElasticConsts(double* const elasticConsts,
+			      const int numElasticConsts,
+			      const double* properties,
+			      const int numProperties,
+			      const double* stateVars,
+			      const int numStateVars,
+			      const double* totalStrain,
+			      const int strainSize,
+			      const double* initialStress,
+			      const int initialStressSize,
+			      const double* initialStrain,
+			      const int initialStrainSize);
+
+      /** Get stable time step for implicit time integration.
+       *
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       *
+       * @returns Time step
+       */
+      double _stableTimeStepImplicit(const double* properties,
+				     const int numProperties,
+				     const double* stateVars,
+				     const int numStateVars) const;
+
+    }; // class ElasticPlaneStress
+
+  } // materials
+} // pylith
+
+
+// End of file 

Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticStrain1D.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticStrain1D.i	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticStrain1D.i	2009-03-13 23:52:54 UTC (rev 14316)
@@ -26,10 +26,129 @@
 
       /// Default constructor
       ElasticStrain1D(void);
-
+      
       /// Destructor
       ~ElasticStrain1D(void);
 
+      // PROTECTED METHODS //////////////////////////////////////////////
+    protected :
+
+      /** Compute properties from values in spatial database.
+       *
+       * Order of values in arrays matches order used in dbValues() and
+       * parameterNames().
+       *
+       * @param propValues Array of property values.
+       * @param dbValues Array of database values.
+       */
+      void _dbToProperties(double* const propValues,
+			   const double_array& dbValues) const;
+      
+      /** Nondimensionalize properties.
+       *
+       * @param values Array of property values.
+       * @param nvalues Number of values.
+       */
+      void _nondimProperties(double* const values,
+			     const int nvalues) const;
+      
+      /** Dimensionalize properties.
+       *
+       * @param values Array of property values.
+       * @param nvalues Number of values.
+       */
+      void _dimProperties(double* const values,
+			  const int nvalues) const;
+      
+      /** Compute density from properties.
+       *
+       * @param density Array for density.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       */
+      void _calcDensity(double* const density,
+			const double* properties,
+			const int numProperties,
+			const double* stateVars,
+			const int numStateVars);
+      
+      /** Compute stress tensor from properties and state variables. If
+       * the state variables are from the previous time step, then the
+       * computeStateVars flag should be set to true so that the state
+       * variables are updated (but not stored) when computing the
+       * stresses.
+       *
+       * @param stress Array for stress tensor.
+       * @param stressSize Size of stress tensor.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       * @param totalStrain Total strain at location.
+       * @param strainSize Size of strain tensor.
+       * @param initialStress Initial stress tensor at location.
+       * @param initialStressSize Size of initial stress array.
+       * @param initialStrain Initial strain tensor at location.
+       * @param initialStrainSize Size of initial strain array.
+       * @param computeStateVars Flag indicating to compute updated
+       * state variables.
+       */
+      void _calcStress(double* const stress,
+		       const int stressSize,
+		       const double* properties,
+		       const int numProperties,
+		       const double* stateVars,
+		       const int numStateVars,
+		       const double* totalStrain,
+		       const int strainSize,
+		       const double* initialStress,
+		       const int initialStressSize,
+		       const double* initialStrain,
+		       const int initialStrainSize,
+		       const bool computeStateVars);
+      
+      /** Compute derivatives of elasticity matrix from properties.
+       *
+       * @param elasticConsts Array for elastic constants.
+       * @param numElasticConsts Number of elastic constants.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       * @param totalStrain Total strain at location.
+       * @param strainSize Size of strain tensor.
+       * @param initialStress Initial stress tensor at location.
+       * @param initialStressSize Size of initial stress array.
+       * @param initialStrain Initial strain tensor at location.
+       * @param initialStrainSize Size of initial strain array.
+       */
+      void _calcElasticConsts(double* const elasticConsts,
+			      const int numElasticConsts,
+			      const double* properties,
+			      const int numProperties,
+			      const double* stateVars,
+			      const int numStateVars,
+			      const double* totalStrain,
+			      const int strainSize,
+			      const double* initialStress,
+			      const int initialStressSize,
+			      const double* initialStrain,
+			      const int initialStrainSize);
+      
+      /** Get stable time step for implicit time integration.
+       *
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       *
+       * @returns Time step
+       */
+      double _stableTimeStepImplicit(const double* properties,
+				     const int numProperties,
+				     const double* stateVars,
+				     const int numStateVars) const;
+
     }; // class ElasticStrain1D
 
   } // materials

Added: short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticStress1D.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticStress1D.i	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticStress1D.i	2009-03-13 23:52:54 UTC (rev 14316)
@@ -0,0 +1,158 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file modulesrc/materials/ElasticStress1D.i
+ *
+ * Python interface to C++ ElasticStress1D object.
+ */
+
+namespace pylith {
+  namespace materials {
+
+    class ElasticStress1D : public ElasticMaterial
+    { // class ElasticStress1D
+
+      // PUBLIC METHODS /////////////////////////////////////////////////
+    public :
+
+      /// Default constructor
+      ElasticStress1D(void);
+      
+      /// Destructor
+      ~ElasticStress1D(void);
+
+      // PROTECTED METHODS //////////////////////////////////////////////
+    protected :
+
+      /** Compute properties from values in spatial database.
+       *
+       * Order of values in arrays matches order used in dbValues() and
+       * parameterNames().
+       *
+       * @param propValues Array of property values.
+       * @param dbValues Array of database values.
+       */
+      void _dbToProperties(double* const propValues,
+			   const double_array& dbValues) const;
+      
+      /** Nondimensionalize properties.
+       *
+       * @param values Array of property values.
+       * @param nvalues Number of values.
+       */
+      void _nondimProperties(double* const values,
+			     const int nvalues) const;
+      
+      /** Dimensionalize properties.
+       *
+       * @param values Array of property values.
+       * @param nvalues Number of values.
+       */
+      void _dimProperties(double* const values,
+			  const int nvalues) const;
+      
+      /** Compute density from properties.
+       *
+       * @param density Array for density.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       */
+      void _calcDensity(double* const density,
+			const double* properties,
+			const int numProperties,
+			const double* stateVars,
+			const int numStateVars);
+      
+      /** Compute stress tensor from properties and state variables. If
+       * the state variables are from the previous time step, then the
+       * computeStateVars flag should be set to true so that the state
+       * variables are updated (but not stored) when computing the
+       * stresses.
+       *
+       * @param stress Array for stress tensor.
+       * @param stressSize Size of stress tensor.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       * @param totalStrain Total strain at location.
+       * @param strainSize Size of strain tensor.
+       * @param initialStress Initial stress tensor at location.
+       * @param initialStressSize Size of initial stress array.
+       * @param initialStrain Initial strain tensor at location.
+       * @param initialStrainSize Size of initial strain array.
+       * @param computeStateVars Flag indicating to compute updated
+       * state variables.
+       */
+      void _calcStress(double* const stress,
+		       const int stressSize,
+		       const double* properties,
+		       const int numProperties,
+		       const double* stateVars,
+		       const int numStateVars,
+		       const double* totalStrain,
+		       const int strainSize,
+		       const double* initialStress,
+		       const int initialStressSize,
+		       const double* initialStrain,
+		       const int initialStrainSize,
+		       const bool computeStateVars);
+      
+      /** Compute derivatives of elasticity matrix from properties.
+       *
+       * @param elasticConsts Array for elastic constants.
+       * @param numElasticConsts Number of elastic constants.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       * @param totalStrain Total strain at location.
+       * @param strainSize Size of strain tensor.
+       * @param initialStress Initial stress tensor at location.
+       * @param initialStressSize Size of initial stress array.
+       * @param initialStrain Initial strain tensor at location.
+       * @param initialStrainSize Size of initial strain array.
+       */
+      void _calcElasticConsts(double* const elasticConsts,
+			      const int numElasticConsts,
+			      const double* properties,
+			      const int numProperties,
+			      const double* stateVars,
+			      const int numStateVars,
+			      const double* totalStrain,
+			      const int strainSize,
+			      const double* initialStress,
+			      const int initialStressSize,
+			      const double* initialStrain,
+			      const int initialStrainSize);
+      
+      /** Get stable time step for implicit time integration.
+       *
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       *
+       * @returns Time step
+       */
+      double _stableTimeStepImplicit(const double* properties,
+				     const int numProperties,
+				     const double* stateVars,
+				     const int numStateVars) const;
+
+    }; // class ElasticStress1D
+
+  } // materials
+} // pylith
+
+
+// End of file

Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/materials/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/materials/Makefile.am	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/materials/Makefile.am	2009-03-13 23:52:54 UTC (rev 14316)
@@ -21,7 +21,11 @@
 	materials.i \
 	Material.i \
 	ElasticMaterial.i \
-	ElasticStrain1D.i
+	ElasticStrain1D.i \
+	ElasticStress1D.i \
+	ElasticPlaneStrain.i \
+	ElasticPlaneStress.i \
+	ElasticIsotropic3D.i
 
 swig_generated = \
 	materials_wrap.cxx \

Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/materials/materials.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/materials/materials.i	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/materials/materials.i	2009-03-13 23:52:54 UTC (rev 14316)
@@ -22,6 +22,10 @@
 
 #include "pylith/materials/ElasticMaterial.hh"
 #include "pylith/materials/ElasticStrain1D.hh"
+#include "pylith/materials/ElasticStress1D.hh"
+#include "pylith/materials/ElasticPlaneStrain.hh"
+#include "pylith/materials/ElasticPlaneStress.hh"
+#include "pylith/materials/ElasticIsotropic3D.hh"
 
 #include "pylith/utils/arrayfwd.hh"
 %}
@@ -51,6 +55,10 @@
 %include "Material.i"
 %include "ElasticMaterial.i"
 %include "ElasticStrain1D.i"
+%include "ElasticStress1D.i"
+%include "ElasticPlaneStrain.i"
+%include "ElasticPlaneStress.i"
+%include "ElasticIsotropic3D.i"
 
 
 // End of file

Modified: short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -127,8 +127,7 @@
     """
     Create handle to corresponding C++ object.
     """
-    if None == self.this:
-      ModuleAbsorbingDampers.__init__(self)
+    ModuleAbsorbingDampers.__init__(self)
     return
   
 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/bc/BoundaryCondition.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/bc/BoundaryCondition.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/pylith/bc/BoundaryCondition.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -93,7 +93,6 @@
     Constructor.
     """
     Component.__init__(self, name, facility="boundary_condition")
-    self.this = None
     self._createModuleObj()
     return
 
@@ -127,4 +126,12 @@
     return
 
 
+  def _createModuleObj(self):
+    """
+    Call constructor for module object for access to C++ object.
+    """
+    raise NotImplementedError, \
+          "Please implement _createModuleOb() in derived class."
+
+
 # End of file 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/bc/DirichletBC.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/bc/DirichletBC.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/pylith/bc/DirichletBC.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -157,8 +157,7 @@
     """
     Create handle to corresponding C++ object.
     """
-    if None == self.this:
-      ModuleDirichletBC.__init__(self)
+    ModuleDirichletBC.__init__(self)
     return
   
 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/bc/DirichletBoundary.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/bc/DirichletBoundary.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/pylith/bc/DirichletBoundary.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -146,8 +146,7 @@
     """
     Create handle to corresponding C++ object.
     """
-    if None == self.this:
-      ModuleDirichletBoundary.__init__(self)
+    ModuleDirichletBoundary.__init__(self)
     return
   
 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/bc/Neumann.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/bc/Neumann.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/pylith/bc/Neumann.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -168,8 +168,7 @@
     """
     Create handle to corresponding C++ object.
     """
-    if None == self.this:
-      ModuleNeumann.__init__(self)
+    ModuleNeumann.__init__(self)
     return
   
 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticIsotropic3D.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticIsotropic3D.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticIsotropic3D.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -17,9 +17,10 @@
 ## Factory: material.
 
 from ElasticMaterial import ElasticMaterial
+from materials import ElasticIsotropic3D as ModuleElasticIsotropic3D
 
 # ElasticIsotropic3D class
-class ElasticIsotropic3D(ElasticMaterial):
+class ElasticIsotropic3D(ElasticMaterial, ModuleElasticIsotropic3D):
   """
   Python object implementing 3-D isotropic linear elastic material.
 
@@ -44,14 +45,13 @@
     return
 
 
-  def _createCppHandle(self):
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _createModuleObj(self):
     """
-    Create handle to corresponding C++ object.
+    Call constructor for module object for access to C++ object.
     """
-    if None == self.cppHandle:
-      import pylith.materials.materials as bindings
-      self.cppHandle = bindings.ElasticIsotropic3D()
-      self.dimension = self.cppHandle.dimension
+    ModuleElasticIsotropic3D.__init__(self)
     return
   
 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticMaterial.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticMaterial.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticMaterial.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -62,22 +62,6 @@
     return
 
 
-  def useElasticBehavior(self, flag):
-    """
-    Set useElasticBehavior flag (True=elastic, False=inelastic if applicable).
-    """
-    assert(None != self.cppHandle)
-    self.cppHandle.useElasticBehavior = flag
-    return
-
-
-  def getCellField(self, name):
-    """
-    Get cell field.
-    """
-    return self.cppHandle.cellField(name, self.mesh.cppHandle)
-
-
   # PRIVATE METHODS ////////////////////////////////////////////////////
 
   def _configure(self):

Modified: short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticPlaneStrain.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticPlaneStrain.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticPlaneStrain.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -18,9 +18,10 @@
 ## Factory: material.
 
 from ElasticMaterial import ElasticMaterial
+from materials import ElasticPlaneStrain as ModuleElasticPlaneStrain
 
 # ElasticPlaneStrain class
-class ElasticPlaneStrain(ElasticMaterial):
+class ElasticPlaneStrain(ElasticMaterial, ModuleElasticPlaneStrain):
   """
   Python object implementing 2-D isotropic linear elastic material for
   plane strain.
@@ -46,14 +47,13 @@
     return
 
 
-  def _createCppHandle(self):
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _createModuleObj(self):
     """
-    Create handle to corresponding C++ object.
+    Call constructor for module object for access to C++ object.
     """
-    if None == self.cppHandle:
-      import pylith.materials.materials as bindings
-      self.cppHandle = bindings.ElasticPlaneStrain()
-      self.dimension = self.cppHandle.dimension
+    ModuleElasticPlaneStrain.__init__(self)
     return
   
 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticPlaneStress.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticPlaneStress.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticPlaneStress.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -18,9 +18,10 @@
 ## Factory: material.
 
 from ElasticMaterial import ElasticMaterial
+from materials import ElasticPlaneStress as ModuleElasticPlaneStress
 
 # ElasticPlaneStress class
-class ElasticPlaneStress(ElasticMaterial):
+class ElasticPlaneStress(ElasticMaterial, ModuleElasticPlaneStress):
   """
   Python object implementing 2-D isotropic linear elastic material for
   plane stress.
@@ -46,14 +47,13 @@
     return
 
 
-  def _createCppHandle(self):
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _createModuleObj(self):
     """
-    Create handle to corresponding C++ object.
+    Call constructor for module object for access to C++ object.
     """
-    if None == self.cppHandle:
-      import pylith.materials.materials as bindings
-      self.cppHandle = bindings.ElasticPlaneStress()
-      self.dimension = self.cppHandle.dimension
+    ModuleElasticPlaneStress.__init__(self)
     return
   
 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticStrain1D.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticStrain1D.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticStrain1D.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -18,9 +18,10 @@
 ## Factory: material.
 
 from ElasticMaterial import ElasticMaterial
+from materials import ElasticStrain1D as ModuleElasticStrain1D
 
 # ElasticStrain1D class
-class ElasticStrain1D(ElasticMaterial):
+class ElasticStrain1D(ElasticMaterial, ModuleElasticStrain1D):
   """
   Python object implementing 1-D linear elastic material with axial strain.
 
@@ -45,14 +46,13 @@
     return
 
 
-  def _createCppHandle(self):
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _createModuleObj(self):
     """
-    Create handle to corresponding C++ object.
+    Call constructor for module object for access to C++ object.
     """
-    if None == self.cppHandle:
-      import pylith.materials.materials as bindings
-      self.cppHandle = bindings.ElasticStrain1D()
-      self.dimension = self.cppHandle.dimension
+    ModuleElasticStrain1D.__init__(self)
     return
   
 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticStress1D.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticStress1D.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/pylith/materials/ElasticStress1D.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -18,9 +18,10 @@
 ## Factory: material.
 
 from ElasticMaterial import ElasticMaterial
+from materials import ElasticStress1D as ModuleElasticStress1D
 
 # ElasticStress1D class
-class ElasticStress1D(ElasticMaterial):
+class ElasticStress1D(ElasticMaterial, ModuleElasticStress1D):
   """
   Python object implementing 1-D linear elastic material with axial stress.
 
@@ -45,14 +46,13 @@
     return
 
 
-  def _createCppHandle(self):
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _createModuleObj(self):
     """
-    Create handle to corresponding C++ object.
+    Call constructor for module object for access to C++ object.
     """
-    if None == self.cppHandle:
-      import pylith.materials.materials as bindings
-      self.cppHandle = bindings.ElasticStress1D()
-      self.dimension = self.cppHandle.dimension
+    ModuleElasticStress1D.__init__(self)
     return
   
 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/materials/Material.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/materials/Material.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/pylith/materials/Material.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -24,11 +24,10 @@
 ##
 ## Factory: material
 
-from materials import ModuleMaterial
 from pyre.components.Component import Component
 
 # Material class
-class Material(Component, ModuleMaterial):
+class Material(Component):
   """
   Python material property manager.
 
@@ -81,8 +80,8 @@
                                            factory=SimpleDB)
     dbInitialState.meta['tip'] = "Database for initial state variables."
 
-    from pylith.feassemble.quadrature.Quadrature import Quadrature
-    quadrature = pyre.inventory.facility("quadrature", factory=Quadrature)
+    from pylith.feassemble.Quadrature import MeshQuadrature
+    quadrature = pyre.inventory.facility("quadrature", factory=MeshQuadrature)
     quadrature.meta['tip'] = "Quadrature object for numerical integration."
 
 
@@ -93,17 +92,19 @@
     Constructor.
     """
     Component.__init__(self, name, facility="material")
-    ModuleMaterial.__init__(self)
+    self._createModuleObj()
     self.output = None
     return
 
 
-  def preinitialize(self):
+  def preinitialize(self, mesh):
     """
     Do pre-initialization setup.
     """
-    self.quadrature.preinitialize()
     self._setupLogging()
+    self.mesh = mesh
+    self.quadrature(self.matQuadrature)
+    self.matQuadrature.preinitialize(self.mesh.coordsys().dimension())
     return
 
 
@@ -114,12 +115,17 @@
     logEvent = "%sverify" % self._loggingPrefix
     self._logger.eventBegin(logEvent)
 
-    if self.quadrature.spaceDim != self.dimension:
+    if self.matQuadrature.cellDim != self.mesh.dimension() or \
+       self.matQuadrature.spaceDim != self.mesh.coordsys.spaceDim():
         raise ValueError, \
-              "Quadrature scheme and material are incompatible.\n" \
-              "Dimension for quadrature: %d\n" \
-              "Dimension for material '%s': %d" % \
-              (self.quadrature.spaceDim, self.label, self.dimension)
+              "Quadrature scheme for material '%s' and mesh are incompatible.\n" \
+              "Quadrature cell dimension: %d\n" \
+              "Quadrature spatial dimension: %d\n" \
+              "Mesh cell dimension: %d\n" \
+              "Mesh spatial dimension: %d" % \
+              (self.label,
+               self.matQuadrature.cellDim, self.matQuadrature.spaceDim,
+               self.mesh.dimension(), self.mesh.coordsys().spaceDim())
     
     self._logger.eventEnd(logEvent)
     return
@@ -145,18 +151,18 @@
     if self.inventory.useInitialState:
       self.dbInitialState(self.inventory.dbInitialState)
 
-    self.quadrature = self.inventory.quadrature
+    self.matQuadrature = self.inventory.quadrature
     return
 
   
-  def _createCppHandle(self):
+  def _createModuleObj(self):
     """
-    Create handle to corresponding C++ object.
+    Call constructor for module object for access to C++ object.
     """
-    raise NotImplementedError("Please implement _createCppHandle() in " \
-                              "derived class.")
-  
-  
+    raise NotImplementedError, \
+          "Please implement _createModuleOb() in derived class."
+
+
   def _setupLogging(self):
     """
     Setup event logging.
@@ -166,7 +172,7 @@
 
     from pylith.utils.EventLogger import EventLogger
     logger = EventLogger()
-    logger.setClassName("FE Material")
+    logger.className("FE Material")
     logger.initialize()
 
     events = ["verify",

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticIsotropic3D.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticIsotropic3D.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticIsotropic3D.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -28,20 +28,9 @@
     """
     Test constructor.
     """
-    from pylith.materials.ElasticIsotropic3D import ElasticIsotropic3D
     material = ElasticIsotropic3D()
-    material._createCppHandle()
-    self.assertNotEqual(None, material.cppHandle)
-    return
 
-
-  def test_dimension(self):
-    """
-    Test dimension().
-    """
-    material = ElasticIsotropic3D()
-    material._createCppHandle()
-    self.assertEqual(3, material.dimension)
+    self.assertEqual(3, material.dimension())
     return
 
 
@@ -50,7 +39,6 @@
     Test useElasticBehavior().
     """
     material = ElasticIsotropic3D()
-    material._createCppHandle()
     material.useElasticBehavior(False)
     return
 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStrain.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStrain.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStrain.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -29,18 +29,8 @@
     Test constructor.
     """
     material = ElasticPlaneStrain()
-    material._createCppHandle()
-    self.assertNotEqual(None, material.cppHandle)
-    return
 
-
-  def test_dimension(self):
-    """
-    Test dimension().
-    """
-    material = ElasticPlaneStrain()
-    material._createCppHandle()
-    self.assertEqual(2, material.dimension)
+    self.assertEqual(2, material.dimension())
     return
 
 
@@ -49,7 +39,6 @@
     Test useElasticBehavior().
     """
     material = ElasticPlaneStrain()
-    material._createCppHandle()
     material.useElasticBehavior(False)
     return
 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStress.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStress.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStress.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -29,18 +29,8 @@
     Test constructor.
     """
     material = ElasticPlaneStress()
-    material._createCppHandle()
-    self.assertNotEqual(None, material.cppHandle)
-    return
 
-
-  def test_dimension(self):
-    """
-    Test dimension().
-    """
-    material = ElasticPlaneStress()
-    material._createCppHandle()
-    self.assertEqual(2, material.dimension)
+    self.assertEqual(2, material.dimension())
     return
 
 
@@ -49,7 +39,6 @@
     Test useElasticBehavior().
     """
     material = ElasticPlaneStress()
-    material._createCppHandle()
     material.useElasticBehavior(False)
     return
 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStrain1D.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStrain1D.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStrain1D.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -29,18 +29,8 @@
     Test constructor.
     """
     material = ElasticStrain1D()
-    material._createCppHandle()
-    self.assertNotEqual(None, material.cppHandle)
-    return
 
-
-  def test_dimension(self):
-    """
-    Test dimension().
-    """
-    material = ElasticStrain1D()
-    material._createCppHandle()
-    self.assertEqual(1, material.dimension)
+    self.assertEqual(1, material.dimension())
     return
 
 
@@ -49,7 +39,6 @@
     Test useElasticBehavior().
     """
     material = ElasticStrain1D()
-    material._createCppHandle()
     material.useElasticBehavior(False)
     return
 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStress1D.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStress1D.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStress1D.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -29,18 +29,8 @@
     Test constructor.
     """
     material = ElasticStress1D()
-    material._createCppHandle()
-    self.assertNotEqual(None, material.cppHandle)
-    return
 
-
-  def test_dimension(self):
-    """
-    Test dimension().
-    """
-    material = ElasticStress1D()
-    material._createCppHandle()
-    self.assertEqual(1, material.dimension)
+    self.assertEqual(1, material.dimension())
     return
 
 
@@ -49,7 +39,6 @@
     Test useElasticBehavior().
     """
     material = ElasticStress1D()
-    material._createCppHandle()
     material.useElasticBehavior(False)
     return
 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/testmaterials.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/testmaterials.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/testmaterials.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -56,33 +56,33 @@
 
     suite = unittest.TestSuite()
 
-    from TestMaterial import TestMaterial
-    suite.addTest(unittest.makeSuite(TestMaterial))
+    #from TestMaterial import TestMaterial
+    #suite.addTest(unittest.makeSuite(TestMaterial))
 
-    from TestElasticIsotropic3D import TestElasticIsotropic3D
-    suite.addTest(unittest.makeSuite(TestElasticIsotropic3D))
+    from TestElasticStrain1D import TestElasticStrain1D
+    suite.addTest(unittest.makeSuite(TestElasticStrain1D))
 
+    from TestElasticStress1D import TestElasticStress1D
+    suite.addTest(unittest.makeSuite(TestElasticStress1D))
+
     from TestElasticPlaneStrain import TestElasticPlaneStrain
     suite.addTest(unittest.makeSuite(TestElasticPlaneStrain))
 
     from TestElasticPlaneStress import TestElasticPlaneStress
     suite.addTest(unittest.makeSuite(TestElasticPlaneStress))
 
-    from TestElasticStrain1D import TestElasticStrain1D
-    suite.addTest(unittest.makeSuite(TestElasticStrain1D))
+    from TestElasticIsotropic3D import TestElasticIsotropic3D
+    suite.addTest(unittest.makeSuite(TestElasticIsotropic3D))
 
-    from TestElasticStress1D import TestElasticStress1D
-    suite.addTest(unittest.makeSuite(TestElasticStress1D))
+    #from TestMaxwellIsotropic3D import TestMaxwellIsotropic3D
+    #suite.addTest(unittest.makeSuite(TestMaxwellIsotropic3D))
 
-    from TestMaxwellIsotropic3D import TestMaxwellIsotropic3D
-    suite.addTest(unittest.makeSuite(TestMaxwellIsotropic3D))
+    #from TestGenMaxwellIsotropic3D import TestGenMaxwellIsotropic3D
+    #suite.addTest(unittest.makeSuite(TestGenMaxwellIsotropic3D))
 
-    from TestGenMaxwellIsotropic3D import TestGenMaxwellIsotropic3D
-    suite.addTest(unittest.makeSuite(TestGenMaxwellIsotropic3D))
+    #from TestHomogeneous import TestHomogeneous
+    #suite.addTest(unittest.makeSuite(TestHomogeneous))
 
-    from TestHomogeneous import TestHomogeneous
-    suite.addTest(unittest.makeSuite(TestHomogeneous))
-
     return suite
 
 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/Makefile.am	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/Makefile.am	2009-03-13 23:52:54 UTC (rev 14316)
@@ -15,8 +15,8 @@
 
 SUBDIRS = data
 
-TESTS = testdriver.py
-dist_check_SCRIPTS = testdriver.py 
+TESTS = testmeshio.py
+dist_check_SCRIPTS = testmeshio.py 
 
 TESTS_ENVIRONMENT = $(PYTHON)
 
@@ -30,8 +30,8 @@
 	TestOutputSolnSubset.py
 
 if ENABLE_CUBIT
-  TESTS += testdriver_cubit.py
-  dist_check_SCRIPTS += testdriver_cubit.py
+  TESTS += testcubit.py
+  dist_check_SCRIPTS += testcubit.py
 endif	
 
 noinst_tmp = \

Copied: short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testcubit.py (from rev 14315, short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testdriver_cubit.py)
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testcubit.py	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testcubit.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+## @file unittests/meshio/testmeshio.py
+
+## @brief Python application for testing meshio code.
+
+from pyre.applications.Script import Script
+
+import unittest
+
+class TestApp(Script):
+  """
+  Test application.
+  """
+
+  # PUBLIC METHODS /////////////////////////////////////////////////////
+
+  def __init__(self, name="testapp"):
+    """
+    Constructor.
+    """
+    Script.__init__(self, name)
+    return
+
+
+  def main(self):
+    """
+    Run the application.
+    """
+    from pylith.utils.PetscManager import PetscManager
+    manager = PetscManager()
+    manager.initialize()
+    unittest.TextTestRunner(verbosity=2).run(self._suite())
+    manager.finalize()
+    return
+
+
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _suite(self):
+    """
+    Setup the test suite.
+    """
+
+    suite = unittest.TestSuite()
+
+    from TestMeshIOCubit import TestMeshIOCubit
+    suite.addTest(unittest.makeSuite(TestMeshIOCubit))
+
+    return suite
+
+
+# ----------------------------------------------------------------------
+if __name__ == '__main__':
+  app = TestApp()
+  app.run()
+
+
+# End of file 

Deleted: short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testdriver.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testdriver.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testdriver.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -1,86 +0,0 @@
-#!/usr/bin/env python
-#
-# ======================================================================
-#
-#                           Brad T. Aagaard
-#                        U.S. Geological Survey
-#
-# {LicenseText}
-#
-# ======================================================================
-#
-
-## @file unittests/meshio/testmeshio.py
-
-## @brief Python application for testing meshio code.
-
-from pyre.applications.Script import Script
-
-import unittest
-
-class TestApp(Script):
-  """
-  Test application.
-  """
-
-  # PUBLIC METHODS /////////////////////////////////////////////////////
-
-  def __init__(self, name="testapp"):
-    """
-    Constructor.
-    """
-    Script.__init__(self, name)
-    return
-
-
-  def main(self):
-    """
-    Run the application.
-    """
-    from pylith.utils.PetscManager import PetscManager
-    manager = PetscManager()
-    manager.initialize()
-
-    unittest.TextTestRunner(verbosity=2).run(self._suite())
-
-    manager.finalize()
-    return
-
-
-  # PRIVATE METHODS ////////////////////////////////////////////////////
-
-  def _suite(self):
-    """
-    Setup the test suite.
-    """
-
-    suite = unittest.TestSuite()
-
-    from TestMeshIOAscii import TestMeshIOAscii
-    suite.addTest(unittest.makeSuite(TestMeshIOAscii))
-
-    from TestMeshIOLagrit import TestMeshIOLagrit
-    suite.addTest(unittest.makeSuite(TestMeshIOLagrit))
-
-    #from TestVertexFilterVecNorm import TestVertexFilterVecNorm
-    #suite.addTest(unittest.makeSuite(TestVertexFilterVecNorm))
-
-    #from TestCellFilterAvg import TestCellFilterAvg
-    #suite.addTest(unittest.makeSuite(TestCellFilterAvg))
-
-    #from TestOutputManager import TestOutputManager
-    #suite.addTest(unittest.makeSuite(TestOutputManager))
-
-    #from TestOutputSolnSubset import TestOutputSolnSubset
-    #suite.addTest(unittest.makeSuite(TestOutputSolnSubset))
-
-    return suite
-
-
-# ----------------------------------------------------------------------
-if __name__ == '__main__':
-  app = TestApp()
-  app.run()
-
-
-# End of file 

Deleted: short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testdriver_cubit.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testdriver_cubit.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testdriver_cubit.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -1,69 +0,0 @@
-#!/usr/bin/env python
-#
-# ======================================================================
-#
-#                           Brad T. Aagaard
-#                        U.S. Geological Survey
-#
-# {LicenseText}
-#
-# ======================================================================
-#
-
-## @file unittests/meshio/testmeshio.py
-
-## @brief Python application for testing meshio code.
-
-from pyre.applications.Script import Script
-
-import unittest
-
-class TestApp(Script):
-  """
-  Test application.
-  """
-
-  # PUBLIC METHODS /////////////////////////////////////////////////////
-
-  def __init__(self, name="testapp"):
-    """
-    Constructor.
-    """
-    Script.__init__(self, name)
-    return
-
-
-  def main(self):
-    """
-    Run the application.
-    """
-    from pylith.utils.PetscManager import PetscManager
-    manager = PetscManager()
-    manager.initialize()
-    unittest.TextTestRunner(verbosity=2).run(self._suite())
-    manager.finalize()
-    return
-
-
-  # PRIVATE METHODS ////////////////////////////////////////////////////
-
-  def _suite(self):
-    """
-    Setup the test suite.
-    """
-
-    suite = unittest.TestSuite()
-
-    from TestMeshIOCubit import TestMeshIOCubit
-    suite.addTest(unittest.makeSuite(TestMeshIOCubit))
-
-    return suite
-
-
-# ----------------------------------------------------------------------
-if __name__ == '__main__':
-  app = TestApp()
-  app.run()
-
-
-# End of file 

Copied: short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testmeshio.py (from rev 14315, short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testdriver.py)
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testmeshio.py	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/meshio/testmeshio.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -0,0 +1,86 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+## @file unittests/meshio/testmeshio.py
+
+## @brief Python application for testing meshio code.
+
+from pyre.applications.Script import Script
+
+import unittest
+
+class TestApp(Script):
+  """
+  Test application.
+  """
+
+  # PUBLIC METHODS /////////////////////////////////////////////////////
+
+  def __init__(self, name="testapp"):
+    """
+    Constructor.
+    """
+    Script.__init__(self, name)
+    return
+
+
+  def main(self):
+    """
+    Run the application.
+    """
+    from pylith.utils.PetscManager import PetscManager
+    manager = PetscManager()
+    manager.initialize()
+
+    unittest.TextTestRunner(verbosity=2).run(self._suite())
+
+    manager.finalize()
+    return
+
+
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _suite(self):
+    """
+    Setup the test suite.
+    """
+
+    suite = unittest.TestSuite()
+
+    from TestMeshIOAscii import TestMeshIOAscii
+    suite.addTest(unittest.makeSuite(TestMeshIOAscii))
+
+    from TestMeshIOLagrit import TestMeshIOLagrit
+    suite.addTest(unittest.makeSuite(TestMeshIOLagrit))
+
+    #from TestVertexFilterVecNorm import TestVertexFilterVecNorm
+    #suite.addTest(unittest.makeSuite(TestVertexFilterVecNorm))
+
+    #from TestCellFilterAvg import TestCellFilterAvg
+    #suite.addTest(unittest.makeSuite(TestCellFilterAvg))
+
+    #from TestOutputManager import TestOutputManager
+    #suite.addTest(unittest.makeSuite(TestOutputManager))
+
+    #from TestOutputSolnSubset import TestOutputSolnSubset
+    #suite.addTest(unittest.makeSuite(TestOutputSolnSubset))
+
+    return suite
+
+
+# ----------------------------------------------------------------------
+if __name__ == '__main__':
+  app = TestApp()
+  app.run()
+
+
+# End of file 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/Makefile.am	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/Makefile.am	2009-03-13 23:52:54 UTC (rev 14316)
@@ -15,8 +15,8 @@
 
 SUBDIRS = data
 
-TESTS = testdriver.py
-dist_check_SCRIPTS = testdriver.py
+TESTS = testtopology.py
+dist_check_SCRIPTS = testtopology.py
 
 TESTS_ENVIRONMENT = $(PYTHON)
 

Deleted: short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testdriver.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testdriver.py	2009-03-13 21:54:02 UTC (rev 14315)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testdriver.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -1,93 +0,0 @@
-#!/usr/bin/env python
-#
-# ======================================================================
-#
-#                           Brad T. Aagaard
-#                        U.S. Geological Survey
-#
-# {LicenseText}
-#
-# ======================================================================
-#
-
-## @file unittests/topology/testdriver.py
-
-## @brief Python application for testing topology code.
-
-from pyre.applications.Script import Script
-
-import unittest
-
-class TestApp(Script):
-  """
-  Test application.
-  """
-
-  # PUBLIC METHODS /////////////////////////////////////////////////////
-
-  def __init__(self, name="testapp"):
-    """
-    Constructor.
-    """
-    Script.__init__(self, name)
-    return
-
-
-  def main(self):
-    """
-    Run the application.
-    """
-    from pylith.utils.PetscManager import PetscManager
-    manager = PetscManager()
-    manager.initialize()
-    unittest.TextTestRunner(verbosity=2).run(self._suite())
-    manager.finalize()
-    return
-
-
-  # PRIVATE METHODS ////////////////////////////////////////////////////
-
-  def _suite(self):
-    """
-    Setup the test suite.
-    """
-
-    suite = unittest.TestSuite()
-
-    from TestMesh import TestMesh
-    suite.addTest(unittest.makeSuite(TestMesh))
-
-    from TestSubMesh import TestSubMesh
-    suite.addTest(unittest.makeSuite(TestSubMesh))
-
-    from TestFieldBase import TestFieldBase
-    suite.addTest(unittest.makeSuite(TestFieldBase))
-
-    from TestMeshField import TestMeshField
-    suite.addTest(unittest.makeSuite(TestMeshField))
-
-    from TestMeshFields import TestMeshFields
-    suite.addTest(unittest.makeSuite(TestMeshFields))
-
-    from TestSolutionFields import TestSolutionFields
-    suite.addTest(unittest.makeSuite(TestSolutionFields))
-
-    from TestJacobian import TestJacobian
-    suite.addTest(unittest.makeSuite(TestJacobian))
-
-    from TestMeshGenerator import TestMeshGenerator
-    suite.addTest(unittest.makeSuite(TestMeshGenerator))
-
-    from TestMeshImporter import TestMeshImporter
-    suite.addTest(unittest.makeSuite(TestMeshImporter))
-
-    return suite
-
-
-# ----------------------------------------------------------------------
-if __name__ == '__main__':
-  app = TestApp()
-  app.run()
-
-
-# End of file 

Copied: short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testtopology.py (from rev 14315, short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testdriver.py)
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testtopology.py	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testtopology.py	2009-03-13 23:52:54 UTC (rev 14316)
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+## @file unittests/topology/testdriver.py
+
+## @brief Python application for testing topology code.
+
+from pyre.applications.Script import Script
+
+import unittest
+
+class TestApp(Script):
+  """
+  Test application.
+  """
+
+  # PUBLIC METHODS /////////////////////////////////////////////////////
+
+  def __init__(self, name="testapp"):
+    """
+    Constructor.
+    """
+    Script.__init__(self, name)
+    return
+
+
+  def main(self):
+    """
+    Run the application.
+    """
+    from pylith.utils.PetscManager import PetscManager
+    manager = PetscManager()
+    manager.initialize()
+    unittest.TextTestRunner(verbosity=2).run(self._suite())
+    manager.finalize()
+    return
+
+
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _suite(self):
+    """
+    Setup the test suite.
+    """
+
+    suite = unittest.TestSuite()
+
+    from TestMesh import TestMesh
+    suite.addTest(unittest.makeSuite(TestMesh))
+
+    from TestSubMesh import TestSubMesh
+    suite.addTest(unittest.makeSuite(TestSubMesh))
+
+    from TestFieldBase import TestFieldBase
+    suite.addTest(unittest.makeSuite(TestFieldBase))
+
+    from TestMeshField import TestMeshField
+    suite.addTest(unittest.makeSuite(TestMeshField))
+
+    from TestMeshFields import TestMeshFields
+    suite.addTest(unittest.makeSuite(TestMeshFields))
+
+    from TestSolutionFields import TestSolutionFields
+    suite.addTest(unittest.makeSuite(TestSolutionFields))
+
+    from TestJacobian import TestJacobian
+    suite.addTest(unittest.makeSuite(TestJacobian))
+
+    from TestMeshGenerator import TestMeshGenerator
+    suite.addTest(unittest.makeSuite(TestMeshGenerator))
+
+    from TestMeshImporter import TestMeshImporter
+    suite.addTest(unittest.makeSuite(TestMeshImporter))
+
+    return suite
+
+
+# ----------------------------------------------------------------------
+if __name__ == '__main__':
+  app = TestApp()
+  app.run()
+
+
+# End of file 



More information about the CIG-COMMITS mailing list