From: wolf Date: Mon, 2 May 2005 20:30:30 +0000 (+0000) Subject: Add a comment, and fix an assertion. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b7fd3d2e935f0dd7963d38c027156f0c41c4137;p=dealii-svn.git Add a comment, and fix an assertion. git-svn-id: https://svn.dealii.org/trunk@10593 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-18/step-18.cc b/deal.II/examples/step-18/step-18.cc index 9f7a6101f2..c42ffeffad 100644 --- a/deal.II/examples/step-18/step-18.cc +++ b/deal.II/examples/step-18/step-18.cc @@ -2615,14 +2615,21 @@ namespace QuasiStaticElasticity // changes in other // parts of the program // (or the library, for - // that matter): + // that matter). Note that in order + // to make these checks work + // even on cells where the + // stress happens to be zero, + // we need to compare + // less-than-or-equal, not just + // less-than some small + // tolerance: Assert (std::fabs(trace(new_stress) - trace(rotated_new_stress)) - < + <= 1e-12 * std::fabs(trace(new_stress)), ExcInternalError()); Assert (std::fabs(determinant(new_stress) - determinant(rotated_new_stress)) - < + <= 1e-12 * std::fabs(determinant(new_stress)), ExcInternalError());