[cig-commits] r6221 - in short/3D/PyLith/trunk/libsrc: . feassemble materials

brad at geodynamics.org brad at geodynamics.org
Sat Mar 10 20:26:47 PST 2007


Author: brad
Date: 2007-03-10 20:26:46 -0800 (Sat, 10 Mar 2007)
New Revision: 6221

Added:
   short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial3D.cc
   short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial3D.hh
   short/3D/PyLith/trunk/libsrc/materials/Material.cc
   short/3D/PyLith/trunk/libsrc/materials/Material.hh
   short/3D/PyLith/trunk/libsrc/materials/Material.icc
Removed:
   short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc
   short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.hh
Modified:
   short/3D/PyLith/trunk/libsrc/Makefile.am
   short/3D/PyLith/trunk/libsrc/feassemble/IntegratorExplicit.hh
   short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.hh
   short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.cc
   short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.hh
   short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.icc
   short/3D/PyLith/trunk/libsrc/materials/Makefile.am
Log:
Worked on implementing materials.

Modified: short/3D/PyLith/trunk/libsrc/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/Makefile.am	2007-03-10 21:12:47 UTC (rev 6220)
+++ short/3D/PyLith/trunk/libsrc/Makefile.am	2007-03-11 04:26:46 UTC (rev 6221)
@@ -13,10 +13,10 @@
 SUBDIRS = \
 	utils \
 	feassemble \
-	meshio
+	materials \
+	meshio \
+	topology
 
-# materials
-
 lib_LTLIBRARIES = libpylith.la
 
 libpylith_la_SOURCES = \
@@ -31,6 +31,9 @@
 	feassemble/Quadrature2Din3D.cc \
 	feassemble/Quadrature3D.cc \
 	feassemble/ParameterManager.cc \
+	materials/Material.cc \
+	materials/ElasticMaterial3D.cc \
+	materials/ElasticIsotropic3D.cc \
 	meshio/MeshIO.cc \
 	meshio/MeshIOAscii.cc
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorExplicit.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorExplicit.hh	2007-03-10 21:12:47 UTC (rev 6220)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorExplicit.hh	2007-03-11 04:26:46 UTC (rev 6221)
@@ -58,6 +58,12 @@
   virtual
   IntegratorExplicit* clone(void) const = 0;
 
+  /** Set quadrature for integrating finite-element quantities.
+   *
+   * @param q Quadrature for integrating.
+   */
+  void quadrature(const Quadrature* q);
+
   /** Set time step for advancing from time t to time t+dt.
    *
    * @param dt Time step

Modified: short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.hh	2007-03-10 21:12:47 UTC (rev 6220)
+++ short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.hh	2007-03-11 04:26:46 UTC (rev 6221)
@@ -18,11 +18,6 @@
  *
  * The parameter manager stores the fields associated with parameters
  * for physical properties or boundary conditions.
- *
- * :QUESTION: Should there be only one parameter manager for all
- * element families or one per element family? If we can easily create
- * a section that pertains only to an element family, then one per
- * family would make the most sense.
  */
 
 #if !defined(pylith_feassemble_parametermanager_hh)

Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.cc	2007-03-10 21:12:47 UTC (rev 6220)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.cc	2007-03-11 04:26:46 UTC (rev 6221)
@@ -12,7 +12,6 @@
 
 #include <portinfo>
 
-#include "ElasticMaterial.hh" // ISA ElasticMaterial
 #include "ElasticIsotropic3D.hh" // implementation of object methods
 
 #include <assert.h> // USES assert()
@@ -23,22 +22,34 @@
     class _ElasticIsotropic3D;
   } // materials
 } // pylith
