[cig-commits] r21668 - in short/3D/PyLith/trunk/libsrc/pylith: bc faults friction materials topology

brad at geodynamics.org brad at geodynamics.org
Wed Mar 27 15:43:23 PDT 2013


Author: brad
Date: 2013-03-27 15:43:22 -0700 (Wed, 27 Mar 2013)
New Revision: 21668

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/bc/AbsorbingDampers.cc
   short/3D/PyLith/trunk/libsrc/pylith/bc/BCIntegratorSubMesh.cc
   short/3D/PyLith/trunk/libsrc/pylith/bc/BoundaryCondition.cc
   short/3D/PyLith/trunk/libsrc/pylith/bc/BoundaryConditionPoints.cc
   short/3D/PyLith/trunk/libsrc/pylith/bc/DirichletBC.cc
   short/3D/PyLith/trunk/libsrc/pylith/bc/DirichletBoundary.cc
   short/3D/PyLith/trunk/libsrc/pylith/bc/Neumann.cc
   short/3D/PyLith/trunk/libsrc/pylith/bc/PointForce.cc
   short/3D/PyLith/trunk/libsrc/pylith/bc/TimeDependentPoints.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/BruneSlipFn.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/ConstRateSlipFn.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/EqKinSrc.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesive.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveKin.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveLagrange.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveTract.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/LiuCosSlipFn.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/SlipTimeFn.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/StepSlipFn.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/TimeHistorySlipFn.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/TractPerturbation.cc
   short/3D/PyLith/trunk/libsrc/pylith/friction/FrictionModel.cc
   short/3D/PyLith/trunk/libsrc/pylith/materials/ElasticMaterial.cc
   short/3D/PyLith/trunk/libsrc/pylith/materials/Material.cc
   short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.cc
   short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOps.cc
   short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.cc
Log:
Code cleanup, including adding use of begin/end method macros.

Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/AbsorbingDampers.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/AbsorbingDampers.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/AbsorbingDampers.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -61,8 +61,12 @@
 void 
 pylith::bc::AbsorbingDampers::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   BCIntegratorSubMesh::deallocate();
   _db = 0; // :TODO: Use shared pointer
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -72,6 +76,8 @@
 pylith::bc::AbsorbingDampers::initialize(const topology::Mesh& mesh,
 					 const PylithScalar upDir[3])
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   assert(_boundaryMesh);
   assert(_quadrature);
   assert(_db);
@@ -216,6 +222,8 @@
   } // for
 
   _db->close();
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -225,6 +233,8 @@
 						const PylithScalar t,
 						topology::SolutionFields* const fields)
 { // integrateResidual
+  PYLITH_METHOD_BEGIN;
+
   assert(_quadrature);
   assert(_boundaryMesh);
   assert(_parameters);
@@ -354,6 +364,8 @@
   PetscLogFlops((cEnd-cStart)*numQuadPts*(1+numBasis*(1+numBasis*(3*spaceDim))));
   _logger->eventEnd(computeEvent);
 #endif
+
+  PYLITH_METHOD_END;
 } // integrateResidual
 
 // ----------------------------------------------------------------------
@@ -363,6 +375,8 @@
 						      const PylithScalar t,
 						      topology::SolutionFields* const fields)
 { // integrateResidualLumped
+  PYLITH_METHOD_BEGIN;
+
   assert(_quadrature);
   assert(_boundaryMesh);
   assert(_parameters);
@@ -492,6 +506,8 @@
   PetscLogFlops((cEnd-cStart)*numQuadPts*(1+numBasis+numBasis*(1+spaceDim*3)));
   _logger->eventEnd(computeEvent);
 #endif
+
+  PYLITH_METHOD_END;
 } // integrateResidualLumped
 
 // ----------------------------------------------------------------------
@@ -501,6 +517,8 @@
 						const PylithScalar t,
 						topology::SolutionFields* const fields)
 { // integrateJacobian
+  PYLITH_METHOD_BEGIN;
+
   assert(_quadrature);
   assert(_boundaryMesh);
   assert(_logger);
@@ -627,6 +645,8 @@
 #endif
 
   _needNewJacobian = false;
+
+  PYLITH_METHOD_END;
 } // integrateJacobian
 
 // ----------------------------------------------------------------------
@@ -636,6 +656,8 @@
 						const PylithScalar t,
 						topology::SolutionFields* const fields)
 { // integrateJacobian
+  PYLITH_METHOD_BEGIN;
+
   assert(_quadrature);
   assert(_boundaryMesh);
   assert(_logger);
@@ -759,6 +781,8 @@
 #endif
 
   _needNewJacobian = false;
+
+  PYLITH_METHOD_END;
 } // integrateJacobian
 
 // ----------------------------------------------------------------------
@@ -766,7 +790,11 @@
 void
 pylith::bc::AbsorbingDampers::verifyConfiguration(const topology::Mesh& mesh) const
 { // verifyConfiguration
+  PYLITH_METHOD_BEGIN;
+
   BCIntegratorSubMesh::verifyConfiguration(mesh);
+
+  PYLITH_METHOD_END;
 } // verifyConfiguration
 
 // ----------------------------------------------------------------------
@@ -774,8 +802,9 @@
 void
 pylith::bc::AbsorbingDampers::_initializeLogger(void)
 { // initializeLogger
-  delete _logger; _logger = new utils::EventLogger;
-  assert(_logger);
+   PYLITH_METHOD_BEGIN;
+
+ delete _logger; _logger = new utils::EventLogger;assert(_logger);
   _logger->className("AbsorbingDampers");
   _logger->initialize();
 
@@ -790,6 +819,8 @@
   _logger->registerEvent("AdIJ compute");
   _logger->registerEvent("AdIJ restrict");
   _logger->registerEvent("AdIJ update");
+
+  PYLITH_METHOD_END;
 } // initializeLogger
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/BCIntegratorSubMesh.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/BCIntegratorSubMesh.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/BCIntegratorSubMesh.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -46,11 +46,15 @@
 void
 pylith::bc::BCIntegratorSubMesh::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   BoundaryCondition::deallocate();
   feassemble::Integrator<feassemble::Quadrature<topology::SubMesh> >::deallocate();
 
   delete _boundaryMesh; _boundaryMesh = 0;
   delete _parameters; _parameters = 0;
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -58,11 +62,15 @@
 void
 pylith::bc::BCIntegratorSubMesh::createSubMesh(const topology::Mesh& mesh)
 { // createSubMesh
+  PYLITH_METHOD_BEGIN;
+
   delete _boundaryMesh; _boundaryMesh = 0;
   delete _parameters; _parameters = 0;
 
   _boundaryMesh = new topology::SubMesh(mesh, _label.c_str());
   assert(_boundaryMesh);
+
+  PYLITH_METHOD_END;
 } // createSubMesh
 
 // ----------------------------------------------------------------------
@@ -70,6 +78,8 @@
 void
 pylith::bc::BCIntegratorSubMesh::verifyConfiguration(const topology::Mesh& mesh) const 
 { // verifyConfiguration
+  PYLITH_METHOD_BEGIN;
+
   assert(_quadrature);
   assert(_boundaryMesh);
 
@@ -109,6 +119,8 @@
       throw std::runtime_error(msg.str());
     } // if
   } // for
+
+  PYLITH_METHOD_END;
 } // verifyConfiguration
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/BoundaryCondition.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/BoundaryCondition.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/BoundaryCondition.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -50,6 +50,8 @@
 void
 pylith::bc::BoundaryCondition::verifyConfiguration(const topology::Mesh& mesh) const
 { // verifyConfiguration
+  PYLITH_METHOD_BEGIN;
+
   const PetscDM dmMesh = mesh.dmMesh();assert(dmMesh);
   PetscBool hasLabel = PETSC_FALSE;
   PetscErrorCode err = DMPlexHasLabel(dmMesh, _label.c_str(), &hasLabel);CHECK_PETSC_ERROR(err);
@@ -59,6 +61,8 @@
 	<< "' for boundary condition.";
     throw std::runtime_error(msg.str());
   } // if
+
+  PYLITH_METHOD_END;
 } // verifyConfiguration
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/BoundaryConditionPoints.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/BoundaryConditionPoints.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/BoundaryConditionPoints.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -48,8 +48,12 @@
 void 
 pylith::bc::BoundaryConditionPoints::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   BoundaryCondition::deallocate();
   delete _parameters; _parameters = 0;
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -65,6 +69,8 @@
 void
 pylith::bc::BoundaryConditionPoints::_getPoints(const topology::Mesh& mesh)
 { // _getPoints
+  PYLITH_METHOD_BEGIN;
+
   typedef topology::Mesh::IntSection::chart_type chart_type;
 
   PetscDM dmMesh = mesh.dmMesh();assert(dmMesh);
@@ -89,6 +95,8 @@
   for(PetscInt p = 0; p < numPoints; ++p) {_points[p] = points[p];}
   err = ISRestoreIndices(pointIS, &points);CHECK_PETSC_ERROR(err);
   err = ISDestroy(&pointIS);CHECK_PETSC_ERROR(err);
+
+  PYLITH_METHOD_END;
 } // _getPoints
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/DirichletBC.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/DirichletBC.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/DirichletBC.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -49,8 +49,12 @@
 void
 pylith::bc::DirichletBC::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   TimeDependentPoints::deallocate();
   feassemble::Constraint::deallocate();
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -59,14 +63,18 @@
 pylith::bc::DirichletBC::initialize(const topology::Mesh& mesh,
 				    const PylithScalar upDir[3])
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   if (0 == _bcDOF.size())
-    return;
+    PYLITH_METHOD_END;
 
   _getPoints(mesh);
 
   assert(_normalizer);
   const PylithScalar lengthScale = _normalizer->lengthScale();
   _queryDatabases(mesh, lengthScale, "displacement");
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -74,9 +82,11 @@
 void
 pylith::bc::DirichletBC::setConstraintSizes(const topology::Field<topology::Mesh>& field)
 { // setConstraintSizes
+  PYLITH_METHOD_BEGIN;
+
   const int numFixedDOF = _bcDOF.size();
   if (0 == numFixedDOF)
-    return;
+    PYLITH_METHOD_END;
 
   PetscSection section = field.petscSection();assert(section);
   PetscInt numFields;
@@ -107,6 +117,8 @@
     // We should be specifying what field the BC is for
     if (numFields) {err = PetscSectionAddFieldConstraintDof(section, point, 0, numFixedDOF);CHECK_PETSC_ERROR(err);}
   } // for
+
+  PYLITH_METHOD_END;
 } // setConstraintSizes
 
 // ----------------------------------------------------------------------
@@ -114,9 +126,11 @@
 void
 pylith::bc::DirichletBC::setConstraints(const topology::Field<topology::Mesh>& field)
 { // setConstraints
+  PYLITH_METHOD_BEGIN;
+
   const int numFixedDOF = _bcDOF.size();
   if (0 == numFixedDOF)
-    return;
+    PYLITH_METHOD_END;
 
   PetscSection section = field.petscSection();assert(section);
   PetscInt numFields;
@@ -170,6 +184,8 @@
     err = PetscSectionSetConstraintIndices(section, point, &allCInd[0]);CHECK_PETSC_ERROR(err);
     if (numFields) {err = PetscSectionSetFieldConstraintIndices(section, point, 0, &allCInd[0]);CHECK_PETSC_ERROR(err);}
   } // for
+
+  PYLITH_METHOD_END;
 } // setConstraints
 
 // ----------------------------------------------------------------------
@@ -178,9 +194,11 @@
 pylith::bc::DirichletBC::setField(const PylithScalar t,
 				  const topology::Field<topology::Mesh>& field)
 { // setField
+  PYLITH_METHOD_BEGIN;
+
   const int numFixedDOF = _bcDOF.size();
   if (0 == numFixedDOF)
-    return;
+    PYLITH_METHOD_END;
 
   // Calculate spatial and temporal variation of value for BC.
   _calculateValue(t);
@@ -207,6 +225,8 @@
       fieldArray[_bcDOF[iDOF]+off] = valueArray[voff+iDOF];
     } // for
   } // for
+
+  PYLITH_METHOD_END;
 } // setField
 
 // ----------------------------------------------------------------------
@@ -216,9 +236,11 @@
 				      const PylithScalar t1,
 				      const topology::Field<topology::Mesh>& field)
 { // setFieldIncr
+  PYLITH_METHOD_BEGIN;
+
   const int numFixedDOF = _bcDOF.size();
   if (0 == numFixedDOF)
-    return;
+    PYLITH_METHOD_END;
 
   // Calculate spatial and temporal variation of value for BC.
   _calculateValueIncr(t0, t1);
@@ -244,6 +266,8 @@
       fieldArray[_bcDOF[iDOF]+off] = valueArray[voff+iDOF];
     } // for
   } // for
+
+  PYLITH_METHOD_END;
 } // setFieldIncr
 
 // ----------------------------------------------------------------------
