[cig-commits] r15194 - in short/3D/PyLith/trunk: . libsrc/bc libsrc/feassemble libsrc/materials modulesrc/bc modulesrc/feassemble modulesrc/materials pylith/feassemble pylith/perf
brad at geodynamics.org
brad at geodynamics.org
Thu Jun 11 10:04:37 PDT 2009
Author: brad
Date: 2009-06-11 10:04:34 -0700 (Thu, 11 Jun 2009)
New Revision: 15194
Modified:
short/3D/PyLith/trunk/TODO
short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.hh
short/3D/PyLith/trunk/libsrc/bc/BoundaryCondition.cc
short/3D/PyLith/trunk/libsrc/bc/DirichletBC.hh
short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.hh
short/3D/PyLith/trunk/libsrc/bc/Neumann.hh
short/3D/PyLith/trunk/libsrc/bc/PointForce.hh
short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.cc
short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.hh
short/3D/PyLith/trunk/libsrc/feassemble/ElasticityExplicit.cc
short/3D/PyLith/trunk/libsrc/feassemble/ElasticityExplicit.hh
short/3D/PyLith/trunk/libsrc/feassemble/ElasticityImplicit.cc
short/3D/PyLith/trunk/libsrc/feassemble/ElasticityImplicit.hh
short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc
short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.hh
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh
short/3D/PyLith/trunk/libsrc/feassemble/QuadratureEngine.cc
short/3D/PyLith/trunk/libsrc/feassemble/QuadratureEngine.hh
short/3D/PyLith/trunk/libsrc/feassemble/QuadratureRefCell.cc
short/3D/PyLith/trunk/libsrc/feassemble/QuadratureRefCell.hh
short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.hh
short/3D/PyLith/trunk/libsrc/materials/Material.cc
short/3D/PyLith/trunk/libsrc/materials/Material.hh
short/3D/PyLith/trunk/libsrc/materials/Metadata.cc
short/3D/PyLith/trunk/libsrc/materials/Metadata.hh
short/3D/PyLith/trunk/modulesrc/bc/AbsorbingDampers.i
short/3D/PyLith/trunk/modulesrc/bc/DirichletBC.i
short/3D/PyLith/trunk/modulesrc/bc/Neumann.i
short/3D/PyLith/trunk/modulesrc/bc/PointForce.i
short/3D/PyLith/trunk/modulesrc/feassemble/CellGeometry.i
short/3D/PyLith/trunk/modulesrc/feassemble/Constraint.i
short/3D/PyLith/trunk/modulesrc/feassemble/ElasticityExplicit.i
short/3D/PyLith/trunk/modulesrc/feassemble/ElasticityImplicit.i
short/3D/PyLith/trunk/modulesrc/feassemble/Integrator.i
short/3D/PyLith/trunk/modulesrc/feassemble/IntegratorElasticity.i
short/3D/PyLith/trunk/modulesrc/feassemble/Quadrature.i
short/3D/PyLith/trunk/modulesrc/feassemble/QuadratureRefCell.i
short/3D/PyLith/trunk/modulesrc/materials/ElasticMaterial.i
short/3D/PyLith/trunk/modulesrc/materials/Material.i
short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py
short/3D/PyLith/trunk/pylith/perf/MemoryLogger.py
Log:
More work on adding deallocation() methods to allow explicit deallocation from Python.
Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/TODO 2009-06-11 17:04:34 UTC (rev 15194)
@@ -38,8 +38,8 @@
pytests
full-scale test (axial compression/extension?)
Generalized Maxwell materials (initial stress/strain)
+ CURRENTLY DISABLED!!!!
-
----------------------------------------------------------------------
1. Tidy up
@@ -51,11 +51,11 @@
Need to call parent deallocate() but not objects deallocate.
bc C++, SWIG
faults C++, SWIG
+ feassemble C++, SWIG
+ materials C++, SWIG
2. Add missing unit tests
- add test_factory() methods to Python unit tests
-
pytests
test_configure
Modified: short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -68,7 +68,6 @@
~AbsorbingDampers(void);
/// Deallocate PETSc and local data structures.
- virtual
void deallocate(void);
/** Set database for boundary condition parameters.
Modified: short/3D/PyLith/trunk/libsrc/bc/BoundaryCondition.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/BoundaryCondition.cc 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/bc/BoundaryCondition.cc 2009-06-11 17:04:34 UTC (rev 15194)
@@ -29,6 +29,7 @@
// Destructor.
pylith::bc::BoundaryCondition::~BoundaryCondition(void)
{ // destructor
+ deallocate();
} // destructor
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/bc/DirichletBC.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/DirichletBC.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/bc/DirichletBC.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -38,6 +38,7 @@
DirichletBC(void);
/// Destructor.
+ virtual
~DirichletBC(void);
/// Deallocate PETSc and local data structures.
Modified: short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -37,7 +37,6 @@
~DirichletBoundary(void);
/// Deallocate PETSc and local data structures.
- virtual
void deallocate(void);
/** Initialize boundary condition.
Modified: short/3D/PyLith/trunk/libsrc/bc/Neumann.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/Neumann.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/bc/Neumann.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -37,7 +37,6 @@
~Neumann(void);
/// Deallocate PETSc and local data structures.
- virtual
void deallocate(void);
/** Set database for boundary condition parameters.
Modified: short/3D/PyLith/trunk/libsrc/bc/PointForce.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/PointForce.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/bc/PointForce.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -40,7 +40,6 @@
~PointForce(void);
/// Deallocate PETSc and local data structures.
- virtual
void deallocate(void);
/** Initialize boundary condition.
Modified: short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.cc 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.cc 2009-06-11 17:04:34 UTC (rev 15194)
@@ -57,6 +57,7 @@
// Default destructor.
pylith::feassemble::CellGeometry::~CellGeometry(void)
{ // destructor
+ deallocate();
} // destructor
// ----------------------------------------------------------------------
@@ -69,6 +70,13 @@
} // copy constructor
// ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::feassemble::CellGeometry::deallocate(void)
+{ // deallocate
+} // deallocate
+
+// ----------------------------------------------------------------------
// Get dimension of cell.
int
pylith::feassemble::CellGeometry::cellDim(void) const
Modified: short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -56,6 +56,10 @@
virtual
~CellGeometry(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Create a copy of geometry.
*
* @returns Copy of geometry.
Modified: short/3D/PyLith/trunk/libsrc/feassemble/ElasticityExplicit.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/ElasticityExplicit.cc 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/ElasticityExplicit.cc 2009-06-11 17:04:34 UTC (rev 15194)
@@ -51,9 +51,18 @@
// Destructor
pylith::feassemble::ElasticityExplicit::~ElasticityExplicit(void)
{ // destructor
+ deallocate();
} // destructor
// ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::feassemble::ElasticityExplicit::deallocate(void)
+{ // deallocate
+ IntegratorElasticity::deallocate();
+} // deallocate
+
+// ----------------------------------------------------------------------
// Set time step for advancing from time t to time t+dt.
void
pylith::feassemble::ElasticityExplicit::timeStep(const double dt)
Modified: short/3D/PyLith/trunk/libsrc/feassemble/ElasticityExplicit.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/ElasticityExplicit.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/ElasticityExplicit.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -72,6 +72,9 @@
/// Destructor
~ElasticityExplicit(void);
+ /// Deallocate PETSc and local data structures.
+ void deallocate(void);
+
/** Set time step for advancing from time t to time t+dt.
*
* @param dt Time step
Modified: short/3D/PyLith/trunk/libsrc/feassemble/ElasticityImplicit.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/ElasticityImplicit.cc 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/ElasticityImplicit.cc 2009-06-11 17:04:34 UTC (rev 15194)
@@ -53,9 +53,18 @@
// Destructor
pylith::feassemble::ElasticityImplicit::~ElasticityImplicit(void)
{ // destructor
+ deallocate();
} // destructor
// ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::feassemble::ElasticityImplicit::deallocate(void)
+{ // deallocate
+ IntegratorElasticity::deallocate();
+} // deallocate
+
+// ----------------------------------------------------------------------
// Set time step for advancing from time t to time t+dt.
void
pylith::feassemble::ElasticityImplicit::timeStep(const double dt)
Modified: short/3D/PyLith/trunk/libsrc/feassemble/ElasticityImplicit.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/ElasticityImplicit.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/ElasticityImplicit.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -64,6 +64,9 @@
/// Destructor
~ElasticityImplicit(void);
+ /// Deallocate PETSc and local data structures.
+ void deallocate(void);
+
/** Set time step for advancing from time t to time t+dt.
*
* @param dt Time step
Modified: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc 2009-06-11 17:04:34 UTC (rev 15194)
@@ -50,11 +50,21 @@
// Destructor
pylith::feassemble::IntegratorElasticity::~IntegratorElasticity(void)
{ // destructor
- delete _outputFields; _outputFields = 0;
- _material = 0; // Don't manage memory for material
+ deallocate();
} // destructor
// ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::feassemble::IntegratorElasticity::deallocate(void)
+{ // deallocate
+ Integrator<Quadrature<topology::Mesh> >::deallocate();
+
+ delete _outputFields; _outputFields = 0;
+ _material = 0; // :TODO: Use shared pointer.
+} // deallocate
+
+// ----------------------------------------------------------------------
// Set material.
void
pylith::feassemble::IntegratorElasticity::material(materials::ElasticMaterial* m)
Modified: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -54,8 +54,13 @@
IntegratorElasticity(void);
/// Destructor
+ virtual
~IntegratorElasticity(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Set material.
*
* @param m Elastic material.
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc 2009-06-11 17:04:34 UTC (rev 15194)
@@ -46,9 +46,20 @@
template<typename mesh_type>
pylith::feassemble::Quadrature<mesh_type>::~Quadrature(void)
{ // destructor
+ deallocate();
+} // destructor
+
+// ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+template<typename mesh_type>
+void
+pylith::feassemble::Quadrature<mesh_type>::deallocate(void)
+{ // deallocate
+ QuadratureRefCell::deallocate();
+
delete _engine; _engine = 0;
delete _geometryFields; _geometryFields = 0;
-} // destructor
+} // deallocate
// ----------------------------------------------------------------------
// Copy constructor
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -57,6 +57,9 @@
*/
Quadrature(const Quadrature& q);
+ /// Deallocate PETSc and local data structures.
+ void deallocate(void);
+
/// Setup quadrature engine.
void initializeGeometry(void);
Modified: short/3D/PyLith/trunk/libsrc/feassemble/QuadratureEngine.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/QuadratureEngine.cc 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/QuadratureEngine.cc 2009-06-11 17:04:34 UTC (rev 15194)
@@ -31,9 +31,17 @@
// Destructor
pylith::feassemble::QuadratureEngine::~QuadratureEngine(void)
{ // destructor
+ deallocate();
} // destructor
// ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::feassemble::QuadratureEngine::deallocate(void)
+{ // deallocate
+} // deallocate
+
+// ----------------------------------------------------------------------
// Allocate cell buffers.
void
pylith::feassemble::QuadratureEngine::initialize(void)
Modified: short/3D/PyLith/trunk/libsrc/feassemble/QuadratureEngine.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/QuadratureEngine.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/QuadratureEngine.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -36,8 +36,13 @@
QuadratureEngine(const QuadratureRefCell& q);
/// Destructor
+ virtual
~QuadratureEngine(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Create a copy of this object.
*
* @returns Copy of this.
Modified: short/3D/PyLith/trunk/libsrc/feassemble/QuadratureRefCell.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/QuadratureRefCell.cc 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/QuadratureRefCell.cc 2009-06-11 17:04:34 UTC (rev 15194)
@@ -37,10 +37,18 @@
// Destructor
pylith::feassemble::QuadratureRefCell::~QuadratureRefCell(void)
{ // destructor
- delete _geometry; _geometry = 0;
+ deallocate();
} // destructor
// ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::feassemble::QuadratureRefCell::deallocate(void)
+{ // deallocate
+ delete _geometry; _geometry = 0;
+} // deallocate
+
+// ----------------------------------------------------------------------
// Copy constructor
pylith::feassemble::QuadratureRefCell::QuadratureRefCell(const QuadratureRefCell& q) :
_minJacobian(q._minJacobian),
Modified: short/3D/PyLith/trunk/libsrc/feassemble/QuadratureRefCell.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/QuadratureRefCell.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/feassemble/QuadratureRefCell.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -43,8 +43,13 @@
QuadratureRefCell(void);
/// Destructor
+ virtual
~QuadratureRefCell(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Set basis functions and their derivatives, and coordinates and
* weights of the quadrature points.
*
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc 2009-06-11 17:04:34 UTC (rev 15194)
@@ -53,15 +53,21 @@
// Destructor.
pylith::materials::ElasticMaterial::~ElasticMaterial(void)
{ // destructor
- delete _initialFields; _initialFields = 0;
-
- // Python db object owns databases, so just set point to null
- // :KLUDGE: Should use shared pointer
- _dbInitialStress = 0;
- _dbInitialStrain = 0;
+ deallocate();
} // destructor
// ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::materials::ElasticMaterial::deallocate(void)
+{ // deallocate
+ delete _initialFields; _initialFields = 0;
+
+ _dbInitialStress = 0; // :TODO: Use shared pointer.
+ _dbInitialStrain = 0; // :TODO: Use shared pointer.
+} // deallocate
+
+// ----------------------------------------------------------------------
// Initialize material by getting physical property parameters from
// database.
void
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -47,6 +47,10 @@
virtual
~ElasticMaterial(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Set database for initial stress state.
*
* @param db Spatial database.
Modified: short/3D/PyLith/trunk/libsrc/materials/Material.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.cc 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.cc 2009-06-11 17:04:34 UTC (rev 15194)
@@ -74,16 +74,22 @@
// Destructor.
pylith::materials::Material::~Material(void)
{ // destructor
+ deallocate();
+} // destructor
+
+// ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::materials::Material::deallocate(void)
+{ // deallocate
delete _normalizer; _normalizer = 0;
delete _properties; _properties = 0;
delete _stateVars; _stateVars = 0;
- // Python db object owns databases, so just set pointer to null
- // :KLUDGE: Should use shared pointer
- _dbProperties = 0;
- _dbInitialState = 0;
-} // destructor
-
+ _dbProperties = 0; // :TODO: Use shared pointer.
+ _dbInitialState = 0; // :TODO: Use shared pointer.
+} // deallocate
+
// ----------------------------------------------------------------------
// Set scales used to nondimensionalize physical properties.
void
Modified: short/3D/PyLith/trunk/libsrc/materials/Material.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -56,6 +56,10 @@
virtual
~Material(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Get spatial dimension of material.
*
* @returns Spatial dimension.
Modified: short/3D/PyLith/trunk/libsrc/materials/Metadata.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Metadata.cc 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/materials/Metadata.cc 2009-06-11 17:04:34 UTC (rev 15194)
@@ -75,9 +75,17 @@
// Default destructor
pylith::materials::Metadata::~Metadata(void)
{ // destructor
+ deallocate();
} // destructor
// ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::materials::Metadata::deallocate(void)
+{ // deallocate
+} // deallocate
+
+// ----------------------------------------------------------------------
// Get fiber dimension of value.
int
pylith::materials::Metadata::fiberDim(const char* name,
Modified: short/3D/PyLith/trunk/libsrc/materials/Metadata.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Metadata.hh 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/libsrc/materials/Metadata.hh 2009-06-11 17:04:34 UTC (rev 15194)
@@ -84,6 +84,9 @@
/// Default destructor
~Metadata(void);
+ /// Deallocate PETSc and local data structures.
+ void deallocate(void);
+
/** Get names of properties.
*
* @returns Array of names of properties.
Modified: short/3D/PyLith/trunk/modulesrc/bc/AbsorbingDampers.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/bc/AbsorbingDampers.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/bc/AbsorbingDampers.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -31,7 +31,6 @@
~AbsorbingDampers(void);
/// Deallocate PETSc and local data structures.
- virtual
void deallocate(void);
/** Set database for boundary condition parameters.
Modified: short/3D/PyLith/trunk/modulesrc/bc/DirichletBC.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/bc/DirichletBC.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/bc/DirichletBC.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -29,6 +29,7 @@
DirichletBC(void);
/// Destructor.
+ virtual
~DirichletBC(void);
/// Deallocate PETSc and local data structures.
Modified: short/3D/PyLith/trunk/modulesrc/bc/Neumann.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/bc/Neumann.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/bc/Neumann.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -31,7 +31,6 @@
~Neumann(void);
/// Deallocate PETSc and local data structures.
- virtual
void deallocate(void);
/** Set database for boundary condition parameters.
Modified: short/3D/PyLith/trunk/modulesrc/bc/PointForce.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/bc/PointForce.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/bc/PointForce.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -32,7 +32,6 @@
~PointForce(void);
/// Deallocate PETSc and local data structures.
- virtual
void deallocate(void);
/** Initialize boundary condition.
Modified: short/3D/PyLith/trunk/modulesrc/feassemble/CellGeometry.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/CellGeometry.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/CellGeometry.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -48,6 +48,10 @@
virtual
~CellGeometry(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Create a copy of geometry.
*
* @returns Copy of geometry.
Modified: short/3D/PyLith/trunk/modulesrc/feassemble/Constraint.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/Constraint.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/Constraint.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -31,6 +31,10 @@
virtual
~Constraint(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Set manager of scales used to nondimensionalize problem.
*
* @param dim Nondimensionalizer.
Modified: short/3D/PyLith/trunk/modulesrc/feassemble/ElasticityExplicit.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/ElasticityExplicit.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/ElasticityExplicit.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -30,6 +30,9 @@
/// Destructor
~ElasticityExplicit(void);
+ /// Deallocate PETSc and local data structures.
+ void deallocate(void);
+
/** Set time step for advancing from time t to time t+dt.
*
* @param dt Time step
Modified: short/3D/PyLith/trunk/modulesrc/feassemble/ElasticityImplicit.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/ElasticityImplicit.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/ElasticityImplicit.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -30,6 +30,9 @@
/// Destructor
~ElasticityImplicit(void);
+ /// Deallocate PETSc and local data structures.
+ void deallocate(void);
+
/** Set time step for advancing from time t to time t+dt.
*
* @param dt Time step
Modified: short/3D/PyLith/trunk/modulesrc/feassemble/Integrator.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/Integrator.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/Integrator.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -32,6 +32,10 @@
virtual
~Integrator(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Get the quadrature for integrating finite-element
* quantities.
*
Modified: short/3D/PyLith/trunk/modulesrc/feassemble/IntegratorElasticity.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/IntegratorElasticity.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/IntegratorElasticity.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -31,8 +31,13 @@
IntegratorElasticity(void);
/// Destructor
+ virtual
~IntegratorElasticity(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Set material.
*
* @param m Elastic material.
Modified: short/3D/PyLith/trunk/modulesrc/feassemble/Quadrature.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/Quadrature.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/Quadrature.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -31,6 +31,9 @@
/// Destructor
~Quadrature(void);
+ /// Deallocate PETSc and local data structures.
+ void deallocate(void);
+
/** Copy constructor.
*
* @param q Quadrature to copy
Modified: short/3D/PyLith/trunk/modulesrc/feassemble/QuadratureRefCell.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/QuadratureRefCell.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/QuadratureRefCell.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -28,8 +28,13 @@
QuadratureRefCell(void);
/// Destructor
+ virtual
~QuadratureRefCell(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Set basis functions and their derivatives, and coordinates and
* weights of the quadrature points.
*
Modified: short/3D/PyLith/trunk/modulesrc/materials/ElasticMaterial.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/ElasticMaterial.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/materials/ElasticMaterial.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -40,6 +40,10 @@
virtual
~ElasticMaterial(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Set database for initial stress state.
*
* @param db Spatial database.
Modified: short/3D/PyLith/trunk/modulesrc/materials/Material.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/Material.i 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/modulesrc/materials/Material.i 2009-06-11 17:04:34 UTC (rev 15194)
@@ -38,6 +38,10 @@
virtual
~Material(void);
+ /// Deallocate PETSc and local data structures.
+ virtual
+ void deallocate(void);
+
/** Get spatial dimension of material.
*
* @returns Spatial dimension.
Modified: short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py 2009-06-11 17:04:34 UTC (rev 15194)
@@ -14,8 +14,6 @@
##
## @brief Python abstract base class for integrating over
## finite-elements using quadrature.
-##
-## Factory: quadrature.
from pylith.utils.PetscComponent import PetscComponent
@@ -25,8 +23,6 @@
"""
Python abstract base class for integrating over finite-elements
using quadrature.
-
- Factory: quadrature.
"""
# INVENTORY //////////////////////////////////////////////////////////
Modified: short/3D/PyLith/trunk/pylith/perf/MemoryLogger.py
===================================================================
--- short/3D/PyLith/trunk/pylith/perf/MemoryLogger.py 2009-06-11 16:57:34 UTC (rev 15193)
+++ short/3D/PyLith/trunk/pylith/perf/MemoryLogger.py 2009-06-11 17:04:34 UTC (rev 15194)
@@ -44,6 +44,7 @@
includeDealloc = pyre.inventory.bool("include_dealloc", default=True)
includeDealloc.meta['tip'] = "Subtract deallocated memory when reporting."
+
# PUBLIC METHODS /////////////////////////////////////////////////////
def __init__(self, name="perf_logger"):
@@ -56,6 +57,7 @@
self.memory['Completion'] = 0
return
+
def logMesh(self, stage, mesh):
"""
Read mesh parameters to determine memory from our model.
@@ -63,12 +65,14 @@
import pylith.perf.Mesh
if not stage in self.memory: self.memory[stage] = {}
- meshModel = pylith.perf.Mesh.Mesh(mesh.dimension(), mesh.coneSize(), mesh.numVertices(), mesh.numCells())
+ meshModel = pylith.perf.Mesh.Mesh(mesh.dimension(), mesh.coneSize(),
+ mesh.numVertices(), mesh.numCells())
meshModel.tabulate(self.memory[stage])
for group, nvertices in mesh.groupSizes():
self.logVertexGroup('VertexGroups', group, nvertices, mesh.numVertices())
return
+
def logVertexGroup(self, stage, label, nvertices, nMeshVertices):
"""
Read vertex group parameters to determine memory from our model.
@@ -76,10 +80,12 @@
import pylith.perf.VertexGroup
if not stage in self.memory: self.memory[stage] = {}
- groupModel = pylith.perf.VertexGroup.VertexGroup(label, nvertices, nMeshVertices)
+ groupModel = pylith.perf.VertexGroup.VertexGroup(label, nvertices,
+ nMeshVertices)
groupModel.tabulate(self.memory[stage])
return
+
def logMaterial(self, stage, material):
"""
Read material parameters to determine memory from our model.
@@ -87,12 +93,14 @@
import pylith.perf.Material
if not stage in self.memory: self.memory[stage] = {}
- materialModel = pylith.perf.Material.Material(material.label(), material.ncells)
+ materialModel = pylith.perf.Material.Material(material.label(),
+ material.ncells)
materialModel.tabulate(self.memory[stage])
self.logField(stage, material.propertiesField())
self.logField(stage, material.stateVarsField())
return
+
def logQuadrature(self, stage, quadrature):
##self.logField(stage, quadrature.quadPtsPrecomp())
##self.logField(stage, quadrature.jacobianPrecomp())
@@ -105,6 +113,7 @@
##self.logField('Field', quadrature.basisDerivPrecomp())
return
+
def logField(self, stage, field):
"""
Read field parameters to determine memory from our model.
@@ -112,10 +121,12 @@
import pylith.perf.Field
if not stage in self.memory: self.memory[stage] = {}
- fieldModel = pylith.perf.Field.Field(field.label(), field.sectionSize(), field.chartSize())
+ fieldModel = pylith.perf.Field.Field(field.label(), field.sectionSize(),
+ field.chartSize())
fieldModel.tabulate(self.memory[stage])
return
+
def logGlobalOrder(self, stage, label, field):
"""
Read parameters to determine memory from our model.
@@ -127,6 +138,7 @@
orderModel.tabulate(self.memory[stage])
return
+
def logJacobian(self, stage, label):
"""
Read parameters to determine memory from our model.
@@ -138,6 +150,7 @@
jacModel.tabulate(self.memory[stage])
return
+
def mergeMemDict(self, memDictTarget, memDictSource):
for key in memDictSource:
if not key in memDictTarget:
@@ -150,6 +163,7 @@
memDictTarget[key] += memDictSource[key]
return
+
def join(self, logger):
"""
Incorporate information from another logger.
@@ -157,16 +171,20 @@
self.mergeMemDict(self.memory, logger.memory)
return
+
def prefix(self, indent):
prefix = ''
for i in range(indent):
prefix += ' '
return prefix
+
def memLine(self, source, name, mem, indent = 0):
- return '%s%-30s %8d bytes (%.3f MB)' % (self.prefix(indent), name+' ('+source+'):', mem, mem / self.megabyte)
+ return '%s%-30s %8d bytes (%.3f MB)' % \
+ (self.prefix(indent), name+' ('+source+'):', mem, mem / self.megabyte)
- def processMemDict(self, memDict, indent = 0, namePrefix = '', includeDealloc = True):
+ def processMemDict(self, memDict, indent = 0, namePrefix = '',
+ includeDealloc = True):
from pylith.utils.petsc import MemoryLogger
logger = MemoryLogger.singleton()
output = []
@@ -177,7 +195,8 @@
fullname = namePrefix+name
if isinstance(m, dict):
output.append(self.prefix(indent)+name)
- out,mem,codeMem = self.processMemDict(m, indent, fullname, includeDealloc)
+ out,mem,codeMem = self.processMemDict(m, indent, fullname,
+ includeDealloc)
output.extend(out)
total += mem
codeTotal += codeMem
@@ -203,9 +222,11 @@
output.append(self.memLine('Model', 'Total', total, indent))
output.append(self.memLine('Code', 'Total', mem, indent))
if mem:
- output.append('%sPercentage memory modeled: %.2f%%' % (self.prefix(indent), total*100.0/mem))
+ output.append('%sPercentage memory modeled: %.2f%%' % \
+ (self.prefix(indent), total*100.0/mem))
else:
- output.append('%sMemory modeled: %d (no measured memory)' % (self.prefix(indent), total))
+ output.append('%sMemory modeled: %d (no measured memory)' % \
+ (self.prefix(indent), total))
return output, total, codeTotal
def show(self):
@@ -213,12 +234,15 @@
Print memory usage.
"""
output = ["MEMORY USAGE"]
- output.extend(self.processMemDict(self.memory, includeDealloc = self.includeDealloc)[0])
+ output.extend(self.processMemDict(self.memory, includeDealloc = \
+ self.includeDealloc)[0])
from pylith.utils.petsc import MemoryLogger
logger = MemoryLogger.singleton()
- output.append(self.memLine('Code', 'Total Alloced', logger.getAllocationTotal('default'), 1))
- output.append(self.memLine('Code', 'Total Dealloced', logger.getDeallocationTotal('default'), 1))
+ output.append(self.memLine('Code', 'Total Alloced',
+ logger.getAllocationTotal('default'), 1))
+ output.append(self.memLine('Code', 'Total Dealloced',
+ logger.getDeallocationTotal('default'), 1))
print '\n'.join(output)
return
More information about the CIG-COMMITS
mailing list