[cig-commits] r21605 - short/3D/PyLith/trunk/libsrc/pylith/faults

brad at geodynamics.org brad at geodynamics.org
Thu Mar 21 13:10:59 PDT 2013


Author: brad
Date: 2013-03-21 13:10:58 -0700 (Thu, 21 Mar 2013)
New Revision: 21605

Modified:
   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/FaultCohesiveDyn.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveLagrange.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/LiuCosSlipFn.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/StaticPerturbation.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
Log:
Code cleanup. Remove ALE memory logger stuff.

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/BruneSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/BruneSlipFn.cc	2013-03-21 20:04:45 UTC (rev 21604)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/BruneSlipFn.cc	2013-03-21 20:10:58 UTC (rev 21605)
@@ -87,9 +87,6 @@
   PetscErrorCode err;
   err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
 
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Fault");
-
   delete _parameters; _parameters = new topology::Fields<topology::Field<topology::SubMesh> >(faultMesh);
   assert(_parameters);
   _parameters->add("final slip", "final_slip");
@@ -122,8 +119,6 @@
   PetscVec riseTimeVec = riseTime.localVector();assert(riseTimeVec);
   PetscScalar *riseTimeArray = NULL;
 
-  logger.stagePop();
-
   // Open databases and set query values
   _dbFinalSlip->open();
   switch (spaceDim)

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/ConstRateSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/ConstRateSlipFn.cc	2013-03-21 20:04:45 UTC (rev 21604)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/ConstRateSlipFn.cc	2013-03-21 20:10:58 UTC (rev 21605)
@@ -85,9 +85,6 @@
   PetscErrorCode err;
   err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
 
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Fault");
-
   delete _parameters; _parameters = new topology::Fields<topology::Field<topology::SubMesh> >(faultMesh);
   assert(_parameters);
   _parameters->add("slip rate", "slip_rate");
@@ -110,8 +107,6 @@
   PetscVec slipTimeVec = slipTime.localVector();assert(slipTimeVec);
   PetscScalar *slipTimeArray = NULL;
 
-  logger.stagePop();
-
   // Open databases and set query values
   _dbSlipRate->open();
   switch (spaceDim)

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc	2013-03-21 20:04:45 UTC (rev 21604)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc	2013-03-21 20:10:58 UTC (rev 21605)
@@ -151,9 +151,6 @@
   const spatialdata::geocoords::CoordSys* cs = mesh.coordsys();
   assert(cs);
 
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("FaultFields");
-
   // Create field for relative velocity associated with Lagrange vertex k
   _fields->add("relative velocity", "relative_velocity");
   topology::Field<topology::SubMesh>& velRel = _fields->get("relative velocity");
@@ -162,7 +159,6 @@
   velRel.vectorFieldType(topology::FieldBase::VECTOR);
   velRel.scale(_normalizer->lengthScale() / _normalizer->timeScale());
 
-  logger.stagePop();
 } // initialize
 
 // ----------------------------------------------------------------------
@@ -1665,13 +1661,8 @@
   // Allocate buffer for tractions field (if necessary).
   PetscSection tractionsSection = tractions->petscSection();
   if (!tractionsSection) {
-    ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-    logger.stagePush("FaultFields");
-
     const topology::Field<topology::SubMesh>& dispRel = _fields->get("relative disp");
     tractions->cloneSection(dispRel);
-
-    logger.stagePop();
   } // if
   const PylithScalar pressureScale = _normalizer->pressureScale();
   tractions->label("traction");

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveLagrange.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveLagrange.cc	2013-03-21 20:04:45 UTC (rev 21604)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveLagrange.cc	2013-03-21 20:10:58 UTC (rev 21605)
@@ -101,9 +101,6 @@
   _fields = new topology::Fields<topology::Field<topology::SubMesh> >(
     *_faultMesh);
 
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("FaultFields");
-
   // Allocate dispRel field
   _fields->add("relative disp", "relative_disp");
   topology::Field<topology::SubMesh>& dispRel = _fields->get("relative disp");