@@ -251,8 +275,12 @@
 void
 pylith::bc::DirichletBC::verifyConfiguration(const topology::Mesh& mesh) const
 { // verifyConfiguration
+  PYLITH_METHOD_BEGIN;
+
   BoundaryCondition::verifyConfiguration(mesh);
   TimeDependent::verifyConfiguration(mesh);
+
+  PYLITH_METHOD_END;
 } // verifyConfiguration
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/DirichletBoundary.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/DirichletBoundary.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/DirichletBoundary.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -53,10 +53,14 @@
 void
 pylith::bc::DirichletBoundary::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   DirichletBC::deallocate();
 
   delete _boundaryMesh; _boundaryMesh = 0;
   delete _outputFields; _outputFields = 0;
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -65,10 +69,14 @@
 pylith::bc::DirichletBoundary::initialize(const topology::Mesh& mesh,
 					  const PylithScalar upDir[3])
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   DirichletBC::initialize(mesh, upDir);
 
   _boundaryMesh = new topology::SubMesh(mesh, _label.c_str());
   assert(_boundaryMesh);
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -77,6 +85,8 @@
 pylith::bc::DirichletBoundary::vertexField(const char* name,
 					   const topology::SolutionFields& fields)
 { // getVertexField
+  PYLITH_METHOD_BEGIN;
+
   assert(_normalizer);
   const PylithScalar lengthScale = _normalizer->lengthScale();
   const PylithScalar timeScale = _normalizer->timeScale();
@@ -104,15 +114,15 @@
   bufferScalar.allocate();
 
   if (0 == strcasecmp(name, "initial_value"))
-    return _bufferVector("initial", "initial_displacement", lengthScale);
+    PYLITH_METHOD_RETURN(_bufferVector("initial", "initial_displacement", lengthScale));
   else if (0 == strcasecmp(name, "rate_of_change"))
-    return _bufferVector("rate", "velocity", rateScale);
+    PYLITH_METHOD_RETURN(_bufferVector("rate", "velocity", rateScale));
   else if (0 == strcasecmp(name, "change_in_value"))
-    return _bufferVector("change", "displacement_change", lengthScale);
+    PYLITH_METHOD_RETURN(_bufferVector("change", "displacement_change", lengthScale));
   else if (0 == strcasecmp(name, "rate_start_time"))
-    return _bufferScalar("rate time", "velocity_start_time", timeScale);
+    PYLITH_METHOD_RETURN(_bufferScalar("rate time", "velocity_start_time", timeScale));
   else if (0 == strcasecmp(name, "change_start_time"))
-    return _bufferScalar("change time", "change_start_time", timeScale);
+    PYLITH_METHOD_RETURN(_bufferScalar("change time", "change_start_time", timeScale));
   else {
     std::ostringstream msg;
     msg
@@ -122,7 +132,8 @@
   } // else
 
   // Satisfy return value (should never reach here)
-  return _outputFields->get("null");
+
+  PYLITH_METHOD_RETURN(_outputFields->get("null"));
 } // getVertexField
 
 // ----------------------------------------------------------------------
@@ -132,6 +143,8 @@
 					     const char* label,
 					     const PylithScalar scale)
 { // _bufferVector
+  PYLITH_METHOD_BEGIN;
+
   assert(_boundaryMesh);
   assert(_parameters);
   assert(_outputFields);
@@ -173,7 +186,7 @@
   buffer.label(label);
   buffer.scale(scale);
 
-  return buffer;
+  PYLITH_METHOD_RETURN(buffer);
 } // _bufferVector
 
 // ----------------------------------------------------------------------
@@ -183,6 +196,8 @@
 					     const char* label,
 					     const PylithScalar scale)
 { // _bufferScalar
+  PYLITH_METHOD_BEGIN;
+
   assert(_boundaryMesh);
   assert(_parameters);
   assert(_outputFields);
@@ -218,7 +233,7 @@
   buffer.label(label);
   buffer.scale(scale);
 
-  return buffer;
+  PYLITH_METHOD_RETURN(buffer);
 } // _bufferScalar
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/Neumann.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/Neumann.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/Neumann.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -59,8 +59,12 @@
 void
 pylith::bc::Neumann::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   BCIntegratorSubMesh::deallocate();
   TimeDependent::deallocate();
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -70,8 +74,12 @@
 pylith::bc::Neumann::initialize(const topology::Mesh& mesh,
 				const PylithScalar upDir[3])
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   _queryDatabases();
   _paramsLocalToGlobal(upDir);
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -81,6 +89,8 @@
 				       const PylithScalar t,
 				       topology::SolutionFields* const fields)
 { // integrateResidual
+  PYLITH_METHOD_BEGIN;
+
   assert(_quadrature);
   assert(_boundaryMesh);
   assert(_parameters);
@@ -157,6 +167,8 @@
 
     PetscLogFlops(numQuadPts*(1+numBasis*(1+numBasis*(1+2*spaceDim))));
   } // for
+
+  PYLITH_METHOD_END;
 } // integrateResidual
 
 // ----------------------------------------------------------------------
@@ -164,11 +176,15 @@
 void
 pylith::bc::Neumann::verifyConfiguration(const topology::Mesh& mesh) const
 { // verifyConfiguration
+  PYLITH_METHOD_BEGIN;
+
   if (1 == mesh.dimension())
     throw std::runtime_error("Neumann boundary conditions are not "
 			     "implemented for a 1-D mesh.");
 
   BCIntegratorSubMesh::verifyConfiguration(mesh);
+
+  PYLITH_METHOD_END;
 } // verifyConfiguration
 
 // ----------------------------------------------------------------------
@@ -177,23 +193,25 @@
 pylith::bc::Neumann::cellField(const char* name,
 			       topology::SolutionFields* const fields)
 { // cellField
+  PYLITH_METHOD_BEGIN;
+
   assert(_parameters);
   assert(name);
 
   if (0 == strcasecmp(name, "initial_value"))
-    return _parameters->get("initial");
+    PYLITH_METHOD_RETURN(_parameters->get("initial"));
 
   else if (0 == strcasecmp(name, "rate_of_change"))
-    return _parameters->get("rate");
+    PYLITH_METHOD_RETURN(_parameters->get("rate"));
 
   else if (0 == strcasecmp(name, "change_in_value"))
-    return _parameters->get("change");
+    PYLITH_METHOD_RETURN(_parameters->get("change"));
 
   else if (0 == strcasecmp(name, "rate_start_time"))
-    return _parameters->get("rate time");
+    PYLITH_METHOD_RETURN(_parameters->get("rate time"));
 
   else if (0 == strcasecmp(name, "change_start_time"))
-    return _parameters->get("change time");
+    PYLITH_METHOD_RETURN(_parameters->get("change time"));
 
   else {
     std::ostringstream msg;
@@ -202,7 +220,8 @@
     throw std::runtime_error(msg.str());
   } // else
 
-  return _parameters->get("traction"); // Satisfy method definition
+  // Satisfy method definition
+  PYLITH_METHOD_RETURN(_parameters->get("traction"));
 } // cellField
 
 // ----------------------------------------------------------------------
@@ -210,6 +229,8 @@
 void
 pylith::bc::Neumann::_queryDatabases(void)
 { // _queryDatabases
+  PYLITH_METHOD_BEGIN;
+
   assert(_quadrature);
   assert(_boundaryMesh);
   
@@ -363,6 +384,7 @@
       _dbTimeHistory->open();
   } // if
 
+  PYLITH_METHOD_END;
 } // _queryDatabases
 
 // ----------------------------------------------------------------------
@@ -373,6 +395,8 @@
 			      const int querySize,
 			      const PylithScalar scale)
 { // _queryDB
+  PYLITH_METHOD_BEGIN;
+
   assert(name);
   assert(db);
   assert(_boundaryMesh);
@@ -455,6 +479,8 @@
     for(PetscInt d = 0; d < vdof; ++d)
       valueArray[voff+d] = valuesCell[d];
   } // for
+
+  PYLITH_METHOD_END;
 } // _queryDB
 
 // ----------------------------------------------------------------------
@@ -463,6 +489,8 @@
 void
   pylith::bc::Neumann::_paramsLocalToGlobal(const PylithScalar upDir[3])
 { // _paramsLocalToGlobal
+  PYLITH_METHOD_BEGIN;
+
   assert(_boundaryMesh);
   assert(_parameters);
   assert(_quadrature);
@@ -592,6 +620,8 @@
   delete initialVisitor; initialVisitor = 0;
   delete rateVisitor; rateVisitor = 0;
   delete changeVisitor; changeVisitor = 0;
+
+  PYLITH_METHOD_END;
 } // paramsLocalToGlobal
 
 // ----------------------------------------------------------------------
@@ -599,6 +629,8 @@
 void
 pylith::bc::Neumann::_calculateValue(const PylithScalar t)
 { // _calculateValue
+  PYLITH_METHOD_BEGIN;
+
   assert(_parameters);
   assert(_boundaryMesh);
   assert(_quadrature);
@@ -715,6 +747,8 @@
   delete rateTimeVisitor; rateTimeVisitor = 0;
   delete changeVisitor; changeVisitor = 0;
   delete changeTimeVisitor; changeTimeVisitor = 0;
+
+  PYLITH_METHOD_END;
 }  // _calculateValue
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/PointForce.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/PointForce.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/PointForce.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -50,8 +50,12 @@
 void
 pylith::bc::PointForce::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   TimeDependentPoints::deallocate();
   feassemble::Integrator<feassemble::Quadrature<topology::Mesh> >::deallocate();
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -60,8 +64,10 @@
 pylith::bc::PointForce::initialize(const topology::Mesh& mesh,
 				    const PylithScalar upDir[3])
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   if (0 == _bcDOF.size())
-    return;
+    PYLITH_METHOD_END;
 
   _getPoints(mesh);
 
@@ -71,6 +77,8 @@
   const PylithScalar forceScale = pressureScale * lengthScale * lengthScale;
 
   _queryDatabases(mesh, forceScale, "force");
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -80,6 +88,8 @@
 					  const PylithScalar t,
 					  topology::SolutionFields* const fields)
 { // integrateResidualAssembled
+  PYLITH_METHOD_BEGIN;
+
   assert(_parameters);
   assert(_normalizer);
 
@@ -123,6 +133,8 @@
       residualArray[roff+_bcDOF[iDOF]] += valueArray[voff+iDOF];
     } // for
   } // for
+
+  PYLITH_METHOD_END;
 } // integrateResidualAssembled
 
 // ----------------------------------------------------------------------
@@ -130,8 +142,12 @@
 void
 pylith::bc::PointForce::verifyConfiguration(const topology::Mesh& mesh) const
 { // verifyConfiguration
+  PYLITH_METHOD_BEGIN;
+
   BoundaryCondition::verifyConfiguration(mesh);
   TimeDependent::verifyConfiguration(mesh);
+
+  PYLITH_METHOD_END;
 } // verifyConfiguration
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/TimeDependentPoints.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/TimeDependentPoints.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/TimeDependentPoints.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -55,8 +55,12 @@
 void
 pylith::bc::TimeDependentPoints::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   BoundaryConditionPoints::deallocate();
   TimeDependent::deallocate();
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -80,6 +84,8 @@
 						 const PylithScalar valueScale,
 						 const char* fieldName)
 { // _queryDatabases
+  PYLITH_METHOD_BEGIN;
+
   const PylithScalar timeScale = _getNormalizer().timeScale();
   const PylithScalar rateScale = valueScale / timeScale;
 
@@ -213,6 +219,8 @@
   } // for
   delete[] valueNames; valueNames = 0;
   delete[] rateNames; rateNames = 0;
+
+  PYLITH_METHOD_END;
 } // _queryDatabases
 
 // ----------------------------------------------------------------------
@@ -223,6 +231,8 @@
 					  const int querySize,
 					  const PylithScalar scale)
 { // _queryDB
+  PYLITH_METHOD_BEGIN;
+
   assert(name);
   assert(db);
   assert(_parameters);
@@ -272,6 +282,8 @@
       parametersArray[off+i] = valueVertex[i];
     } // for
   } // for
+
+  PYLITH_METHOD_END;
 } // _queryDB
 
 // ----------------------------------------------------------------------
@@ -279,6 +291,8 @@
 void
 pylith::bc::TimeDependentPoints::_calculateValue(const PylithScalar t)
 { // _calculateValue
+  PYLITH_METHOD_BEGIN;
+
   assert(_parameters);
 
   const PylithScalar timeScale = _getNormalizer().timeScale();
@@ -379,6 +393,8 @@
   delete rateTimeVisitor; rateTimeVisitor = 0;
   delete changeVisitor; changeVisitor = 0;
   delete changeTimeVisitor; changeTimeVisitor = 0;
+
+  PYLITH_METHOD_END;
 }  // _calculateValue
 
 // ----------------------------------------------------------------------