-class pylith::materials::_ElasticIsotropic3D {
-public :
-  static const char* NAMESPARAMS[];
-  static const int NUMPARAMS;
 
-  /// Indices of paramters in queries
-  enum parameters {
-    IVP = 0, ///< Index for Vp
-    IVS = 1, ///< Index for Vs
-    IDENSITY = 2 ///< Index for density
-  };
+class pylith::materials::_ElasticIsotropic3D {
+public:
+  static const int numDBValues;
+  static const char* namesDBValues[];
+  static const int numParameters;
+  static const char* namesParameters[];
+  static const int didDensity;
+  static const int didVs;
+  static const int didVp;
+  static const int pidDensity;
+  static const int pidMu;
+  static const int pidLambda;
 }; // _ElasticIsotropic3D
-const char* pylith::materials::_ElasticIsotropic3D::NAMESPARAMS[] =
-  { "Vp", "Vs", "Density" };
-const int pylith::materials::_ElasticIsotropic3D::NUMPARAMS = 3;
 
+const int pylith::materials::_ElasticIsotropic3D::numDBValues = 3;
+const char* pylith::materials::_ElasticIsotropic3D::namesDBValues[] =
+  {"density", "vp", "vs" };
+const int pylith::materials::_ElasticIsotropic3D::numParameters = 3;
+const char* pylith::materials::_ElasticIsotropic3D::namesParameters[] =
+  {"density", "mu", "lambda" };
+const int pylith::materials::_ElasticIsotropic3D::didDensity = 0;
+const int pylith::materials::_ElasticIsotropic3D::didVs = 1;
+const int pylith::materials::_ElasticIsotropic3D::didVp = 2;
+const int pylith::materials::_ElasticIsotropic3D::pidDensity = 0;
+const int pylith::materials::_ElasticIsotropic3D::pidMu = 1;
+const int pylith::materials::_ElasticIsotropic3D::pidLambda = 2;
+
 // ----------------------------------------------------------------------
 // Default constructor.
 pylith::materials::ElasticIsotropic3D::ElasticIsotropic3D(void)
@@ -55,103 +66,85 @@
 // Copy constructor.
 pylith::materials::ElasticIsotropic3D::ElasticIsotropic3D(
 						const ElasticIsotropic3D& m) :
-  ElasticMaterial(m)
+  ElasticMaterial3D(m)
 { // copy constructor
 } // copy constructor
 
 // ----------------------------------------------------------------------
-// Get names of parameters for material.
-const char**
-pylith::materials::ElasticIsotropic3D::namesParams(void) const
-{ // namesParams
-  return _ElasticIsotropic3D::NAMESPARAMS;
-} // namesParams
-  
-// ----------------------------------------------------------------------
-// Get number of parameters for material.
-int
-pylith::materials::ElasticIsotropic3D::numParams(void) const
-{ // numParams
-  return _ElasticIsotropic3D::NUMPARAMS;
-} // numParams
-  
-// ----------------------------------------------------------------------
-// Compute inertia at points using material parameters.
+// Compute parameters from values in spatial database.
 void
-pylith::materials::ElasticIsotropic3D::calcInertia(double** ppInertia,
-						   int* pSize,
-						   const double* pParams,
-						   const int npts,
-						   const void* pState) const
-{ // calcInertia
-  assert(0 != ppInertia);
-  assert(0 != pSize);
-  assert( (0 == pParams && 0 == npts) ||
-	  (0 != pParams && 0 < npts) );
+pylith::materials::ElasticIsotropic3D::dbToParams(double* paramVals,
+						  const int numParams,
+						  double* dbValues,
+						  const int numValues) const
+{ // computeParameters
+  assert(0 != paramVals);
+  assert(_NUMPARAMETERS == numParams);
+  assert(0 != dbValues);
+  assert(_NUMDBVALUES == numValues);
 
-  delete[] *ppInertia; *ppInertia = (npts > 0) ? new double[npts] : 0;
-  *pSize = npts;
+  const double density = dbValues[_ElasticIsotropic3D::didDensity];
+  const double vs = dbValues[_ElasticIsotropic3D::didVs];
+  const double vp = dbValues[_ElasticIsotropic3D::didVp];
+ 
+  const double mu = density * vs*vs;
+  const double lambda = density * vp*vp - 2.0*mu;
 
-  for (int ipt=0; ipt < npts; ++ipt) {
-    const double* pParamsPt = pParams + ipt*_ElasticIsotropic3D::NUMPARAMS;
-    (*ppInertia)[ipt] = pParamsPt[_ElasticIsotropic3D::IDENSITY];
-  } // for
-} // calcInertia
+  paramVals[_ElasticIsotropic3D::pidDensity] = density;
+  paramVals[_ElasticIsotropic3D::pidMu] = mu;
+  paramVals[_ElasticIsotropic3D::pidLambda] = lambda;
+} // computeParameters
 
 // ----------------------------------------------------------------------
-// Compute elasticity constants at points using material parameters.
+// Compute density at location from parameters.
 void
-pylith::materials::ElasticIsotropic3D::calcElasticityConsts(
-						    double** ppElasticityC,
-						    int* pSize,
-						    const double* pParams,
-						    const int npts,
-						    const void* pState) const
-{ // calcElasticityConsts
-  assert(0 != ppElasticityC);
-  assert(0 != pSize);
-  assert( (0 == pParams && 0 == npts) ||
-	  (0 != pParams && 0 < npts) );
+pylith::materials::ElasticIsotropic3D::calcDensity(double* density,
+						   const double* parameters,
+						   const int numParameters)
+{ // calcDensity
+  assert(0 != density);
+  *density = parameters[_ElasticIsotropic3D::pidDensity];
+} // calcDensity
 
-  delete[] *ppElasticityC; 
-  *ppElasticityC = (npts > 0) ? new double[NUMELASTCONSTS*npts] : 0;
-  *pSize = NUMELASTCONSTS*npts;
+// ----------------------------------------------------------------------
+// Compute density at location from parameters.
+void
+pylith::materials::ElasticIsotropic3D::calcElasticConsts(double* elasticConsts,
+							 const int numConsts,
+							 const double* parameters,
+							 const int numParameters)
+{ // calcElasticConsts
+  assert(0 != elasticConsts);
+  assert(NUMELASTCONSTS == numConsts);
+  assert(0 != parameters);
+  assert(_ElasticIsotropic3D::numParameters == numParameters);
 
-  for (int ipt=0; ipt < npts; ++ipt) {
-    const double* pParamsPt = pParams + ipt*_ElasticIsotropic3D::NUMPARAMS;
-    const double density = pParamsPt[_ElasticIsotropic3D::IDENSITY];
-    const double vp = pParamsPt[_ElasticIsotropic3D::IVP];
-    const double vs = pParamsPt[_ElasticIsotropic3D::IVS];
+  const double density = parameters[_ElasticIsotropic3D::pidDensity];
+  const double mu = parameters[_ElasticIsotropic3D::pidMu];
+  const double lambda = parameters[_ElasticIsotropic3D::pidLambda];
+  
+  elasticConsts[ 0] = lambda + 2.0*mu; // C1111
+  elasticConsts[ 1] = lambda; // C1122
+  elasticConsts[ 2] = lambda; // C1133
+  elasticConsts[ 3] = 0; // C1112
+  elasticConsts[ 4] = 0; // C1123
+  elasticConsts[ 5] = 0; // C1113
+  elasticConsts[ 6] = lambda + 2.0*mu; // C2222
+  elasticConsts[ 7] = lambda; // C2233
+  elasticConsts[ 8] = 0; // C2212
+  elasticConsts[ 9] = 0; // C2223
+  elasticConsts[10] = 0; // C2212
+  elasticConsts[11] = lambda + 2.0*mu; // C3333
+  elasticConsts[12] = 0; // C3312
+  elasticConsts[13] = 0; // C3323
+  elasticConsts[14] = 0; // C3312
+  elasticConsts[15] = mu; // C1212
+  elasticConsts[16] = 0; // C1223
+  elasticConsts[17] = 0; // C1213
+  elasticConsts[18] = mu; // C2323
+  elasticConsts[19] = 0; // C2313
+  elasticConsts[20] = mu; // C1313
+} // calcElasticConsts
 
-    const double mu = density*vs*vs;
-    const double lambda = density*vp*vp - 2.0*mu;
-    
-    const int iElasticityC = NUMELASTCONSTS*ipt;
-    (*ppElasticityC)[iElasticityC   ] = lambda + 2.0*mu; // C1111
-    (*ppElasticityC)[iElasticityC+ 1] = lambda; // C1122
-    (*ppElasticityC)[iElasticityC+ 2] = lambda; // C1133
-    (*ppElasticityC)[iElasticityC+ 3] = 0; // C1112
-    (*ppElasticityC)[iElasticityC+ 4] = 0; // C1123
-    (*ppElasticityC)[iElasticityC+ 5] = 0; // C1113
-    (*ppElasticityC)[iElasticityC+ 6] = lambda + 2.0*mu; // C2222
-    (*ppElasticityC)[iElasticityC+ 7] = lambda; // C2233
-    (*ppElasticityC)[iElasticityC+ 8] = 0; // C2212
-    (*ppElasticityC)[iElasticityC+ 9] = 0; // C2223
-    (*ppElasticityC)[iElasticityC+10] = 0; // C2212
-    (*ppElasticityC)[iElasticityC+11] = lambda + 2.0*mu; // C3333
-    (*ppElasticityC)[iElasticityC+12] = 0; // C3312
-    (*ppElasticityC)[iElasticityC+13] = 0; // C3323
-    (*ppElasticityC)[iElasticityC+14] = 0; // C3312
-    (*ppElasticityC)[iElasticityC+15] = mu; // C1212
-    (*ppElasticityC)[iElasticityC+16] = 0; // C1223
-    (*ppElasticityC)[iElasticityC+17] = 0; // C1213
-    (*ppElasticityC)[iElasticityC+18] = mu; // C2323
-    (*ppElasticityC)[iElasticityC+19] = 0; // C2313
-    (*ppElasticityC)[iElasticityC+20] = mu; // C1313
-  } // for
-} // elasticityConsts
 
-// version
-// $Id$
-
 // End of file 

Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.hh	2007-03-10 21:12:47 UTC (rev 6220)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.hh	2007-03-11 04:26:46 UTC (rev 6221)
@@ -14,24 +14,29 @@
  *
  * @brief C++ ElasticIsotropic3D object
  *
- * 3-D, isotropic, linear elastic material.
+ * 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
+ * internally using density, lambda, and mu, which are directly
+ * related to the elasticity constants use in the finite-element
+ * integration.
  */
 
 #if !defined(pylith_materials_elasticisotropic3d_hh)
 #define pylith_materials_elasticisotropic3d_hh
 
+#include "ElasticMaterial3D.hh"
+
 /// Namespace for pylith package
 namespace pylith {
   namespace materials {
-    class ElasticMaterial;
     class ElasticIsotropic3D;
     class TestElasticIsotropic3D; // unit testing
   } // materials
 } // pylith
 
 /// 3-D, isotropic, linear elastic material.
-class pylith::materials::ElasticIsotropic3D : 
-  public pylith::materials::ElasticMaterial
+class pylith::materials::ElasticIsotropic3D : public ElasticMaterial3D
 { // class ElasticIsotropic3D
   friend class TestElasticIsotropic3D; // unit testing
 
@@ -44,93 +49,110 @@
   /// Destructor
   ~ElasticIsotropic3D(void);
 
+  /** Create a pointer to a copy of this.
+   *
+   * @returns Pointer to copy
+   */
+  ElasticMaterial3D* clone(void) const;
+
+  // PROTECTED METHODS //////////////////////////////////////////////////
+protected :
+
   /** Copy constructor
    *
    * @param m Material to copy
    */
   ElasticIsotropic3D(const ElasticIsotropic3D& m);
 
-  /** Create a pointer to a copy of this.
+  /** Get names of values expected to be in database of parameters for
+   *  physical properties.
    *
-   * @returns Pointer to copy
+   * @returns Names of values
    */
-  ElasticMaterial* clone(void) const;
+  const char** dbValues(void) const;
 
-  /** Compute inertia at points using material parameters.
+  /** Get number of values expected to be in database of parameters for
+   *  physical properties.
    *
-   * The values are returned through the parameters.
+   * @returns Number of values
+   */
+  int numDBValues(void) const;
+
+  /** Get names of parameters for physical properties.
    *
-   * Index into array of inertia values:
-   * index = iPoint
+   * @returns Names of parameters
+   */
+  const char** parameterNames(void) const;
+
+  /** Get number of parameters for physical properties.
    *
-   * @param ppIntertia Array of mass densities
-   * @param pSize Size of mass densities array
-   * @param pParams Array of material parameters [npts x numParams]
-   * @param npts Number of points
-   * @param pState Pointer to system state at points
+   * @returns Number of parameters
    */
-  void calcInertia(double** ppInertia,
-		   int* pSize,
-		   const double* pParams,
-		   const int npts,
-		   const void* pState) const;
-  
-  /** Compute elasticity constants at points using material parameters.
+  int numParameters(void) const;
+
+  /** Compute parameters from values in spatial database.
    *
-   * The values are returned through the parameters and are grouped by
-   * point.
+   * Order of values in arrays matches order used in dbValues() and
+   * parameterNames().
    *
-   * Index into array of elasticity constants:
-   * index = iPoint*NUMELASTCONSTS + iConstant
-   *
-   * Order of elasticity constants:
-   *  0: C1111,  1: C1122,  2: C1133,  3: C1112,  4: C1123,  5: C1113,
-   *             6: C2222,  7: C2233,  8: C2212,  9: C2223, 10: C2213,
-   *                       11: C3333, 12: C3312, 13: C3323, 14: C3313,
-   *                                  15: C1212, 16: C1223, 17: C1213,
-   *                                             18: C2323, 19: C2313,
-   *                                                        20: C1313
-   *
-   * @param pElasticityC Array of elasticity constants
-   * @param pSize Size of elastiticy constants array
-   * @param pParams Array of material parameters [npts x numParams]
-   * @param npts Number of points
-   * @param pState Pointer to system state at points
+   * @param paramVals Array of parameters
+   * @param numParams Number of parameters
+   * @param dbValues Array of database values
+   * @param numValues Number of database values
    */
-  void calcElasticityConsts(double** pElasticityC,
-			    int* pSize,
-			    const double* pParams,
-			    const int npts,
-			    const void* pState) const;
+  void dbToParams(double* paramVals,
+		  const int numParams,
+		  double* dbValues,
+		  const int numValues) const;
 
-  // PROTECTED METHODS //////////////////////////////////////////////////
-protected :
-
-  /** Get names of parameters for material.
+  /** Compute density at location from parameters.
    *
-   * @returns Array of names of parameters
+   * @param density Pointer to density at location
+   * @param parameters Parameters at location
+   * @param numParameters Number of parameters
    */
-  const char** namesParams(void) const;
-  
-  /** Get number of parameters for material.
+  void calcDensity(double* density,
+		   const double* parameters,
+		   const int numParameters);
+
+  /** Compute density at location from parameters.
    *
-   * @returns Number of parameters
+   * @param elasticConsts Pointer to elastic constants at location
+   * @param numConsts Number of elastic constants
+   * @param parameters Parameters at location
+   * @param numParameters Number of parameters
    */
-  int numParams(void) const;
-  
-  // PRIVATE METHODS ////////////////////////////////////////////////////
+  void calcElasticConsts(double* elasticConsts,
+			 const int numConsts,
+			 const double* parameters,
+			 const int numParameters);
+
+  // NOT IMPLEMENTED ////////////////////////////////////////////////////
 private :
 
   /// Not implemented
   const ElasticIsotropic3D& operator=(const ElasticIsotropic3D& m);
 
+  // PRIVATE MEMBERS ////////////////////////////////////////////////////
+private :
+
+  /// Number of values expected in database of physical property parameters
+  static const int _NUMDBVALUES;
+
+  /// Names of values expected in database of physical property parameters
+  static const char* _NAMESDBVALUES[];
+
+  /// Number of physical property parameters
+  static const int _NUMPARAMETERS;
+
+  /// Names of physical property parameters
+  static const char* _NAMESPARAMETERS[];  
+
 }; // class ElasticIsotropic3D
 
 #include "ElasticIsotropic3D.icc" // inline methods
 
 #endif // pylith_materials_elasticisotropic3d_hh
 
-// version
-// $Id$
 
 // End of file 

Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.icc	2007-03-10 21:12:47 UTC (rev 6220)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.icc	2007-03-11 04:26:46 UTC (rev 6221)
@@ -16,12 +16,38 @@
 
 // Create a pointer to a copy of this.
 inline
-pylith::materials::ElasticMaterial*
+pylith::materials::ElasticMaterial3D*
 pylith::materials::ElasticIsotropic3D::clone(void) const {
   return new ElasticIsotropic3D(*this);
 }
 
-// version
-// $Id$
+// Get names of values expected to be in database of parameters for
+inline
+const char**
+pylith::materials::ElasticIsotropic3D::dbValues(void) const {
+  return _NAMESDBVALUES;
+}
 
+// Get number of values expected to be in database of parameters for
+inline
+int
+pylith::materials::ElasticIsotropic3D::numDBValues(void) const {
+  return _NUMDBVALUES;
+}
+
+// Get names of parameters for physical properties.
+inline
+const char**
+pylith::materials::ElasticIsotropic3D::parameterNames(void) const {
+  return _NAMESPARAMETERS;
+}
+
+// Get number of parameters for physical properties.
+inline
+int
+pylith::materials::ElasticIsotropic3D::numParameters(void) const {
+  return _NUMPARAMETERS;
+}
+
+
 // End of file 

Deleted: short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc	2007-03-10 21:12:47 UTC (rev 6220)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc	2007-03-11 04:26:46 UTC (rev 6221)
@@ -1,124 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-//                           Brad T. Aagaard
-//                        U.S. Geological Survey
-//
-// {LicenseText}
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "ElasticMaterial.hh" // implementation of object methods
-
-#include "spatialdata/spatialdb/SpatialDB.hh" // USES SpatialDB
-
-#include <assert.h> // USES assert()
-
-// ----------------------------------------------------------------------
-const int pylith::materials::ElasticMaterial::NUMELASTCONSTS = 21;
-
-// ----------------------------------------------------------------------
-// Default constructor.
-pylith::materials::ElasticMaterial::ElasticMaterial(void) :
-  _pDB(0)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
-// Destructor.
-pylith::materials::ElasticMaterial::~ElasticMaterial(void)
-{ // destructor
-  // Do not own database, so just set pointer to null.
-  _pDB = 0;
-} // destructor
-
-// ----------------------------------------------------------------------
-// Copy constructor.
-pylith::materials::ElasticMaterial::ElasticMaterial(const ElasticMaterial& m) :
-  _pDB(m._pDB)
-{ // copy constructor
-} // copy constructor
-
-// ----------------------------------------------------------------------
-// Set database for material parameters.
-void
-pylith::materials::ElasticMaterial::parametersDB(
-                            spatialdata::spatialdb::SpatialDB* pDB)
-{ // parametersDB
-  _pDB = pDB;
-} // parametersDB
-
-// ----------------------------------------------------------------------
-// Get intertia at points.
-void
-pylith::materials::ElasticMaterial::inertia(
-			     double** ppInertia,
-			     int* pSize,
-			     const double* pPts,
-			     const int npts,
-			     const spatialdata::geocoords::CoordSys* pCS,
-			     const void* pState) const
-{ // inertia
-  double* pParams = 0;
-  int size = 0;
-  _getParameters(&pParams, &size, pPts, npts, pCS);
-  calcInertia(ppInertia, pSize, pParams, size, pState);
-  delete[] pParams; pParams = 0;
-} // inertia
-
-// ----------------------------------------------------------------------
-/* Get elasticity constants at quadrature points. */
-void
-pylith::materials::ElasticMaterial::elasticityConsts(
-			 double** ppElasticityC,
-			 int* pSize,
-			 const double* pPts,
-			 const int npts,
-			 const spatialdata::geocoords::CoordSys* pCS,
-			 const void* pState) const
-{ // elasticityConsts
-  double* pParams = 0;
-  int size = 0;
-  _getParameters(&pParams, &size, pPts, npts, pCS);
-  calcElasticityConsts(ppElasticityC, pSize, pParams, size, pState);
-  delete[] pParams; pParams = 0;
-} // elasticityConsts
-
-// ----------------------------------------------------------------------
-// Get material parameters at a set of points.
-void
-pylith::materials::ElasticMaterial::_getParameters(double** ppParams,
-						   int* pSize,
-						   const double* pPts,
-						   const int npts,
-			 const spatialdata::geocoords::CoordSys* pCS) const
-{ // _getParameters
-  assert(0 != ppParams);
-  assert(0 != pSize);
-  assert( (0 == pPts && 0 == npts) ||
-	  (0 != pPts && 0 < npts) );
-  assert(0 != _pDB);
-
-  const int size = npts*numParams();
-  delete[] *ppParams; *ppParams = (size > 0) ? new double[size] : 0;
-  *pSize = size;
-
-  const int numCoords = 3;
-  for (int ipt=0; ipt < npts; ++ipt) {
-    double* pVals = 0;
-    int nvals = numParams();
-    const double* pCoords = pPts + numCoords*ipt;
-    _pDB->query(&pVals, nvals, pCoords[0], pCoords[1], pCoords[2], pCS);
-    for (int ival=0; ival < nvals; ++ival)
-      (*ppParams)[ipt*nvals+ival] = pVals[ival];
-  } // for
-} // _getParameters
-
-// version
-// $Id$
-
-// End of file 

Deleted: short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.hh	2007-03-10 21:12:47 UTC (rev 6220)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.hh	2007-03-11 04:26:46 UTC (rev 6221)
@@ -1,122 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-//                           Brad T. Aagaard
-//                        U.S. Geological Survey
-//
-// {LicenseText}
-//
-// ----------------------------------------------------------------------
-//
-
-/** @file libsrc/materials/ElasticMaterial.hh
- *
- * @brief C++ ElasticMaterial object
- *
- * Interface definition for material constitutive model.
- */
-
-#if !defined(pylith_materials_elasticmaterial_hh)
-#define pylith_materials_elasticmaterial_hh
-
-/// Namespace for pylith package
-namespace pylith {
-  namespace materials {
-    class ElasticMaterial;
-  } // materials
-} // pylith
-
-/// Namespace for spatialdata package
-namespace spatialdata {
-  namespace spatialdb {
-    class SpatialDB; // forward declaration
-  } // spatialdb
-  namespace geocoords {
-    class CoordSys;
-  } // geocoords
-} // spatialdata
-
-/// C++ object for material constitutive model.
-class pylith::materials::ElasticMaterial
-{ // class ElasticMaterial
-
-  // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
-  /// Default constructor.
-  ElasticMaterial(void);
-
-  /// Destructor.
-  virtual
-  ~ElasticMaterial(void);
-
-  /** Copy constructor.
-   *
-   * @param m Material to copy
-   */
-  ElasticMaterial(const ElasticMaterial& m);
-
-  /** Create a pointer to a copy of this.
-   *
-   * @returns Pointer to copy
-   */
-  virtual
-  ElasticMaterial* clone(void) const = 0;
-
-  /** Set database for physical property parameters.
-   *
-   * @param pDB Pointer to database.
-   */
-  void parametersDB(spatialdata::spatialdb::SpatialDB* pDB);
-
-  /** Get physical property parameters from database.
-   *
-   * @param mesh PETSc mesh
-   * @param label Label identifying material
-   */
-  void createParameters(const ALE::Obj<ALE::Mesh>& mesh);
-  
-  /** Get section with inertia values.
-   *
-   */
-  void inertia(void);
-
-  /** Get section with elasticity constants.
-   *
-   * Index into array of elasticity constants:
-   * index = iPoint*NUMELASTCONSTS + iConstant
-   *
-   * Order of elasticity constants:
-   *  0: C1111,  1: C1122,  2: C1133,  3: C1112,  4: C1123,  5: C1113,
-   *             6: C2222,  7: C2233,  8: C2212,  9: C2223, 10: C2213,
-   *                       11: C3333, 12: C3312, 13: C3323, 14: C3313,
-   *                                  15: C1212, 16: C1223, 17: C1213,
-   *                                             18: C2323, 19: C2313,
-   *                                                        20: C1313
-   *
-   */
-  void elasticityConstants(void);
-
-  // PUBLIC MEMBERS /////////////////////////////////////////////////////
-public :
-
-  static const int NUMELASTCONSTS; ///< Number of elastic constants
-
-  // NOT IMPLEMENTED ////////////////////////////////////////////////////
-private :
-
-  /// Not implemented
-  const ElasticMaterial& operator=(const ElasticMaterial& m);
-
-  // PRIVATE MEMBERS ////////////////////////////////////////////////////
-private :
-
-  /// Database of parameters for material
-  spatialdata::spatialdb::SpatialDB* _pDB;
-
-}; // class ElasticMaterial
-
-#endif // pylith_materials_elasticmaterial_hh
-
-// End of file 

Copied: short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial3D.cc (from rev 6218, short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc)
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc	2007-03-10 03:09:03 UTC (rev 6218)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial3D.cc	2007-03-11 04:26:46 UTC (rev 6221)
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "ElasticMaterial3D.hh" // implementation of object methods
+
+#include <assert.h> // USES assert()
+
+// ----------------------------------------------------------------------
+const int pylith::materials::ElasticMaterial3D::NUMELASTCONSTS = 21;
+
+// ----------------------------------------------------------------------
+// Default constructor.
+pylith::materials::ElasticMaterial3D::ElasticMaterial3D(void)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor.
+pylith::materials::ElasticMaterial3D::~ElasticMaterial3D(void)
+{ // destructor
+} // destructor
+
+// ----------------------------------------------------------------------
+// Copy constructor.
+pylith::materials::ElasticMaterial3D::ElasticMaterial3D(const ElasticMaterial3D& m) :
+  Material(m)
+{ // copy constructor
+} // copy constructor
+
+// ----------------------------------------------------------------------
+// Get section with inertia values.
+const ALE::Obj<ALE::Mesh::real_section_type>&
+pylith::materials::ElasticMaterial3D::density(void)
+{ // density
+} // density
+
+// ----------------------------------------------------------------------
+// Get section with elasticity constants.
+const ALE::Obj<ALE::Mesh::real_section_type>&
+pylith::materials::ElasticMaterial3D::elasticityConstants(void)
+{ // elasticityConstants
+} // elasticityConstants
+
+
+// End of file 

Copied: short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial3D.hh (from rev 6218, short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.hh)
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.hh	2007-03-10 03:09:03 UTC (rev 6218)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial3D.hh	2007-03-11 04:26:46 UTC (rev 6221)
@@ -0,0 +1,132 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file libsrc/materials/ElasticMaterial3D.hh
+ *
+ * @brief C++ ElasticMaterial object
+ *
+ * Interface definition for 3-D linear and nonlinear elastic materials.
+ */
+
+#if !defined(pylith_materials_elasticmaterial3d_hh)
+#define pylith_materials_elasticmaterial3d_hh
+
+#include "Material.hh" // ISA Material
+
+#include <petscmesh.h> // USES Mesh
+
+
+/// Namespace for pylith package
+namespace pylith {
+  namespace materials {
+    class ElasticMaterial3D;
+  } // materials
+} // pylith
+
+/// C++ object for material constitutive model.
+class pylith::materials::ElasticMaterial3D : public Material
+{ // class ElasticMaterial3D
+
+  typedef ALE::Mesh::real_section_type real_section_type;
+
+
+  // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+  /// Default constructor.
+  ElasticMaterial3D(void);
+
+  /// Destructor.
+  virtual
+  ~ElasticMaterial3D(void);
+
+  /** Create a pointer to a copy of this.
+   *
+   * @returns Pointer to copy
+   */
+  virtual
+  ElasticMaterial3D* clone(void) const = 0;
+
+  /** Get section with density values.
+   *
+   * @returns Section with density values.
+   */
+  const ALE::Obj<real_section_type>& density(void);
+
+  /** Get section with elasticity constants.
+   *
+   * Index into array of elasticity constants:
+   * index = iQuadPt*NUMELASTCONSTS + iConstant
+   *
+   * Order of elasticity constants:
+   *  0: C1111,  1: C1122,  2: C1133,  3: C1112,  4: C1123,  5: C1113,
+   *             6: C2222,  7: C2233,  8: C2212,  9: C2223, 10: C2213,
+   *                       11: C3333, 12: C3312, 13: C3323, 14: C3313,
+   *                                  15: C1212, 16: C1223, 17: C1213,
+   *                                             18: C2323, 19: C2313,
+   *                                                        20: C1313
+   *
+   * @returns Section with elasticity constants.
+   */
+  const ALE::Obj<real_section_type>& elasticityConstants(void);
+
+  // PUBLIC MEMBERS /////////////////////////////////////////////////////
+public :
+
+  static const int NUMELASTCONSTS; ///< Number of elastic constants
+
+  // PROTECTED METHODS //////////////////////////////////////////////////
+protected :
+
+  /** Copy constructor.
+   *
+   * @param m Material to copy
+   */
+  ElasticMaterial3D(const ElasticMaterial3D& m);
+
+
+  /** Compute density at location from parameters.
+   *
+   * @param density Pointer to density at location
+   * @param parameters Parameters at location
+   * @param numParameters Number of parameters
+   */
+  virtual
+  void calcDensity(double* density,
+		   const double* parameters,
+		   const int numParameters) = 0;
+
+  /** Compute density at location from parameters.
+   *
+   * @param elasticConsts Pointer to elastic constants at location
+   * @param numConsts Number of elastic constants
+   * @param parameters Parameters at location
+   * @param numParameters Number of parameters
+   */
+  virtual
+  void calcElasticConsts(double* elasticConsts,
+			 const int numConstants,
+			 const double* parameters,
+			 const int numParameters) = 0;
+
+  // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
+
+  /// Not implemented
+  const ElasticMaterial3D& operator=(const ElasticMaterial3D& m);
+
+}; // class ElasticMaterial3D
+
+#endif // pylith_materials_elasticmaterial3d_hh
+
+
+// End of file 

Modified: short/3D/PyLith/trunk/libsrc/materials/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Makefile.am	2007-03-10 21:12:47 UTC (rev 6220)
+++ short/3D/PyLith/trunk/libsrc/materials/Makefile.am	2007-03-11 04:26:46 UTC (rev 6221)
@@ -13,16 +13,11 @@
 subpackage = materials
 include $(top_srcdir)/subpackage.am
 
-lib_LTLIBRARIES = libpylithmaterials.la
-
-libpylithmaterials_la_SOURCES = \
-	ElasticIsotropic3D.cc \
-	ElasticMaterial.cc
-
 subpkginclude_HEADERS = \
 	ElasticIsotropic3D.hh \
 	ElasticIsotropic3D.icc \
-	ElasticMaterial.hh
+	ElasticMaterial3D.hh \
+	Material.hh
 
 noinst_HEADERS =
 
@@ -31,7 +26,5 @@
 BUILT_SOURCES = export-subpkgincludeHEADERS
 CLEANFILES = export-subpkgincludeHEADERS
 
-# version
-# $Id$
 
 # End of file 

Added: short/3D/PyLith/trunk/libsrc/materials/Material.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.cc	2007-03-10 21:12:47 UTC (rev 6220)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.cc	2007-03-11 04:26:46 UTC (rev 6221)
@@ -0,0 +1,171 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "Material.hh" // implementation of object methods
+
+#include "pylith/feassemble/ParameterManager.hh" // USES ParameterManager
+#include "pylith/feassemble/Quadrature.hh" // USES ParameterManager
+
+#include "spatialdata/spatialdb/SpatialDB.hh" // USES SpatialDB
+
+#include <petscmesh.h> // USES Mesh
+
+#include <assert.h> // USES assert()
+#include <stdexcept> // USES std::runtime_error
+#include <sstream> // USES std::ostringstream
+
+// ----------------------------------------------------------------------
+// Default constructor.
+pylith::materials::Material::Material(void) :
+  _db(0),
+  _parameters(0),
+  _id(0),
+  _label("")
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor.
+pylith::materials::Material::~Material(void)
+{ // destructor
+  // Python db object owns database, so just set pointer to null
+  _db = 0;
+
+  delete _parameters; _parameters = 0;
+} // destructor
+
+// ----------------------------------------------------------------------
+// Copy constructor.
+pylith::materials::Material::Material(const Material& m) :
+  _db(m._db),
+  _parameters(m._parameters),
+  _id(m._id),
+  _label(m._label)
+{ // copy constructor
+} // copy constructor
+
+// ----------------------------------------------------------------------
+// Get physical property parameters from database.
+void
+pylith::materials::Material::initialize(const ALE::Obj<ALE::Mesh>& mesh,
+					const spatialdata::geocoords::CoordSys* cs,
+					pylith::feassemble::Quadrature* quadrature)
+{ // initialize
+  assert(0 != _db);
+  assert(0 != cs);
+  assert(0 != quadrature);
+
+  typedef ALE::Mesh::real_section_type real_section_type;
+  typedef ALE::Mesh::topology_type topology_type;
+
+  // Get cells associated with material
+  const ALE::Mesh::int_section_type::patch_type patch = 0;
+  const ALE::Obj<real_section_type>& coordinates = 
+    mesh->getRealSection("coordinates");
+  const ALE::Obj<topology_type>& topology = coordinates->getTopology();
+  const ALE::Obj<topology_type::label_sequence>& cells = 
+    topology->heightStratum(patch, 0);
+  const topology_type::label_sequence::iterator cellsEnd = cells->end();
+  // :TODO: Get cells for material only
+
+  // Create sections to hold parameters for physical properties
+  delete _parameters; _parameters = new feassemble::ParameterManager(mesh);
+  const int numQuadPts = quadrature->numQuadPts();
+  const int fiberDim = numQuadPts; // number of values in field per cell
+
+  /* :QUESTION: MATT
+   *
+   * We want to create a section that stores values just for cells in
+   * this material, we want to carry around storage for density,
+   * etc. for cells not of this material.
+   */
+  const int numParams = numParameters();
+  const char** paramNames = parameterNames();
+
+  ALE::Obj<real_section_type>* paramSections = 
+    (numParams > 0) ? new ALE::Obj<real_section_type>[numParams] : 0;
+  
+  for (int iParam=0; iParam < numParams; ++iParam) {
+    _parameters->addReal(paramNames[iParam]);
+    paramSections[iParam] = _parameters->getReal(paramNames[iParam]);
+    paramSections[iParam]->setFiberDimensionByDepth(patch, 0, fiberDim);
+    paramSections[iParam]->allocate();
+  } // for
+
+  // Setup database for querying
+  const int numValues = numDBValues();
+  _db->open();
+  _db->queryVals(dbValues(), numValues);
+  
+  // Loop over cells
+  double* queryData = (numValues > 0) ? new double[numValues] : 0;
+  double* paramData = (numParams > 0) ? new double[numParams] : 0;
+  double** cellData = (numParams > 0) ? new double*[numParams] : 0;
+  for (int iParam = 0; iParam < 0; ++iParam)
+    cellData[iParam] = (numQuadPts > 0) ? new double[numQuadPts] : 0;
+  for (topology_type::label_sequence::iterator cellIter=cells->begin();
+       cellIter != cellsEnd;
+       ++cellIter) {
+    // Compute geometry information for current cell
+    quadrature->computeGeometry(coordinates, *cellIter);
+
+    const double* quadPts = quadrature->quadPts();
+    const int spaceDim = quadrature->spaceDim();
+
+    // Loop over quadrature points in cell and query database
+    for (int iQuadPt=0, index=0; 
+	 iQuadPt < numQuadPts; 
+	 ++iQuadPt, index+=spaceDim) {
+      const int err = _db->query(queryData, numValues, &quadPts[index],
+				 spaceDim, cs);
+      if (err) {
+	std::ostringstream msg;
+	msg << "Could not find parameters for physical properties at \n"
+	    << "(";
+	for (int i=0; i < spaceDim; ++i)
+	  msg << "  " << quadPts[index+spaceDim];
+	msg << ") in material " << _label << "\n"
+	    << "using spatial database " << _db->label() << ".";
+
+	// Cleanup, then throw exception
+	for (int iParam=0; iParam < numParams; ++iParam) {
+	  delete[] cellData[iParam]; cellData[iParam] = 0;
+	} // fir
+	delete[] cellData; cellData = 0;
+	delete[] queryData; queryData = 0;
+	delete[] paramData; paramData = 0;
+	throw std::runtime_error(msg.str());
+      } // if
+      dbToParams(paramData, numParams, queryData, numValues);
+
+      for (int iParam=0; iParam < numParams; ++iParam)
+	cellData[iParam][iQuadPt] = paramData[iParam];
+    } // for
+    // Assemble cell contribution into fields
+    for (int iParam=0; iParam < numParams; ++iParam)
+      paramSections[iParam]->updateAdd(patch, *cellIter, cellData[iParam]);
+  } // for
+  for (int iParam=0; iParam < numParams; ++iParam) {
+    delete[] cellData[iParam]; cellData[iParam] = 0;
+  } // fir
+  delete[] cellData; cellData = 0;
+  delete[] queryData; queryData = 0;
+  delete[] paramData; paramData = 0;
+
+  // Close database
+  _db->close();
+} // initialize
+  
+
+// End of file 

Added: short/3D/PyLith/trunk/libsrc/materials/Material.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.hh	2007-03-10 21:12:47 UTC (rev 6220)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.hh	2007-03-11 04:26:46 UTC (rev 6221)
@@ -0,0 +1,187 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file libsrc/materials/Material.hh
+ *
+ * @brief C++ abstract base class for Material object.
+ *
+ * Interface definition for material.
+ */
+
+#if !defined(pylith_materials_material_hh)
+#define pylith_materials_material_hh
+
+#include <string> // HASA std::string
+
+/// Namespace for pylith package
+namespace pylith {
+  namespace materials {
+    class Material;
+    class TestMaterial; // unit testing
+  } // materials
+
+  namespace feassemble {
+    class ParameterManager; // HOLDSA ParameterManager
+    class Quadrature; // USES Quadrature
+  } // feassemble
+} // pylith
+
+/// Namespace for spatialdata package
+namespace spatialdata {
+  namespace spatialdb {
+    class SpatialDB; // forward declaration
+  } // spatialdb
+  namespace geocoords {
+    class CoordSys;
+  } // geocoords
+} // spatialdata
+
+/// Namespace for spatialdata package
+namespace ALE {
+  class Mesh;
+  template<class T> class Obj;
+} // ALE
+
+/// C++ abstract base class for Material object.
+class pylith::materials::Material
+{ // class Material
+  friend class TestMaterial; // unit testing
+
+  // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+  /// Default constructor.
+  Material(void);
+
+  /// Destructor.
+  virtual
+  ~Material(void);
+
+  /** Set database for physical property parameters.
+   *
+   * @param pDB Pointer to database.
+   */
+  void parametersDB(spatialdata::spatialdb::SpatialDB* db);
+
+  /** Set identifier of material.
+   *
+   * @param value Material identifier
+   */
+  void id(const int value);
+
+  /** Get identifier of material.
+   *
+   * @returns Material identifier
+   */
+  int id(void) const;
+
+  /** Set label of material.
+   *
+   * @param value Label of material
+   */
+  void label(const char* value);
+
+  /** Get label of material.
+   *
+   * @returns Label of material
+   */
+  const std::string& label(void) const;
+
+  /** Initialize material by getting physical property parameters from
+   * database.
+   *
+   * @param mesh PETSc mesh
+   * @param cs Coordinate system associated with mesh
+   * @param quadrature Quadrature for finite-element integration
+   */
+  void initialize(const ALE::Obj<ALE::Mesh>& mesh,
+		  const spatialdata::geocoords::CoordSys* cs,
+		  pylith::feassemble::Quadrature* quadrature);
+  
+  // PROTECTED METHODS //////////////////////////////////////////////////
+protected :
+
+  /** Copy constructor.
+   *
+   * @param m Material to copy
+   */
+  Material(const Material& m);
+
+  /** Get names of values expected to be in database of parameters for
+   *  physical properties.
+   *
+   * @returns Names of values
+   */
+  virtual
+  const char** dbValues(void) const = 0;
+
+  /** Get number of values expected to be in database of parameters for
+   *  physical properties.
+   *
+   * @returns Number of values
+   */
+  virtual
+  int numDBValues(void) const = 0;
+
+  /** Get names of parameters for physical properties.
+   *
+   * @returns Names of parameters
+   */
+  virtual
+  const char** parameterNames(void) const = 0;
+
+  /** Get number of parameters for physical properties.
+   *
+   * @returns Number of parameters
+   */
+  virtual
+  int numParameters(void) const = 0;
+
+  /** Compute parameters from values in spatial database.
+   *
+   * @param paramVals Array of parameters
+   * @param numParams Number of parameters
+   * @param dbValues Array of database values
+   * @param numValues Number of database values
+   */
+  virtual
+  void dbToParams(double* paramVals,
+		  const int numParams,
+		  double* dbValues,
+		  const int numValues) const = 0;
+
+  // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
+
+  /// Not implemented
+  const Material& operator=(const Material& m);
+
+  // PRIVATE MEMBERS ////////////////////////////////////////////////////
+private :
+
+  /// Database of parameters for physical properties of material
+  spatialdata::spatialdb::SpatialDB* _db;
+
+  ///< Manager of parameters for physical properties of material
+  pylith::feassemble::ParameterManager* _parameters;
+
+  int _id; ///< Material identifier
+  std::string _label; ///< Label of material
+
+}; // class Material
+
+#include "Material.icc" // inline methods
+
+#endif // pylith_materials_material_hh
+
+
+// End of file 

Added: short/3D/PyLith/trunk/libsrc/materials/Material.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.icc	2007-03-10 21:12:47 UTC (rev 6220)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.icc	2007-03-11 04:26:46 UTC (rev 6221)
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#if !defined(pylith_materials_material_hh)
+#error "Material.icc can only be included from Material.hh"
+#endif
+
+// Set database for material parameters.
+inline
+void
+pylith::materials::Material::parametersDB(spatialdata::spatialdb::SpatialDB* db) {
+  _db = db;
+}
+
+// Set identifier of material.
+inline
+void
+pylith::materials::Material::id(const int value) {
+  _id = value;
+}
+
+// Get identifier of material.
+inline
+int
+pylith::materials::Material::id(void) const {
+  return _id;
+}
+
+// Set name of material.
+inline
+void
+pylith::materials::Material::label(const char* value) {
+  _label = value;
+}
+
+// Get label of material.
+inline
+const std::string&
+pylith::materials::Material::label(void) const {
+  return _label;
+}
+
+
+// End of file 



More information about the cig-commits mailing list