[MOAB-dev] r2957 - MOAB/trunk

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Mon Jun 22 08:24:56 CDT 2009


Author: kraftche
Date: 2009-06-22 08:24:56 -0500 (Mon, 22 Jun 2009)
New Revision: 2957

Modified:
   MOAB/trunk/MBSkinner.cpp
Log:
o Remove broken test for handling non-source entities adjacent to a 
  source_dim-1 side (skinning a subset of the mesh.)

o Add fix suggested by Brandon for the above problem.

o Remove assert() if source_dim-1 side has three or more adjacent
  elements of dimension source_dim.  With Brandon's fix this should
  no longer occur for valid input, but it can still happen for
  invalid input (e.g. a bunch of quads that don't form a topologically
  2-D patch).  Treat such sides as interior.
  
  


Modified: MOAB/trunk/MBSkinner.cpp
===================================================================
--- MOAB/trunk/MBSkinner.cpp	2009-06-22 05:02:45 UTC (rev 2956)
+++ MOAB/trunk/MBSkinner.cpp	2009-06-22 13:24:56 UTC (rev 2957)
@@ -312,16 +312,22 @@
         result = thisMB->get_adjacencies(sub_conn, num_sub_nodes, source_dim, false,
                                          dum_elems);
         if (MB_SUCCESS != result) return result;
-        assert(0 < dum_elems.size() && 3 > dum_elems.size());
-        if (1 == dum_elems.size() ||
-            (2 == dum_elems.size() && 
-             (source_entities.find(*dum_elems.begin()) == source_entities.end() ||
-              source_entities.find(*dum_elems.rbegin()) == source_entities.end()))) {
+        dum_elems = dum_elems.intersect( source_entities );
+        if (dum_elems.empty()) {
+          assert(false);  // should never happen
+          return MB_FAILURE;
+        }
+        // if (dum_elems.size() > 2) { 
+          // source entities do not form a valid source-dim patch (t-junction).
+          // do we care?
+        // }
+        
+        if (1 == dum_elems.size()) {
             // this sub_element is on the skin
 
             // check for existing entity
           dum_sub_elems.clear();
-          result = thisMB->get_adjacencies(sub_conn, num_sub_nodes, source_dim-1, false,
+          result = thisMB->get_adjacencies(sub_conn, num_sub_nodes, mTargetDim, false,
                                            dum_sub_elems);
           if (MB_SUCCESS != result) return result;
           if (dum_sub_elems.empty()) {



More information about the moab-dev mailing list