[cig-commits] commit 2033 by bangerth to /var/svn/dealii/aspect
dealii.demon at gmail.com
dealii.demon at gmail.com
Thu Nov 21 12:54:22 PST 2013
Revision 2033
Be more lenient in evaluating the depth of a point in the box model.
U trunk/aspect/source/geometry_model/box.cc
http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=2033&peg=2033
Diff:
Modified: trunk/aspect/source/geometry_model/box.cc
===================================================================
--- trunk/aspect/source/geometry_model/box.cc 2013-11-21 20:46:44 UTC (rev 2032)
+++ trunk/aspect/source/geometry_model/box.cc 2013-11-21 20:53:51 UTC (rev 2033)
@@ -110,8 +110,18 @@
{
const double d = maximal_depth()-position(dim-1);
- Assert (d >= -1e-14*std::fabs(maximal_depth()), ExcInternalError());
- Assert (d <= (1.+1e-14)*maximal_depth(), ExcInternalError());
+ // if we violate the bounds, check that we do so only very slightly and
+ // then just return maximal or minimal depth
+ if (d < 0)
+ {
+ Assert (d >= -1e-14*std::fabs(maximal_depth()), ExcInternalError());
+ return 0;
+ }
+ if (d > maximal_depth())
+ {
+ Assert (d <= (1.+1e-14)*maximal_depth(), ExcInternalError());
+ return maximal_depth();
+ }
return d;
}
More information about the CIG-COMMITS
mailing list