[MOAB-dev] r3001 - MOAB/trunk

tautges at mcs.anl.gov tautges at mcs.anl.gov
Mon Jul 13 17:59:18 CDT 2009


Author: tautges
Date: 2009-07-13 17:59:17 -0500 (Mon, 13 Jul 2009)
New Revision: 3001

Modified:
   MOAB/trunk/MBCore.cpp
   MOAB/trunk/MeshTopoUtil.cpp
Log:
2 smallish changes motivated by Milad:
- in MeshTopoUtil::get_bridge_entities, if to_dim is -1, then all
entities (of all dimensions) adjacent to bridge entities are returned,
rather than just entities of to_dim.  This is a hack for now; probably
need extra arg requesting aentities too

- fixed MBCore::SideNumber to work correctly with structured mesh

Passes make check.



Modified: MOAB/trunk/MBCore.cpp
===================================================================
--- MOAB/trunk/MBCore.cpp	2009-07-13 22:40:04 UTC (rev 3000)
+++ MOAB/trunk/MBCore.cpp	2009-07-13 22:59:17 UTC (rev 3001)
@@ -2152,6 +2152,10 @@
   const MBEntityHandle *parent_conn, *child_conn;
   int num_parent_vertices, num_child_vertices;
   MBErrorCode result = get_connectivity(parent, parent_conn, num_parent_vertices, true);
+  if (MB_NOT_IMPLEMENTED == result) {
+    static std::vector<MBEntityHandle> tmp_connect(MBCN::MAX_NODES_PER_ELEMENT);
+    result = get_connectivity(parent, parent_conn, num_parent_vertices, true, &tmp_connect);
+  }
   if (MB_SUCCESS != result) return result;
 
   if (TYPE_FROM_HANDLE(child) == MBVERTEX) {

Modified: MOAB/trunk/MeshTopoUtil.cpp
===================================================================
--- MOAB/trunk/MeshTopoUtil.cpp	2009-07-13 22:40:04 UTC (rev 3000)
+++ MOAB/trunk/MeshTopoUtil.cpp	2009-07-13 22:59:17 UTC (rev 3001)
@@ -412,10 +412,22 @@
     
       // get to_dim adjacencies, merge into to_ents
     last_toents =  to_ents;
-    result = mbImpl->get_adjacencies(new_bridges, to_dim, false, to_ents,
-                                     MBInterface::UNION);
-    if (MB_SUCCESS != result) return result;
-    
+    if (-1 == to_dim) {
+      result = mbImpl->get_adjacencies(new_bridges, 3, false, to_ents,
+				       MBInterface::UNION);
+      if (MB_SUCCESS != result) return result;
+      for (int d = 2; d >= 1; d--) {
+	result = mbImpl->get_adjacencies(to_ents, d, true, to_ents,
+					 MBInterface::UNION);
+	if (MB_SUCCESS != result) return result;
+      }
+    }
+    else {
+      result = mbImpl->get_adjacencies(new_bridges, to_dim, false, to_ents,
+				       MBInterface::UNION);
+      if (MB_SUCCESS != result) return result;
+    }
+
       // subtract last_toents to get new_toents
     if (nl < num_layers-1)
       new_toents = to_ents.subtract(last_toents);



More information about the moab-dev mailing list