@@ -388,6 +404,8 @@
 pylith::bc::TimeDependentPoints::_calculateValueIncr(const PylithScalar t0,
 						     const PylithScalar t1)
 { // _calculateValueIncr
+  PYLITH_METHOD_BEGIN;
+
   assert(_parameters);
 
   const PylithScalar timeScale = _getNormalizer().timeScale();
@@ -513,6 +531,8 @@
   delete rateTimeVisitor; rateTimeVisitor = 0;
   delete changeVisitor; changeVisitor = 0;
   delete changeTimeVisitor; changeTimeVisitor = 0;
+
+  PYLITH_METHOD_END;
 }  // _calculateValueIncr
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/BruneSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/BruneSlipFn.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/BruneSlipFn.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -58,11 +58,15 @@
 void 
 pylith::faults::BruneSlipFn::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   SlipTimeFn::deallocate();
 
   _dbFinalSlip = 0; // :TODO: Use shared pointer.
   _dbSlipTime = 0; // :TODO: Use shared pointer.
   _dbRiseTime = 0; // :TODO: Use shared pointer.
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -72,6 +76,8 @@
 					const spatialdata::units::Nondimensional& normalizer,
 					const PylithScalar originTime)
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   assert(_dbFinalSlip);
   assert(_dbSlipTime);
   assert(_dbRiseTime);
@@ -221,6 +227,8 @@
   _dbFinalSlip->close();
   _dbSlipTime->close();
   _dbRiseTime->close();
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -229,6 +237,8 @@
 pylith::faults::BruneSlipFn::slip(topology::Field<topology::SubMesh>* slip,
 				  const PylithScalar t)
 { // slip
+  PYLITH_METHOD_BEGIN;
+
   assert(slip);
   assert(_parameters);
 
@@ -281,6 +291,8 @@
   } // for
 
   PetscLogFlops((vEnd-vStart) * (2+8 + 3*spaceDim));
+
+  PYLITH_METHOD_END;
 } // slip
 
 // ----------------------------------------------------------------------
@@ -288,7 +300,9 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::BruneSlipFn::finalSlip(void)
 { // finalSlip
-  return _parameters->get("final slip");
+  PYLITH_METHOD_BEGIN;
+
+  PYLITH_METHOD_RETURN(_parameters->get("final slip"));
 } // finalSlip
 
 // ----------------------------------------------------------------------
@@ -296,7 +310,9 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::BruneSlipFn::slipTime(void)
 { // slipTime
-  return _parameters->get("slip time");
+  PYLITH_METHOD_BEGIN;
+
+  PYLITH_METHOD_RETURN(_parameters->get("slip time"));
 } // slipTime
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/ConstRateSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/ConstRateSlipFn.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/ConstRateSlipFn.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -56,10 +56,14 @@
 void 
 pylith::faults::ConstRateSlipFn::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   SlipTimeFn::deallocate();
 
   _dbSlipRate = 0; // :TODO: Use shared pointer.
   _dbSlipTime = 0; // :TODO: Use shared pointer.
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -70,6 +74,8 @@
 			    const spatialdata::units::Nondimensional& normalizer,
 			    const PylithScalar originTime)
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   assert(_dbSlipRate);
   assert(_dbSlipTime);
 
@@ -190,6 +196,8 @@
   // Close databases
   _dbSlipRate->close();
   _dbSlipTime->close();
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -198,6 +206,8 @@
 pylith::faults::ConstRateSlipFn::slip(topology::Field<topology::SubMesh>* slip,
 				      const PylithScalar t)
 { // slip
+  PYLITH_METHOD_BEGIN;
+
   assert(slip);
   assert(_parameters);
 
@@ -238,6 +248,8 @@
   } // for
 
   PetscLogFlops((vEnd-vStart) * (1 + _slipRateVertex.size()));
+
+  PYLITH_METHOD_END;
 } // slip
 
 // ----------------------------------------------------------------------
@@ -245,8 +257,10 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::ConstRateSlipFn::finalSlip(void)
 { // finalSlip
+  PYLITH_METHOD_BEGIN;
+
   // Slip rate is parameter instead of final slip.
-  return _parameters->get("slip rate");
+  PYLITH_METHOD_RETURN(_parameters->get("slip rate"));
 } // finalSlip
 
 // ----------------------------------------------------------------------
@@ -254,7 +268,9 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::ConstRateSlipFn::slipTime(void)
 { // slipTime
-  return _parameters->get("slip time");
+  PYLITH_METHOD_BEGIN;
+
+  PYLITH_METHOD_RETURN(_parameters->get("slip time"));
 } // slipTime
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/EqKinSrc.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/EqKinSrc.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/EqKinSrc.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -22,6 +22,8 @@
 
 #include "SlipTimeFn.hh" // USES SlipTimeFn
 
+#include "pylith/utils/petscerror.h" // USES PYLITH_METHOD_BEGIN
+
 #include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
 
 #include <cassert> // USES assert()
@@ -79,10 +81,14 @@
 pylith::faults::EqKinSrc::initialize(const topology::SubMesh& faultMesh,
 				     const spatialdata::units::Nondimensional& normalizer)
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   // :TODO: Normalize slip time in Python?
   normalizer.nondimensionalize(&_originTime, 1, normalizer.timeScale());
   assert(_slipfn);
   _slipfn->initialize(faultMesh, normalizer, _originTime);
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -91,8 +97,12 @@
 pylith::faults::EqKinSrc::slip(topology::Field<topology::SubMesh>* const slipField,
 			       const PylithScalar t)
 { // slip
+  PYLITH_METHOD_BEGIN;
+
   assert(_slipfn);
   _slipfn->slip(slipField, t);
+
+  PYLITH_METHOD_END;
 } // slip
 
 // ----------------------------------------------------------------------
@@ -100,8 +110,10 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::EqKinSrc::finalSlip(void) const
 { // finalSlip
+  PYLITH_METHOD_BEGIN;
+
   assert(_slipfn);
-  return _slipfn->finalSlip();
+  PYLITH_METHOD_RETURN(_slipfn->finalSlip());
 } // finalSlip
 
 // ----------------------------------------------------------------------
@@ -109,8 +121,10 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::EqKinSrc::slipTime(void) const
 { // slipTime
+  PYLITH_METHOD_BEGIN;
+
   assert(_slipfn);
-  return _slipfn->slipTime();
+  PYLITH_METHOD_RETURN(_slipfn->slipTime());
 } // slipTime
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesive.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesive.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -48,10 +48,14 @@
 void 
 pylith::faults::FaultCohesive::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   Fault::deallocate();
   feassemble::Integrator<feassemble::Quadrature<topology::SubMesh> >::deallocate();
 
   delete _fields; _fields = 0;
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -69,6 +73,8 @@
 int
 pylith::faults::FaultCohesive::numVerticesNoMesh(const topology::Mesh& mesh) const
 { // numVerticesNoMesh
+  PYLITH_METHOD_BEGIN;
+
   PetscInt nvertices = 0;
 
   if (!_useFaultMesh) {
@@ -91,7 +97,7 @@
     nvertices = -1;
   } // else
 
-  return nvertices;
+  PYLITH_METHOD_RETURN(nvertices);
 } // numVerticesNoMesh
 
 // ----------------------------------------------------------------------
@@ -103,6 +109,8 @@
                                               int *firstFaultCell,
                                               const bool flipFault)
 { // adjustTopology
+  PYLITH_METHOD_BEGIN;
+
   assert(mesh);
   assert(std::string("") != label());
   
@@ -151,6 +159,8 @@
 	<< err.what();
     throw std::runtime_error(msg.str());
   }
+
+  PYLITH_METHOD_END;
 } // adjustTopology
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -74,6 +74,8 @@
 // Deallocate PETSc and local data structures.
 void pylith::faults::FaultCohesiveDyn::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   FaultCohesiveLagrange::deallocate();
 
   _tractPerturbation = 0; // :TODO: Use shared pointer
@@ -81,6 +83,8 @@
 
   delete _jacobian; _jacobian = 0;
   PetscErrorCode err = KSPDestroy(&_ksp);CHECK_PETSC_ERROR(err);
+
+  PYLITH_METHOD_END;
 } // deallocate
 
 // ----------------------------------------------------------------------
@@ -129,6 +133,8 @@
 pylith::faults::FaultCohesiveDyn::initialize(const topology::Mesh& mesh,
 					     const PylithScalar upDir[3])
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   assert(upDir);
   assert(_quadrature);
   assert(_normalizer);
@@ -159,6 +165,8 @@
   velRel.vectorFieldType(topology::FieldBase::VECTOR);
   velRel.scale(_normalizer->lengthScale() / _normalizer->timeScale());
 
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -168,6 +176,8 @@
 						    const PylithScalar t,
 						    topology::SolutionFields* const fields)
 { // integrateResidual
+  PYLITH_METHOD_BEGIN;
+
   assert(fields);
   assert(_fields);
   assert(_logger);
@@ -376,6 +386,8 @@
 #if !defined(DETAILED_EVENT_LOGGING)
   _logger->eventEnd(computeEvent);
 #endif
+
+  PYLITH_METHOD_END;
 } // integrateResidual
 
 // ----------------------------------------------------------------------
@@ -384,6 +396,8 @@
 pylith::faults::FaultCohesiveDyn::updateStateVars(const PylithScalar t,
 						  topology::SolutionFields* const fields)
 { // updateStateVars
+  PYLITH_METHOD_BEGIN;
+
   assert(fields);
   assert(_fields);
 
@@ -513,6 +527,8 @@
   err = VecRestoreArray(dispTVec, &dispTArray);CHECK_PETSC_ERROR(err);
   err = VecRestoreArray(dispTIncrVec, &dispTIncrArray);CHECK_PETSC_ERROR(err);
   err = VecRestoreArray(orientationVec, &orientationArray);CHECK_PETSC_ERROR(err);
+
+  PYLITH_METHOD_END;
 } // updateStateVars
 
 // ----------------------------------------------------------------------
@@ -522,6 +538,8 @@
 						     const PylithScalar t,
 						     const topology::Jacobian& jacobian)
 { // constrainSolnSpace
+  PYLITH_METHOD_BEGIN;
+
   /// Member prototype for _constrainSolnSpaceXD()
   typedef void (pylith::faults::FaultCohesiveDyn::*constrainSolnSpace_fn_type)
     (scalar_array*,
@@ -1158,6 +1176,8 @@
   dispIncrAdjSection->view("AFTER DISP INCR adjust");
   dispIncrSection->view("AFTER DISP INCR");
 #endif
+
+  PYLITH_METHOD_END;
 } // constrainSolnSpace
 
 // ----------------------------------------------------------------------
@@ -1169,6 +1189,8 @@
 			 const PylithScalar t,
 			 const topology::Field<topology::Mesh>& jacobian)
 { // adjustSolnLumped
+  PYLITH_METHOD_BEGIN;
+
   /// Member prototype for _constrainSolnSpaceXD()
   typedef void (pylith::faults::FaultCohesiveDyn::*constrainSolnSpace_fn_type)
     (scalar_array*,
@@ -1531,6 +1553,8 @@
   //dLagrangeTpdtSection->view("AFTER dLagrange");
   //dispIncrSection->view("AFTER DISP INCR (t->t+dt)");
 #endif
+
+  PYLITH_METHOD_END;
 } // adjustSolnLumped
 
 // ----------------------------------------------------------------------
@@ -1539,6 +1563,8 @@
 pylith::faults::FaultCohesiveDyn::vertexField(const char* name,
 					      const topology::SolutionFields* fields)
 { // vertexField
+  PYLITH_METHOD_BEGIN;
+
   assert(_faultMesh);
   assert(_quadrature);
   assert(_normalizer);
@@ -1559,7 +1585,8 @@
     buffer.copy(dispRel);
     buffer.label("slip");
     FaultCohesiveLagrange::globalToFault(&buffer, orientation);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
+
   } else if (0 == strcasecmp("slip_rate", name)) {
     const topology::Field<topology::SubMesh>& velRel = _fields->get("relative velocity");
     _allocateBufferVectorField();
@@ -1567,7 +1594,8 @@
     buffer.copy(velRel);
     buffer.label("slip_rate");
     FaultCohesiveLagrange::globalToFault(&buffer, orientation);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
+
   } else if (cohesiveDim > 0 && 0 == strcasecmp("strike_dir", name)) {
     PetscSection orientationSection = _fields->get("orientation").petscSection();assert(orientationSection);
     PetscVec orientationVec = _fields->get("orientation").localVector();assert(orientationVec);
@@ -1576,7 +1604,7 @@
     buffer.copy(orientationSection, 0, PETSC_DETERMINE, orientationVec);
     buffer.label("strike_dir");
     buffer.scale(1.0);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
 
   } else if (2 == cohesiveDim && 0 == strcasecmp("dip_dir", name)) {
     PetscSection orientationSection = _fields->get("orientation").petscSection();assert(orientationSection);
@@ -1586,7 +1614,8 @@
     buffer.copy(orientationSection, 1, PETSC_DETERMINE, orientationVec);
     buffer.label("dip_dir");
     buffer.scale(1.0);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
+
   } else if (0 == strcasecmp("normal_dir", name)) {
     PetscSection orientationSection = _fields->get("orientation").petscSection();assert(orientationSection);
     PetscVec orientationVec = _fields->get("orientation").localVector();assert(orientationVec);
@@ -1595,16 +1624,19 @@
     buffer.copy(orientationSection, cohesiveDim, PETSC_DETERMINE, orientationVec);
     buffer.label("normal_dir");
     buffer.scale(1.0);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
+
   } else if (0 == strcasecmp("traction", name)) {
     assert(fields);
     const topology::Field<topology::Mesh>& dispT = fields->get("disp(t)");
     _allocateBufferVectorField();
     topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
     _calcTractions(&buffer, dispT);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
+
   } else if (_friction->hasPropStateVar(name)) {
-    return _friction->getField(name);
+    PYLITH_METHOD_RETURN(_friction->getField(name));
+
   } else if (_tractPerturbation && _tractPerturbation->hasParameter(name)) {
     const topology::Field<topology::SubMesh>& param = _tractPerturbation->vertexField(name, fields);
     if (param.vectorFieldType() == topology::FieldBase::VECTOR) {
@@ -1612,9 +1644,9 @@
       topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
       buffer.copy(param);
       FaultCohesiveLagrange::globalToFault(&buffer, orientation);
-      return buffer;
+      PYLITH_METHOD_RETURN(buffer);
     } else {
-      return param;
+      PYLITH_METHOD_RETURN(param);
     } // if/else
 
   } else {
@@ -1631,7 +1663,7 @@
   assert(_fields);
   const topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
 
-  return buffer;
+  PYLITH_METHOD_RETURN(buffer);
 } // vertexField
 
 // ----------------------------------------------------------------------
@@ -1640,6 +1672,8 @@
 pylith::faults::FaultCohesiveDyn::_calcTractions(topology::Field<topology::SubMesh>* tractions,
 						 const topology::Field<topology::Mesh>& dispT)
 { // _calcTractions
+  PYLITH_METHOD_BEGIN;
+
   assert(tractions);
   assert(_faultMesh);
   assert(_fields);
@@ -1712,6 +1746,8 @@
   tractions->view("TRACTIONS");
 #endif
 
+
+  PYLITH_METHOD_END;
 } // _calcTractions
 
 // ----------------------------------------------------------------------
@@ -1721,6 +1757,8 @@
 void
 pylith::faults::FaultCohesiveDyn::_updateRelMotion(const topology::SolutionFields& fields)
 { // _updateRelMotion
+  PYLITH_METHOD_BEGIN;
+
   assert(_fields);
 
   const int spaceDim = _quadrature->spaceDim();
@@ -1820,6 +1858,8 @@
   err = VecRestoreArray(velocityVec, &velocityArray);CHECK_PETSC_ERROR(err);
 
   PetscLogFlops(numVertices*spaceDim*spaceDim*4);
+
+  PYLITH_METHOD_END;
 } // _updateRelMotion
 
 // ----------------------------------------------------------------------
@@ -1827,6 +1867,8 @@
 void
 pylith::faults::FaultCohesiveDyn::_sensitivitySetup(const topology::Jacobian& jacobian)
 { // _sensitivitySetup
+  PYLITH_METHOD_BEGIN;
+
   assert(_fields);
   assert(_quadrature);
 
@@ -1893,6 +1935,8 @@
     err = KSPAppendOptionsPrefix(_ksp, "friction_");CHECK_PETSC_ERROR(err);
     err = KSPSetFromOptions(_ksp);CHECK_PETSC_ERROR(err);
   } // if
+
+  PYLITH_METHOD_END;
 } // _sensitivitySetup
 
 // ----------------------------------------------------------------------