@@ -112,8 +109,6 @@
   dispRel.vectorFieldType(topology::FieldBase::VECTOR);
   dispRel.scale(_normalizer->lengthScale());
 
-  logger.stagePop();
-
   _quadrature->initializeGeometry();
 
 #if defined(PRECOMPUTE_GEOMETRY)
@@ -1370,9 +1365,6 @@
   PylithScalar jacobianDet = 0;
   scalar_array refCoordsVertex(cohesiveDim);
 
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("FaultFields");
-
   // Allocate orientation field.
   scalar_array orientationVertex(orientationSize);
   _fields->add("orientation", "orientation");
@@ -1393,8 +1385,6 @@
   PetscVec          orientationVec     = orientation.localVector();
   PetscScalar *orientationArray;
 
-  logger.stagePop();
-
   // Compute orientation of fault at constraint vertices
 
   // Get section containing coordinates of vertices
@@ -1658,9 +1648,6 @@
   err = DMPlexGetDepthStratum(faultDMMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
   err = DMPlexGetHeightStratum(faultDMMesh, 0, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
 
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("FaultFields");
-
   // Allocate area field.
   _fields->add("area", "area");
   topology::Field<topology::SubMesh>&       area    = _fields->get("area");
@@ -1676,8 +1663,6 @@
   PetscScalar *areaArray;
   assert(areaSection);assert(areaVec);
 
-  logger.stagePop();
-
   scalar_array coordinatesCell(numBasis*spaceDim);
   PetscSection coordSection;
   PetscVec          coordVec;
@@ -1759,13 +1744,9 @@
   // Allocate buffer for tractions field (if necessary).
   PetscSection tractionsSection = tractions->petscSection();
   if (!tractionsSection) {
-    ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-    logger.stagePush("FaultFields");
-
     const topology::Field<topology::SubMesh>& dispRel = _fields->get("relative disp");
     tractions->cloneSection(dispRel);
     tractionsSection = tractions->petscSection();
-    logger.stagePop();
   } // if
   PetscVec          tractionsVec = tractions->localVector();
   PetscScalar *tractionsArray;
@@ -1819,9 +1800,6 @@
   if (_fields->hasField("buffer (vector)"))
     return;
 
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("OutputFields");
-
   // Create vector field; use same shape/chart as relative
   // displacement field.
   assert(_faultMesh);
@@ -1832,8 +1810,6 @@
   buffer.cloneSection(dispRel);
   buffer.zero();
   assert(buffer.vectorFieldType() == topology::FieldBase::VECTOR);
-
-  logger.stagePop();
 } // _allocateBufferVectorField
 
 // ----------------------------------------------------------------------
@@ -1845,9 +1821,6 @@
   if (_fields->hasField("buffer (scalar)"))
     return;
 
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("OutputFields");
-
   // Create vector field; use same shape/chart as area field.
   assert(_faultMesh);
   _fields->add("buffer (scalar)", "buffer");
@@ -1858,8 +1831,6 @@
   buffer.scale(1.0);
   buffer.zero();
   assert(buffer.vectorFieldType() == topology::FieldBase::SCALAR);
-
-  logger.stagePop();
 } // _allocateBufferScalarField
 
 // ----------------------------------------------------------------------
@@ -1971,9 +1942,6 @@
     assert(faultDMMesh);
     err = DMPlexGetHeightStratum(faultDMMesh, 0, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
 
-    ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-    logger.stagePush("OutputFields");
-
     const int fiberDim = 1;
     _fields->add("partition", "partition", pylith::topology::FieldBase::CELLS_FIELD, fiberDim);
     topology::Field<topology::SubMesh>& partition = _fields->get("partition");
@@ -1999,8 +1967,6 @@
     } // for
     err = VecRestoreArray(partitionVec, &partitionArray);CHECK_PETSC_ERROR(err);
 
