[MOAB-dev] r4376 - MOAB/trunk/tools/dagmc
bmsmith6 at wisc.edu
bmsmith6 at wisc.edu
Tue Dec 14 23:59:06 CST 2010
Author: bmsmith
Date: 2010-12-14 23:59:06 -0600 (Tue, 14 Dec 2010)
New Revision: 4376
Modified:
MOAB/trunk/tools/dagmc/DagMC.cpp
Log:
-Fix a bug for the overlap-tolerance point inclusion test.
Used the wrong tolerance argument for ray_intersect_sets.
The result is not affected - it just takes less time.
-Check some return values instead of relying on asserts.
Modified: MOAB/trunk/tools/dagmc/DagMC.cpp
===================================================================
--- MOAB/trunk/tools/dagmc/DagMC.cpp 2010-12-15 04:19:55 UTC (rev 4375)
+++ MOAB/trunk/tools/dagmc/DagMC.cpp 2010-12-15 05:59:06 UTC (rev 4376)
@@ -785,25 +785,21 @@
const double large = 1e15;
const double ray_length = large;
- unsigned min_tolerance_intersections;
- double keep_all_hits_dist;
-
// If overlaps occur, the pt is inside if traveling along the ray from the
// origin, there are ever more exits than entrances. In lieu of implementing
// that, all intersections to infinity are required if overlaps occur (expensive)
+ unsigned min_tolerance_intersections;
if(0 != overlapThickness) {
- min_tolerance_intersections = 1000000;
- keep_all_hits_dist = large;
+ min_tolerance_intersections = -1;
// only the first intersection is needed if overlaps do not occur (cheap)
} else {
min_tolerance_intersections = 1;
- keep_all_hits_dist = numericalPrecision;
}
// Get intersection(s) of forward and reverse orientation. Do not return
// glancing intersections or previous facets.
ErrorCode rval = obbTree.ray_intersect_sets( dists, surfs, facets, root,
- keep_all_hits_dist,
+ numericalPrecision,
min_tolerance_intersections,
ray_origin, ray_direction,
&ray_length, NULL, NULL, &volume,
@@ -1382,14 +1378,17 @@
int len, sense_out;
rval = mbImpl->get_connectivity( facet, conn, len );
- assert( MB_SUCCESS == rval );
- assert( 3 == len );
+ assert( MB_SUCCESS == rval );
+ if(MB_SUCCESS != rval) return rval;
+ assert( 3 == len );
rval = mbImpl->get_coords( conn, 3, coords[0].array() );
- assert(MB_SUCCESS == rval);
+ assert(MB_SUCCESS == rval);
+ if(MB_SUCCESS != rval) return rval;
rval = surface_sense( volume, surface, sense_out );
- assert( MB_SUCCESS == rval);
+ assert( MB_SUCCESS == rval);
More information about the moab-dev
mailing list