[cig-commits] [commit] baagaard/add-release-2.0.3, baagaard/add-release-2.1.0, baagaard/dynrup-new-lagrange, baagaard/feature-output-station-names, baagaard/feature-progress-monitor, baagaard/fix-custom-faultpc, baagaard/fix-error-messages, baagaard/fix-faults-intersect, baagaard/fix-friction-initial-state, baagaard/update-autoconf, knepley/feature-petsc-fe, knepley/upgrade-petsc-3.5, knepley/upgrade-petsc-master, maint, master, next, willic3/fix-plasticity: Improved some error messages. (229a1df)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Wed Nov 5 15:44:26 PST 2014
Repository : https://github.com/geodynamics/pylith
On branches: baagaard/add-release-2.0.3,baagaard/add-release-2.1.0,baagaard/dynrup-new-lagrange,baagaard/feature-output-station-names,baagaard/feature-progress-monitor,baagaard/fix-custom-faultpc,baagaard/fix-error-messages,baagaard/fix-faults-intersect,baagaard/fix-friction-initial-state,baagaard/update-autoconf,knepley/feature-petsc-fe,knepley/upgrade-petsc-3.5,knepley/upgrade-petsc-master,maint,master,next,willic3/fix-plasticity
Link : https://github.com/geodynamics/pylith/compare/f33c75b19fd60eedb2a3405db76a1fee333bb1d7...5b6d812b1612809fea3bd331c4e5af98c25a536a
>---------------------------------------------------------------
commit 229a1df778e2eb94f3b8b27f4d5fa0087d2c98a3
Author: Brad Aagaard <baagaard at usgs.gov>
Date: Mon Jun 30 12:16:06 2014 -0700
Improved some error messages.
Also did some minor code cleanup.
>---------------------------------------------------------------
229a1df778e2eb94f3b8b27f4d5fa0087d2c98a3
libsrc/pylith/faults/CohesiveTopology.cc | 12 ++++++------
libsrc/pylith/faults/FaultCohesive.cc | 3 +--
libsrc/pylith/faults/FaultCohesiveImpulses.cc | 11 ++++-------
libsrc/pylith/faults/FaultCohesiveLagrange.cc | 6 +++---
libsrc/pylith/faults/TimeHistorySlipFn.cc | 4 ++--
libsrc/pylith/faults/TopologyOps.cc | 2 +-
libsrc/pylith/faults/TractPerturbation.cc | 6 +++---
libsrc/pylith/feassemble/CellGeometry.cc | 3 ++-
libsrc/pylith/friction/FrictionModel.cc | 10 ++++------
libsrc/pylith/materials/ElasticMaterial.cc | 10 ++++------
libsrc/pylith/materials/Material.cc | 11 ++++-------
libsrc/pylith/meshio/DataWriterHDF5.cc | 6 +++---
libsrc/pylith/meshio/DataWriterHDF5Ext.cc | 6 +++---
libsrc/pylith/meshio/MeshBuilder.cc | 3 +--
libsrc/pylith/meshio/MeshIOCubit.cc | 3 +--
libsrc/pylith/topology/Field.cc | 9 ++++-----
libsrc/pylith/topology/Fields.cc | 18 ++++++------------
libsrc/pylith/topology/Jacobian.cc | 8 ++++----
libsrc/pylith/topology/Mesh.cc | 6 ++----
libsrc/pylith/topology/MeshOps.cc | 3 +--
libsrc/pylith/topology/SolutionFields.cc | 3 +--
21 files changed, 60 insertions(+), 83 deletions(-)
diff --git a/libsrc/pylith/faults/CohesiveTopology.cc b/libsrc/pylith/faults/CohesiveTopology.cc
index bbba016..6f3bae0 100644
--- a/libsrc/pylith/faults/CohesiveTopology.cc
+++ b/libsrc/pylith/faults/CohesiveTopology.cc
@@ -98,16 +98,16 @@ pylith::faults::CohesiveTopology::create(topology::Mesh* mesh,
err = DMPlexGetConeSize(dm, p, &numEdges);PYLITH_CHECK_ERROR(err);
if (numEdges != 3) {
std::ostringstream msg;
- msg << "Face "<<p<<" has "<<numEdges<<" edges != 3.";
- throw std::runtime_error(msg.str());
+ msg << "Internal error while creating fault mesh. Face "<<p<<" has "<<numEdges<<" edges != 3.";
+ throw std::logic_error(msg.str());
}
for (e = 0; e < numEdges; ++e) {
err = DMPlexGetCone(dm, edges[e], &verts);PYLITH_CHECK_ERROR(err);
err = DMPlexGetConeSize(dm, edges[e], &numVerts);PYLITH_CHECK_ERROR(err);
if (numVerts != 2) {
std::ostringstream msg;
- msg << "Edge "<<edges[e]<<" has "<<numVerts<<" vertices != 2.";
- throw std::runtime_error(msg.str());
+ msg << "Internal error while creating fault mesh. Edge "<<edges[e]<<" has "<<numVerts<<" vertices != 2.";
+ throw std::logic_error(msg.str());
}
err = DMPlexGetSupportSize(dm, verts[0], &supportSizeA);PYLITH_CHECK_ERROR(err);
err = DMPlexGetSupport(dm, verts[0], &supportA);PYLITH_CHECK_ERROR(err);
@@ -129,8 +129,8 @@ pylith::faults::CohesiveTopology::create(topology::Mesh* mesh,
}
if (!found) {
std::ostringstream msg;
- msg << "Face "<<p<<" has no cross edge.";
- throw std::runtime_error(msg.str());
+ msg << "Internal error while creating fault mesh. Face "<<p<<" has no cross edge.";
+ throw std::logic_error(msg.str());
}
}
}
diff --git a/libsrc/pylith/faults/FaultCohesive.cc b/libsrc/pylith/faults/FaultCohesive.cc
index 4f0540b..8b09134 100644
--- a/libsrc/pylith/faults/FaultCohesive.cc
+++ b/libsrc/pylith/faults/FaultCohesive.cc
@@ -91,8 +91,7 @@ pylith::faults::FaultCohesive::numVerticesNoMesh(const topology::Mesh& mesh) con
err = DMPlexHasLabel(dmMesh, label(), &hasLabel);PYLITH_CHECK_ERROR(err);
if (!hasLabel && !rank) {
std::ostringstream msg;
- msg << "Mesh missing group of vertices '" << label()
- << "' for fault interface condition.";
+ msg << "Mesh missing group of vertices '" << label() << "' for fault interface condition.";
throw std::runtime_error(msg.str());
} // if
err = DMPlexGetStratumSize(dmMesh, label(), 1, &nvertices);PYLITH_CHECK_ERROR(err);
diff --git a/libsrc/pylith/faults/FaultCohesiveImpulses.cc b/libsrc/pylith/faults/FaultCohesiveImpulses.cc
index 686d393..c64ac4c 100644
--- a/libsrc/pylith/faults/FaultCohesiveImpulses.cc
+++ b/libsrc/pylith/faults/FaultCohesiveImpulses.cc
@@ -107,8 +107,7 @@ pylith::faults::FaultCohesiveImpulses::threshold(const PylithScalar value)
{ // threshold
if (value < 0) {
std::ostringstream msg;
- msg << "Threshold (" << value << ") for nonzero amplitudes of impulses "
- "must be nonnegative";
+ msg << "Threshold (" << value << ") for nonzero amplitudes of impulses must be nonnegative";
throw std::runtime_error(msg.str());
} // if
@@ -261,8 +260,7 @@ pylith::faults::FaultCohesiveImpulses::vertexField(const char* name,
} else {
std::ostringstream msg;
- msg << "Request for unknown vertex field '" << name << "' for fault '"
- << label() << "'.";
+ msg << "Request for unknown vertex field '" << name << "' for fault '" << label() << "'.";
throw std::runtime_error(msg.str());
} // else
@@ -356,11 +354,10 @@ pylith::faults::FaultCohesiveImpulses::_setupImpulses(void)
int err = _dbImpulseAmp->query(&litudeArray[aoff], 1, &coordsVertex[0], coordsVertex.size(), cs);
if (err) {
std::ostringstream msg;
- msg << "Could not find amplitude for Green's function impulses at \n" << "(";
+ msg << "Could not find amplitude for Green's function impulses at " << "(";
for (int i = 0; i < spaceDim; ++i)
msg << " " << coordsVertex[i];
- msg << ") in fault " << label() << "\n"
- << "using spatial database '" << _dbImpulseAmp->label() << "'.";
+ msg << ") in fault " << label() << "using spatial database '" << _dbImpulseAmp->label() << "'.";
throw std::runtime_error(msg.str());
} // if
diff --git a/libsrc/pylith/faults/FaultCohesiveLagrange.cc b/libsrc/pylith/faults/FaultCohesiveLagrange.cc
index 630c6f2..8bd3b5a 100644
--- a/libsrc/pylith/faults/FaultCohesiveLagrange.cc
+++ b/libsrc/pylith/faults/FaultCohesiveLagrange.cc
@@ -1052,8 +1052,8 @@ pylith::faults::FaultCohesiveLagrange::verifyConfiguration(const topology::Mesh&
if (ncells > 0 && eMax < 0) {
std::ostringstream msg;
- msg << "No hybrid edges found in mesh with cohesive cells.";
- throw std::runtime_error(msg.str());
+ msg << "No hybrid edges found in mesh with cohesive cells for fault '" << label() << "'.";
+ throw std::logic_error(msg.str());
} // if
for(PetscInt i = 0; i < ncells; ++i) {
@@ -1069,7 +1069,7 @@ pylith::faults::FaultCohesiveLagrange::verifyConfiguration(const topology::Mesh&
}
if (numBasis != cellNumEdges) {
std::ostringstream msg;
- msg << "Quadrature is incompatible with cell for fault '" << label() << "'.\n"
+ msg << "Quadrature is incompatible with cell for fault '" << label() << "'. "
<< "Cell " << cells[i] << " has " << cellNumEdges
<< " edges but quadrature reference cell has "
<< numBasis << " edges.";
diff --git a/libsrc/pylith/faults/TimeHistorySlipFn.cc b/libsrc/pylith/faults/TimeHistorySlipFn.cc
index ba21583..7c57619 100644
--- a/libsrc/pylith/faults/TimeHistorySlipFn.cc
+++ b/libsrc/pylith/faults/TimeHistorySlipFn.cc
@@ -265,8 +265,8 @@ pylith::faults::TimeHistorySlipFn::slip(topology::Field* slip,
if (err) {
std::ostringstream msg;
msg << "Error querying for time '" << relTime
- << "' in time history database "
- << _dbTimeHistory->label() << ".";
+ << "' in time history database '"
+ << _dbTimeHistory->label() << "'.";
throw std::runtime_error(msg.str());
} // if
diff --git a/libsrc/pylith/faults/TopologyOps.cc b/libsrc/pylith/faults/TopologyOps.cc
index 34c5143..d3d7101 100644
--- a/libsrc/pylith/faults/TopologyOps.cc
+++ b/libsrc/pylith/faults/TopologyOps.cc
@@ -128,7 +128,7 @@ pylith::faults::TopologyOps::classifyCellsDM(PetscDM dmMesh,
classifySize = vReplaceCells.size() + vNoReplaceCells.size();
if (classifySize > classifyTotal) {
std::ostringstream msg;
- msg << "Error classifying cells during creation of cohesive cells.\n"
+ msg << "Internal error classifying cells during creation of cohesive cells."
<< " classifySize: " << classifySize << ", classifyTotal: " << classifyTotal;
throw std::logic_error(msg.str());
} // if
diff --git a/libsrc/pylith/faults/TractPerturbation.cc b/libsrc/pylith/faults/TractPerturbation.cc
index a96ed0a..e170b52 100644
--- a/libsrc/pylith/faults/TractPerturbation.cc
+++ b/libsrc/pylith/faults/TractPerturbation.cc
@@ -346,8 +346,8 @@ pylith::faults::TractPerturbation::calculate(const PylithScalar t)
if (err) {
std::ostringstream msg;
msg << "Error querying for time '" << tDim
- << "' in time history database "
- << _dbTimeHistory->label() << ".";
+ << "' in time history database '"
+ << _dbTimeHistory->label() << "'.";
throw std::runtime_error(msg.str());
} // if
} // if
@@ -484,7 +484,7 @@ pylith::faults::TractPerturbation::_queryDB(const char* name,
msg << "Error querying for '" << name << "' at (";
for (int i=0; i < spaceDim; ++i)
msg << " " << coordsVertex[i];
- msg << ") using spatial database " << db->label() << ".";
+ msg << ") using spatial database '" << db->label() << "'.";
throw std::runtime_error(msg.str());
} // if
normalizer.nondimensionalize(&valueVertex[0], valueVertex.size(), scale);
diff --git a/libsrc/pylith/feassemble/CellGeometry.cc b/libsrc/pylith/feassemble/CellGeometry.cc
index 934374c..56f7ea2 100644
--- a/libsrc/pylith/feassemble/CellGeometry.cc
+++ b/libsrc/pylith/feassemble/CellGeometry.cc
@@ -224,7 +224,8 @@ pylith::feassemble::CellGeometry::_orient2D(scalar_array* orientation,
mag = sqrt(p0*p0 + p1*p1 + p2*p2);
if (mag < 1.0e-6) {
std::ostringstream msg;
- msg << "Error computing orientation of cell face.\nUp direction ("
+ msg << "Error computing orientation of cell face. Cannot resolve tangential components into unambigious directions.\n"
+ << "Up direction ("
<< upDir[0] << ", " << upDir[1] << ", " << upDir[2] << ") "
<< " cannot be parallel to the face normal ("
<< r0 << ", " << r1 << ", " << r2 << ").\n"
diff --git a/libsrc/pylith/friction/FrictionModel.cc b/libsrc/pylith/friction/FrictionModel.cc
index d84e565..d1d0331 100644
--- a/libsrc/pylith/friction/FrictionModel.cc
+++ b/libsrc/pylith/friction/FrictionModel.cc
@@ -152,11 +152,10 @@ pylith::friction::FrictionModel::initialize(const topology::Mesh& faultMesh,
&coordsVertexGlobal[0], spaceDim, cs);
if (err) {
std::ostringstream msg;
- msg << "Could not find parameters for physical properties at \n" << "(";
+ msg << "Could not find parameters for physical properties at " << "(";
for (int i = 0; i < spaceDim; ++i)
msg << " " << coordsVertexGlobal[i];
- msg << ") in friction model " << _label << "\n"
- << "using spatial database '" << _dbProperties->label() << "'.";
+ msg << ") in friction model '" << _label << "' using spatial database '" << _dbProperties->label() << "'.";
throw std::runtime_error(msg.str());
} // if
assert(propertiesVertex.size() == propertiesDBQuery.size());
@@ -214,11 +213,10 @@ pylith::friction::FrictionModel::initialize(const topology::Mesh& faultMesh,
&coordsVertexGlobal[0], spaceDim, cs);
if (err) {
std::ostringstream msg;
- msg << "Could not find initial state variables at \n" << "(";
+ msg << "Could not find initial state variables at " << "(";
for (int i = 0; i < spaceDim; ++i)
msg << " " << coordsVertexGlobal[i];
- msg << ") in friction model " << _label << "\n"
- << "using spatial database '" << _dbInitialState->label() << "'.";
+ msg << ") in friction model '" << _label << "' using spatial database '" << _dbInitialState->label() << "'.";
throw std::runtime_error(msg.str());
} // if
_dbToStateVars(&stateVarsVertex[0], stateVarsDBQuery);
diff --git a/libsrc/pylith/materials/ElasticMaterial.cc b/libsrc/pylith/materials/ElasticMaterial.cc
index b25f7af..e182015 100644
--- a/libsrc/pylith/materials/ElasticMaterial.cc
+++ b/libsrc/pylith/materials/ElasticMaterial.cc
@@ -626,7 +626,7 @@ pylith::materials::ElasticMaterial::_initializeInitialStress(const topology::Mes
} // case 3
default :
std::ostringstream msg;
- msg << "Bad dimension '" << dimension() << " in elastic material'." << std::endl;
+ msg << "Bad dimension '" << dimension() << "' in elastic material." << std::endl;
throw std::logic_error(msg.str());
} // switch
@@ -655,8 +655,7 @@ pylith::materials::ElasticMaterial::_initializeInitialStress(const topology::Mes
msg << "Could not find initial stress at (";
for (int i=0; i < spaceDim; ++i)
msg << " " << quadPtsGlobal[iCoord+i];
- msg << ") in material " << label() << "\n"
- << "using spatial database '" << _dbInitialStress->label() << "'.";
+ msg << ") in material '" << label() << "' using spatial database '" << _dbInitialStress->label() << "'.";
throw std::runtime_error(msg.str());
} // if
} // for
@@ -755,7 +754,7 @@ pylith::materials::ElasticMaterial::_initializeInitialStrain(const topology::Mes
} // case 3
default :
std::ostringstream msg;
- msg << "Bad dimension '" << dimension() << " in elastic material'." << std::endl;
+ msg << "Bad dimension '" << dimension() << "' in elastic material." << std::endl;
throw std::logic_error(msg.str());
} // switch
@@ -786,8 +785,7 @@ pylith::materials::ElasticMaterial::_initializeInitialStrain(const topology::Mes
msg << "Could not find initial strain at (";
for (int i=0; i < spaceDim; ++i)
msg << " " << quadPtsGlobal[iCoord+i];
- msg << ") in material " << label() << "\n"
- << "using spatial database '" << _dbInitialStrain->label() << "'.";
+ msg << ") in material '" << label() << "' using spatial database '" << _dbInitialStrain->label() << "'.";
throw std::runtime_error(msg.str());
} // if
} // for
diff --git a/libsrc/pylith/materials/Material.cc b/libsrc/pylith/materials/Material.cc
index e85eca2..ee19edf 100644
--- a/libsrc/pylith/materials/Material.cc
+++ b/libsrc/pylith/materials/Material.cc
@@ -219,11 +219,10 @@ pylith::materials::Material::initialize(const topology::Mesh& mesh,
int err = _dbProperties->query(&propertiesQuery[0], numDBProperties, &quadPtsGlobal[index], spaceDim, cs);
if (err) {
std::ostringstream msg;
- msg << "Could not find parameters for physical properties at \n" << "(";
+ msg << "Could not find parameters for physical properties at " << "(";
for (int i=0; i < spaceDim; ++i)
msg << " " << quadPtsGlobal[index+i];
- msg << ") in material " << _label << "\n"
- << "using spatial database '" << _dbProperties->label() << "'.";
+ msg << ") in material '" << _label << "' using spatial database '" << _dbProperties->label() << "'.";
throw std::runtime_error(msg.str());
} // if
_dbToProperties(&propertiesCell[iQuadPt*_numPropsQuadPt], propertiesQuery);
@@ -236,9 +235,7 @@ pylith::materials::Material::initialize(const topology::Mesh& mesh,
msg << "Could not find initial state variables at \n" << "(";
for (int i=0; i < spaceDim; ++i)
msg << " " << quadPtsGlobal[index+i];
- msg << ") in material " << _label << "\n"
- << "using spatial database '" << _dbInitialState->label()
- << "'.";
+ msg << ") in material '" << _label << "' using spatial database '" << _dbInitialState->label() << "'.";
throw std::runtime_error(msg.str());
} // if
_dbToStateVars(&stateVarsCell[iQuadPt*_numVarsQuadPt], stateVarsQuery);
@@ -499,7 +496,7 @@ pylith::materials::Material::getField(topology::Field *field,
case topology::FieldBase::MULTI_OTHER:
default :
std::ostringstream msg;
- msg << "Bad vector field type '" << fieldType << " for Material'." << std::endl;
+ msg << "Bad vector field type '" << fieldType << "' for Material." << std::endl;
throw std::logic_error(msg.str());
} // switch
field->vectorFieldType(multiType);
diff --git a/libsrc/pylith/meshio/DataWriterHDF5.cc b/libsrc/pylith/meshio/DataWriterHDF5.cc
index 8b2cbb2..570e6b7 100644
--- a/libsrc/pylith/meshio/DataWriterHDF5.cc
+++ b/libsrc/pylith/meshio/DataWriterHDF5.cc
@@ -237,7 +237,7 @@ pylith::meshio::DataWriterHDF5::open(const topology::Mesh& mesh,
throw std::runtime_error(msg.str());
} catch (...) {
std::ostringstream msg;
- msg << "Unknown error while opening HDF5 file " << _hdf5Filename() << ".\n";
+ msg << "Unknown error while opening HDF5 file " << _hdf5Filename() << ".";
throw std::runtime_error(msg.str());
} // try/catch
@@ -332,7 +332,7 @@ pylith::meshio::DataWriterHDF5::writeVertexField(const PylithScalar t,
} catch (...) {
std::ostringstream msg;
msg << "Error while writing field '" << field.label() << "' at time "
- << t << " to HDF5 file '" << _hdf5Filename() << "'.\n";
+ << t << " to HDF5 file '" << _hdf5Filename() << "'.";
throw std::runtime_error(msg.str());
} // try/catch
@@ -398,7 +398,7 @@ pylith::meshio::DataWriterHDF5::writeCellField(const PylithScalar t,
} catch (...) {
std::ostringstream msg;
msg << "Error while writing field '" << field.label() << "' at time "
- << t << " to HDF5 file '" << _hdf5Filename() << "'.\n";
+ << t << " to HDF5 file '" << _hdf5Filename() << "'.";
throw std::runtime_error(msg.str());
} // try/catch
diff --git a/libsrc/pylith/meshio/DataWriterHDF5Ext.cc b/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
index 1ebbc9b..b9cfd16 100644
--- a/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
+++ b/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
@@ -293,7 +293,7 @@ pylith::meshio::DataWriterHDF5Ext::open(const topology::Mesh& mesh,
throw std::runtime_error(msg.str());
} catch (...) {
std::ostringstream msg;
- msg << "Unknown error while opening HDF5 file " << _filename << ".\n";
+ msg << "Unknown error while opening HDF5 file " << _filename << ".";
throw std::runtime_error(msg.str());
} // try/catch
@@ -467,7 +467,7 @@ pylith::meshio::DataWriterHDF5Ext::writeVertexField(const PylithScalar t,
} catch (...) {
std::ostringstream msg;
msg << "Error while writing field '" << field.label() << "' at time "
- << t << " for HDF5 file '" << _filename << "'.\n";
+ << t << " for HDF5 file '" << _filename << "'.";
throw std::runtime_error(msg.str());
} // try/catch
@@ -623,7 +623,7 @@ pylith::meshio::DataWriterHDF5Ext::writeCellField(const PylithScalar t,
} catch (...) {
std::ostringstream msg;
msg << "Error while writing field '" << field.label() << "' at time "
- << t << " for HDF5 file '" << _filename << "'.\n";
+ << t << " for HDF5 file '" << _filename << "'.";
throw std::runtime_error(msg.str());
} // try/catch
diff --git a/libsrc/pylith/meshio/MeshBuilder.cc b/libsrc/pylith/meshio/MeshBuilder.cc
index f45399a..3bdea52 100644
--- a/libsrc/pylith/meshio/MeshBuilder.cc
+++ b/libsrc/pylith/meshio/MeshBuilder.cc
@@ -65,8 +65,7 @@ pylith::meshio::MeshBuilder::buildMesh(topology::Mesh* mesh,
++count;
if (count > 0) {
std::ostringstream msg;
- msg << "Mesh contains " << count
- << " vertices that are not in any cells.";
+ msg << "Mesh contains " << count << " vertices that are not in any cells.";
throw std::runtime_error(msg.str());
} // if
} // check
diff --git a/libsrc/pylith/meshio/MeshIOCubit.cc b/libsrc/pylith/meshio/MeshIOCubit.cc
index 91fb95c..464b69f 100644
--- a/libsrc/pylith/meshio/MeshIOCubit.cc
+++ b/libsrc/pylith/meshio/MeshIOCubit.cc
@@ -102,8 +102,7 @@ pylith::meshio::MeshIOCubit::_read(void)
throw std::runtime_error(msg.str());
} catch (...) {
std::ostringstream msg;
- msg << "Unknown error while reading Cubit Exodus file '" << _filename
- << "'.";
+ msg << "Unknown error while reading Cubit Exodus file '" << _filename << "'.";
throw std::runtime_error(msg.str());
} // try/catch
} else {
diff --git a/libsrc/pylith/topology/Field.cc b/libsrc/pylith/topology/Field.cc
index 7dec198..d5d5099 100644
--- a/libsrc/pylith/topology/Field.cc
+++ b/libsrc/pylith/topology/Field.cc
@@ -786,8 +786,7 @@ pylith::topology::Field::dimensionalize(void) const
if (!const_cast<Field*>(this)->_metadata["default"].dimsOkay) {
std::ostringstream msg;
msg << "Cannot dimensionalize field '" << const_cast<Field*>(this)->_metadata["default"].label
- << "' because the flag "
- << "has been set to keep field nondimensional.";
+ << "' because the flag has been set to keep field nondimensional.";
throw std::runtime_error(msg.str());
} // if
@@ -1186,7 +1185,7 @@ pylith::topology::Field::_getScatter(const char* context,
if (isNewScatter && !createOk) {
std::ostringstream msg;
- msg << "Scatter for context '" << context << "' does not exist.";
+ msg << "Scatter for context '" << context << "' does not exist for field '" << label() << "'.";
throw std::runtime_error(msg.str());
} // if
@@ -1213,7 +1212,7 @@ pylith::topology::Field::_getScatter(const char* context) const
_scatters.find(context);
if (s_iter == _scatters.end()) {
std::ostringstream msg;
- msg << "Scatter for context '" << context << "' does not exist.";
+ msg << "Scatter for context '" << context << "' does not exist for field '" << label() << "'.";
throw std::runtime_error(msg.str());
} // if
@@ -1299,7 +1298,7 @@ pylith::topology::Field::subfieldSetDof(const char *name,
std::ostringstream msg;
msg << "Unknown value for DomainEnum: " << domain << " in Field" << std::endl;
throw std::logic_error(msg.str());
- }
+ } // switch
PetscSection section = NULL;
err = DMGetDefaultSection(_dm, §ion);PYLITH_CHECK_ERROR(err);assert(section);
const int iField = _metadata[name].index;
diff --git a/libsrc/pylith/topology/Fields.cc b/libsrc/pylith/topology/Fields.cc
index 4d05885..6cb9df9 100644
--- a/libsrc/pylith/topology/Fields.cc
+++ b/libsrc/pylith/topology/Fields.cc
@@ -80,8 +80,7 @@ pylith::topology::Fields::add(const char* name,
if (hasField(name)) {
std::ostringstream msg;
- msg << "Could not add field '" << name
- << "' to fields manager, because it already exists.";
+ msg << "Could not add field '" << name << "' to fields manager, because it already exists.";
throw std::runtime_error(msg.str());
} // if
@@ -103,8 +102,7 @@ pylith::topology::Fields::add(const char* name,
if (hasField(name)) {
std::ostringstream msg;
- msg << "Could not add field '" << name
- << "' to fields manager, because it already exists.";
+ msg << "Could not add field '" << name << "' to fields manager, because it already exists.";
throw std::runtime_error(msg.str());
} // if
@@ -125,8 +123,7 @@ pylith::topology::Fields::del(const char* name)
map_type::iterator iter = _fields.find(name);
if (iter == _fields.end()) {
std::ostringstream msg;
- msg << "Could not find field '" << name
- << "' in fields manager to delete.";
+ msg << "Could not find field '" << name << "' in fields manager to delete.";
throw std::runtime_error(msg.str());
} // if
delete iter->second; iter->second = 0;
@@ -153,8 +150,7 @@ pylith::topology::Fields::get(const char* name) const
map_type::const_iterator iter = _fields.find(name);
if (iter == _fields.end()) {
std::ostringstream msg;
- msg << "Could not find field '" << name
- << "' in fields manager for retrieval.";
+ msg << "Could not find field '" << name << "' in fields manager for retrieval.";
throw std::runtime_error(msg.str());
} // if
@@ -171,8 +167,7 @@ pylith::topology::Fields::get(const char* name)
map_type::iterator iter = _fields.find(name);
if (iter == _fields.end()) {
std::ostringstream msg;
- msg << "Could not find field '" << name
- << "' in fields manager for retrieval.";
+ msg << "Could not find field '" << name << "' in fields manager for retrieval.";
throw std::runtime_error(msg.str());
} // if
@@ -189,8 +184,7 @@ pylith::topology::Fields::copyLayout(const char* name)
map_type::const_iterator src = _fields.find(name);
if (src == _fields.end()) {
std::ostringstream msg;
- msg << "Could not find field '" << name
- << "' in fields manager for retrieval.";
+ msg << "Could not find field '" << name << "' in fields manager for retrieval.";
throw std::runtime_error(msg.str());
} // if
diff --git a/libsrc/pylith/topology/Jacobian.cc b/libsrc/pylith/topology/Jacobian.cc
index 3374d40..d24901d 100644
--- a/libsrc/pylith/topology/Jacobian.cc
+++ b/libsrc/pylith/topology/Jacobian.cc
@@ -117,16 +117,16 @@ pylith::topology::Jacobian::assemble(const char* mode)
err = MatGetRow(_matrix,r, &ncols, &cols, PETSC_NULL);PYLITH_CHECK_ERROR(err);
if (!ncols) {
std::ostringstream msg;
- msg << "ERROR: Empty row " << r << " in ["<<rStart<<","<<rEnd<<")" << std::endl;
- throw std::runtime_error(msg.str().c_str());
+ msg << "ERROR: Matrix empty row " << r << " in ["<<rStart<<","<<rEnd<<")" << std::endl;
+ throw std::runtime_error(msg.str());
}
for(c = 0; c < ncols; ++c) {
if (cols[c] == r) break;
}
if (c == ncols) {
std::ostringstream msg;
- msg << "ERROR: Row " << r << " in ["<<rStart<<","<<rEnd<<") is missing diagonal element" << std::endl;
- throw std::runtime_error(msg.str().c_str());
+ msg << "ERROR: Matrix row " << r << " in ["<<rStart<<","<<rEnd<<") is missing diagonal element" << std::endl;
+ throw std::runtime_error(msg.str());
}
err = MatRestoreRow(_matrix,r, &ncols, &cols, PETSC_NULL);PYLITH_CHECK_ERROR(err);
}
diff --git a/libsrc/pylith/topology/Mesh.cc b/libsrc/pylith/topology/Mesh.cc
index db32865..38d961d 100644
--- a/libsrc/pylith/topology/Mesh.cc
+++ b/libsrc/pylith/topology/Mesh.cc
@@ -120,8 +120,7 @@ pylith::topology::Mesh::Mesh(const Mesh& mesh,
if (maxConeSize <= 0) {
std::ostringstream msg;
- msg << "Error while creating submesh. Submesh '"
- << label << "' does not contain any cells.\n";
+ msg << "Error while creating submesh. Submesh '" << label << "' does not contain any cells.\n";
throw std::runtime_error(msg.str());
} // if
@@ -296,8 +295,7 @@ pylith::topology::Mesh::groupSize(const char *name)
err = DMPlexHasLabel(_dmMesh, name, &hasLabel);PYLITH_CHECK_ERROR(err);
if (!hasLabel) {
std::ostringstream msg;
- msg << "Cannot get size of group '" << name
- << "'. Group missing from mesh.";
+ msg << "Cannot get size of group '" << name << "'. Group missing from mesh.";
throw std::runtime_error(msg.str());
} // if
diff --git a/libsrc/pylith/topology/MeshOps.cc b/libsrc/pylith/topology/MeshOps.cc
index dc2eca0..de80542 100644
--- a/libsrc/pylith/topology/MeshOps.cc
+++ b/libsrc/pylith/topology/MeshOps.cc
@@ -166,8 +166,7 @@ pylith::topology::MeshOps::checkMaterialIds(const Mesh& mesh,
assert(0 <= matIndex && matIndex < numMaterials);
if (matCellCountsAll[matIndex] <= 0) {
std::ostringstream msg;
- msg << "No cells associated with material with id '" << matId
- << "'.";
+ msg << "No cells associated with material with id '" << matId << "'.";
throw std::runtime_error(msg.str());
} // if
} // for
diff --git a/libsrc/pylith/topology/SolutionFields.cc b/libsrc/pylith/topology/SolutionFields.cc
index 7bd61ac..7e37e6c 100644
--- a/libsrc/pylith/topology/SolutionFields.cc
+++ b/libsrc/pylith/topology/SolutionFields.cc
@@ -53,8 +53,7 @@ pylith::topology::SolutionFields::solutionName(const char* name)
map_type::const_iterator iter = _fields.find(name);
if (iter == _fields.end()) {
std::ostringstream msg;
- msg << "Cannot use unknown field '" << name
- << "' when setting name of solution field.";
+ msg << "Cannot use unknown field '" << name << "' when setting name of solution field.";
throw std::runtime_error(msg.str());
} // if
_solutionName = name;
More information about the CIG-COMMITS
mailing list