]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a comment, and fix an assertion.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 2 May 2005 20:30:30 +0000 (20:30 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 2 May 2005 20:30:30 +0000 (20:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@10593 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-18/step-18.cc

index 9f7a6101f287b402cb51a6c80055202dae9202ef..c42ffeffad728266a774d30ef389e6b785d3bfa6 100644 (file)
@@ -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());
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.