[MOAB-dev] r4196 - MOAB/trunk/src

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Wed Oct 6 12:02:54 CDT 2010


Author: kraftche
Date: 2010-10-06 12:02:54 -0500 (Wed, 06 Oct 2010)
New Revision: 4196

Modified:
   MOAB/trunk/src/AEntityFactory.cpp
Log:
Fix bug in get_adjacencies.  

1) Higher-level code assumes that functions in AEntityFactory append
   values to the output std::vector (as opposed to replacing the
   contents of the std::vector)
2) AEntityFactory::get_adjacencies( source_ent, dim, create, output_vec )
   assumed that Core::get_connectivity( array, len, output_vec ) also
   appended values to its output vector.
3) Core::get_connectivity( array, len, output_vec ) actually replaces
   the contents of the output vector, which is inconsistent with other
   MOAB API functions.
4) Comments in Core::get_connectivity( array, len, output_vec ) indicate
   that the last time I tried to fix the inconsistency it broke a lot
   of calling code
5) So remove the assumption in  AEntityFactory::get_adjacencies( source_ent, 
   dim, create, output_vec ) that Core::get_connectivity appends.  Instead
   get a direct pointer to the internal connectivity storage and insert
   that at the end of the output vector.


Modified: MOAB/trunk/src/AEntityFactory.cpp
===================================================================
--- MOAB/trunk/src/AEntityFactory.cpp	2010-10-06 16:56:13 UTC (rev 4195)
+++ MOAB/trunk/src/AEntityFactory.cpp	2010-10-06 17:02:54 UTC (rev 4196)
@@ -588,7 +588,11 @@
     result = get_associated_meshsets( source_entity, target_entities ); 
   }
   else if (target_dimension == (source_type != MBPOLYHEDRON ? 0 : 2)) {
-    result = thisMB->get_connectivity(&source_entity, 1, target_entities);
+    std::vector<EntityHandle> tmp_storage;
+    const EntityHandle* conn;
+    int len = 0;
+    result = thisMB->get_connectivity( source_entity, conn, len, false, &tmp_storage );
+    target_entities.insert( target_entities.end(), conn, conn+len );
   }
   else if (target_dimension == 0 && source_type == MBPOLYHEDRON) {
     result = get_polyhedron_vertices(source_entity, target_entities);




































More information about the moab-dev mailing list