-    logger.stagePop();
-
     return partition;    
 
   } // if

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/LiuCosSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/LiuCosSlipFn.cc	2013-03-21 20:04:45 UTC (rev 21604)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/LiuCosSlipFn.cc	2013-03-21 20:10:58 UTC (rev 21605)
@@ -94,9 +94,6 @@
   assert(dmMesh);
   err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
 
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Fault");
-
   delete _parameters; _parameters = new topology::Fields<topology::Field<topology::SubMesh> >(faultMesh);
   assert(0 != _parameters);
   _parameters->add("final slip", "final_slip");
@@ -132,8 +129,6 @@
   PetscScalar *riseTimeArray;
   assert(riseTimeSection);assert(riseTimeVec);
 
-  logger.stagePop();
-
   // Open databases and set query values
   _dbFinalSlip->open();
   switch (spaceDim)

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/StaticPerturbation.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/StaticPerturbation.cc	2013-03-21 20:04:45 UTC (rev 21604)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/StaticPerturbation.cc	2013-03-21 20:10:58 UTC (rev 21605)
@@ -85,10 +85,6 @@
   const PylithScalar timeScale = normalizer.timeScale();
   const PylithScalar pressureScale = normalizer.pressureScale();
 
-  // Memory logging
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Fault");
-
   // Get vertices in fault mesh
   const ALE::Obj<SieveMesh>& sieveMesh = faultMesh.sieveMesh();
   assert(!sieveMesh.isNull());
@@ -109,8 +105,6 @@
   const ALE::Obj<RealSection>& amplitudeSection = amplitude.section();
   assert(!amplitudeSection.isNull());  
 
-  logger.stagePop();
-
   // Open databases and set query values
   _dbAmplitude->open();
   switch (spaceDim)

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/StepSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/StepSlipFn.cc	2013-03-21 20:04:45 UTC (rev 21604)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/StepSlipFn.cc	2013-03-21 20:10:58 UTC (rev 21605)
@@ -82,10 +82,6 @@
   const PylithScalar lengthScale = normalizer.lengthScale();
   const PylithScalar timeScale = normalizer.timeScale();
 
-  // Memory logging
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Fault");
-
   // Get vertices in fault mesh
   DM             dmMesh = faultMesh.dmMesh();
   PetscInt       vStart, vEnd;
@@ -119,8 +115,6 @@
   PetscScalar *slipTimeArray;
   assert(slipTimeSection);assert(slipTimeVec);
 
-  logger.stagePop();
-
   // Open databases and set query values
   _dbFinalSlip->open();
   switch (spaceDim)

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/TimeHistorySlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/TimeHistorySlipFn.cc	2013-03-21 20:04:45 UTC (rev 21604)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/TimeHistorySlipFn.cc	2013-03-21 20:10:58 UTC (rev 21605)
@@ -88,10 +88,6 @@
   const PylithScalar lengthScale = normalizer.lengthScale();
   const PylithScalar timeScale = normalizer.timeScale();
 
-  // Memory logging
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Fault");
-
   // Get vertices in fault mesh
   DM             dmMesh = faultMesh.dmMesh();
   PetscInt       vStart, vEnd;
@@ -125,8 +121,6 @@
   PetscScalar *slipTimeArray;
   assert(slipTimeSection);assert(slipTimeVec);
 