@@ -1902,6 +1946,8 @@
                                                              const topology::Jacobian& jacobian,
                                                              const topology::SolutionFields& fields)
 { // _sensitivityUpdateJacobian
+  PYLITH_METHOD_BEGIN;
+
   assert(_quadrature);
   assert(_fields);
 
@@ -2028,6 +2074,8 @@
   std::cout << "SENSITIVITY JACOBIAN" << std::endl;
   _jacobian->view();
 #endif
+
+  PYLITH_METHOD_END;
 } // _sensitivityUpdateJacobian
 
 // ----------------------------------------------------------------------
@@ -2035,6 +2083,8 @@
 void
 pylith::faults::FaultCohesiveDyn::_sensitivityReformResidual(const bool negativeSide)
 { // _sensitivityReformResidual
+  PYLITH_METHOD_BEGIN;
+
   /** Compute residual -L^T dLagrange
    *
    * Note: We need all entries for L, even those on other processors,
@@ -2125,6 +2175,8 @@
     // Assemble cell contribution into field
     err = DMPlexVecSetClosure(faultDMMesh, residualSection, residualVec, c, &residualCell[0], ADD_VALUES);CHECK_PETSC_ERROR(err);
   } // for
+
+  PYLITH_METHOD_END;
 } // _sensitivityReformResidual
 
 // ----------------------------------------------------------------------
@@ -2132,6 +2184,8 @@
 void
 pylith::faults::FaultCohesiveDyn::_sensitivitySolve(void)
 { // _sensitivitySolve
+  PYLITH_METHOD_BEGIN;
+
   assert(_fields);
   assert(_jacobian);
   assert(_ksp);
@@ -2161,6 +2215,8 @@
   residual.view("SENSITIVITY RESIDUAL");
   solution.view("SENSITIVITY SOLUTION");
 #endif
+
+  PYLITH_METHOD_END;
 } // _sensitivitySolve
 
 // ----------------------------------------------------------------------
@@ -2169,6 +2225,8 @@
 void
 pylith::faults::FaultCohesiveDyn::_sensitivityUpdateSoln(const bool negativeSide)
 { // _sensitivityUpdateSoln
+  PYLITH_METHOD_BEGIN;
+
   assert(_fields);
   assert(_quadrature);
 
@@ -2227,6 +2285,8 @@
   err = VecRestoreArray(dispRelVec, &dispRelArray);CHECK_PETSC_ERROR(err);
   err = VecRestoreArray(solutionVec, &solutionArray);CHECK_PETSC_ERROR(err);
   err = VecRestoreArray(dLagrangeTpdtVec, &dLagrangeTpdtArray);CHECK_PETSC_ERROR(err);
+
+  PYLITH_METHOD_END;
 } // _sensitivityUpdateSoln
 
 
@@ -2241,6 +2301,8 @@
 							  const PylithScalar t,
 							  topology::SolutionFields* const fields)
 { // _constrainSolnSpaceNorm
+  PYLITH_METHOD_BEGIN;
+
   /// Member prototype for _constrainSolnSpaceXD()
   typedef void (pylith::faults::FaultCohesiveDyn::*constrainSolnSpace_fn_type)
     (scalar_array*,
@@ -2491,7 +2553,7 @@
   err = MPI_Allreduce(&numVertices, &numVerticesTotal, 1, MPIU_INT, MPI_SUM, fields->mesh().comm());
 
   assert(numVerticesTotal > 0);
-  return sqrt(norm2Total) / numVerticesTotal;
+  PYLITH_METHOD_RETURN(sqrt(norm2Total) / numVerticesTotal);
 } // _constrainSolnSpaceNorm
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -65,10 +65,14 @@
 void
 pylith::faults::FaultCohesiveImpulses::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   FaultCohesiveLagrange::deallocate();
 
   // :TODO: Use shared pointers for amplitudes of impulses
   _dbImpulseAmp = 0;
+
+  PYLITH_METHOD_END;
 } // deallocate
 
 // ----------------------------------------------------------------------
@@ -130,6 +134,8 @@
 pylith::faults::FaultCohesiveImpulses::initialize(const topology::Mesh& mesh,
 						  const PylithScalar upDir[3])
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   assert(upDir);
   assert(_quadrature);
   assert(_normalizer);
@@ -138,6 +144,8 @@
 
   // Setup impulses
   _setupImpulses();
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -149,6 +157,8 @@
 			     const PylithScalar t,
 			     topology::SolutionFields* const fields)
 { // integrateResidual
+  PYLITH_METHOD_BEGIN;
+
   assert(fields);
   assert(_fields);
   assert(_logger);
@@ -170,6 +180,7 @@
 
   FaultCohesiveLagrange::integrateResidual(residual, t, fields);
 
+  PYLITH_METHOD_END;
 } // integrateResidual
 
 // ----------------------------------------------------------------------
@@ -178,6 +189,8 @@
 pylith::faults::FaultCohesiveImpulses::vertexField(const char* name,
                                               const topology::SolutionFields* fields)
 { // vertexField
+  PYLITH_METHOD_BEGIN;
+
   assert(_faultMesh);
   assert(_quadrature);
   assert(_normalizer);
@@ -197,7 +210,7 @@
     buffer.copy(dispRel);
     buffer.label("slip");
     FaultCohesiveLagrange::globalToFault(&buffer, orientation);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
 
   } else if (cohesiveDim > 0 && 0 == strcasecmp("strike_dir", name)) {
     PetscSection orientationSection = _fields->get("orientation").petscSection();assert(orientationSection);
@@ -207,7 +220,7 @@
     buffer.copy(orientationSection, 0, PETSC_DETERMINE, orientationVec);
     buffer.label("strike_dir");
     buffer.scale(1.0);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
 
   } else if (2 == cohesiveDim && 0 == strcasecmp("dip_dir", name)) {
     PetscSection orientationSection = _fields->get("orientation").petscSection();assert(orientationSection);
@@ -218,7 +231,7 @@
     buffer.copy(orientationSection, 1, PETSC_DETERMINE, orientationVec);
     buffer.label("dip_dir");
     buffer.scale(1.0);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
 
   } else if (0 == strcasecmp("normal_dir", name)) {
     PetscSection orientationSection = _fields->get("orientation").petscSection();assert(orientationSection);
@@ -229,15 +242,15 @@
     buffer.copy(orientationSection, cohesiveDim, PETSC_DETERMINE, orientationVec);
     buffer.label("normal_dir");
     buffer.scale(1.0);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
 
   } else if (0 == strcasecmp("impulse_amplitude", name)) {
     topology::Field<topology::SubMesh>& amplitude = _fields->get("impulse amplitude");
-    return amplitude;
+    PYLITH_METHOD_RETURN(amplitude);
 
   } else if (0 == strcasecmp("area", name)) {
     topology::Field<topology::SubMesh>& area = _fields->get("area");
-    return area;
+    PYLITH_METHOD_RETURN(area);
 
   } else if (0 == strcasecmp("traction_change", name)) {
     assert(fields);
@@ -245,7 +258,7 @@
     _allocateBufferVectorField();
     topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
     _calcTractionsChange(&buffer, dispT);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
 
   } else {
     std::ostringstream msg;
@@ -261,7 +274,7 @@
   // Satisfy return values
   assert(_fields);
   const topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
-  return buffer;
+  PYLITH_METHOD_RETURN(buffer);
 } // vertexField
 
  
@@ -270,9 +283,11 @@
 void
 pylith::faults::FaultCohesiveImpulses::_setupImpulses(void)
 { // _setupImpulses
+  PYLITH_METHOD_BEGIN;
+
   // If no impulse amplitude specified, leave method
   if (!_dbImpulseAmp)
-    return;
+    PYLITH_METHOD_END;
 
   assert(_normalizer);
   const PylithScalar lengthScale = _normalizer->lengthScale();
@@ -365,6 +380,8 @@
   //amplitude.view("IMPULSE AMPLITUDE"); // DEBUGGING
 
   _setupImpulseOrder(pointOrder);
+
+  PYLITH_METHOD_END;
 } // _setupImpulses
 
 
@@ -373,6 +390,8 @@
 void
 pylith::faults::FaultCohesiveImpulses::_setupImpulseOrder(const std::map<int,int>& pointOrder)
 { // _setupImpulseOrder
+  PYLITH_METHOD_BEGIN;
+
   // Order of impulses is set by processor rank and order of points in
   // mesh, using only those points with nonzero amplitudes.
 
@@ -424,6 +443,8 @@
     } // if
   } // for
 #endif
+
+  PYLITH_METHOD_END;
 } // _setupImpulseOrder
 
 
@@ -433,14 +454,15 @@
 pylith::faults::FaultCohesiveImpulses::_setRelativeDisp(const topology::Field<topology::SubMesh>& dispRel,
 							const int impulse)
 { // _setRelativeDisp
+  PYLITH_METHOD_BEGIN;
+
   assert(_fields);
 
   // If no impulse amplitude specified, leave method
   if (!_dbImpulseAmp)
-    return;
+    PYLITH_METHOD_END;
 
-  const spatialdata::geocoords::CoordSys* cs = _faultMesh->coordsys();
-  assert(cs);
+  const spatialdata::geocoords::CoordSys* cs = _faultMesh->coordsys();assert(cs);
   const int spaceDim = cs->spaceDim();
 
   PetscErrorCode err;
@@ -488,6 +510,8 @@
   std::cout << "impulse: " << impulse << std::endl;
   dispRel.view("DISP RELATIVE"); // DEBUGGING
 #endif
+
+  PYLITH_METHOD_END;
 } // _setRelativeDisp
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveKin.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveKin.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -77,6 +77,8 @@
 					 EqKinSrc** sources,
 					 const int numSources)
 { // eqsrcs
+  PYLITH_METHOD_BEGIN;
+
   assert(numNames == numSources);
 
   // :TODO: Use shared pointers for earthquake sources
@@ -86,6 +88,8 @@
       throw std::runtime_error("Null earthquake source.");
     _eqSrcs[std::string(names[i])] = sources[i];
   } // for
+
+  PYLITH_METHOD_END;
 } // eqsrcs
 
 // ----------------------------------------------------------------------
@@ -94,6 +98,8 @@
 pylith::faults::FaultCohesiveKin::initialize(const topology::Mesh& mesh,
 					     const PylithScalar upDir[3])
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   assert(upDir);
   assert(_quadrature);
   assert(_normalizer);
@@ -106,6 +112,8 @@
     assert(src);
     src->initialize(*_faultMesh, *_normalizer);
   } // for
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -117,6 +125,8 @@
 			     const PylithScalar t,
 			     topology::SolutionFields* const fields)
 { // integrateResidual
+  PYLITH_METHOD_BEGIN;
+
   assert(fields);
   assert(_fields);
   assert(_logger);
@@ -144,6 +154,8 @@
 
   FaultCohesiveLagrange::integrateResidual(residual, t, fields);
 
+
+  PYLITH_METHOD_END;
 } // integrateResidual
 
 // ----------------------------------------------------------------------
@@ -152,6 +164,8 @@
 pylith::faults::FaultCohesiveKin::vertexField(const char* name,
                                               const topology::SolutionFields* fields)
 { // vertexField
+  PYLITH_METHOD_BEGIN;
+
   assert(_faultMesh);
   assert(_quadrature);
   assert(_normalizer);
@@ -174,7 +188,8 @@
     buffer.copy(dispRel);
     buffer.label("slip");
     FaultCohesiveLagrange::globalToFault(&buffer, orientation);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
+
   } else if (cohesiveDim > 0 && 0 == strcasecmp("strike_dir", name)) {
     PetscSection orientationSection = _fields->get("orientation").petscSection();assert(orientationSection);
     PetscVec orientationVec = _fields->get("orientation").localVector();assert(orientationVec);
@@ -183,7 +198,8 @@
     buffer.copy(orientationSection, 0, PETSC_DETERMINE, orientationVec);
     buffer.label("strike_dir");
     buffer.scale(1.0);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
+
   } else if (2 == cohesiveDim && 0 == strcasecmp("dip_dir", name)) {
     PetscSection orientationSection = _fields->get("orientation").petscSection();assert(orientationSection);
     PetscVec orientationVec = _fields->get("orientation").localVector();assert(orientationVec);
@@ -193,7 +209,8 @@
     buffer.copy(orientationSection, 1, PETSC_DETERMINE, orientationVec);
     buffer.label("dip_dir");
     buffer.scale(1.0);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
+
   } else if (0 == strcasecmp("normal_dir", name)) {
     PetscSection orientationSection = _fields->get("orientation").petscSection();assert(orientationSection);
     PetscVec orientationVec = _fields->get("orientation").localVector();assert(orientationVec);
@@ -203,7 +220,7 @@
     buffer.copy(orientationSection, cohesiveDim, PETSC_DETERMINE, orientationVec);
     buffer.label("normal_dir");
     buffer.scale(1.0);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
   } else if (0 == strncasecmp("final_slip_X", name, slipStrLen)) {
     const std::string value = std::string(name).substr(slipStrLen + 1);
 
@@ -220,7 +237,7 @@
       std::string("final_slip_") + std::string(value) : "final_slip";
     buffer.label(label.c_str());
 
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
 
   } else if (0 == strncasecmp("slip_time_X", name, timeStrLen)) {
     const std::string value = std::string(name).substr(timeStrLen + 1);
@@ -236,15 +253,16 @@
     const std::string& label = (_eqSrcs.size() > 1) ? 
       std::string("slip_time_") + std::string(value) : "slip_time";
     buffer.label(label.c_str());
+    PYLITH_METHOD_RETURN(buffer);
 
-    return buffer;
   } else if (0 == strcasecmp("traction_change", name)) {
     assert(fields);
     const topology::Field<topology::Mesh>& dispT = fields->get("disp(t)");
     _allocateBufferVectorField();
     topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
     _calcTractionsChange(&buffer, dispT);
-    return buffer;
+    PYLITH_METHOD_RETURN(buffer);
+
   } else {
     std::ostringstream msg;
     msg << "Request for unknown vertex field '" << name << "' for fault '"
@@ -259,7 +277,7 @@
   // Satisfy return values
   assert(_fields);
   const topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
-  return buffer;
+  PYLITH_METHOD_RETURN(buffer);
 } // vertexField
 
 // End of file 

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveLagrange.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveLagrange.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveLagrange.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -1645,60 +1645,47 @@
   // Fiber dimension of tractions matches spatial dimension.
   const int spaceDim = _quadrature->spaceDim();
 
-  // Get sections.
-  PetscSection dispTSection = dispT.petscSection();
-  PetscVec          dispTVec     = dispT.localVector();
-  PetscScalar *dispTArray;
-  PetscErrorCode err;
-  assert(dispTSection);assert(dispTVec);
+  // Get fields
+  topology::VecVisitorMesh dispTVisitor(dispT);
+  const PetscScalar* dispTArray = dispTVisitor.localArray();
 
-  PetscSection orientationSection = _fields->get("orientation").petscSection();
-  PetscVec          orientationVec     = _fields->get("orientation").localVector();
-  PetscScalar *orientationArray;
-  assert(orientationSection);assert(orientationVec);
+  topology::Field<topology::SubMesh>& orientation = _fields->get("orientation");
+  topology::VecVisitorMesh orientationVisitor(orientation);
+  const PetscScalar* orientationArray = orientationVisitor.localArray();
 
   // Allocate buffer for tractions field (if necessary).
-  PetscSection tractionsSection = tractions->petscSection();
-  if (!tractionsSection) {
+  if (!tractions->petscSection()) {
     const topology::Field<topology::SubMesh>& dispRel = _fields->get("relative disp");
     tractions->cloneSection(dispRel);
-    tractionsSection = tractions->petscSection();
   } // if
-  PetscVec          tractionsVec = tractions->localVector();
-  PetscScalar *tractionsArray;
-  assert(tractionsSection);assert(tractionsVec);
   tractions->zero();
 
+  topology::VecVisitorMesh tractionsVisitor(*tractions);
+  PetscScalar* tractionsArray = tractionsVisitor.localArray();
+
   const PylithScalar pressureScale = tractions->scale();
 
   const int numVertices = _cohesiveVertices.size();
-  err = VecGetArray(dispTVec, &dispTArray);CHECK_PETSC_ERROR(err);
-  err = VecGetArray(tractionsVec, &tractionsArray);CHECK_PETSC_ERROR(err);
-  err = VecGetArray(orientationVec, &orientationArray);CHECK_PETSC_ERROR(err);
   for (int iVertex=0; iVertex < numVertices; ++iVertex) {
     const int v_lagrange = _cohesiveVertices[iVertex].lagrange;
     const int v_fault = _cohesiveVertices[iVertex].fault;
-    PetscInt dof, off, odof, ooff, tdof, toff;
 
-    err = PetscSectionGetDof(dispTSection, v_lagrange, &dof);CHECK_PETSC_ERROR(err);
-    err = PetscSectionGetOffset(dispTSection, v_lagrange, &off);CHECK_PETSC_ERROR(err);
-    assert(spaceDim == dof);
-    err = PetscSectionGetDof(orientationSection, v_fault, &odof);CHECK_PETSC_ERROR(err);
-    err = PetscSectionGetOffset(orientationSection, v_fault, &ooff);CHECK_PETSC_ERROR(err);
-    assert(spaceDim*spaceDim == odof);
-    err = PetscSectionGetDof(tractionsSection, v_fault, &tdof);CHECK_PETSC_ERROR(err);
-    err = PetscSectionGetOffset(tractionsSection, v_fault, &toff);CHECK_PETSC_ERROR(err);
-    assert(spaceDim == tdof);
+    const PetscInt dtoff = dispTVisitor.sectionOffset(v_lagrange);
+    assert(spaceDim == dispTVisitor.sectionDof(v_lagrange));
 
+    const PetscInt ooff = orientationVisitor.sectionOffset(v_fault);
+    assert(spaceDim*spaceDim == orientationVisitor.sectionDof(v_fault));
+
+    const PetscInt toff = tractionsVisitor.sectionOffset(v_fault);
+    assert(spaceDim == tractionsVisitor.sectionDof(v_fault));
+
     // Rotate from global coordinate system to fault (orientation)
     for(PetscInt iDim = 0; iDim < spaceDim; ++iDim) {
       tractionsArray[toff+iDim] = 0.0;
       for(PetscInt jDim = 0; jDim < spaceDim; ++jDim)
-        tractionsArray[toff+iDim] += orientationArray[ooff+iDim*spaceDim+jDim] * dispTArray[off+jDim];
+        tractionsArray[toff+iDim] += orientationArray[ooff+iDim*spaceDim+jDim] * dispTArray[dtoff+jDim];
     }
   } // for
-  err = VecRestoreArray(tractionsVec, &tractionsArray);CHECK_PETSC_ERROR(err);
-  err = VecRestoreArray(orientationVec, &orientationArray);CHECK_PETSC_ERROR(err);
 
   PetscLogFlops(numVertices * (1 + spaceDim) );
 
@@ -1763,11 +1750,10 @@
 //  Get submatrix of Jacobian matrix associated with the negative and
 //  positive sides of the fault.
 void
-pylith::faults::FaultCohesiveLagrange::_getJacobianSubmatrixNP(
-				PetscMat* jacobianSub,
-				std::map<int,int>* indicesMatToSubmat,
-				const topology::Jacobian& jacobian,
-				const topology::SolutionFields& fields)
+pylith::faults::FaultCohesiveLagrange::_getJacobianSubmatrixNP(PetscMat* jacobianSub,
+							       std::map<int,int>* indicesMatToSubmat,
+							       const topology::Jacobian& jacobian,
+							       const topology::SolutionFields& fields)
 { // _getJacobianSubmatrixNP
   PYLITH_METHOD_BEGIN;
 
@@ -1775,32 +1761,31 @@
   assert(indicesMatToSubmat);
 
   // Get global order
-  PetscDM           solutionDM      = fields.solution().dmMesh();
-  PetscSection solutionSection = fields.solution().petscSection();
-  PetscVec          solutionVec     = fields.solution().localVector();
-  PetscSection solutionGlobalSection;
-  PetscScalar *solutionArray;
+  PetscDM solutionDM = fields.solution().dmMesh();
+  PetscSection solutionGlobalSection = NULL;
+  PetscScalar *solutionArray = NULL;
+
   PetscErrorCode err;
-  assert(solutionSection);assert(solutionVec);
   err = DMGetDefaultGlobalSection(solutionDM, &solutionGlobalSection);CHECK_PETSC_ERROR(err);
 
   // Get Jacobian matrix
   const PetscMat jacobianMatrix = jacobian.matrix();
   assert(jacobianMatrix);
 
-  const spatialdata::geocoords::CoordSys* cs = fields.mesh().coordsys();
-  assert(cs);
+  const spatialdata::geocoords::CoordSys* cs = fields.mesh().coordsys();assert(cs);
   const int spaceDim = cs->spaceDim();
 
   const int numVertices = _cohesiveVertices.size();
   int numIndicesNP = 0;
   for (int iVertex=0; iVertex < numVertices; ++iVertex) {
     const int v_lagrange = _cohesiveVertices[iVertex].lagrange;
-    PetscInt goff;
 
     // Compute contribution only if Lagrange constraint is local.
+    PetscInt goff = 0;
     err = PetscSectionGetOffset(solutionGlobalSection, v_lagrange, &goff);CHECK_PETSC_ERROR(err);
-    if (goff < 0) continue;
+    if (goff < 0)
+      continue;
+
     numIndicesNP += 2;
   } // for
   int_array indicesNP(numIndicesNP*spaceDim);
@@ -1809,13 +1794,18 @@
     const int v_lagrange = _cohesiveVertices[iVertex].lagrange;
     const int v_negative = _cohesiveVertices[iVertex].negative;
     const int v_positive = _cohesiveVertices[iVertex].positive;
-    PetscInt gloff, gnoff, gpoff;
 
     // Compute contribution only if Lagrange constraint is local.
+    PetscInt gloff = 0;
     err = PetscSectionGetOffset(solutionGlobalSection, v_lagrange, &gloff);CHECK_PETSC_ERROR(err);
-    if (gloff < 0) continue;
+    if (gloff < 0)
+      continue;
+
+    PetscInt gnoff = 0;
     err = PetscSectionGetOffset(solutionGlobalSection, v_negative, &gnoff);CHECK_PETSC_ERROR(err);
     gnoff = gnoff < 0 ? -(gnoff+1) : gnoff;
+
+    PetscInt gpoff = 0;
     err = PetscSectionGetOffset(solutionGlobalSection, v_positive, &gpoff);CHECK_PETSC_ERROR(err);
     gpoff = gpoff < 0 ? -(gpoff+1) : gpoff;
     
@@ -1833,11 +1823,9 @@
   
   PetscMat* subMat[1];
   IS indicesIS[1];
-  err = ISCreateGeneral(PETSC_COMM_SELF, indicesNP.size(), &indicesNP[0],
-			PETSC_USE_POINTER, &indicesIS[0]);
+  err = ISCreateGeneral(PETSC_COMM_SELF, indicesNP.size(), &indicesNP[0], PETSC_USE_POINTER, &indicesIS[0]);
   CHECK_PETSC_ERROR(err);
-  err = MatGetSubMatrices(jacobianMatrix, 1, indicesIS,
-			  indicesIS, MAT_INITIAL_MATRIX, subMat);
+  err = MatGetSubMatrices(jacobianMatrix, 1, indicesIS, indicesIS, MAT_INITIAL_MATRIX, subMat);
   CHECK_PETSC_ERROR(err);
   err = ISDestroy(&indicesIS[0]); CHECK_PETSC_ERROR(err);
 
@@ -1866,40 +1854,28 @@
 
   if (0 == strcasecmp("partition", name)) {
 
-    PetscDM             faultDMMesh = _faultMesh->dmMesh();
-    PetscInt       cStart, cEnd;
-    PetscErrorCode err;
+    PetscDM faultDMMesh = _faultMesh->dmMesh();assert(faultDMMesh);
+    topology::Stratum cellsStratum(faultDMMesh, topology::Stratum::HEIGHT, 0);
+    const PetscInt cStart = cellsStratum.begin();
+    const PetscInt cEnd = cellsStratum.end();
 
-    assert(faultDMMesh);
-    err = DMPlexGetHeightStratum(faultDMMesh, 0, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
-
     const int fiberDim = 1;
     _fields->add("partition", "partition", pylith::topology::FieldBase::CELLS_FIELD, fiberDim);
     topology::Field<topology::SubMesh>& partition = _fields->get("partition");
     partition.allocate();
-    PetscSection partitionSection = partition.petscSection();
-    PetscVec          partitionVec     = partition.localVector();
-    PetscScalar *partitionArray;
-    assert(partitionSection);assert(partitionVec);
+    topology::VecVisitorMesh partitionVisitor(partition);
+    PetscScalar* partitionArray = partitionVisitor.localArray();
 
-    MPI_Comm    comm;
     PetscMPIInt rank;
-    err = PetscObjectGetComm((PetscObject) faultDMMesh, &comm);CHECK_PETSC_ERROR(err);
-    err = MPI_Comm_rank(comm, &rank);CHECK_PETSC_ERROR(err);
+    PetscErrorCode err = MPI_Comm_rank(_faultMesh->comm(), &rank);CHECK_PETSC_ERROR(err);
     // Loop over cells in fault mesh, set partition
-    err = VecGetArray(partitionVec, &partitionArray);CHECK_PETSC_ERROR(err);
     for(PetscInt c = cStart; c < cEnd; ++c) {
-      PetscInt dof, off;
-
-      err = PetscSectionGetDof(partitionSection, c, &dof);CHECK_PETSC_ERROR(err);
-      err = PetscSectionGetOffset(partitionSection, c, &off);CHECK_PETSC_ERROR(err);
-      assert(dof == 1);
+      const PetscInt off = partitionVisitor.sectionOffset(c);
+      assert(1 == partitionVisitor.sectionDof(c));
       partitionArray[off] = rank;
     } // for
-    err = VecRestoreArray(partitionVec, &partitionArray);CHECK_PETSC_ERROR(err);
 
     PYLITH_METHOD_RETURN(partition);
-
   } // if
 
   // Should not reach this point if requested field was found
@@ -1910,7 +1886,6 @@
   // Satisfy return values
   assert(_fields);
   const topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
-
   PYLITH_METHOD_RETURN(buffer);
 } // cellField
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveTract.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveTract.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveTract.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -55,8 +55,10 @@
 pylith::faults::FaultCohesiveTract::initialize(const topology::Mesh& mesh,
 					       const PylithScalar upDir[3])
 { // initialize
-  assert(0 != upDir);
-  assert(0 != _quadrature);
+  PYLITH_METHOD_BEGIN;
+  
+  assert(upDir);
+  assert(_quadrature);
 
   delete _faultMesh; _faultMesh = new topology::SubMesh();
   CohesiveTopology::createFaultParallel(_faultMesh, mesh, id(),
@@ -70,6 +72,7 @@
   // Initialize quadrature geometry.
   _quadrature->initializeGeometry();
 
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -99,6 +102,8 @@
 void
 pylith::faults::FaultCohesiveTract::verifyConfiguration(const topology::Mesh& mesh) const
 { // verifyConfiguration
+  PYLITH_METHOD_BEGIN;
+  
   assert(_quadrature);
 
   const PetscDM dmMesh = mesh.dmMesh();assert(dmMesh);
@@ -140,6 +145,8 @@
       throw std::runtime_error(msg.str());
     } // if
   } // for
+
+  PYLITH_METHOD_END;
 } // verifyConfiguration
 
 // ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/LiuCosSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/LiuCosSlipFn.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/LiuCosSlipFn.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -58,11 +58,15 @@
 void 
 pylith::faults::LiuCosSlipFn::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   SlipTimeFn::deallocate();
 
   _dbFinalSlip = 0; // :TODO: Use shared pointer.
   _dbSlipTime = 0; // :TODO: Use shared pointer.
   _dbRiseTime = 0; // :TODO: Use shared pointer.
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -72,6 +76,8 @@
 					 const spatialdata::units::Nondimensional& normalizer,
 					 const PylithScalar originTime)
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   assert(_dbFinalSlip);
   assert(_dbSlipTime);
   assert(_dbRiseTime);
@@ -221,6 +227,8 @@
   _dbFinalSlip->close();
   _dbSlipTime->close();
   _dbRiseTime->close();
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -229,6 +237,8 @@
 pylith::faults::LiuCosSlipFn::slip(topology::Field<topology::SubMesh>* slip,
 				   const PylithScalar t)
 { // slip
+  PYLITH_METHOD_BEGIN;
+
   assert(slip);
   assert(_parameters);
 
@@ -281,6 +291,8 @@
   } // for
 
   PetscLogFlops((vEnd-vStart) * (2+28 + 3*_slipVertex.size()));
+
+  PYLITH_METHOD_END;
 } // slip
 
 // ----------------------------------------------------------------------
@@ -288,7 +300,9 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::LiuCosSlipFn::finalSlip(void)
 { // finalSlip
-  return _parameters->get("final slip");
+  PYLITH_METHOD_BEGIN;
+
+  PYLITH_METHOD_RETURN(_parameters->get("final slip"));
 } // finalSlip
 
 // ----------------------------------------------------------------------
@@ -296,7 +310,9 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::LiuCosSlipFn::slipTime(void)
 { // slipTime
-  return _parameters->get("slip time");
+  PYLITH_METHOD_BEGIN;
+
+  PYLITH_METHOD_RETURN(_parameters->get("slip time"));
 } // slipTime
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/SlipTimeFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/SlipTimeFn.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/SlipTimeFn.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -43,7 +43,11 @@
 void 
 pylith::faults::SlipTimeFn::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   delete _parameters; _parameters = 0;
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/StepSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/StepSlipFn.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/StepSlipFn.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -56,10 +56,14 @@
 void 
 pylith::faults::StepSlipFn::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   SlipTimeFn::deallocate();
 
   _dbFinalSlip = 0; // :TODO: Use shared pointer
   _dbSlipTime = 0; // :TODO: Use shared pointer
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -69,6 +73,8 @@
 				       const spatialdata::units::Nondimensional& normalizer,
 				       const PylithScalar originTime)
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   assert(_dbFinalSlip);
   assert(_dbSlipTime);
 
@@ -189,6 +195,8 @@
   // Close databases
   _dbFinalSlip->close();
   _dbSlipTime->close();
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -197,6 +205,8 @@
 pylith::faults::StepSlipFn::slip(topology::Field<topology::SubMesh>* slip,
 				 const PylithScalar t)
 { // slip
+  PYLITH_METHOD_BEGIN;
+
   assert(slip);
   assert(_parameters);
 
@@ -237,6 +247,8 @@
   } // for
 
   PetscLogFlops((vEnd-vStart) * 1);
+
+  PYLITH_METHOD_END;
 } // slip
 
 // ----------------------------------------------------------------------
@@ -244,7 +256,9 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::StepSlipFn::finalSlip(void)
 { // finalSlip
-  return _parameters->get("final slip");
+  PYLITH_METHOD_BEGIN;
+
+  PYLITH_METHOD_RETURN(_parameters->get("final slip"));
 } // finalSlip
 
 // ----------------------------------------------------------------------
@@ -252,7 +266,9 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::StepSlipFn::slipTime(void)
 { // slipTime
-  return _parameters->get("slip time");
+  PYLITH_METHOD_BEGIN;
+
+  PYLITH_METHOD_RETURN(_parameters->get("slip time"));
 } // slipTime
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/TimeHistorySlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/TimeHistorySlipFn.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/TimeHistorySlipFn.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -59,6 +59,8 @@
 void 
 pylith::faults::TimeHistorySlipFn::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   SlipTimeFn::deallocate();
 
   _dbAmplitude = 0; // :TODO: Use shared pointer
@@ -66,6 +68,8 @@
   if (_dbTimeHistory)
     _dbTimeHistory->close();
   _dbTimeHistory = 0; // :TODO: Use shared pointer
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -75,6 +79,8 @@
 					      const spatialdata::units::Nondimensional& normalizer,
 					      const PylithScalar originTime)
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   assert(_dbAmplitude);
   assert(_dbSlipTime);
 
@@ -199,6 +205,8 @@
   // Open time history database.
   _dbTimeHistory->open();
   _timeScale = timeScale;
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -207,6 +215,8 @@
 pylith::faults::TimeHistorySlipFn::slip(topology::Field<topology::SubMesh>* slip,
 					const PylithScalar t)
 { // slip
+  PYLITH_METHOD_BEGIN;
+
   assert(slip);
   assert(_parameters);
   assert(_dbTimeHistory);
@@ -259,6 +269,8 @@
   } // for
 
   PetscLogFlops((vEnd-vStart) * 3);
+
+  PYLITH_METHOD_END;
 } // slip
 
 // ----------------------------------------------------------------------
@@ -266,7 +278,9 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::TimeHistorySlipFn::finalSlip(void)
 { // finalSlip
-  return _parameters->get("slip amplitude");
+  PYLITH_METHOD_BEGIN;
+
+  PYLITH_METHOD_RETURN(_parameters->get("slip amplitude"));
 } // finalSlip
 
 // ----------------------------------------------------------------------
@@ -274,7 +288,9 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::TimeHistorySlipFn::slipTime(void)
 { // slipTime
-  return _parameters->get("slip time");
+  PYLITH_METHOD_BEGIN;
+
+  PYLITH_METHOD_RETURN(_parameters->get("slip time"));
 } // slipTime
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/TractPerturbation.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/TractPerturbation.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/TractPerturbation.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -59,9 +59,13 @@
 void 
 pylith::faults::TractPerturbation::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   TimeDependent::deallocate();
 
   delete _parameters; _parameters = 0;
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -87,6 +91,8 @@
 					      const topology::Field<topology::SubMesh>& faultOrientation, 
 					      const spatialdata::units::Nondimensional& normalizer)
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   const PylithScalar pressureScale = normalizer.pressureScale();
   const PylithScalar timeScale = normalizer.timeScale();
   const PylithScalar rateScale = pressureScale / timeScale;
@@ -243,6 +249,8 @@
     if (_dbTimeHistory)
       _dbTimeHistory->open();
   } // if
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -250,6 +258,8 @@
 void
 pylith::faults::TractPerturbation::calculate(const PylithScalar t)
 { // calculate
+  PYLITH_METHOD_BEGIN;
+
   assert(_parameters);
 
   const PylithScalar timeScale = _timeScale;
@@ -354,6 +364,8 @@
   delete rateTimeVisitor; rateTimeVisitor = 0;
   delete changeVisitor; changeVisitor = 0;
   delete changeTimeVisitor; changeTimeVisitor = 0;
+
+  PYLITH_METHOD_END;
 }  // calculate
 
 
@@ -382,23 +394,25 @@
 pylith::faults::TractPerturbation::vertexField(const char* name,
 					       const topology::SolutionFields* const fields)
 { // vertexField
+  PYLITH_METHOD_BEGIN;
+
   assert(_parameters);
   assert(name);
 
   if (0 == strcasecmp(name, "traction_initial_value"))
-    return _parameters->get("initial");
+    PYLITH_METHOD_RETURN(_parameters->get("initial"));
 
   else if (0 == strcasecmp(name, "traction_rate_of_change"))
-    return _parameters->get("rate");
+    PYLITH_METHOD_RETURN(_parameters->get("rate"));
 
   else if (0 == strcasecmp(name, "traction_change_in_value"))
-    return _parameters->get("change");
+    PYLITH_METHOD_RETURN(_parameters->get("change"));
 
   else if (0 == strcasecmp(name, "traction_rate_start_time"))
-    return _parameters->get("rate time");
+    PYLITH_METHOD_RETURN(_parameters->get("rate time"));
 
   else if (0 == strcasecmp(name, "traction_change_start_time"))
-    return _parameters->get("change time");
+    PYLITH_METHOD_RETURN(_parameters->get("change time"));
 
   else {
     std::ostringstream msg;
@@ -407,7 +421,7 @@
     throw std::runtime_error(msg.str());
   } // else
 
-  return _parameters->get("traction"); // Satisfy method definition
+  PYLITH_METHOD_RETURN(_parameters->get("traction")); // Satisfy method definition
 } // vertexField
 
 // ----------------------------------------------------------------------
@@ -427,6 +441,8 @@
 					    const PylithScalar scale,
 					    const spatialdata::units::Nondimensional& normalizer)
 { // _queryDB
+  PYLITH_METHOD_BEGIN;
+
   assert(name);
   assert(db);
   assert(_parameters);
@@ -481,6 +497,8 @@
       parametersArray[off+i] = valueVertex[i];
     } // for
   } // for
+
+  PYLITH_METHOD_END;
 } // _queryDB
 
 // End of file

Modified: short/3D/PyLith/trunk/libsrc/pylith/friction/FrictionModel.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/friction/FrictionModel.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/friction/FrictionModel.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -66,6 +66,8 @@
 void
 pylith::friction::FrictionModel::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   delete _normalizer; _normalizer = 0;
   delete _fieldsPropsStateVars; _fieldsPropsStateVars = 0;
   _propsFiberDim = 0;
@@ -73,6 +75,8 @@
 
   _dbProperties = 0; // :TODO: Use shared pointer.
   _dbInitialState = 0; // :TODO: Use shared pointer.
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -80,10 +84,14 @@
 void
 pylith::friction::FrictionModel::normalizer(const spatialdata::units::Nondimensional& dim)
 { // normalizer
+  PYLITH_METHOD_BEGIN;
+
   if (!_normalizer)
     _normalizer = new spatialdata::units::Nondimensional(dim);
   else
     *_normalizer = dim;
+
+  PYLITH_METHOD_END;
 } // normalizer
 
 // ----------------------------------------------------------------------
@@ -92,6 +100,8 @@
 pylith::friction::FrictionModel::initialize(const topology::SubMesh& faultMesh,
 					    feassemble::Quadrature<topology::SubMesh>* quadrature)
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   assert(_dbProperties);
 
   // Get vertices associated with friction interface
@@ -231,6 +241,8 @@
 
   // Setup buffers for restrict/update of properties and state variables.
   _propsStateVarsVertex.resize(_propsFiberDim+_varsFiberDim);
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -238,8 +250,10 @@
 const pylith::topology::Fields<pylith::topology::Field<pylith::topology::SubMesh> >&
 pylith::friction::FrictionModel::fieldsPropsStateVars(void) const
 { // fieldsPropsStateVars
+  PYLITH_METHOD_BEGIN;
+
   assert(_fieldsPropsStateVars);
-  return *_fieldsPropsStateVars;
+  PYLITH_METHOD_RETURN(*_fieldsPropsStateVars);
 } // fieldsPropsStateVars
 
 // ----------------------------------------------------------------------
@@ -247,6 +261,8 @@
 bool
 pylith::friction::FrictionModel::hasPropStateVar(const char* name)
 { // hasPropStateVar
+  PYLITH_METHOD_BEGIN;
+
   if (_fieldsPropsStateVars) {
     return _fieldsPropsStateVars->hasField(name);
   } else {
@@ -254,14 +270,14 @@
     const int numProperties = _metadata.numProperties();
     for (int i=0; i < numProperties; ++i)
       if (_metadata.getProperty(i).name == nameString)
-	return true;
+	PYLITH_METHOD_RETURN(true);
     const int numStateVars = _metadata.numStateVars();
     for (int i=0; i < numStateVars; ++i)
       if (_metadata.getStateVar(i).name == nameString)
-	return true;
+	PYLITH_METHOD_RETURN(true);
   } // if/else
 
-  return false;
+  PYLITH_METHOD_RETURN(false);
 } // hasPropStateVar
 
 // ----------------------------------------------------------------------
@@ -277,10 +293,12 @@
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::friction::FrictionModel::getField(const char* name)
 { // getField
+  PYLITH_METHOD_BEGIN;
+
   assert(name);
   assert(_fieldsPropsStateVars);
 
-  return _fieldsPropsStateVars->get(name);
+  PYLITH_METHOD_RETURN(_fieldsPropsStateVars->get(name));
 } // getField
   
 // ----------------------------------------------------------------------
@@ -288,6 +306,8 @@
 void
 pylith::friction::FrictionModel::retrievePropsStateVars(const int point)
 { // retrievePropsStateVars
+  PYLITH_METHOD_BEGIN;
+
   assert(_fieldsPropsStateVars);
   PetscInt iOff = 0;
 
@@ -316,6 +336,8 @@
     } // for
   } // for
   assert(_propsStateVarsVertex.size() == iOff);
+
+  PYLITH_METHOD_END;
 } // retrievePropsStateVars
 
 // ----------------------------------------------------------------------
@@ -326,6 +348,8 @@
                                               const PylithScalar slipRate,
                                               const PylithScalar normalTraction)
 { // calcFriction
+  PYLITH_METHOD_BEGIN;
+
   assert(_fieldsPropsStateVars);
 
   assert(_propsFiberDim+_varsFiberDim == _propsStateVarsVertex.size());
@@ -337,7 +361,7 @@
 					      propertiesVertex, _propsFiberDim,
 					      stateVarsVertex, _varsFiberDim);
   
-  return friction;
+  PYLITH_METHOD_RETURN(friction);
 } // calcFriction
 
 // ----------------------------------------------------------------------
@@ -349,9 +373,11 @@
 						 const PylithScalar normalTraction,
 						 const int vertex)
 { // updateStateVars
+  PYLITH_METHOD_BEGIN;
+
   assert(_fieldsPropsStateVars);
   if (0 == _varsFiberDim)
-    return;
+    PYLITH_METHOD_END;
 
   const PylithScalar* propertiesVertex = &_propsStateVarsVertex[0];
   PylithScalar* stateVarsVertex = &_propsStateVarsVertex[_propsFiberDim];
@@ -387,6 +413,8 @@
     } // for
   } // for
   assert(_propsStateVarsVertex.size() == iOff);
+
+  PYLITH_METHOD_END;
 } // updateStateVars
 
 // ----------------------------------------------------------------------
@@ -409,6 +437,8 @@
 void
 pylith::friction::FrictionModel::_setupPropsStateVars(void)
 { // _setupPropsStateVars
+  PYLITH_METHOD_BEGIN;
+
   // Determine number of values needed to store physical properties.
   const int numProperties = _metadata.numProperties();
   _propsFiberDim = 0;
@@ -464,6 +494,8 @@
     iScale += stateVar.fiberDim;
   } // for
   assert(_varsFiberDim >= 0);
+
+  PYLITH_METHOD_END;
 } // _setupPropsStateVars
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/materials/ElasticMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/materials/ElasticMaterial.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/materials/ElasticMaterial.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -67,11 +67,15 @@
 void
 pylith::materials::ElasticMaterial::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   Material::deallocate();
   delete _initialFields; _initialFields = 0;
 
   _dbInitialStress = 0; // :TODO: Use shared pointer.
   _dbInitialStrain = 0; // :TODO: Use shared pointer.
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -81,6 +85,8 @@
 pylith::materials::ElasticMaterial::initialize(const topology::Mesh& mesh,
 					       feassemble::Quadrature<topology::Mesh>* quadrature)
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   Material::initialize(mesh, quadrature);
 
   assert(0 != quadrature);
@@ -93,6 +99,8 @@
   _initializeInitialStress(mesh, quadrature);
   _initializeInitialStrain(mesh, quadrature);
   _allocateCellArrays();
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -100,6 +108,8 @@
 void
 pylith::materials::ElasticMaterial::retrievePropsAndVars(const int cell)
 { // retrievePropsAndVars
+  PYLITH_METHOD_BEGIN;
+
   assert(_properties);
   assert(_stateVars);
 
@@ -154,6 +164,8 @@
       } // for
     } // if
   } // if
+
+  PYLITH_METHOD_END;
 } // retrievePropsAndVars
 
 // ----------------------------------------------------------------------
@@ -162,6 +174,8 @@
 pylith::materials::ElasticMaterial::calcStress(const scalar_array& totalStrain,
 					       const bool computeStateVars)
 { // calcStress
+  PYLITH_METHOD_BEGIN;
+
   const int numQuadPts = _numQuadPts;
   const int numPropsQuadPt = _numPropsQuadPt;
   const int tensorSize = _tensorSize;
@@ -182,7 +196,7 @@
 		&_initialStrainCell[iQuad*_tensorSize], _tensorSize,
 		computeStateVars);
 
-  return _stressCell;
+  PYLITH_METHOD_RETURN(_stressCell);
 } // calcStress
 
 // ----------------------------------------------------------------------
@@ -190,6 +204,8 @@
 const pylith::scalar_array&
 pylith::materials::ElasticMaterial::calcDerivElastic(const scalar_array& totalStrain)
 { // calcDerivElastic
+  PYLITH_METHOD_BEGIN;
+
   const int numQuadPts = _numQuadPts;
   const int numPropsQuadPt = _numPropsQuadPt;
   const int tensorSize = _tensorSize;
@@ -211,7 +227,7 @@
 		       &_initialStressCell[iQuad*_tensorSize], _tensorSize,
 		       &_initialStrainCell[iQuad*_tensorSize], _tensorSize);
 
-  return _elasticConstsCell;
+  PYLITH_METHOD_RETURN(_elasticConstsCell);
 } // calcDerivElastic
 
 // ----------------------------------------------------------------------
@@ -220,6 +236,8 @@
 pylith::materials::ElasticMaterial::updateStateVars(const scalar_array& totalStrain,
 						    const int cell)
 { // updateStateVars
+  PYLITH_METHOD_BEGIN;
+
   const int numQuadPts = _numQuadPts;
   const int numPropsQuadPt = _numPropsQuadPt;
   const int tensorSize = _tensorSize;
@@ -246,6 +264,8 @@
   for (PetscInt d = 0; d < stateVarsSize; ++d) {
     stateVarsArray[soff+d] = _stateVarsCell[d];
   } // for
+
+  PYLITH_METHOD_END;
 } // updateStateVars
 
 // ----------------------------------------------------------------------
@@ -254,6 +274,8 @@
 pylith::materials::ElasticMaterial::stableTimeStepImplicit(const topology::Mesh& mesh,
 							   topology::Field<topology::Mesh>* field)
 { // stableTimeStepImplicit
+  PYLITH_METHOD_BEGIN;
+
   const int numQuadPts = _numQuadPts;
   const int numPropsQuadPt = _numPropsQuadPt;
   const int tensorSize = _tensorSize;
@@ -329,7 +351,7 @@
   } // for
   delete fieldVisitor; fieldVisitor = 0;
 
-  return dtStable;
+  PYLITH_METHOD_RETURN(dtStable);
 } // stableTimeStepImplicit
 
 // ----------------------------------------------------------------------
@@ -339,6 +361,8 @@
 							   feassemble::Quadrature<topology::Mesh>* quadrature,
 							   topology::Field<topology::Mesh>* field)
 { // stableTimeStepImplicit
+  PYLITH_METHOD_BEGIN;
+
   assert(quadrature);
 
   const int numQuadPts = _numQuadPts;
@@ -431,7 +455,7 @@
   } // for
   delete fieldVisitor; fieldVisitor = 0;
 
-  return dtStable;
+  PYLITH_METHOD_RETURN(dtStable);
 } // stableTimeStepExplicit
 
 // ----------------------------------------------------------------------
@@ -440,6 +464,8 @@
 pylith::materials::ElasticMaterial::_stableTimeStepImplicitMax(const topology::Mesh& mesh,
 							       topology::Field<topology::Mesh>* field)
 { // _stableTimeStepImplicitMax
+  PYLITH_METHOD_BEGIN;
+
   const PylithScalar dtStable = pylith::PYLITH_MAXSCALAR;
   
   if (field) {
@@ -503,7 +529,7 @@
     err = ISDestroy(&cellIS);CHECK_PETSC_ERROR(err);
   } // if
   
-  return dtStable;
+  PYLITH_METHOD_RETURN(dtStable);
 } // _stableTimeStepImplicitMax
 
 // ----------------------------------------------------------------------
@@ -511,6 +537,8 @@
 void
 pylith::materials::ElasticMaterial::_allocateCellArrays(void)
 { // _allocateCellArrays
+  PYLITH_METHOD_BEGIN;
+
   const int numQuadPts = _numQuadPts;
   const int tensorSize = _tensorSize;
   const int numPropsQuadPt = _numPropsQuadPt;
@@ -524,6 +552,8 @@
   _densityCell.resize(numQuadPts);
   _stressCell.resize(numQuadPts * tensorSize);
   _elasticConstsCell.resize(numQuadPts * numElasticConsts);
+
+  PYLITH_METHOD_END;
 } // _allocateCellArrays
 
 // ----------------------------------------------------------------------
@@ -532,8 +562,10 @@
 pylith::materials::ElasticMaterial::_initializeInitialStress(const topology::Mesh& mesh,
 							     feassemble::Quadrature<topology::Mesh>* quadrature)
 { // _initializeInitialStress
+  PYLITH_METHOD_BEGIN;
+
   if (!_dbInitialStress)
-    return;
+    PYLITH_METHOD_END;
 
   assert(_initialFields);
   _initialFields->add("initial stress", "initial_stress");
@@ -658,6 +690,8 @@
 
   // Close databases
   _dbInitialStress->close();
+
+  PYLITH_METHOD_END;
 } // _initializeInitialStress
 
 // ----------------------------------------------------------------------
@@ -666,8 +700,10 @@
 pylith::materials::ElasticMaterial::_initializeInitialStrain(const topology::Mesh& mesh,
 							     feassemble::Quadrature<topology::Mesh>* quadrature)
 { // _initializeInitialStrain
+  PYLITH_METHOD_BEGIN;
+
   if (!_dbInitialStrain)
-    return;
+    PYLITH_METHOD_END;
 
   assert(_initialFields);
   _initialFields->add("initial strain", "initial_strain");
@@ -787,6 +823,8 @@
 
   // Close databases
   _dbInitialStrain->close();
+
+  PYLITH_METHOD_END;
 } // _initializeInitialStrain
 
 // ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/libsrc/pylith/materials/Material.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/materials/Material.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/materials/Material.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -83,12 +83,16 @@
 void
 pylith::materials::Material::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   delete _normalizer; _normalizer = 0;
   delete _properties; _properties = 0;
   delete _stateVars; _stateVars = 0;
 
   _dbProperties = 0; // :TODO: Use shared pointer.
   _dbInitialState = 0; // :TODO: Use shared pointer.
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -96,10 +100,14 @@
 void
 pylith::materials::Material::normalizer(const spatialdata::units::Nondimensional& dim)
 { // normalizer
+  PYLITH_METHOD_BEGIN;
+
   if (!_normalizer)
     _normalizer = new spatialdata::units::Nondimensional(dim);
   else
     *_normalizer = dim;
+
+  PYLITH_METHOD_END;
 } // normalizer
 
 // ----------------------------------------------------------------------
@@ -108,6 +116,8 @@
 pylith::materials::Material::initialize(const topology::Mesh& mesh,
 					feassemble::Quadrature<topology::Mesh>* quadrature)
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   assert(_dbProperties);
   assert(quadrature);
 
@@ -261,6 +271,8 @@
   _dbProperties->close();
   if (_dbInitialState)
     _dbInitialState->close();
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -284,10 +296,13 @@
 bool
 pylith::materials::Material::hasProperty(const char* name)
 { // hasProperty
+  PYLITH_METHOD_BEGIN;
+
   int propertyIndex = -1;
   int stateVarIndex = -1;
   _findField(&propertyIndex, &stateVarIndex, name);
-  return (propertyIndex >= 0);
+
+  PYLITH_METHOD_RETURN(propertyIndex >= 0);
 } // hasProperty
 
 // ----------------------------------------------------------------------
@@ -295,10 +310,13 @@
 bool
 pylith::materials::Material::hasStateVar(const char* name)
 { // hasStateVar
+  PYLITH_METHOD_BEGIN;
+
   int propertyIndex = -1;
   int stateVarIndex = -1;
   _findField(&propertyIndex, &stateVarIndex, name);
-  return (stateVarIndex >= 0);
+
+  PYLITH_METHOD_RETURN(stateVarIndex >= 0);
 } // hasStateVar
 
 // ----------------------------------------------------------------------
@@ -307,6 +325,8 @@
 pylith::materials::Material::getField(topology::Field<topology::Mesh> *field,
 				      const char* name) const
 { // getField
+  PYLITH_METHOD_BEGIN;
+
   assert(field);
   assert(_properties);
   assert(_stateVars);
@@ -497,6 +517,8 @@
       throw std::logic_error("Bad vector field type for Material.");
     } // switch
   field->vectorFieldType(multiType);
+
+  PYLITH_METHOD_END;
 } // getField
   
 // ----------------------------------------------------------------------
@@ -506,6 +528,8 @@
 					int* stateVarIndex,
 					const char* name) const
 { // _findField
+  PYLITH_METHOD_BEGIN;
+
   assert(propertyIndex);
   assert(stateVarIndex);
 
@@ -517,15 +541,17 @@
   for (int i=0; i < numProperties; ++i)
     if (nameString == _metadata.getProperty(i).name) {
       *propertyIndex = i;
-      return;
+      PYLITH_METHOD_END;
     } // if
 
   const int numStateVars = _metadata.numStateVars();
   for (int i=0; i < numStateVars; ++i)
     if (nameString == _metadata.getStateVar(i).name) {
       *stateVarIndex = i;
-      return;
+      PYLITH_METHOD_END;
     } // if
+
+  PYLITH_METHOD_END;
 } // _findField
   
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -34,6 +34,8 @@
   _matrix(0),
   _valuesChanged(true)
 { // constructor
+  PYLITH_METHOD_BEGIN;
+
   PetscDM dmMesh = field.dmMesh();assert(dmMesh);
 
   // Set blockFlag to -1 if okay to set block size equal to fiber
@@ -44,6 +46,8 @@
   PetscErrorCode err = DMCreateMatrix(dmMesh, matrixType, &_matrix);CHECK_PETSC_ERROR_MSG(err, msg);
 
   _type = matrixType;
+
+  PYLITH_METHOD_END;
 } // constructor
 
 // ----------------------------------------------------------------------
@@ -54,6 +58,8 @@
   _matrix(0),
   _valuesChanged(true)
 { // constructor
+  PYLITH_METHOD_BEGIN;
+
   PetscDM dmMesh = field.dmMesh();assert(dmMesh);
 
   // Set blockFlag to -1 if okay to set block size equal to fiber
@@ -64,6 +70,8 @@
   PetscErrorCode err = DMCreateMatrix(dmMesh, matrixType, &_matrix);CHECK_PETSC_ERROR_MSG(err, msg);
 
   _type = matrixType;
+
+  PYLITH_METHOD_END;
 } // constructor
 
 // ----------------------------------------------------------------------
@@ -78,7 +86,11 @@
 void
 pylith::topology::Jacobian::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   PetscErrorCode err = MatDestroy(&_matrix);CHECK_PETSC_ERROR(err);
+
+  PYLITH_METHOD_END;
 } // deallocate
 
 // ----------------------------------------------------------------------
@@ -110,6 +122,8 @@
 void
 pylith::topology::Jacobian::assemble(const char* mode)
 { // assemble
+  PYLITH_METHOD_BEGIN;
+
   PetscErrorCode err = 0;
   if (0 == strcmp(mode, "final_assembly")) {
     err = MatAssemblyBegin(_matrix, MAT_FINAL_ASSEMBLY);CHECK_PETSC_ERROR(err);
@@ -150,6 +164,8 @@
 			     "associated with system Jacobian.");
 
   _valuesChanged = true;
+
+  PYLITH_METHOD_END;
 } // assemble
 
 // ----------------------------------------------------------------------
@@ -157,8 +173,12 @@
 void
 pylith::topology::Jacobian::zero(void)
 { // zero
+  PYLITH_METHOD_BEGIN;
+
   PetscErrorCode err = MatZeroEntries(_matrix);CHECK_PETSC_ERROR(err);
   _valuesChanged = true;
+
+  PYLITH_METHOD_END;
 } // zero
 
 // ----------------------------------------------------------------------
@@ -166,7 +186,11 @@
 void
 pylith::topology::Jacobian::view(void) const
 { // view
+  PYLITH_METHOD_BEGIN;
+
   PetscErrorCode err = MatView(_matrix, PETSC_VIEWER_STDOUT_WORLD);CHECK_PETSC_ERROR(err);
+
+  PYLITH_METHOD_END;
 } // view
 
 // ----------------------------------------------------------------------
@@ -175,11 +199,15 @@
 pylith::topology::Jacobian::write(const char* filename,
                                   const MPI_Comm comm)
 { // write
+  PYLITH_METHOD_BEGIN;
+
   PetscViewer viewer;
   PetscErrorCode err = PetscViewerBinaryOpen(comm, filename, FILE_MODE_WRITE, &viewer);CHECK_PETSC_ERROR(err);
 
   err = MatView(_matrix, viewer); CHECK_PETSC_ERROR(err);
   err = PetscViewerDestroy(&viewer); CHECK_PETSC_ERROR(err);
+
+  PYLITH_METHOD_END;
 } // write
 
 // ----------------------------------------------------------------------
@@ -187,6 +215,8 @@
 void
 pylith::topology::Jacobian::verifySymmetry(void) const
 { // verifySymmetry
+  PYLITH_METHOD_BEGIN;
+
   const PetscMat matSparse = _matrix;
   PetscErrorCode err;
 
@@ -236,6 +266,8 @@
   err = MatDestroy(&matSparseAIJ);CHECK_PETSC_ERROR(err);
   if (!isSymmetric)
     throw std::runtime_error("Jacobian matrix is not symmetric.");
+
+  PYLITH_METHOD_END;
 } // verifySymmetry
 
 // ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOps.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOps.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOps.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -38,6 +38,8 @@
 					    int* const materialIds,
 					    const int numMaterials)
 { // checkMaterialIds
+  PYLITH_METHOD_BEGIN;
+
   assert((!numMaterials && !materialIds) || (numMaterials && materialIds));
   PetscErrorCode err;
 
@@ -95,6 +97,7 @@
     } // if
   } // for
   
+  PYLITH_METHOD_END;
 } // checkMaterialIds
 
 
@@ -103,11 +106,14 @@
 pylith::topology::MeshOps::numMaterialCells(const Mesh& mesh,
 					    int materialId)
 { // numMaterialCells
+  PYLITH_METHOD_BEGIN;
+
   PetscInt ncells = 0;
 
   PetscDM dmMesh = mesh.dmMesh();assert(dmMesh);
   PetscErrorCode err = DMPlexGetStratumSize(dmMesh, "material-id", materialId, &ncells);CHECK_PETSC_ERROR(err);
-  return ncells;
+
+  PYLITH_METHOD_RETURN(ncells);
 } // numMaterialCells
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.cc	2013-03-27 22:41:46 UTC (rev 21667)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.cc	2013-03-27 22:43:22 UTC (rev 21668)
@@ -50,7 +50,11 @@
   _coordsys(0),
   _debug(false)
 { // constructor
+  PYLITH_METHOD_BEGIN;
+
   createSubMesh(mesh, label);
+
+  PYLITH_METHOD_END;
 } // constructor
 
 // ----------------------------------------------------------------------
@@ -65,8 +69,12 @@
 void
 pylith::topology::SubMesh::deallocate(void)
 { // deallocate
+  PYLITH_METHOD_BEGIN;
+
   delete _coordsys; _coordsys = 0;
   _mesh.destroy();
+
+  PYLITH_METHOD_END;
 } // deallocate
   
 // ----------------------------------------------------------------------
@@ -75,6 +83,8 @@
 pylith::topology::SubMesh::createSubMesh(const Mesh& mesh,
 					 const char* label)
 { // createSieveMesh
+  PYLITH_METHOD_BEGIN;
+
 #if defined(ALLOW_SIEVE_MESH) // :TODO: REMOVE SIEVE STUFF
   _mesh.destroy();
 
@@ -175,6 +185,8 @@
 	<< "Submeshes must be one dimension lower than the domain mesh.";
     throw std::runtime_error(msg.str());
   } // if
+
+  PYLITH_METHOD_END;
 } // createSubMesh
 
 // ----------------------------------------------------------------------
@@ -182,12 +194,16 @@
 void
 pylith::topology::SubMesh::coordsys(const Mesh& mesh)
 { // coordsys
+  PYLITH_METHOD_BEGIN;
+
   delete _coordsys; _coordsys = 0;
   const spatialdata::geocoords::CoordSys* cs = mesh.coordsys();
   if (cs) {
     _coordsys = cs->clone();assert(_coordsys);
     _coordsys->initialize();
   } // if
+
+  PYLITH_METHOD_END;
 } // coordsys
 
 // ----------------------------------------------------------------------
@@ -195,8 +211,12 @@
 void 
 pylith::topology::SubMesh::initialize(void)
 { // initialize
+  PYLITH_METHOD_BEGIN;
+
   if (_coordsys)
     _coordsys->initialize();
+
+  PYLITH_METHOD_END;
 } // initialize
 
 // End of file 



More information about the CIG-COMMITS mailing list