[cig-commits] r15018 - in short/3D/PyLith/trunk: libsrc/bc libsrc/faults libsrc/feassemble libsrc/materials libsrc/meshio libsrc/topology modulesrc/feassemble modulesrc/materials modulesrc/topology pylith/apps pylith/feassemble pylith/perf pylith/problems
knepley at geodynamics.org
knepley at geodynamics.org
Tue May 19 13:39:24 PDT 2009
Author: knepley
Date: 2009-05-19 13:39:22 -0700 (Tue, 19 May 2009)
New Revision: 15018
Modified:
short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc
short/3D/PyLith/trunk/libsrc/bc/Neumann.cc
short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc
short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh
short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc
short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc
short/3D/PyLith/trunk/libsrc/materials/Material.cc
short/3D/PyLith/trunk/libsrc/materials/Material.hh
short/3D/PyLith/trunk/libsrc/meshio/CellFilterAvg.cc
short/3D/PyLith/trunk/libsrc/meshio/VertexFilterVecNorm.cc
short/3D/PyLith/trunk/libsrc/topology/Field.cc
short/3D/PyLith/trunk/modulesrc/feassemble/Integrator.i
short/3D/PyLith/trunk/modulesrc/feassemble/Quadrature.i
short/3D/PyLith/trunk/modulesrc/materials/Makefile.am
short/3D/PyLith/trunk/modulesrc/materials/Material.i
short/3D/PyLith/trunk/modulesrc/topology/Makefile.am
short/3D/PyLith/trunk/pylith/apps/PyLithApp.py
short/3D/PyLith/trunk/pylith/feassemble/Integrator.py
short/3D/PyLith/trunk/pylith/perf/Logger.py
short/3D/PyLith/trunk/pylith/perf/MemoryLogger.py
short/3D/PyLith/trunk/pylith/problems/Formulation.py
short/3D/PyLith/trunk/pylith/problems/Problem.py
short/3D/PyLith/trunk/pylith/problems/TimeDependent.py
Log:
Lots of logging, fixed dimensioned coordinates
Modified: short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -121,6 +121,7 @@
const int fiberDim = numQuadPts * spaceDim;
_dampingConsts = new topology::Field<topology::SubMesh>(*_boundaryMesh);
+ _dampingConsts->label("damping constants");
assert(0 != _dampingConsts);
_dampingConsts->newSection(cells, fiberDim);
_dampingConsts->allocate();
Modified: short/3D/PyLith/trunk/libsrc/bc/Neumann.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/Neumann.cc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/bc/Neumann.cc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -117,6 +117,7 @@
const int fiberDim = spaceDim * numQuadPts;
_tractions = new topology::Field<topology::SubMesh>(*_boundaryMesh);
+ _tractions->label("tractions");
assert(0 != _tractions);
_tractions->newSection(cells, fiberDim);
_tractions->allocate();
Modified: short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -647,13 +647,14 @@
if (debug)
coordinates->view("Coordinates with shadow vertices");
-#if 0
+#if 1
// Fix dimensioned coordinates (we use the same chart as the
// coordinates, so we only need to update the values).
// MATT: THIS CODE DOESN"T APPEAR TO WORK.
if (sieveMesh->hasRealSection("coordinates_dimensioned")) {
const ALE::Obj<topology::Mesh::RealSection>& coordinatesDim =
sieveMesh->getRealSection("coordinates_dimensioned");
+ sieveMesh->reallocate(coordinatesDim);
assert(!coordinatesDim.isNull());
if (debug)
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -1217,6 +1217,7 @@
// Allocate buffer for tractions field (if nec.).
const ALE::Obj<RealSection>& tractionsSection = tractions->section();
+ tractions->label("tractions");
if (tractionsSection.isNull()) {
tractions->newSection(topology::FieldBase::VERTICES_FIELD, fiberDim);
tractions->allocate();
@@ -1271,6 +1272,7 @@
assert(0 != _faultMesh);
assert(0 != _fields);
_bufferVectorField = new topology::Field<topology::SubMesh>(*_faultMesh);
+ _bufferVectorField->label("vector field buffer");
const topology::Field<topology::SubMesh>& slip =
_fields->get("cumulative slip");
_bufferVectorField->newSection(slip);
@@ -1290,6 +1292,7 @@
assert(0 != _faultMesh);
assert(0 != _fields);
_bufferScalarField = new topology::Field<topology::SubMesh>(*_faultMesh);
+ _bufferScalarField->label("scalar field buffer");
const topology::Field<topology::SubMesh>& area = _fields->get("area");
_bufferScalarField->newSection(area);
_bufferScalarField->allocate();
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -47,6 +47,15 @@
} // destructor
// ----------------------------------------------------------------------
+// Get quadrature for integrating finite-element quantities.
+template<typename quadrature_type>
+const quadrature_type&
+pylith::feassemble::Integrator<quadrature_type>::quadrature()
+{ // quadrature
+ return *_quadrature;
+} // quadrature
+
+// ----------------------------------------------------------------------
// Set quadrature for integrating finite-element quantities.
template<typename quadrature_type>
void
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh 2009-05-19 20:39:22 UTC (rev 15018)
@@ -51,6 +51,13 @@
virtual
~Integrator(void);
+ /** Get the quadrature for integrating finite-element
+ * quantities.
+ *
+ * @returns Quadrature for integrating.
+ */
+ const quadrature_type& quadrature();
+
/** Set quadrature for integrating finite-element
* quantities. Quadrature should already be initialized.
*
Modified: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -337,6 +337,7 @@
} else {
if (0 == _bufferFieldOther)
_bufferFieldOther = new topology::Field<topology::Mesh>(mesh);
+ _bufferFieldOther->label("scalar field buffer");
_material->getField(_bufferFieldOther, name);
return *_bufferFieldOther;
} // if/else
@@ -369,6 +370,7 @@
if (0 == _bufferFieldTensor) {
_bufferFieldTensor = new topology::Field<topology::Mesh>(mesh);
+ _bufferFieldTensor->label("tensor field buffer");
assert(0 != _bufferFieldTensor);
_bufferFieldTensor->newSection(cells, numQuadPts*tensorSize);
_bufferFieldTensor->allocate();
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -147,13 +147,16 @@
typedef typename mesh_type::SieveMesh::label_sequence label_sequence;
typedef typename mesh_type::RestrictVisitor RestrictVisitor;
- const char* loggingStage = "QuadratureCreation";
+ const char* loggingStage = "Quadrature";
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ logger.setDebug(1);
logger.stagePush(loggingStage);
// Allocate field and cell buffer for quadrature points
int fiberDim = _numQuadPts * _spaceDim;
+ std::cout << "Quadrature points: " << _numQuadPts << " space dim: " << _spaceDim << " numCells: " << cells->size() << std::endl;
_quadPtsField = new topology::Field<mesh_type>(mesh);
+ _quadPtsField->label("quadPoints");
assert(0 != _quadPtsField);
_quadPtsField->newSection(cells, fiberDim);
_quadPtsField->allocate();
@@ -164,29 +167,38 @@
const typename RealSection::chart_type& chart = section->getChart();
// Allocate field and cell buffer for Jacobian at quadrature points
+ logger.setDebug(2);
+ std::cout << "Jacobian: cell dim: " << _cellDim << std::endl;
fiberDim = (_cellDim > 0) ?
_numQuadPts * _cellDim * _spaceDim :
_numQuadPts * 1 * _spaceDim;
_jacobianField = new topology::Field<mesh_type>(mesh);
+ _jacobianField->label("jacobian");
assert(0 != _jacobianField);
_jacobianField->newSection(chart, fiberDim);
_jacobianField->allocate();
+ logger.setDebug(1);
// Allocate field and cell buffer for determinant of Jacobian at quad pts
+ std::cout << "Jacobian det:" << std::endl;
fiberDim = _numQuadPts;
_jacobianDetField = new topology::Field<mesh_type>(mesh);
+ _jacobianDetField->label("jacobianDet");
assert(0 != _jacobianDetField);
_jacobianDetField->newSection(chart, fiberDim);
_jacobianDetField->allocate();
// Allocate field for derivatives of basis functions at quad pts
+ std::cout << "Basis derivatives: num basis: " << _numBasis << std::endl;
fiberDim = _numQuadPts * _numBasis * _spaceDim;
_basisDerivField = new topology::Field<mesh_type>(mesh);
+ _basisDerivField->label("basis derivatives");
assert(0 != _basisDerivField);
_basisDerivField->newSection(chart, fiberDim);
_basisDerivField->allocate();
logger.stagePop();
+ logger.setDebug(0);
#if defined(ALE_MEM_LOGGING)
std::cout
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh 2009-05-19 20:39:22 UTC (rev 15018)
@@ -97,6 +97,31 @@
*/
const double_array& jacobianDet(void) const;
+ /** Get precomputed coordinates of quadrature points
+ *
+ * @returns Array of coordinates of quadrature points in cell
+ */
+ const pylith::topology::Field<mesh_type>& quadPtsPrecomp(void) const;
+
+ /** Get precomputed derivatives of basis fns evaluated at quadrature points.
+ *
+ * @returns Array of derivatives of basis fns evaluated at
+ * quadrature points
+ */
+ const pylith::topology::Field<mesh_type>& basisDerivPrecomp(void) const;
+
+ /** Get precomputed Jacobians evaluated at quadrature points.
+ *
+ * @returns Array of Jacobian inverses evaluated at quadrature points.
+ */
+ const pylith::topology::Field<mesh_type>& jacobianPrecomp(void) const;
+
+ /** Get precomputed determinants of Jacobian evaluated at quadrature points.
+ *
+ * @returns Array of determinants of Jacobian evaluated at quadrature pts
+ */
+ const pylith::topology::Field<mesh_type>& jacobianDetPrecomp(void) const;
+
/** Compute geometric quantities for each cell.
*
* @param mesh Finite-element mesh
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -69,6 +69,42 @@
return _engine->jacobianDet();
}
+// Get precomputed coordinates of quadrature points
+template<typename mesh_type>
+inline
+const pylith::topology::Field<mesh_type>&
+pylith::feassemble::Quadrature<mesh_type>::quadPtsPrecomp(void) const {
+ assert(0 != _quadPtsField);
+ return *_quadPtsField;
+}
+
+// Get precomputed derivatives of basis fns evaluated at quadrature points.
+template<typename mesh_type>
+inline
+const pylith::topology::Field<mesh_type>&
+pylith::feassemble::Quadrature<mesh_type>::basisDerivPrecomp(void) const {
+ assert(0 != _basisDerivField);
+ return *_basisDerivField;
+}
+
+// Get precomputed Jacobians evaluated at quadrature points.
+template<typename mesh_type>
+inline
+const pylith::topology::Field<mesh_type>&
+pylith::feassemble::Quadrature<mesh_type>::jacobianPrecomp(void) const {
+ assert(0 != _jacobianField);
+ return *_jacobianField;
+}
+
+// Get precomputed determinants of Jacobian evaluated at quadrature points.
+template<typename mesh_type>
+inline
+const pylith::topology::Field<mesh_type>&
+pylith::feassemble::Quadrature<mesh_type>::jacobianDetPrecomp(void) const {
+ assert(0 != _jacobianDetField);
+ return *_jacobianDetField;
+}
+
// Precompute geometric quantities for each cell.
template<typename mesh_type>
inline
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -367,6 +367,7 @@
// Create field to hold initial stress state.
delete _initialStress; _initialStress = 0;
_initialStress = new topology::Field<topology::Mesh>(mesh);
+ _initialStress->label("initial stress");
assert(0 != _initialStress);
const int fiberDim = numQuadPts * tensorSize;
assert(fiberDim > 0);
@@ -510,6 +511,7 @@
// Create field to hold initial strain state.
delete _initialStrain; _initialStrain = 0;
_initialStrain = new topology::Field<topology::Mesh>(mesh);
+ _initialStrain->label("initial stress");
assert(0 != _initialStrain);
const int fiberDim = numQuadPts * tensorSize;
assert(fiberDim > 0);
Modified: short/3D/PyLith/trunk/libsrc/materials/Material.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.cc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.cc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -104,6 +104,8 @@
{ // initialize
assert(0 != _dbProperties);
assert(0 != quadrature);
+ ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ logger.stagePush("Materials");
// Get quadrature information
const int numQuadPts = quadrature->numQuadPts();
@@ -123,11 +125,13 @@
// Create field to hold physical properties.
delete _properties; _properties = new topology::Field<topology::Mesh>(mesh);
+ _properties->label("properties");
assert(0 != _properties);
int fiberDim = numQuadPts * _numPropsQuadPt;
_properties->newSection(cells, fiberDim);
_properties->allocate();
_properties->zero();
+ std::cout << "Initializing material " << _label << ": Created properties" << std::endl;
const ALE::Obj<RealSection>& propertiesSection = _properties->section();
assert(!propertiesSection.isNull());
@@ -155,6 +159,7 @@
// if there is no initial state, because this we will use this field
// to hold the state variables.
delete _stateVars; _stateVars = new topology::Field<topology::Mesh>(mesh);
+ _stateVars->label("state variables");
fiberDim = numQuadPts * _numVarsQuadPt;
if (fiberDim > 0) {
assert(0 != _stateVars);
@@ -165,6 +170,7 @@
_stateVars->allocate();
_stateVars->zero();
} // if
+ std::cout << "Initializing material " << _label << ": Created state vars" << std::endl;
const ALE::Obj<RealSection>& stateVarsSection =
(fiberDim > 0) ? _stateVars->section() : 0;
@@ -256,13 +262,29 @@
_dbProperties->close();
if (0 != _dbInitialState)
_dbInitialState->close();
+ logger.stagePop();
} // initialize
// ----------------------------------------------------------------------
+// Get properties
+const pylith::materials::Material::field_type&
+pylith::materials::Material::getProperties() const
+{ // getProperties
+ return *_properties;
+} // getProperties
+
+// ----------------------------------------------------------------------
+// Get state variables
+const pylith::materials::Material::field_type&
+pylith::materials::Material::getStateVars() const
+{ // getStateVars
+ return *_stateVars;
+} // getStateVars
+
+// ----------------------------------------------------------------------
// Get physical property or state variable field.
void
-pylith::materials::Material::getField(topology::Field<topology::Mesh>* field,
- const char* name) const
+pylith::materials::Material::getField(field_type *field, const char* name) const
{ // getField
assert(0 != field);
assert(0 != _properties);
@@ -309,6 +331,8 @@
assert(totalPropsFiberDim == numQuadPts * numPropsQuadPt);
const int totalFiberDim = numQuadPts * fiberDim;
+ ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ logger.stagePush("Materials");
// Allocate buffer for property field if necessary.
const ALE::Obj<RealSection>& fieldSection = field->section();
bool useCurrentField = !fieldSection.isNull();
@@ -330,6 +354,7 @@
assert(!fieldSection.isNull());
field->label(name);
fieldType = _metadata.fieldType(name, Metadata::PROPERTY);
+ logger.stagePop();
// Buffer for property at cell's quadrature points
double_array fieldCell(numQuadPts*fiberDim);
@@ -380,6 +405,8 @@
assert(totalVarsFiberDim == numQuadPts * numVarsQuadPt);
const int totalFiberDim = numQuadPts * fiberDim;
+ ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ logger.stagePush("Materials");
// Allocate buffer for state variable field if necessary.
const ALE::Obj<RealSection>& fieldSection = field->section();
bool useCurrentField = !fieldSection.isNull();
@@ -401,6 +428,7 @@
assert(!fieldSection.isNull());
fieldType = _metadata.fieldType(name, Metadata::STATEVAR);
field->label(name);
+ logger.stagePop();
// Buffer for state variable at cell's quadrature points
double_array fieldCell(numQuadPts*fiberDim);
Modified: short/3D/PyLith/trunk/libsrc/materials/Material.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.hh 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.hh 2009-05-19 20:39:22 UTC (rev 15018)
@@ -38,6 +38,8 @@
class pylith::materials::Material
{ // class Material
friend class TestMaterial; // unit testing
+public:
+ typedef pylith::topology::Field<pylith::topology::Mesh> field_type;
// PUBLIC METHODS /////////////////////////////////////////////////////
public :
@@ -153,9 +155,20 @@
* @param field Field over material cells.
* @param name Name of field to retrieve.
*/
- void getField(topology::Field<topology::Mesh>* field,
- const char* name) const;
+ void getField(field_type *field, const char* name) const;
+ /** Get the properties.
+ *
+ * @returns the properties
+ */
+ const field_type& getProperties() const;
+
+ /** Get the state variables.
+ *
+ * @returns the state variables
+ */
+ const field_type& getStateVars() const;
+
// PROTECTED METHODS //////////////////////////////////////////////////
protected :
@@ -221,10 +234,10 @@
double _dt; ///< Current time step
/// Field containing physical properties of material.
- topology::Field<topology::Mesh>* _properties;
+ field_type *_properties;
/// Field containing the state variables for the material.
- topology::Field<topology::Mesh>* _stateVars;
+ field_type *_stateVars;
spatialdata::units::Nondimensional* _normalizer; ///< Nondimensionalizer
Modified: short/3D/PyLith/trunk/libsrc/meshio/CellFilterAvg.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/CellFilterAvg.cc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/meshio/CellFilterAvg.cc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -91,6 +91,7 @@
_fieldAvg = new field_type(fieldIn.mesh());
assert(0 != _fieldAvg);
_fieldAvg->newSection(sectionIn->getChart(), fiberDim);
+ _fieldAvg->label("average");
_fieldAvg->allocate();
switch (fieldIn.vectorFieldType())
Modified: short/3D/PyLith/trunk/libsrc/meshio/VertexFilterVecNorm.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/VertexFilterVecNorm.cc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/meshio/VertexFilterVecNorm.cc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -75,6 +75,7 @@
// Allocation field if necessary
if (0 == _fieldVecNorm) {
_fieldVecNorm = new field_type(fieldIn.mesh());
+ _fieldVecNorm->label("vector norm");
_fieldVecNorm->newSection(sectionIn->getChart(), fiberDimNorm);
_fieldVecNorm->allocate();
Modified: short/3D/PyLith/trunk/libsrc/topology/Field.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Field.cc 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/libsrc/topology/Field.cc 2009-05-19 20:39:22 UTC (rev 15018)
@@ -80,7 +80,7 @@
int
pylith::topology::Field<mesh_type>::chartSize(void) const
{ // spaceDim
- return _section->getChart().size();
+ return _section.isNull() ? 0 : _section->getChart().size();
} // spaceDim
// ----------------------------------------------------------------------
@@ -89,7 +89,7 @@
int
pylith::topology::Field<mesh_type>::size(void) const
{ // spaceDim
- return _section->size();
+ return _section.isNull() ? 0 : _section->size();
} // spaceDim
// ----------------------------------------------------------------------
@@ -99,6 +99,7 @@
pylith::topology::Field<mesh_type>::newSection(void)
{ // newSection
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ std::cout << "Making Field " << _label << " empty section" << std::endl;
logger.stagePush("Field");
_section = new RealSection(_mesh.comm(), _mesh.debug());
logger.stagePop();
@@ -115,6 +116,7 @@
typedef typename mesh_type::SieveMesh::point_type point_type;
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ std::cout << "Making Field " << _label << " section type 1" << std::endl;
logger.stagePush("Field");
if (fiberDim < 0) {
std::ostringstream msg;
@@ -173,6 +175,7 @@
const int fiberDim)
{ // newSection
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ std::cout << "Making Field " << _label << " section type 2" << std::endl;
logger.stagePush("Field");
if (_section.isNull()) {
logger.stagePop();
@@ -184,13 +187,17 @@
const typename chart_type::const_iterator chartEnd = chart.end();
for (typename chart_type::const_iterator c_iter = chart.begin();
c_iter != chartEnd;
- ++c_iter)
+ ++c_iter) {
_section->setFiberDimension(*c_iter, fiberDim);
+ }
{
+ std::cout << " allocating Field " << _label << " section type 2" << std::endl;
logger.stagePop();
allocate();
logger.stagePush("Field");
+ std::cout << " done allocating Field " << _label << " section type 2" << std::endl;
}
+ std::cout << "Done making Field " << _label << " section type 2" << std::endl;
logger.stagePop();
} // newSection
@@ -201,6 +208,7 @@
pylith::topology::Field<mesh_type>::newSection(const Field& src)
{ // newSection
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ std::cout << "Making Field " << _label << " section type 3" << std::endl;
logger.stagePush("Field");
_vecFieldType = src._vecFieldType;
Modified: short/3D/PyLith/trunk/modulesrc/feassemble/Integrator.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/Integrator.i 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/Integrator.i 2009-05-19 20:39:22 UTC (rev 15018)
@@ -32,6 +32,13 @@
virtual
~Integrator(void);
+ /** Get the quadrature for integrating finite-element
+ * quantities.
+ *
+ * @returns Quadrature for integrating.
+ */
+ const quadrature_type& quadrature();
+
/** Set quadrature for integrating finite-element
* quantities. Quadrature should already be initialized.
*
Modified: short/3D/PyLith/trunk/modulesrc/feassemble/Quadrature.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/Quadrature.i 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/Quadrature.i 2009-05-19 20:39:22 UTC (rev 15018)
@@ -54,6 +54,31 @@
/// Deallocate temporary storage.
void clear(void);
+
+ /** Get precomputed coordinates of quadrature points
+ *
+ * @returns Array of coordinates of quadrature points in cell
+ */
+ const pylith::topology::Field<mesh_type>& quadPtsPrecomp(void) const;
+
+ /** Get precomputed derivatives of basis fns evaluated at quadrature points.
+ *
+ * @returns Array of derivatives of basis fns evaluated at
+ * quadrature points
+ */
+ const pylith::topology::Field<mesh_type>& basisDerivPrecomp(void) const;
+
+ /** Get precomputed Jacobians evaluated at quadrature points.
+ *
+ * @returns Array of Jacobian inverses evaluated at quadrature points.
+ */
+ const pylith::topology::Field<mesh_type>& jacobianPrecomp(void) const;
+
+ /** Get precomputed determinants of Jacobian evaluated at quadrature points.
+ *
+ * @returns Array of determinants of Jacobian evaluated at quadrature pts
+ */
+ const pylith::topology::Field<mesh_type>& jacobianDetPrecomp(void) const;
}; // Quadrature
Modified: short/3D/PyLith/trunk/modulesrc/materials/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/Makefile.am 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/modulesrc/materials/Makefile.am 2009-05-19 20:39:22 UTC (rev 15018)
@@ -33,7 +33,7 @@
materials.py
_materialsmodule_la_LDFLAGS = -module -avoid-version \
- $(AM_LDFLAGS) $(PYTHON_LA_LDFLAGS)
+ -g $(AM_LDFLAGS) $(PYTHON_LA_LDFLAGS)
dist__materialsmodule_la_SOURCES = $(swig_sources) $(swig_generated)
@@ -49,7 +49,7 @@
$(PYTHON_BLDLIBRARY) $(PYTHON_LIBS) $(PYTHON_SYSLIBS)
endif
-INCLUDES += $(PYTHON_EGG_CPPFLAGS) -I$(NUMPY_INCDIR) -I$(PYTHON_INCDIR) $(PETSC_INCLUDE)
+INCLUDES += -g $(PYTHON_EGG_CPPFLAGS) -I$(NUMPY_INCDIR) -I$(PYTHON_INCDIR) $(PETSC_INCLUDE)
$(srcdir)/materials_wrap.cxx $(srcdir)/materials.py: $(swig_sources)
$(SWIG) -Wall -c++ -python $<
Modified: short/3D/PyLith/trunk/modulesrc/materials/Material.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/Material.i 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/modulesrc/materials/Material.i 2009-05-19 20:39:22 UTC (rev 15018)
@@ -21,6 +21,8 @@
class Material
{ // class Material
+ public:
+ typedef pylith::topology::Field<pylith::topology::Mesh> field_type;
// PUBLIC METHODS /////////////////////////////////////////////////
public :
@@ -122,9 +124,20 @@
* @param field Field over material cells.
* @param name Name of field to retrieve.
*/
- void getField(pylith::topology::Field<pylith::topology::Mesh>* field,
- const char* name) const;
+ void getField(field_type *field, const char* name) const;
+ /** Get the properties.
+ *
+ * @returns the properties
+ */
+ const field_type& getProperties() const;
+
+ /** Get the state variables.
+ *
+ * @returns the state variables
+ */
+ const field_type& getStateVars() const;
+
// PROTECTED METHODS //////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/modulesrc/topology/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/modulesrc/topology/Makefile.am 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/modulesrc/topology/Makefile.am 2009-05-19 20:39:22 UTC (rev 15018)
@@ -34,7 +34,7 @@
topology.py
_topologymodule_la_LDFLAGS = -module -avoid-version \
- $(AM_LDFLAGS) $(PYTHON_LA_LDFLAGS)
+ -g $(AM_LDFLAGS) $(PYTHON_LA_LDFLAGS)
dist__topologymodule_la_SOURCES = $(swig_sources) $(swig_generated)
@@ -47,7 +47,7 @@
$(PYTHON_BLDLIBRARY) $(PYTHON_LIBS) $(PYTHON_SYSLIBS)
endif
-INCLUDES += $(PYTHON_EGG_CPPFLAGS) -I$(NUMPY_INCDIR) -I$(PYTHON_INCDIR) $(PETSC_INCLUDE)
+INCLUDES += -g $(PYTHON_EGG_CPPFLAGS) -I$(NUMPY_INCDIR) -I$(PYTHON_INCDIR) $(PETSC_INCLUDE)
$(srcdir)/topology_wrap.cxx $(srcdir)/topology.py: $(swig_sources)
$(SWIG) -Wall -c++ -python $<
Modified: short/3D/PyLith/trunk/pylith/apps/PyLithApp.py
===================================================================
--- short/3D/PyLith/trunk/pylith/apps/PyLithApp.py 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/pylith/apps/PyLithApp.py 2009-05-19 20:39:22 UTC (rev 15018)
@@ -85,7 +85,7 @@
if "interfaces" in dir(self.problem):
interfaces = self.problem.interfaces.components()
mesh = self.mesher.create(self.problem.normalizer, interfaces)
- self.perfLogger.logMesh("MeshingCreation", mesh)
+ self.perfLogger.logMesh('Mesh', mesh)
del interfaces
del self.mesher
self._debug.log(resourceUsageString())
Modified: short/3D/PyLith/trunk/pylith/feassemble/Integrator.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/Integrator.py 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/pylith/feassemble/Integrator.py 2009-05-19 20:39:22 UTC (rev 15018)
@@ -111,7 +111,6 @@
"""
return
-
# PRIVATE METHODS ////////////////////////////////////////////////////
def _setupLogging(self):
Modified: short/3D/PyLith/trunk/pylith/perf/Logger.py
===================================================================
--- short/3D/PyLith/trunk/pylith/perf/Logger.py 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/pylith/perf/Logger.py 2009-05-19 20:39:22 UTC (rev 15018)
@@ -41,7 +41,7 @@
import pyre.inventory
- verbose = pyre.inventory.bool("verbose", default=True)
+ verbose = pyre.inventory.bool("verbose", default=False)
verbose.meta['tip'] = "Print information to the screen."
# PUBLIC METHODS /////////////////////////////////////////////////////
Modified: short/3D/PyLith/trunk/pylith/perf/MemoryLogger.py
===================================================================
--- short/3D/PyLith/trunk/pylith/perf/MemoryLogger.py 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/pylith/perf/MemoryLogger.py 2009-05-19 20:39:22 UTC (rev 15018)
@@ -62,11 +62,11 @@
"""
import pylith.perf.Mesh
- if not 'Mesh' in self.memory: self.memory['Mesh'] = {}
+ if not stage in self.memory: self.memory[stage] = {}
meshModel = pylith.perf.Mesh.Mesh(mesh.dimension(), mesh.coneSize(), mesh.numVertices(), mesh.numCells())
- meshModel.tabulate(self.memory['Mesh'])
+ meshModel.tabulate(self.memory[stage])
for group, nvertices in mesh.groupSizes():
- self.logVertexGroup(stage, group, nvertices, mesh.numVertices())
+ self.logVertexGroup('VertexGroups', group, nvertices, mesh.numVertices())
if self.verbose: self.show()
return
@@ -76,9 +76,9 @@
"""
import pylith.perf.VertexGroup
- if not 'VertexGroups' in self.memory: self.memory['VertexGroups'] = {}
- group = pylith.perf.VertexGroup.VertexGroup(label, nvertices, nMeshVertices)
- group.tabulate(self.memory['VertexGroups'])
+ if not stage in self.memory: self.memory[stage] = {}
+ groupModel = pylith.perf.VertexGroup.VertexGroup(label, nvertices, nMeshVertices)
+ groupModel.tabulate(self.memory[stage])
if self.verbose: self.show()
return
@@ -88,21 +88,39 @@
"""
import pylith.perf.Material
- if not 'Materials' in self.memory: self.memory['Materials'] = {}
- material = pylith.perf.Material.Material(material.label(), material.ncells)
- material.tabulate(self.memory['Materials'])
+ if not stage in self.memory: self.memory[stage] = {}
+ materialModel = pylith.perf.Material.Material(material.label(), material.ncells)
+ materialModel.tabulate(self.memory[stage])
+ self.logField(stage, material.getProperties())
+ self.logField(stage, material.getStateVars())
+ # For debugging right now
+ self.logField('Field', material.getProperties())
+ self.logField('Field', material.getStateVars())
if self.verbose: self.show()
return
+ def logQuadrature(self, stage, quadrature):
+ ##self.logField(stage, quadrature.quadPtsPrecomp())
+ ##self.logField(stage, quadrature.jacobianPrecomp())
+ ##self.logField(stage, quadrature.jacobianDetPrecomp())
+ ##self.logField(stage, quadrature.basisDerivPrecomp())
+ # For debugging right now
+ ##self.logField('Field', quadrature.quadPtsPrecomp())
+ ##self.logField('Field', quadrature.jacobianPrecomp())
+ ##self.logField('Field', quadrature.jacobianDetPrecomp())
+ ##self.logField('Field', quadrature.basisDerivPrecomp())
+ if self.verbose: self.show()
+ return
+
def logField(self, stage, field):
"""
Read field parameters to determine memory from our model.
"""
import pylith.perf.Field
- if not 'Field' in self.memory: self.memory['Field'] = {}
- field = pylith.perf.Field.Field(field.label(), field.size(), field.chartSize())
- field.tabulate(self.memory['Field'])
+ if not stage in self.memory: self.memory[stage] = {}
+ fieldModel = pylith.perf.Field.Field(field.label(), field.size(), field.chartSize())
+ fieldModel.tabulate(self.memory[stage])
if self.verbose: self.show()
return
Modified: short/3D/PyLith/trunk/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Formulation.py 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/pylith/problems/Formulation.py 2009-05-19 20:39:22 UTC (rev 15018)
@@ -306,7 +306,11 @@
for name in self.fields.fieldNames():
field = self.fields.get(name)
+ self.perfLogger.logField('Problem', field)
+ # For debugging right now
self.perfLogger.logField('Field', field)
+ for integrator in self.integratorsMesh + self.integratorsSubMesh:
+ self.perfLogger.logQuadrature('Quadrature', integrator.quadrature())
self._info.log("Formulation finalize.")
self._debug.log(resourceUsageString())
Modified: short/3D/PyLith/trunk/pylith/problems/Problem.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Problem.py 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/pylith/problems/Problem.py 2009-05-19 20:39:22 UTC (rev 15018)
@@ -167,7 +167,6 @@
"Material id values must be unique." % \
(material.label(), materialIds[material.id()], material.id())
materialIds[material.id()] = material.label()
- self.perfLogger.logMaterial("Problem Verification", material)
for interface in self.interfaces.components():
if interface.id() in materialIds.keys():
@@ -193,6 +192,10 @@
raise NotImplementedError, "initialize() not implemented."
return
+ def logMaterials(self):
+ for material in self.materials.components():
+ self.perfLogger.logMaterial('Materials', material)
+ return
def run(self, app):
"""
Modified: short/3D/PyLith/trunk/pylith/problems/TimeDependent.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/TimeDependent.py 2009-05-19 17:03:21 UTC (rev 15017)
+++ short/3D/PyLith/trunk/pylith/problems/TimeDependent.py 2009-05-19 20:39:22 UTC (rev 15018)
@@ -108,7 +108,7 @@
"""
Solve time dependent problem.
"""
-
+ self.logMaterials()
self._info.log("Solving problem.")
self.checkpointTimer.toplevel = app # Set handle for saving state
More information about the CIG-COMMITS
mailing list