-  logger.stagePop();
-
   // Open databases and set query values
   _dbAmplitude->open();
   switch (spaceDim)

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/TractPerturbation.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/TractPerturbation.cc	2013-03-21 20:04:45 UTC (rev 21604)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/TractPerturbation.cc	2013-03-21 20:10:58 UTC (rev 21605)
@@ -84,16 +84,12 @@
 					      const topology::Field<topology::SubMesh>& faultOrientation, 
 					      const spatialdata::units::Nondimensional& normalizer)
 { // initialize
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Fault");
-
   const PylithScalar pressureScale = normalizer.pressureScale();
   const PylithScalar timeScale = normalizer.timeScale();
   const PylithScalar rateScale = pressureScale / timeScale;
   _timeScale = timeScale;
 
-  const spatialdata::geocoords::CoordSys* cs = faultMesh.coordsys();
-  assert(cs);
+  const spatialdata::geocoords::CoordSys* cs = faultMesh.coordsys();assert(cs);
   const int spaceDim = cs->spaceDim();
 
   delete _parameters; 
@@ -101,34 +97,40 @@
 
   // Create section to hold time dependent values
   _parameters->add("value", "traction", topology::FieldBase::VERTICES_FIELD, spaceDim);
-  _parameters->get("value").vectorFieldType(topology::FieldBase::VECTOR);
-  _parameters->get("value").scale(pressureScale);
-  _parameters->get("value").allocate();
+  topology::Field<topology::SubMesh>& value = _parameters->get("value");
+  value.vectorFieldType(topology::FieldBase::VECTOR);
+  value.scale(pressureScale);
+  value.allocate();
   if (_dbInitial) {
     _parameters->add("initial", "traction_initial", topology::FieldBase::VERTICES_FIELD, spaceDim);
-    _parameters->get("initial").vectorFieldType(topology::FieldBase::VECTOR);
-    _parameters->get("initial").scale(pressureScale);
-    _parameters->get("initial").allocate();
+    topology::Field<topology::SubMesh>& initial = _parameters->get("initial");
+    initial.vectorFieldType(topology::FieldBase::VECTOR);
+    initial.scale(pressureScale);
+    initial.allocate();
   }
   if (_dbRate) {
     _parameters->add("rate", "traction_rate", topology::FieldBase::VERTICES_FIELD, spaceDim);
-    _parameters->get("rate").vectorFieldType(topology::FieldBase::VECTOR);
-    _parameters->get("rate").scale(rateScale);
-    _parameters->get("rate").allocate();
+    topology::Field<topology::SubMesh>& rate = _parameters->get("rate");
+    rate.vectorFieldType(topology::FieldBase::VECTOR);
+    rate.scale(rateScale);
+    rate.allocate();
     _parameters->add("rate time", "rate_start_time", topology::FieldBase::VERTICES_FIELD, 1);
-    _parameters->get("rate time").vectorFieldType(topology::FieldBase::SCALAR);
-    _parameters->get("rate time").scale(timeScale);
-    _parameters->get("rate time").allocate();
+    topology::Field<topology::SubMesh>& rateTime = _parameters->get("rate time");
+    rateTime.vectorFieldType(topology::FieldBase::SCALAR);
+    rateTime.scale(timeScale);
+    rateTime.allocate();
   } // if
   if (_dbChange) {
     _parameters->add("change", "traction_change", topology::FieldBase::VERTICES_FIELD, spaceDim);
-    _parameters->get("change").vectorFieldType(topology::FieldBase::VECTOR);
-    _parameters->get("change").scale(pressureScale);
-    _parameters->get("change").allocate();
+    topology::Field<topology::SubMesh>& change = _parameters->get("change");
+    change.vectorFieldType(topology::FieldBase::VECTOR);
+    change.scale(pressureScale);
+    change.allocate();
     _parameters->add("change time", "change_start_time", topology::FieldBase::VERTICES_FIELD, 1);
-    _parameters->get("change time").vectorFieldType(topology::FieldBase::SCALAR);
-    _parameters->get("change time").scale(timeScale);
-    _parameters->get("change time").allocate();
+    topology::Field<topology::SubMesh>& changeTime = _parameters->get("change time");
+    changeTime.vectorFieldType(topology::FieldBase::SCALAR);
+    changeTime.scale(timeScale);
+    changeTime.allocate();
   } // if
 
   if (_dbInitial) { // Setup initial values, if provided.
@@ -238,8 +240,6 @@
     if (_dbTimeHistory)
       _dbTimeHistory->open();
   } // if
-  
-  logger.stagePop();
 } // initialize
 
 // ----------------------------------------------------------------------



More information about the CIG-COMMITS mailing list