[cig-commits] r6472 - in short/3D/PyLith/trunk: . libsrc
libsrc/feassemble libsrc/materials modulesrc/materials pylith
pylith/materials
brad at geodynamics.org
brad at geodynamics.org
Thu Mar 29 22:03:56 PDT 2007
Author: brad
Date: 2007-03-29 22:03:55 -0700 (Thu, 29 Mar 2007)
New Revision: 6472
Added:
short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic1D.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic1D.hh
short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic1D.icc
short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.hh
short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.icc
short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.hh
short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.icc
short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStrain.py
short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStress.py
Removed:
short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic2D.py
Modified:
short/3D/PyLith/trunk/TODO
short/3D/PyLith/trunk/libsrc/Makefile.am
short/3D/PyLith/trunk/libsrc/feassemble/ExplicitElasticity.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.hh
short/3D/PyLith/trunk/libsrc/materials/Makefile.am
short/3D/PyLith/trunk/modulesrc/materials/materials.pyxe.src
short/3D/PyLith/trunk/pylith/Makefile.am
short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic1D.py
short/3D/PyLith/trunk/pylith/materials/__init__.py
Log:
Started work on implementing 1-D and 2-D elastic materials.
Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/TODO 2007-03-30 05:03:55 UTC (rev 6472)
@@ -5,6 +5,9 @@
Error checking
add isNull() assertions before using ALE::Obj.
+0. Add unit tests for ElasticIsotropic1D, ElasticPlaneStrain,
+ElasticPlaneStress.
+
1. Finish implementing ExplicitElasticity
a. C++
b. Python object
Modified: short/3D/PyLith/trunk/libsrc/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/Makefile.am 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/Makefile.am 2007-03-30 05:03:55 UTC (rev 6472)
@@ -32,8 +32,11 @@
feassemble/Quadrature3D.cc \
feassemble/ParameterManager.cc \
materials/Material.cc \
+ materials/ElasticIsotropic1D.cc \
materials/ElasticIsotropic3D.cc \
materials/ElasticMaterial.cc \
+ materials/ElasticPlaneStrain.cc \
+ materials/ElasticPlaneStress.cc \
meshio/MeshIO.cc \
meshio/MeshIOAscii.cc
Modified: short/3D/PyLith/trunk/libsrc/feassemble/ExplicitElasticity.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/ExplicitElasticity.cc 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/feassemble/ExplicitElasticity.cc 2007-03-30 05:03:55 UTC (rev 6472)
@@ -364,8 +364,7 @@
throw std::runtime_error("Logging PETSc flops failed.");
// Assemble cell contribution into field
- PetscErrorCode err =
- assembleMatrix(*mat, *cellIter, _cellMatrix, ADD_VALUES);
+ err = assembleMatrix(*mat, *cellIter, _cellMatrix, ADD_VALUES);
if (err)
throw std::runtime_error("Update to PETSc Mat failed.");
} // for
Added: short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic1D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic1D.cc 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic1D.cc 2007-03-30 05:03:55 UTC (rev 6472)
@@ -0,0 +1,185 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "ElasticIsotropic1D.hh" // implementation of object methods
+
+#include <assert.h> // USES assert()
+
+// ----------------------------------------------------------------------
+// _ElasticIsotropic1D is a helper class for ElasticIsotropic1D. We define
+// it in this implementation file to insulate other objects from these
+// details.
+namespace pylith {
+ namespace materials {
+ class _ElasticIsotropic1D;
+ } // materials
+} // pylith
+
+class pylith::materials::_ElasticIsotropic1D {
+public:
+ // Number of elastic constants (for general 3-D elastic material)
+ static const int numElasticConsts;
+
+ // Values expected in spatial database
+ static const int numDBValues;
+ static const char* namesDBValues[];
+
+ // Indices (order) of database values
+ static const int didDensity;
+ static const int didVp;
+
+ // Parameters
+ static const int numParameters;
+ static const char* namesParameters[];
+
+ // Indices (order) of parameters
+ static const int pidDensity;
+ static const int pidLambda2Mu;
+}; // _ElasticIsotropic1D
+
+const int pylith::materials::_ElasticIsotropic1D::numElasticConsts = 1;
+const int pylith::materials::_ElasticIsotropic1D::numDBValues = 2;
+const char* pylith::materials::_ElasticIsotropic1D::namesDBValues[] =
+ {"density", "vp" };
+const int pylith::materials::_ElasticIsotropic1D::numParameters = 3;
+const char* pylith::materials::_ElasticIsotropic1D::namesParameters[] =
+ {"density", "lambda+2mu" };
+const int pylith::materials::_ElasticIsotropic1D::didDensity = 0;
+const int pylith::materials::_ElasticIsotropic1D::didVp = 1;
+const int pylith::materials::_ElasticIsotropic1D::pidDensity = 0;
+const int pylith::materials::_ElasticIsotropic1D::pidLambda2Mu = 1;
+
+// ----------------------------------------------------------------------
+// Default constructor.
+pylith::materials::ElasticIsotropic1D::ElasticIsotropic1D(void)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor.
+pylith::materials::ElasticIsotropic1D::~ElasticIsotropic1D(void)
+{ // destructor
+} // destructor
+
+// ----------------------------------------------------------------------
+// Copy constructor.
+pylith::materials::ElasticIsotropic1D::ElasticIsotropic1D(
+ const ElasticIsotropic1D& m) :
+ ElasticMaterial(m)
+{ // copy constructor
+} // copy constructor
+
+// ----------------------------------------------------------------------
+// Get number of elastic constants for material.
+const int
+pylith::materials::ElasticIsotropic1D::numElasticConsts(void) const
+{ // numElasticConsts
+ return _ElasticIsotropic1D::numElasticConsts;
+} // numElasticConsts
+
+// ----------------------------------------------------------------------
+// Get names of values expected to be in database of parameters for
+const char**
+pylith::materials::ElasticIsotropic1D::_dbValues(void) const
+{ // _dbValues
+ return _ElasticIsotropic1D::namesDBValues;
+} // _dbValues
+
+// ----------------------------------------------------------------------
+// Get number of values expected to be in database of parameters for
+int
+pylith::materials::ElasticIsotropic1D::_numDBValues(void) const
+{ // _numDBValues
+ return _ElasticIsotropic1D::numDBValues;
+} // _numDBValues
+
+// ----------------------------------------------------------------------
+// Get names of parameters for physical properties.
+const char**
+pylith::materials::ElasticIsotropic1D::_parameterNames(void) const
+{ // _parameterNames
+ return _ElasticIsotropic1D::namesParameters;
+} // _parameterNames
+
+// ----------------------------------------------------------------------
+// Get number of parameters for physical properties.
+int
+pylith::materials::ElasticIsotropic1D::_numParameters(void) const
+{ // _numParameters
+ return _ElasticIsotropic1D::numParameters;
+} // _numParameters
+
+// ----------------------------------------------------------------------
+// Compute parameters from values in spatial database.
+void
+pylith::materials::ElasticIsotropic1D::_dbToParameters(double* paramVals,
+ const int numParams,
+ const double* dbValues,
+ const int numValues) const
+{ // computeParameters
+ assert(0 != paramVals);
+ assert(_ElasticIsotropic1D::numParameters == numParams);
+ assert(0 != dbValues);
+ assert(_ElasticIsotropic1D::numDBValues == numValues);
+
+ const double density = dbValues[_ElasticIsotropic1D::didDensity];
+ const double vp = dbValues[_ElasticIsotropic1D::didVp];
+
+ const double lambda2mu = density * vp*vp;
+
+ paramVals[_ElasticIsotropic1D::pidDensity] = density;
+ paramVals[_ElasticIsotropic1D::pidLambda2Mu] = lambda2mu;
+} // computeParameters
+
+// ----------------------------------------------------------------------
+// Compute density at location from parameters.
+void
+pylith::materials::ElasticIsotropic1D::_calcDensity(const double* parameters,
+ const int numParameters,
+ const int numLocs)
+{ // calcDensity
+ assert(0 != _density);
+ assert(0 != parameters);
+
+ for (int iLoc=0, index=0; iLoc < numLocs; ++iLoc, index+=numParameters)
+ _density[iLoc] =
+ parameters[index+_ElasticIsotropic1D::pidDensity];
+} // calcDensity
+
+// ----------------------------------------------------------------------
+// Compute density at location from parameters.
+void
+pylith::materials::ElasticIsotropic1D::_calcElasticConsts(const double* parameters,
+ const int numParameters,
+ const int numLocs)
+{ // calcElasticConsts
+ assert(0 != _elasticConsts);
+ assert(0 != parameters);
+ assert(_ElasticIsotropic1D::numParameters == numParameters);
+
+ for (int iLoc=0, indexP=0, indexC=0;
+ iLoc < numLocs;
+ ++iLoc,
+ indexP+=_ElasticIsotropic1D::numParameters,
+ indexC+=_ElasticIsotropic1D::numElasticConsts) {
+ const double density = parameters[indexP+_ElasticIsotropic1D::pidDensity];
+ const double lambda2mu =
+ parameters[indexP+_ElasticIsotropic1D::pidLambda2Mu];
+
+ _elasticConsts[indexC+ 0] = lambda2mu; // C1111
+ } // for
+} // calcElasticConsts
+
+
+// End of file
Added: short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic1D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic1D.hh 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic1D.hh 2007-03-30 05:03:55 UTC (rev 6472)
@@ -0,0 +1,158 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file libsrc/materials/ElasticIsotropic1D.h
+ *
+ * @brief C++ ElasticIsotropic1D object
+ *
+ * 1-D, isotropic, linear elastic material. The physical properties
+ * are specified using density and compressional-wave speed. The
+ * physical properties are stored internally using density and lambda
+ * + 2 mu, which are directly related to the elasticity constants used
+ * in the finite-element integration.
+ */
+
+#if !defined(pylith_materials_elasticisotropic1d_hh)
+#define pylith_materials_elasticisotropic1d_hh
+
+#include "ElasticMaterial.hh"
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace materials {
+ class ElasticIsotropic1D;
+ class TestElasticIsotropic1D; // unit testing
+ } // materials
+} // pylith
+
+/// 3-D, isotropic, linear elastic material.
+class pylith::materials::ElasticIsotropic1D : public ElasticMaterial
+{ // class ElasticIsotropic1D
+ friend class TestElasticIsotropic1D; // unit testing
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Default constructor
+ ElasticIsotropic1D(void);
+
+ /// Destructor
+ ~ElasticIsotropic1D(void);
+
+ /** Create a pointer to a copy of this.
+ *
+ * @returns Pointer to copy
+ */
+ ElasticMaterial* clone(void) const;
+
+ /** Get number of elastic constants for material.
+ *
+ * 1-D = 1
+ * 2-D = 6
+ * 3-D = 21
+ *
+ * @returns Number of elastic constants
+ */
+ const int numElasticConsts(void) const;
+
+ // PROTECTED METHODS //////////////////////////////////////////////////
+protected :
+
+ /** Copy constructor
+ *
+ * @param m Material to copy
+ */
+ ElasticIsotropic1D(const ElasticIsotropic1D& m);
+
+ /** Get names of values expected to be in database of parameters for
+ * physical properties.
+ *
+ * @returns Names of values
+ */
+ const char** _dbValues(void) const;
+
+ /** Get number of values expected to be in database of parameters for
+ * physical properties.
+ *
+ * @returns Number of values
+ */
+ int _numDBValues(void) const;
+
+ /** Get names of parameters for physical properties.
+ *
+ * @returns Names of parameters
+ */
+ const char** _parameterNames(void) const;
+
+ /** Get number of parameters for physical properties.
+ *
+ * @returns Number of parameters
+ */
+ int _numParameters(void) const;
+
+ /** Compute parameters from values in spatial database.
+ *
+ * Order of values in arrays matches order used in dbValues() and
+ * parameterNames().
+ *
+ * @param paramVals Array of parameters
+ * @param numParams Number of parameters
+ * @param dbValues Array of database values
+ * @param numValues Number of database values
+ */
+ void _dbToParameters(double* paramVals,
+ const int numParams,
+ const double* dbValues,
+ const int numValues) const;
+
+ /** Compute density at locations from parameters.
+ *
+ * Results are stored in _density.
+ *
+ * Index into parameters = iLoc*numParameters + iParam
+ *
+ * @param parameters Parameters at location
+ * @param numParameters Number of parameters
+ * @param numLocs Number of locations
+ */
+ void _calcDensity(const double* parameters,
+ const int numParameters,
+ const int numLocs);
+
+ /** Compute density at locations from parameters.
+ *
+ * Results are stored in _elasticConsts.
+ *
+ * Index into parameters = iLoc*numParameters + iParam
+ *
+ * @param parameters Parameters at location
+ * @param numParameters Number of parameters
+ * @param numLocs Number of locations
+ */
+ void _calcElasticConsts(const double* parameters,
+ const int numParameters,
+ const int numLocs);
+
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
+
+ /// Not implemented
+ const ElasticIsotropic1D& operator=(const ElasticIsotropic1D& m);
+
+}; // class ElasticIsotropic1D
+
+#include "ElasticIsotropic1D.icc" // inline methods
+
+#endif // pylith_materials_elasticisotropic1d_hh
+
+
+// End of file
Added: short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic1D.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic1D.icc 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic1D.icc 2007-03-30 05:03:55 UTC (rev 6472)
@@ -0,0 +1,25 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#if !defined(pylith_materials_elasticisotropic1d_hh)
+#error "ElasticIsotropic1D.icc can only be included from ElasticIsotropic1D.hh"
+#endif
+
+// Create a pointer to a copy of this.
+inline
+pylith::materials::ElasticMaterial*
+pylith::materials::ElasticIsotropic1D::clone(void) const {
+ return new ElasticIsotropic1D(*this);
+}
+
+
+// End of file
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.hh 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.hh 2007-03-30 05:03:55 UTC (rev 6472)
@@ -16,9 +16,9 @@
*
* 3-D, isotropic, linear elastic material. The physical properties
* are specified using density, shear-wave speed, and
- * compressional-wave speed. The physical properties stored are
+ * compressional-wave speed. The physical properties are stored
* internally using density, lambda, and mu, which are directly
- * related to the elasticity constants use in the finite-element
+ * related to the elasticity constants used in the finite-element
* integration.
*/
Added: short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.cc 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.cc 2007-03-30 05:03:55 UTC (rev 6472)
@@ -0,0 +1,197 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "ElasticPlaneStrain.hh" // implementation of object methods
+
+#include <assert.h> // USES assert()
+
+// ----------------------------------------------------------------------
+// _ElasticPlaneStrain is a helper class for ElasticPlaneStrain. We define
+// it in this implementation file to insulate other objects from these
+// details.
+namespace pylith {
+ namespace materials {
+ class _ElasticPlaneStrain;
+ } // materials
+} // pylith
+
+class pylith::materials::_ElasticPlaneStrain {
+public:
+ // Number of elastic constants (for general 3-D elastic material)
+ static const int numElasticConsts;
+
+ // Values expected in spatial database
+ static const int numDBValues;
+ static const char* namesDBValues[];
+
+ // Indices (order) of database values
+ static const int didDensity;
+ static const int didVs;
+ static const int didVp;
+
+ // Parameters
+ static const int numParameters;
+ static const char* namesParameters[];
+
+ // Indices (order) of parameters
+ static const int pidDensity;
+ static const int pidMu;
+ static const int pidLambda;
+}; // _ElasticPlaneStrain
+
+const int pylith::materials::_ElasticPlaneStrain::numElasticConsts = 6;
+const int pylith::materials::_ElasticPlaneStrain::numDBValues = 3;
+const char* pylith::materials::_ElasticPlaneStrain::namesDBValues[] =
+ {"density", "vs", "vp" };
+const int pylith::materials::_ElasticPlaneStrain::numParameters = 3;
+const char* pylith::materials::_ElasticPlaneStrain::namesParameters[] =
+ {"density", "mu", "lambda" };
+const int pylith::materials::_ElasticPlaneStrain::didDensity = 0;
+const int pylith::materials::_ElasticPlaneStrain::didVs = 1;
+const int pylith::materials::_ElasticPlaneStrain::didVp = 2;
+const int pylith::materials::_ElasticPlaneStrain::pidDensity = 0;
+const int pylith::materials::_ElasticPlaneStrain::pidMu = 1;
+const int pylith::materials::_ElasticPlaneStrain::pidLambda = 2;
+
+// ----------------------------------------------------------------------
+// Default constructor.
+pylith::materials::ElasticPlaneStrain::ElasticPlaneStrain(void)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor.
+pylith::materials::ElasticPlaneStrain::~ElasticPlaneStrain(void)
+{ // destructor
+} // destructor
+
+// ----------------------------------------------------------------------
+// Copy constructor.
+pylith::materials::ElasticPlaneStrain::ElasticPlaneStrain(
+ const ElasticPlaneStrain& m) :
+ ElasticMaterial(m)
+{ // copy constructor
+} // copy constructor
+
+// ----------------------------------------------------------------------
+// Get number of elastic constants for material.
+const int
+pylith::materials::ElasticPlaneStrain::numElasticConsts(void) const
+{ // numElasticConsts
+ return _ElasticPlaneStrain::numElasticConsts;
+} // numElasticConsts
+
+// ----------------------------------------------------------------------
+// Get names of values expected to be in database of parameters for
+const char**
+pylith::materials::ElasticPlaneStrain::_dbValues(void) const
+{ // _dbValues
+ return _ElasticPlaneStrain::namesDBValues;
+} // _dbValues
+
+// ----------------------------------------------------------------------
+// Get number of values expected to be in database of parameters for
+int
+pylith::materials::ElasticPlaneStrain::_numDBValues(void) const
+{ // _numDBValues
+ return _ElasticPlaneStrain::numDBValues;
+} // _numDBValues
+
+// ----------------------------------------------------------------------
+// Get names of parameters for physical properties.
+const char**
+pylith::materials::ElasticPlaneStrain::_parameterNames(void) const
+{ // _parameterNames
+ return _ElasticPlaneStrain::namesParameters;
+} // _parameterNames
+
+// ----------------------------------------------------------------------
+// Get number of parameters for physical properties.
+int
+pylith::materials::ElasticPlaneStrain::_numParameters(void) const
+{ // _numParameters
+ return _ElasticPlaneStrain::numParameters;
+} // _numParameters
+
+// ----------------------------------------------------------------------
+// Compute parameters from values in spatial database.
+void
+pylith::materials::ElasticPlaneStrain::_dbToParameters(double* paramVals,
+ const int numParams,
+ const double* dbValues,
+ const int numValues) const
+{ // computeParameters
+ assert(0 != paramVals);
+ assert(_ElasticPlaneStrain::numParameters == numParams);
+ assert(0 != dbValues);
+ assert(_ElasticPlaneStrain::numDBValues == numValues);
+
+ const double density = dbValues[_ElasticPlaneStrain::didDensity];
+ const double vs = dbValues[_ElasticPlaneStrain::didVs];
+ const double vp = dbValues[_ElasticPlaneStrain::didVp];
+
+ const double mu = density * vs*vs;
+ const double lambda = density * vp*vp - 2.0*mu;
+
+ paramVals[_ElasticPlaneStrain::pidDensity] = density;
+ paramVals[_ElasticPlaneStrain::pidMu] = mu;
+ paramVals[_ElasticPlaneStrain::pidLambda] = lambda;
+} // computeParameters
+
+// ----------------------------------------------------------------------
+// Compute density at location from parameters.
+void
+pylith::materials::ElasticPlaneStrain::_calcDensity(const double* parameters,
+ const int numParameters,
+ const int numLocs)
+{ // calcDensity
+ assert(0 != _density);
+ assert(0 != parameters);
+
+ for (int iLoc=0, index=0; iLoc < numLocs; ++iLoc, index+=numParameters)
+ _density[iLoc] =
+ parameters[index+_ElasticPlaneStrain::pidDensity];
+} // calcDensity
+
+// ----------------------------------------------------------------------
+// Compute density at location from parameters.
+void
+pylith::materials::ElasticPlaneStrain::_calcElasticConsts(const double* parameters,
+ const int numParameters,
+ const int numLocs)
+{ // calcElasticConsts
+ assert(0 != _elasticConsts);
+ assert(0 != parameters);
+ assert(_ElasticPlaneStrain::numParameters == numParameters);
+
+ for (int iLoc=0, indexP=0, indexC=0;
+ iLoc < numLocs;
+ ++iLoc,
+ indexP+=_ElasticPlaneStrain::numParameters,
+ indexC+=_ElasticPlaneStrain::numElasticConsts) {
+ const double density = parameters[indexP+_ElasticPlaneStrain::pidDensity];
+ const double mu = parameters[indexP+_ElasticPlaneStrain::pidMu];
+ const double lambda = parameters[indexP+_ElasticPlaneStrain::pidLambda];
+
+ _elasticConsts[indexC+ 0] = lambda + 2.0*mu; // C1111
+ _elasticConsts[indexC+ 1] = lambda; // C1122
+ _elasticConsts[indexC+ 3] = 0; // C1112
+ _elasticConsts[indexC+ 6] = lambda + 2.0*mu; // C2222
+ _elasticConsts[indexC+ 8] = 0; // C2212
+ _elasticConsts[indexC+15] = mu; // C1212
+ } // for
+} // calcElasticConsts
+
+
+// End of file
Added: short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.hh 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.hh 2007-03-30 05:03:55 UTC (rev 6472)
@@ -0,0 +1,159 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file libsrc/materials/ElasticPlaneStrain.h
+ *
+ * @brief C++ ElasticPlaneStrain object
+ *
+ * 3-D, isotropic, linear elastic material for plane strain. The
+ * physical properties are specified using density, shear-wave speed,
+ * and compressional-wave speed. The physical properties are stored
+ * internally using density, lambda, and mu, which are directly
+ * related to the elasticity constants used in the finite-element
+ * integration.
+ */
+
+#if !defined(pylith_materials_elasticplanestrain_hh)
+#define pylith_materials_elasticplanestrain_hh
+
+#include "ElasticMaterial.hh"
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace materials {
+ class ElasticPlaneStrain;
+ class TestElasticPlaneStrain; // unit testing
+ } // materials
+} // pylith
+
+/// 3-D, isotropic, linear elastic material.
+class pylith::materials::ElasticPlaneStrain : public ElasticMaterial
+{ // class ElasticPlaneStrain
+ friend class TestElasticPlaneStrain; // unit testing
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Default constructor
+ ElasticPlaneStrain(void);
+
+ /// Destructor
+ ~ElasticPlaneStrain(void);
+
+ /** Create a pointer to a copy of this.
+ *
+ * @returns Pointer to copy
+ */
+ ElasticMaterial* clone(void) const;
+
+ /** Get number of elastic constants for material.
+ *
+ * 1-D = 1
+ * 2-D = 6
+ * 3-D = 21
+ *
+ * @returns Number of elastic constants
+ */
+ const int numElasticConsts(void) const;
+
+ // PROTECTED METHODS //////////////////////////////////////////////////
+protected :
+
+ /** Copy constructor
+ *
+ * @param m Material to copy
+ */
+ ElasticPlaneStrain(const ElasticPlaneStrain& m);
+
+ /** Get names of values expected to be in database of parameters for
+ * physical properties.
+ *
+ * @returns Names of values
+ */
+ const char** _dbValues(void) const;
+
+ /** Get number of values expected to be in database of parameters for
+ * physical properties.
+ *
+ * @returns Number of values
+ */
+ int _numDBValues(void) const;
+
+ /** Get names of parameters for physical properties.
+ *
+ * @returns Names of parameters
+ */
+ const char** _parameterNames(void) const;
+
+ /** Get number of parameters for physical properties.
+ *
+ * @returns Number of parameters
+ */
+ int _numParameters(void) const;
+
+ /** Compute parameters from values in spatial database.
+ *
+ * Order of values in arrays matches order used in dbValues() and
+ * parameterNames().
+ *
+ * @param paramVals Array of parameters
+ * @param numParams Number of parameters
+ * @param dbValues Array of database values
+ * @param numValues Number of database values
+ */
+ void _dbToParameters(double* paramVals,
+ const int numParams,
+ const double* dbValues,
+ const int numValues) const;
+
+ /** Compute density at locations from parameters.
+ *
+ * Results are stored in _density.
+ *
+ * Index into parameters = iLoc*numParameters + iParam
+ *
+ * @param parameters Parameters at location
+ * @param numParameters Number of parameters
+ * @param numLocs Number of locations
+ */
+ void _calcDensity(const double* parameters,
+ const int numParameters,
+ const int numLocs);
+
+ /** Compute density at locations from parameters.
+ *
+ * Results are stored in _elasticConsts.
+ *
+ * Index into parameters = iLoc*numParameters + iParam
+ *
+ * @param parameters Parameters at location
+ * @param numParameters Number of parameters
+ * @param numLocs Number of locations
+ */
+ void _calcElasticConsts(const double* parameters,
+ const int numParameters,
+ const int numLocs);
+
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
+
+ /// Not implemented
+ const ElasticPlaneStrain& operator=(const ElasticPlaneStrain& m);
+
+}; // class ElasticPlaneStrain
+
+#include "ElasticPlaneStrain.icc" // inline methods
+
+#endif // pylith_materials_elasticplanestrain_hh
+
+
+// End of file
Added: short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.icc 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.icc 2007-03-30 05:03:55 UTC (rev 6472)
@@ -0,0 +1,25 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#if !defined(pylith_materials_elasticplanestrain_hh)
+#error "ElasticPlanestrain.icc can only be included from ElasticPlanestrain.hh"
+#endif
+
+// Create a pointer to a copy of this.
+inline
+pylith::materials::ElasticMaterial*
+pylith::materials::ElasticPlaneStrain::clone(void) const {
+ return new ElasticPlaneStrain(*this);
+}
+
+
+// End of file
Added: short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.cc 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.cc 2007-03-30 05:03:55 UTC (rev 6472)
@@ -0,0 +1,197 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "ElasticPlaneStress.hh" // implementation of object methods
+
+#include <assert.h> // USES assert()
+
+// ----------------------------------------------------------------------
+// _ElasticPlaneStress is a helper class for ElasticPlaneStress. We define
+// it in this implementation file to insulate other objects from these
+// details.
+namespace pylith {
+ namespace materials {
+ class _ElasticPlaneStress;
+ } // materials
+} // pylith
+
+class pylith::materials::_ElasticPlaneStress {
+public:
+ // Number of elastic constants (for general 3-D elastic material)
+ static const int numElasticConsts;
+
+ // Values expected in spatial database
+ static const int numDBValues;
+ static const char* namesDBValues[];
+
+ // Indices (order) of database values
+ static const int didDensity;
+ static const int didVs;
+ static const int didVp;
+
+ // Parameters
+ static const int numParameters;
+ static const char* namesParameters[];
+
+ // Indices (order) of parameters
+ static const int pidDensity;
+ static const int pidMu;
+ static const int pidLambda;
+}; // _ElasticPlaneStress
+
+const int pylith::materials::_ElasticPlaneStress::numElasticConsts = 6;
+const int pylith::materials::_ElasticPlaneStress::numDBValues = 3;
+const char* pylith::materials::_ElasticPlaneStress::namesDBValues[] =
+ {"density", "vs", "vp" };
+const int pylith::materials::_ElasticPlaneStress::numParameters = 3;
+const char* pylith::materials::_ElasticPlaneStress::namesParameters[] =
+ {"density", "mu", "lambda" };
+const int pylith::materials::_ElasticPlaneStress::didDensity = 0;
+const int pylith::materials::_ElasticPlaneStress::didVs = 1;
+const int pylith::materials::_ElasticPlaneStress::didVp = 2;
+const int pylith::materials::_ElasticPlaneStress::pidDensity = 0;
+const int pylith::materials::_ElasticPlaneStress::pidMu = 1;
+const int pylith::materials::_ElasticPlaneStress::pidLambda = 2;
+
+// ----------------------------------------------------------------------
+// Default constructor.
+pylith::materials::ElasticPlaneStress::ElasticPlaneStress(void)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor.
+pylith::materials::ElasticPlaneStress::~ElasticPlaneStress(void)
+{ // destructor
+} // destructor
+
+// ----------------------------------------------------------------------
+// Copy constructor.
+pylith::materials::ElasticPlaneStress::ElasticPlaneStress(
+ const ElasticPlaneStress& m) :
+ ElasticMaterial(m)
+{ // copy constructor
+} // copy constructor
+
+// ----------------------------------------------------------------------
+// Get number of elastic constants for material.
+const int
+pylith::materials::ElasticPlaneStress::numElasticConsts(void) const
+{ // numElasticConsts
+ return _ElasticPlaneStress::numElasticConsts;
+} // numElasticConsts
+
+// ----------------------------------------------------------------------
+// Get names of values expected to be in database of parameters for
+const char**
+pylith::materials::ElasticPlaneStress::_dbValues(void) const
+{ // _dbValues
+ return _ElasticPlaneStress::namesDBValues;
+} // _dbValues
+
+// ----------------------------------------------------------------------
+// Get number of values expected to be in database of parameters for
+int
+pylith::materials::ElasticPlaneStress::_numDBValues(void) const
+{ // _numDBValues
+ return _ElasticPlaneStress::numDBValues;
+} // _numDBValues
+
+// ----------------------------------------------------------------------
+// Get names of parameters for physical properties.
+const char**
+pylith::materials::ElasticPlaneStress::_parameterNames(void) const
+{ // _parameterNames
+ return _ElasticPlaneStress::namesParameters;
+} // _parameterNames
+
+// ----------------------------------------------------------------------
+// Get number of parameters for physical properties.
+int
+pylith::materials::ElasticPlaneStress::_numParameters(void) const
+{ // _numParameters
+ return _ElasticPlaneStress::numParameters;
+} // _numParameters
+
+// ----------------------------------------------------------------------
+// Compute parameters from values in spatial database.
+void
+pylith::materials::ElasticPlaneStress::_dbToParameters(double* paramVals,
+ const int numParams,
+ const double* dbValues,
+ const int numValues) const
+{ // computeParameters
+ assert(0 != paramVals);
+ assert(_ElasticPlaneStress::numParameters == numParams);
+ assert(0 != dbValues);
+ assert(_ElasticPlaneStress::numDBValues == numValues);
+
+ const double density = dbValues[_ElasticPlaneStress::didDensity];
+ const double vs = dbValues[_ElasticPlaneStress::didVs];
+ const double vp = dbValues[_ElasticPlaneStress::didVp];
+
+ const double mu = density * vs*vs;
+ const double lambda = density * vp*vp - 2.0*mu;
+
+ paramVals[_ElasticPlaneStress::pidDensity] = density;
+ paramVals[_ElasticPlaneStress::pidMu] = mu;
+ paramVals[_ElasticPlaneStress::pidLambda] = lambda;
+} // computeParameters
+
+// ----------------------------------------------------------------------
+// Compute density at location from parameters.
+void
+pylith::materials::ElasticPlaneStress::_calcDensity(const double* parameters,
+ const int numParameters,
+ const int numLocs)
+{ // calcDensity
+ assert(0 != _density);
+ assert(0 != parameters);
+
+ for (int iLoc=0, index=0; iLoc < numLocs; ++iLoc, index+=numParameters)
+ _density[iLoc] =
+ parameters[index+_ElasticPlaneStress::pidDensity];
+} // calcDensity
+
+// ----------------------------------------------------------------------
+// Compute density at location from parameters.
+void
+pylith::materials::ElasticPlaneStress::_calcElasticConsts(const double* parameters,
+ const int numParameters,
+ const int numLocs)
+{ // calcElasticConsts
+ assert(0 != _elasticConsts);
+ assert(0 != parameters);
+ assert(_ElasticPlaneStress::numParameters == numParameters);
+
+ for (int iLoc=0, indexP=0, indexC=0;
+ iLoc < numLocs;
+ ++iLoc,
+ indexP+=_ElasticPlaneStress::numParameters,
+ indexC+=_ElasticPlaneStress::numElasticConsts) {
+ const double density = parameters[indexP+_ElasticPlaneStress::pidDensity];
+ const double mu = parameters[indexP+_ElasticPlaneStress::pidMu];
+ const double lambda = parameters[indexP+_ElasticPlaneStress::pidLambda];
+
+ _elasticConsts[indexC+ 0] = lambda + 2.0*mu; // C1111
+ _elasticConsts[indexC+ 1] = lambda; // C1122
+ _elasticConsts[indexC+ 2] = 0; // C1112
+ _elasticConsts[indexC+ 3] = lambda + 2.0*mu; // C2222
+ _elasticConsts[indexC+ 4] = 0; // C2212
+ _elasticConsts[indexC+15] = mu; // C1212
+ } // for
+} // calcElasticConsts
+
+
+// End of file
Added: short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.hh 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.hh 2007-03-30 05:03:55 UTC (rev 6472)
@@ -0,0 +1,159 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file libsrc/materials/ElasticPlaneStress.h
+ *
+ * @brief C++ ElasticPlaneStress object
+ *
+ * 2-D, isotropic, linear elastic material for plane stress. The
+ * physical properties are specified using density, shear-wave speed,
+ * and compressional-wave speed. The physical properties are stored
+ * internally using density, lambda, and mu, which are directly
+ * related to the elasticity constants used in the finite-element
+ * integration.
+ */
+
+#if !defined(pylith_materials_elasticplanestress_hh)
+#define pylith_materials_elasticplanestress_hh
+
+#include "ElasticMaterial.hh"
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace materials {
+ class ElasticPlaneStress;
+ class TestElasticPlaneStress; // unit testing
+ } // materials
+} // pylith
+
+/// 2-D, isotropic, linear elastic material for plane stress.
+class pylith::materials::ElasticPlaneStress : public ElasticMaterial
+{ // class ElasticPlaneStress
+ friend class TestElasticPlaneStress; // unit testing
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Default constructor
+ ElasticPlaneStress(void);
+
+ /// Destructor
+ ~ElasticPlaneStress(void);
+
+ /** Create a pointer to a copy of this.
+ *
+ * @returns Pointer to copy
+ */
+ ElasticMaterial* clone(void) const;
+
+ /** Get number of elastic constants for material.
+ *
+ * 1-D = 1
+ * 2-D = 6
+ * 3-D = 21
+ *
+ * @returns Number of elastic constants
+ */
+ const int numElasticConsts(void) const;
+
+ // PROTECTED METHODS //////////////////////////////////////////////////
+protected :
+
+ /** Copy constructor
+ *
+ * @param m Material to copy
+ */
+ ElasticPlaneStress(const ElasticPlaneStress& m);
+
+ /** Get names of values expected to be in database of parameters for
+ * physical properties.
+ *
+ * @returns Names of values
+ */
+ const char** _dbValues(void) const;
+
+ /** Get number of values expected to be in database of parameters for
+ * physical properties.
+ *
+ * @returns Number of values
+ */
+ int _numDBValues(void) const;
+
+ /** Get names of parameters for physical properties.
+ *
+ * @returns Names of parameters
+ */
+ const char** _parameterNames(void) const;
+
+ /** Get number of parameters for physical properties.
+ *
+ * @returns Number of parameters
+ */
+ int _numParameters(void) const;
+
+ /** Compute parameters from values in spatial database.
+ *
+ * Order of values in arrays matches order used in dbValues() and
+ * parameterNames().
+ *
+ * @param paramVals Array of parameters
+ * @param numParams Number of parameters
+ * @param dbValues Array of database values
+ * @param numValues Number of database values
+ */
+ void _dbToParameters(double* paramVals,
+ const int numParams,
+ const double* dbValues,
+ const int numValues) const;
+
+ /** Compute density at locations from parameters.
+ *
+ * Results are stored in _density.
+ *
+ * Index into parameters = iLoc*numParameters + iParam
+ *
+ * @param parameters Parameters at location
+ * @param numParameters Number of parameters
+ * @param numLocs Number of locations
+ */
+ void _calcDensity(const double* parameters,
+ const int numParameters,
+ const int numLocs);
+
+ /** Compute density at locations from parameters.
+ *
+ * Results are stored in _elasticConsts.
+ *
+ * Index into parameters = iLoc*numParameters + iParam
+ *
+ * @param parameters Parameters at location
+ * @param numParameters Number of parameters
+ * @param numLocs Number of locations
+ */
+ void _calcElasticConsts(const double* parameters,
+ const int numParameters,
+ const int numLocs);
+
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
+
+ /// Not implemented
+ const ElasticPlaneStress& operator=(const ElasticPlaneStress& m);
+
+}; // class ElasticPlaneStress
+
+#include "ElasticPlaneStress.icc" // inline methods
+
+#endif // pylith_materials_elasticplanestress_hh
+
+
+// End of file
Added: short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.icc 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.icc 2007-03-30 05:03:55 UTC (rev 6472)
@@ -0,0 +1,25 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#if !defined(pylith_materials_elasticplanestress_hh)
+#error "ElasticPlaneStress.icc can only be included from ElasticPlaneStress.hh"
+#endif
+
+// Create a pointer to a copy of this.
+inline
+pylith::materials::ElasticMaterial*
+pylith::materials::ElasticPlaneStress::clone(void) const {
+ return new ElasticPlaneStress(*this);
+}
+
+
+// End of file
Modified: short/3D/PyLith/trunk/libsrc/materials/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Makefile.am 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/libsrc/materials/Makefile.am 2007-03-30 05:03:55 UTC (rev 6472)
@@ -14,10 +14,16 @@
include $(top_srcdir)/subpackage.am
subpkginclude_HEADERS = \
+ ElasticIsotropic1D.hh \
+ ElasticIsotropic1D.icc \
ElasticIsotropic3D.hh \
ElasticIsotropic3D.icc \
ElasticMaterial.hh \
ElasticMaterial.icc \
+ ElasticPlaneStrain.hh \
+ ElasticPlaneStrain.icc \
+ ElasticPlaneStress.hh \
+ ElasticPlaneStress.icc \
Material.hh \
Material.icc
Modified: short/3D/PyLith/trunk/modulesrc/materials/materials.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/materials.pyxe.src 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/modulesrc/materials/materials.pyxe.src 2007-03-30 05:03:55 UTC (rev 6472)
@@ -13,7 +13,10 @@
#header{
#include "pylith/materials/Material.hh"
#include "pylith/materials/ElasticMaterial.hh"
+#include "pylith/materials/ElasticIsotropic1D.hh"
#include "pylith/materials/ElasticIsotropic3D.hh"
+#include "pylith/materials/ElasticPlaneStrain.hh"
+#include "pylith/materials/ElasticPlaneStress.hh"
#include <assert.h>
#include <stdexcept>
@@ -220,6 +223,90 @@
# ----------------------------------------------------------------------
+cdef class ElasticIsotropic1D(ElasticMaterial):
+
+ def __init__(self):
+ """
+ Constructor.
+ """
+ # create shim for constructor
+ #embed{ void* ElasticIsotropic1D_constructor()
+ void* result = 0;
+ try {
+ result = (void*)(new pylith::materials::ElasticIsotropic1D);
+ } 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 = ElasticIsotropic1D_constructor()
+ self.handle = self._createHandle()
+ return
+
+
+# ----------------------------------------------------------------------
+cdef class ElasticPlaneStrain(ElasticMaterial):
+
+ def __init__(self):
+ """
+ Constructor.
+ """
+ # create shim for constructor
+ #embed{ void* ElasticPlaneStrain_constructor()
+ void* result = 0;
+ try {
+ result = (void*)(new pylith::materials::ElasticPlaneStrain);
+ } 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 = ElasticPlaneStrain_constructor()
+ self.handle = self._createHandle()
+ return
+
+
+# ----------------------------------------------------------------------
+cdef class ElasticPlaneStress(ElasticMaterial):
+
+ def __init__(self):
+ """
+ Constructor.
+ """
+ # create shim for constructor
+ #embed{ void* ElasticPlaneStress_constructor()
+ void* result = 0;
+ try {
+ result = (void*)(new pylith::materials::ElasticPlaneStress);
+ } 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 = ElasticPlaneStress_constructor()
+ self.handle = self._createHandle()
+ return
+
+
+# ----------------------------------------------------------------------
cdef class ElasticIsotropic3D(ElasticMaterial):
def __init__(self):
Modified: short/3D/PyLith/trunk/pylith/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/pylith/Makefile.am 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/pylith/Makefile.am 2007-03-30 05:03:55 UTC (rev 6472)
@@ -30,8 +30,9 @@
feassemble/quadrature/__init__.py \
materials/__init__.py \
materials/ElasticIsotropic1D.py \
- materials/ElasticIsotropic2D.py \
materials/ElasticIsotropic3D.py \
+ materials/ElasticPlaneStrain.py \
+ materials/ElasticPlaneStress.py \
materials/Homogeneous.py \
materials/Material.py \
materials/MaterialsBin.py \
Modified: short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic1D.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic1D.py 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic1D.py 2007-03-30 05:03:55 UTC (rev 6472)
@@ -18,11 +18,11 @@
from Material import Material
-# import pylith.materials.materials as bindings
+import pylith.materials.materials as bindings
# ElasticIsotropic1D class
-class ElasticIsotropic3D(Material):
+class ElasticIsotropic1D(Material):
"""
Python object implementing 1-D isotropic linear elastic material.
@@ -36,8 +36,7 @@
Constructor.
"""
Material.__init__(self, name)
- # :TODO: Need to create module for materials
- # self.cppHandle = bindings.ElasticIsotropic1D()
+ self.cppHandle = bindings.ElasticIsotropic1D()
return
Deleted: short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic2D.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic2D.py 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic2D.py 2007-03-30 05:03:55 UTC (rev 6472)
@@ -1,53 +0,0 @@
-#!/usr/bin/env python
-#
-# ----------------------------------------------------------------------
-#
-# Brad T. Aagaard
-# U.S. Geological Survey
-#
-# <LicenseText>
-#
-# ----------------------------------------------------------------------
-#
-
-## @file pylith/materials/ElasticIsotropic1D.py
-##
-## @brief Python object implementing 2-D isotropic linear elastic material.
-##
-## Factory: material.
-
-from Material import Material
-
-# import pylith.materials.materials as bindings
-
-
-# ElasticIsotropic2D class
-class ElasticIsotropic2D(Material):
- """
- Python object implementing 2-D isotropic linear elastic material.
-
- Factory: material.
- """
-
- # PUBLIC METHODS /////////////////////////////////////////////////////
-
- def __init__(self, name="elasticisotropic2d"):
- """
- Constructor.
- """
- Material.__init__(self, name)
- # :TODO: Need to create module for materials
- # self.cppHandle = bindings.ElasticIsotropic2D()
- return
-
-
-# FACTORIES ////////////////////////////////////////////////////////////
-
-def material():
- """
- Factory associated with ElasticIsotropic2D.
- """
- return ElasticIsotropic2D()
-
-
-# End of file
Added: short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStrain.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStrain.py 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStrain.py 2007-03-30 05:03:55 UTC (rev 6472)
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pylith/materials/ElasticPlaneStrain.py
+##
+## @brief Python object implementing 1-D isotropic linear elastic
+## material for plane strain.
+##
+## Factory: material.
+
+from Material import Material
+
+import pylith.materials.materials as bindings
+
+
+# ElasticPlaneStrain class
+class ElasticPlaneStrain(Material):
+ """
+ Python object implementing 2-D isotropic linear elastic material for
+ plane strain.
+
+ Factory: material.
+ """
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ def __init__(self, name="elasticplanestrain"):
+ """
+ Constructor.
+ """
+ Material.__init__(self, name)
+ self.cppHandle = bindings.ElasticPlaneStrain()
+ return
+
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def material():
+ """
+ Factory associated with ElasticPlaneStrain.
+ """
+ return ElasticPlaneStrain()
+
+
+# End of file
Copied: short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStress.py (from rev 6471, short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic2D.py)
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic2D.py 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStress.py 2007-03-30 05:03:55 UTC (rev 6472)
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pylith/materials/ElasticPlaneStress.py
+##
+## @brief Python object implementing 2-D isotropic linear elastic
+## material for plane stress.
+##
+## Factory: material.
+
+from Material import Material
+
+import pylith.materials.materials as bindings
+
+
+# ElasticPlaneStress class
+class ElasticPlaneStress(Material):
+ """
+ Python object implementing 2-D isotropic linear elastic material for
+ plane stress.
+
+ Factory: material.
+ """
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ def __init__(self, name="elasticplanestress"):
+ """
+ Constructor.
+ """
+ Material.__init__(self, name)
+ self.cppHandle = bindings.ElasticPlaneStress()
+ return
+
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def material():
+ """
+ Factory associated with ElasticPlaneStress.
+ """
+ return ElasticPlaneStress()
+
+
+# End of file
Modified: short/3D/PyLith/trunk/pylith/materials/__init__.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/__init__.py 2007-03-30 01:21:51 UTC (rev 6471)
+++ short/3D/PyLith/trunk/pylith/materials/__init__.py 2007-03-30 05:03:55 UTC (rev 6472)
@@ -15,8 +15,9 @@
## @brief Python PyLith materials module initialization
__all__ = ['ElasticIsotropic1D',
- 'ElasticIsotropic2D',
'ElasticIsotropic3D',
+ 'ElasticPlaneStrain',
+ 'ElasticPlaneStress',
'Homogeneous',
'Material',
'MaterialsBin']
More information about the cig-commits
mailing list