[cig-commits] r22070 - in short/3D/PyLith/trunk/libsrc/pylith: bc faults feassemble friction materials meshio problems topology utils
knepley at geodynamics.org
knepley at geodynamics.org
Tue May 14 20:40:26 PDT 2013
Author: knepley
Date: 2013-05-14 20:40:25 -0700 (Tue, 14 May 2013)
New Revision: 22070
Modified:
short/3D/PyLith/trunk/libsrc/pylith/bc/Neumann.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/CohesiveTopology.cc
short/3D/PyLith/trunk/libsrc/pylith/faults/CohesiveTopology.hh
short/3D/PyLith/trunk/libsrc/pylith/faults/ConstRateSlipFn.cc
short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesive.hh
short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc
short/3D/PyLith/trunk/libsrc/pylith/faults/LiuCosSlipFn.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/TopologyOps.hh
short/3D/PyLith/trunk/libsrc/pylith/faults/TractPerturbation.cc
short/3D/PyLith/trunk/libsrc/pylith/feassemble/CellGeometry.cc
short/3D/PyLith/trunk/libsrc/pylith/feassemble/ElasticityImplicit.cc
short/3D/PyLith/trunk/libsrc/pylith/feassemble/ElasticityImplicitLgDeform.cc
short/3D/PyLith/trunk/libsrc/pylith/feassemble/GeometryTet3D.cc
short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc
short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticityLgDeform.cc
short/3D/PyLith/trunk/libsrc/pylith/feassemble/Quadrature.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/meshio/CellFilterAvg.cc
short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterVTK.cc
short/3D/PyLith/trunk/libsrc/pylith/meshio/OutputManager.cc
short/3D/PyLith/trunk/libsrc/pylith/meshio/VertexFilterVecNorm.cc
short/3D/PyLith/trunk/libsrc/pylith/problems/Solver.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/CoordsVisitor.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/FieldBase.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/Fields.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/Fields.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/ReverseCuthillMcKee.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/Stratum.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorMesh.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorSubMesh.hh
short/3D/PyLith/trunk/libsrc/pylith/utils/arrayfwd.hh
short/3D/PyLith/trunk/libsrc/pylith/utils/error.h
Log:
PyLith now builds with a non-Sieve PETSc which is pure C
Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/Neumann.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/Neumann.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/Neumann.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -297,9 +297,9 @@
break;
} // case 3
default :
- std::cerr << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad spatial dimension in Neumann.");
+ std::ostringstream msg;
+ msg << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
_queryDB("initial", _dbInitial, spaceDim, pressureScale);
_dbInitial->close();
@@ -328,9 +328,9 @@
break;
} // case 3
default :
- std::cerr << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad spatial dimension in Neumann.");
+ std::ostringstream msg;
+ msg << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
_queryDB("rate", _dbRate, spaceDim, rateScale);
@@ -362,9 +362,9 @@
break;
} // case 3
default :
- std::cerr << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad spatial dimension in Neumann.");
+ std::ostringstream msg;
+ msg << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
_queryDB("change", _dbChange, spaceDim, pressureScale);
Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/TimeDependentPoints.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/TimeDependentPoints.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/TimeDependentPoints.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -33,9 +33,6 @@
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
#include <cstring> // USES strcpy()
-#include <cassert> // USES assert()
-#include <stdexcept> // USES std::runtime_error
-#include <sstream> // USES std::ostringstream
// ----------------------------------------------------------------------
// Default constructor.
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/BruneSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/BruneSlipFn.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/BruneSlipFn.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -143,9 +143,9 @@
break;
} // case 3
default :
- std::cerr << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
- assert(false);
- throw std::logic_error("Bad spatial dimension in BruneSlipFn.");
+ std::ostringstream msg;
+ msg << "Bad spatial dimension '" << spaceDim << " in BruneSlipFn'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
_dbSlipTime->open();
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/CohesiveTopology.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/CohesiveTopology.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -27,17 +27,6 @@
#include "pylith/utils/error.h" // USES PYLITH_CHECK_ERROR
-extern
-PetscErrorCode DMPlexGetOrientedFace(PetscDM dm,
- PetscInt cell,
- PetscInt faceSize,
- const PetscInt face[],
- PetscInt numCorners,
- PetscInt indices[],
- PetscInt origVertices[],
- PetscInt faceVertices[],
- PetscBool *posOriented);
-
// ----------------------------------------------------------------------
void
pylith::faults::CohesiveTopology::createFault(topology::Mesh* faultMesh,
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/CohesiveTopology.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/CohesiveTopology.hh 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/CohesiveTopology.hh 2013-05-15 03:40:25 UTC (rev 22070)
@@ -29,6 +29,8 @@
#include "pylith/topology/Mesh.hh" // USES Mesh::IntSection
+#include <map>
+
// CohesiveTopology -----------------------------------------------------
/// Creation of cohesive cells.
class pylith::faults::CohesiveTopology
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/ConstRateSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/ConstRateSlipFn.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/ConstRateSlipFn.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -132,9 +132,9 @@
break;
} // case 3
default :
- std::cerr << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad spatial dimension in ConstRateSlipFn.");
+ std::ostringstream msg;
+ msg << "Bad spatial dimension '" << spaceDim << " in ConstRateSlipFn'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
_dbSlipTime->open();
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesive.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesive.hh 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesive.hh 2013-05-15 03:40:25 UTC (rev 22070)
@@ -30,6 +30,8 @@
#include "pylith/feassemble/Integrator.hh" // ISA Integrator
+#include <map>
+
// FaultCohesive --------------------------------------------------------
/// Absract base class for fault surface implemented with cohesive cells.
class pylith::faults::FaultCohesive : public Fault,
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -340,14 +340,15 @@
residualArray[rpoff+d] += -areaArray[aoff] * (dispTArray[dtloff+d] + dispTIncrArray[diloff+d] - tractPerturbVertex[d]);
} // for
} else { // opening, normal traction should be zero
+ std::ostringstream msg;
if (fabs(tractionNormal) > _zeroTolerance) {
- std::cerr << "WARNING! Fault opening with nonzero traction."
+ msg << "WARNING! Fault opening with nonzero traction."
<< ", v_fault: " << v_fault
<< ", opening: " << slipNormal
<< ", normal traction: " << tractionNormal
<< std::endl;
+ throw std::runtime_error(msg.str());
} // if
- assert(fabs(tractionNormal) < _zeroTolerance);
} // if/else
#if defined(DETAILED_EVENT_LOGGING)
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/LiuCosSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/LiuCosSlipFn.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/LiuCosSlipFn.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -144,9 +144,9 @@
break;
} // case 3
default :
- std::cerr << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad spatial dimension in LiuCosSlipFn.");
+ std::ostringstream msg;
+ msg << "Bad spatial dimension '" << spaceDim << " in LiuCosSlipFn'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
_dbSlipTime->open();
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/StepSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/StepSlipFn.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/StepSlipFn.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -131,9 +131,9 @@
break;
} // case 3
default :
- std::cerr << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad spatial dimension in StepSlipFn.");
+ std::ostringstream msg;
+ msg << "Bad spatial dimension '" << spaceDim << " in StepSlipFn'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
_dbSlipTime->open();
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/TimeHistorySlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/TimeHistorySlipFn.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/TimeHistorySlipFn.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -137,9 +137,9 @@
break;
} // case 3
default :
- std::cerr << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad spatial dimension in TimeHistorySlipFn.");
+ std::ostringstream msg;
+ msg << "Bad spatial dimension '" << spaceDim << " in TimeHistorySlipFn'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
_dbSlipTime->open();
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyOps.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyOps.hh 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyOps.hh 2013-05-15 03:40:25 UTC (rev 22070)
@@ -28,6 +28,9 @@
#include "faultsfwd.hh" // forward declarations
#include "pylith/topology/Mesh.hh" // USES Mesh
+#include <set>
+#include <vector>
+#include <iostream>
// TopologyOps ----------------------------------------------------------
/// Helper object for creation of cohesive cells.
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/TractPerturbation.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/TractPerturbation.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/TractPerturbation.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -163,9 +163,9 @@
break;
} // case 3
default :
- std::cerr << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad spatial dimension in TractPerturbation.");
+ std::ostringstream msg;
+ msg << "Bad spatial dimension '" << spaceDim << " in TractPerturbation'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
_queryDB("initial", _dbInitial, spaceDim, pressureScale, normalizer);
_dbInitial->close();
@@ -196,9 +196,9 @@
break;
} // case 3
default :
- std::cerr << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad spatial dimension in TractPerturbation.");
+ std::ostringstream msg;
+ msg << "Bad spatial dimension '" << spaceDim << " in TractPerturbation'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
_queryDB("rate", _dbRate, spaceDim, rateScale, normalizer);
@@ -232,9 +232,9 @@
break;
} // case 3
default :
- std::cerr << "Bad spatial dimension '" << spaceDim << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad spatial dimension in TractPerturbation.");
+ std::ostringstream msg;
+ msg << "Bad spatial dimension '" << spaceDim << " in TractPerturbation'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
_queryDB("change", _dbChange, spaceDim, pressureScale, normalizer);
Modified: short/3D/PyLith/trunk/libsrc/pylith/feassemble/CellGeometry.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/feassemble/CellGeometry.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/feassemble/CellGeometry.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -22,10 +22,10 @@
#include "petsc.h" // USES PetscLogFlops
+#include "pylith/utils/error.h" // USES std::logic_error
#include <cstring> // USES memcpy()
#include <iostream> // USES std::cerr
-#include <stdexcept> // USES std::logic_error
// ----------------------------------------------------------------------
// Default constructor.
Modified: short/3D/PyLith/trunk/libsrc/pylith/feassemble/ElasticityImplicit.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/feassemble/ElasticityImplicit.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/feassemble/ElasticityImplicit.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -443,10 +443,12 @@
throw std::runtime_error("Lapack SVD failed");
minSV = svalues[n-7];
maxSV = svalues[0];
+#if 0
std::cout << "Element " << cell << std::endl;
for(int i = 0; i < n; ++i)
std::cout << " sV["<<i<<"] = " << svalues[i] << std::endl;
std::cout << " kappa(elemMat) = " << maxSV/minSV << std::endl;
+#endif
delete [] elemMat;
delete [] svalues;
delete [] work;
Modified: short/3D/PyLith/trunk/libsrc/pylith/feassemble/ElasticityImplicitLgDeform.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/feassemble/ElasticityImplicitLgDeform.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/feassemble/ElasticityImplicitLgDeform.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -450,10 +450,12 @@
throw std::runtime_error("Lapack SVD failed");
minSV = svalues[n-7];
maxSV = svalues[0];
+#if 0
std::cout << "Element " << cell << std::endl;
for(int i = 0; i < n; ++i)
- std::cout << " sV["<<i<<"] = " << svalues[i] << std::endl;
+ std::cout << " sV["<<i<<"] = " << svalues[i] << std::endl;
std::cout << " kappa(elemMat) = " << maxSV/minSV << std::endl;
+#endif
delete [] elemMat;
delete [] svalues;
delete [] work;
Modified: short/3D/PyLith/trunk/libsrc/pylith/feassemble/GeometryTet3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/feassemble/GeometryTet3D.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/feassemble/GeometryTet3D.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -26,6 +26,7 @@
#include "pylith/utils/array.hh" // USES scalar_array
#include "pylith/utils/constdefs.h" // USES scalar_array
+#include "pylith/utils/error.h" // USES std::logic_error
#include <cassert> // USES assert()
Modified: short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -41,6 +41,7 @@
#include <strings.h> // USES strcasecmp()
#include <cassert> // USES assert()
#include <stdexcept> // USES std::runtime_error
+#include <iostream> // USES std::cerr
// ----------------------------------------------------------------------
// Constructor
Modified: short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticityLgDeform.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticityLgDeform.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticityLgDeform.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -91,9 +91,9 @@
} else if (3 == cellDim) {
calcTotalStrainFn = &pylith::feassemble::IntegratorElasticityLgDeform::_calcTotalStrain3D;
} else {
- std::cerr << "Bad cell dimension '" << cellDim << "'." << std::endl;
- assert(false);
- throw std::logic_error("Bad cell dimension in IntegratorElasticityLgDeform::updateStateVars().");
+ std::ostringstream msg;
+ msg << "Bad cell dimension '" << cellDim << " in IntegratorElasticityLgDeform::updateStateVars()'." << std::endl;
+ throw std::logic_error(msg.str());
} // else
// Allocate arrays for cell data.
@@ -172,9 +172,9 @@
} else if (3 == cellDim) {
calcTotalStrainFn = &pylith::feassemble::IntegratorElasticityLgDeform::_calcTotalStrain3D;
} else {
- std::cerr << "Bad cell dimension '" << cellDim << "'." << std::endl;
- assert(false);
- throw std::logic_error("Bad cell dimension in IntegratorElasticityLgDeform::_calcStrainStressField().");
+ std::ostringstream msg;
+ msg << "Bad cell dimension '" << cellDim << " in IntegratorElasticityLgDeform::_calcStrainStressField()'." << std::endl;
+ throw std::logic_error(msg.str());
} // else
// Allocate arrays for cell data.
Modified: short/3D/PyLith/trunk/libsrc/pylith/feassemble/Quadrature.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/feassemble/Quadrature.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/feassemble/Quadrature.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -35,6 +35,7 @@
#include <cassert> // USES assert()
#include <stdexcept> // USES std::runtime_error
+#include <iostream> // USES std::cerr
#include <sstream> // USES std::ostringstream
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/pylith/friction/FrictionModel.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/friction/FrictionModel.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/friction/FrictionModel.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -37,6 +37,7 @@
#include <cassert> // USES assert()
#include <stdexcept> // USES std::runtime_error
#include <sstream> // USES std::ostringstream
+#include <iostream> // USES std::cerr
//#define PRECOMPUTE_GEOMETRY
Modified: short/3D/PyLith/trunk/libsrc/pylith/materials/ElasticMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/materials/ElasticMaterial.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/materials/ElasticMaterial.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -629,9 +629,9 @@
break;
} // case 3
default :
- std::cerr << "Bad dimension '" << dimension() << "'." << std::endl;
- assert(0);
- throw std::logic_error("Unknown dimension in elastic material.");
+ std::ostringstream msg;
+ msg << "Bad dimension '" << dimension() << " in elastic material'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
assert(_normalizer);
@@ -762,9 +762,9 @@
break;
} // case 3
default :
- std::cerr << "Bad dimension '" << dimension() << "'." << std::endl;
- assert(0);
- throw std::logic_error("Unknown dimension in elastic material.");
+ std::ostringstream msg;
+ msg << "Bad dimension '" << dimension() << " in elastic material'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
assert(_normalizer);
Modified: short/3D/PyLith/trunk/libsrc/pylith/materials/Material.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/materials/Material.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/materials/Material.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -503,9 +503,9 @@
case topology::FieldBase::MULTI_TENSOR:
case topology::FieldBase::MULTI_OTHER:
default :
- std::cerr << "Bad vector field type '" << fieldType << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad vector field type for Material.");
+ std::ostringstream msg;
+ msg << "Bad vector field type '" << fieldType << " for Material'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
field->vectorFieldType(multiType);
Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/CellFilterAvg.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/CellFilterAvg.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/CellFilterAvg.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -151,10 +151,9 @@
case topology::FieldBase::TENSOR:
case topology::FieldBase::OTHER:
default :
- std::cerr << "Bad vector field type '" << fieldIn.vectorFieldType()
- << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad vector field type for CellFilterAvg.");
+ std::ostringstream msg;
+ msg << "Bad vector field type '" << fieldIn.vectorFieldType() << " for CellFilterAvg'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
_fieldAvg->label(fieldIn.label());
Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -59,8 +59,8 @@
DataWriter::deallocate();
PetscErrorCode err = 0;
- const typename dataset_type::const_iterator& dEnd = _datasets.end();
- for (typename dataset_type::iterator d_iter=_datasets.begin();
+ const dataset_type::const_iterator& dEnd = _datasets.end();
+ for (dataset_type::iterator d_iter=_datasets.begin();
d_iter != dEnd;
++d_iter) {
err = PetscViewerDestroy(&d_iter->second.viewer);PYLITH_CHECK_ERROR(err);
Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterVTK.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterVTK.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterVTK.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -24,7 +24,6 @@
#include "pylith/topology/Field.hh" // USES Field
#include "pylith/topology/Stratum.hh" // USES StratumIS
-#include <petscdmmesh_viewers.hh> // USES VTKViewer
#include <petscdmplex.h>
#include <cassert> // USES assert()
Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/OutputManager.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/OutputManager.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/OutputManager.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -28,6 +28,7 @@
#include "pylith/topology/Fields.hh" // USES Fields
#include "spatialdata/geocoords/CoordSys.hh" // USES CoordSys
+#include <iostream> // USES std::cout
// ----------------------------------------------------------------------
// Constructor
@@ -266,12 +267,11 @@
fieldName = "buffer (multiple others)";
break;
default :
- // Spit out usefule error message and stop via assert. If
- // optimized, throw exception.
- std::cerr << "Unknown field type '" << fieldIn.vectorFieldType()
- << "'";
- assert(0);
- throw std::logic_error("Unknown field type");
+ // Spit out useful error message and stop via assert. If
+ // optimized, throw exception.
+ std::ostringstream msg;
+ msg << "Unknown field type '" << fieldIn.vectorFieldType() << "'";
+ throw std::logic_error(msg.str());
} // switch
if (!_fields) {
Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/VertexFilterVecNorm.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/VertexFilterVecNorm.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/VertexFilterVecNorm.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -108,10 +108,9 @@
case topology::FieldBase::TENSOR:
case topology::FieldBase::OTHER:
default :
- std::cerr << "Bad vector field type '" << fieldIn.vectorFieldType()
- << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad vector field type in VertexFilterVecNorm.");
+ std::ostringstream msg;
+ msg << "Bad vector field type '" << fieldIn.vectorFieldType() << " for VertexFilterVecNorm'." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
} // if
Modified: short/3D/PyLith/trunk/libsrc/pylith/problems/Solver.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/problems/Solver.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/problems/Solver.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -30,8 +30,6 @@
#include "pylith/utils/EventLogger.hh" // USES EventLogger
#include "pylith/utils/error.h" // USES PYLITH_CHECK_ERROR
-#include <petscdmmesh_solvers.hh> // USES constructFieldSplit()
-
#include <cassert> // USES assert()
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/CoordsVisitor.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/CoordsVisitor.hh 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/CoordsVisitor.hh 2013-05-15 03:40:25 UTC (rev 22070)
@@ -30,8 +30,6 @@
#include "pylith/utils/petscfwd.h" // HASA PetscVec, PetscSection
-#include <petscdmmesh.hh>
-
// CoordsVisitor ----------------------------------------------------------
/** @brief Helper class for accessing coordinates in a finite-element mesh.
*/
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -28,13 +28,8 @@
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
#include "pylith/utils/error.h" // USES PYLITH_CHECK_ERROR
+#include <iostream> // USES std::cout
-#include <petscdmmesh.hh>
-
-#include <stdexcept> // USES std::runtime_error
-#include <sstream> // USES std::ostringstream
-#include <cassert> // USES assert()
-
// ----------------------------------------------------------------------
// Default constructor.
pylith::topology::Field::Field(const Mesh& mesh) :
@@ -359,8 +354,9 @@
err = DMPlexGetChart(_dm, &pStart, &pEnd);PYLITH_CHECK_ERROR(err);
break;
default:
- std::cerr << "Unknown value for DomainEnum: " << domain << std::endl;
- throw std::logic_error("Bad domain enum in Field.");
+ std::ostringstream msg;
+ msg << "Unknown value for DomainEnum: " << domain << " in Field" << std::endl;
+ throw std::logic_error(msg.str());
}
newSection(pStart, pEnd, fiberDim);
@@ -872,11 +868,10 @@
case MULTI_OTHER:
vecFieldString = "multiple other values";
break;
- default :
- std::cerr << "Unknown vector field value '" << const_cast<Field*>(this)->_metadata["default"].vectorFieldType
- << "'." << std::endl;
- assert(0);
- throw std::logic_error("Bad vector field type in Field.");
+ default:
+ std::ostringstream msg;
+ msg << "Unknown vector field value '" << const_cast<Field*>(this)->_metadata["default"].vectorFieldType << "' in Field." << std::endl;
+ throw std::logic_error(msg.str());
} // switch
std::cout << "Viewing field '" << const_cast<Field*>(this)->_metadata["default"].label << "' "<< label << ".\n"
@@ -1379,8 +1374,9 @@
err = DMPlexGetChart(_dm, &pStart, &pEnd);PYLITH_CHECK_ERROR(err);
break;
default:
- std::cerr << "Unknown value for DomainEnum: " << domain << std::endl;
- throw std::logic_error("Bad domain enum in Field.");
+ std::ostringstream msg;
+ msg << "Unknown value for DomainEnum: " << domain << " in Field" << std::endl;
+ throw std::logic_error(msg.str());
}
PetscSection section = NULL;
err = DMGetDefaultSection(_dm, §ion);PYLITH_CHECK_ERROR(err);assert(section);
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/FieldBase.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/FieldBase.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/FieldBase.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -19,6 +19,7 @@
#include <portinfo>
#include "FieldBase.hh" // implementation of class methods
+#include "pylith/utils/error.h" // USES std::logic_error
// ----------------------------------------------------------------------
// Default constructor.
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Fields.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Fields.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Fields.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -46,9 +46,9 @@
void
pylith::topology::Fields::deallocate(void)
{ // deallocate
- const typename map_type::iterator begin = _fields.begin();
- const typename map_type::iterator end = _fields.end();
- for (typename map_type::iterator iter=begin; iter != end; ++iter) {
+ const map_type::iterator begin = _fields.begin();
+ const map_type::iterator end = _fields.end();
+ for (map_type::iterator iter=begin; iter != end; ++iter) {
delete iter->second; iter->second = 0;
} // for
} // deallocate
@@ -58,7 +58,7 @@
bool
pylith::topology::Fields::hasField(const char* name) const
{ // hasField
- typename map_type::const_iterator iter = _fields.find(name);
+ map_type::const_iterator iter = _fields.find(name);
return iter != _fields.end();
} // hasField
@@ -104,7 +104,7 @@
void
pylith::topology::Fields::del(const char* name)
{ // del
- typename map_type::iterator iter = _fields.find(name);
+ map_type::iterator iter = _fields.find(name);
if (iter == _fields.end()) {
std::ostringstream msg;
msg << "Could not find field '" << name
@@ -128,7 +128,7 @@
const pylith::topology::Field&
pylith::topology::Fields::get(const char* name) const
{ // get
- typename map_type::const_iterator iter = _fields.find(name);
+ map_type::const_iterator iter = _fields.find(name);
if (iter == _fields.end()) {
std::ostringstream msg;
msg << "Could not find field '" << name
@@ -143,7 +143,7 @@
pylith::topology::Field&
pylith::topology::Fields::get(const char* name)
{ // get
- typename map_type::iterator iter = _fields.find(name);
+ map_type::iterator iter = _fields.find(name);
if (iter == _fields.end()) {
std::ostringstream msg;
msg << "Could not find field '" << name
@@ -158,7 +158,7 @@
void
pylith::topology::Fields::copyLayout(const char* name)
{ // copyLayout
- typename map_type::const_iterator src = _fields.find(name);
+ map_type::const_iterator src = _fields.find(name);
if (src == _fields.end()) {
std::ostringstream msg;
msg << "Could not find field '" << name
@@ -166,9 +166,9 @@
throw std::runtime_error(msg.str());
} // if
- const typename map_type::iterator begin = _fields.begin();
- const typename map_type::iterator end = _fields.end();
- for (typename map_type::iterator iter=begin; iter != end; ++iter)
+ const map_type::iterator begin = _fields.begin();
+ const map_type::iterator end = _fields.end();
+ for (map_type::iterator iter=begin; iter != end; ++iter)
if (iter != src)
iter->second->cloneSection(*src->second);
} // copyLayout
@@ -193,9 +193,9 @@
*numNames = _fields.size();
*names = new char*[_fields.size()];
assert(*names);
- const typename map_type::const_iterator namesEnd = _fields.end();
+ const map_type::const_iterator namesEnd = _fields.end();
int i = 0;
- for (typename map_type::const_iterator name = _fields.begin();
+ for (map_type::const_iterator name = _fields.begin();
name != namesEnd;
++name) {
const char len = name->first.length();
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Fields.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Fields.hh 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Fields.hh 2013-05-15 03:40:25 UTC (rev 22070)
@@ -32,6 +32,7 @@
#include "pylith/topology/FieldBase.hh" // USES FieldBase::DomainEnum
#include <string> // USES std::string
+#include <map> // USES std::map
// Fields ---------------------------------------------------------------
/// Container for managing multiple fields over a finite-element mesh.
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -24,6 +24,7 @@
#include "Field.hh" // USES Field
#include "pylith/utils/error.h" // USES PYLITH_CHECK_ERROR
+#include <iostream> // USES std::cerr
// ----------------------------------------------------------------------
// Default constructor.
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.hh 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.hh 2013-05-15 03:40:25 UTC (rev 22070)
@@ -31,8 +31,6 @@
#include "pylith/utils/petscfwd.h" // HOLDSA PetscMat
-#include <petscdmmesh.hh> // USES MPI_Comm
-
#include <string> // USES std::string
// Jacobian -------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.hh 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.hh 2013-05-15 03:40:25 UTC (rev 22070)
@@ -30,8 +30,6 @@
// Include directives ---------------------------------------------------
#include "topologyfwd.hh" // forward declarations
-#include <petscdmmesh.hh> // HASA ALE::IMesh
-
// MeshOrder ------------------------------------------------------------
/// Object for managing order of mesh entities.
class ALE::MeshOrder
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/ReverseCuthillMcKee.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/ReverseCuthillMcKee.cc 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/ReverseCuthillMcKee.cc 2013-05-15 03:40:25 UTC (rev 22070)
@@ -24,6 +24,7 @@
#include <cassert> // USES assert()
#include <stdexcept> // USES std::exception
+#include <iostream> // USES std::cerr
// ----------------------------------------------------------------------
// Set vertices and cells in mesh.
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Stratum.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Stratum.hh 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Stratum.hh 2013-05-15 03:40:25 UTC (rev 22070)
@@ -31,8 +31,6 @@
#include "pylith/utils/petscfwd.h" // HASA PetscDM, PetscIS
-#include <petscdmmesh.hh>
-
// Stratum --------------------------------------------------------
/// Height or depth stratum.
class pylith::topology::Stratum
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorMesh.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorMesh.hh 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorMesh.hh 2013-05-15 03:40:25 UTC (rev 22070)
@@ -31,8 +31,6 @@
#include "pylith/utils/petscfwd.h" // HASA PetscVec, PetscSection
-#include <petscdmmesh.hh>
-
// VecVisitorMesh ----------------------------------------------------------
/** @brief Helper class for accessing field values at points in a
* finite-element mesh.
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorSubMesh.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorSubMesh.hh 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorSubMesh.hh 2013-05-15 03:40:25 UTC (rev 22070)
@@ -39,8 +39,6 @@
#include "pylith/utils/petscfwd.h" // HASA PetscVec, PetscSection
-#include <petscdmmesh.hh>
-
// VecVisitorSubMesh -------------------------------------------------------
/** @brief Helper class for accessing field values at points in a
* finite-element mesh.
Modified: short/3D/PyLith/trunk/libsrc/pylith/utils/arrayfwd.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/utils/arrayfwd.hh 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/utils/arrayfwd.hh 2013-05-15 03:40:25 UTC (rev 22070)
@@ -34,6 +34,8 @@
#include "types.hh" // USES PylithScalar
#include <string> // USES std::string
+#include <vector> // USES std::vector
+#include <valarray> // USES std::valarray
/// Forward declaration of STL vector
namespace std {
Modified: short/3D/PyLith/trunk/libsrc/pylith/utils/error.h
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/utils/error.h 2013-05-15 00:10:26 UTC (rev 22069)
+++ short/3D/PyLith/trunk/libsrc/pylith/utils/error.h 2013-05-15 03:40:25 UTC (rev 22070)
@@ -25,6 +25,10 @@
#if !defined(pylith_utils_error_h)
#define pylith_utils_error_h
+#include <cassert>
+#include <stdexcept>
+#include <sstream>
+
#undef __FUNCT__
#if defined(__FUNCTION_NAME__)
#define __FUNCT__ __FUNCTION_NAME__
@@ -38,7 +42,7 @@
#define PYLITH_METHOD_END PetscFunctionReturnVoid()
#define PYLITH_METHOD_RETURN(v) PetscFunctionReturn(v)
-#define PYLITH_CHECK_ERROR(err) CHKERRXX(err)
+#define PYLITH_CHECK_ERROR(err) do {if (PetscUnlikely(err)) {PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,err,PETSC_ERROR_IN_CXX,0);}} while(0)
#define PYLITH_CHECK_ERROR_MSG(err, msg) \
if (err) { \
More information about the CIG-COMMITS
mailing list