[MOAB-dev] r5267 - in MOAB/trunk: itaps/igeom src src/moab test

iulian at mcs.anl.gov iulian at mcs.anl.gov
Sun Dec 18 14:57:23 CST 2011


Author: iulian
Date: 2011-12-18 14:57:17 -0600 (Sun, 18 Dec 2011)
New Revision: 5267

Modified:
   MOAB/trunk/itaps/igeom/FBiGeom_MOAB.cpp
   MOAB/trunk/src/FBEngine.cpp
   MOAB/trunk/src/GeomTopoTool.cpp
   MOAB/trunk/src/moab/FBEngine.hpp
   MOAB/trunk/src/moab/GeomTopoTool.hpp
   MOAB/trunk/test/gttool_test.cpp
Log:
introduce the convention that the moab sets with geometry dimension tag 4 are the 
sets of other geometry entities. As a reminder, moab sets with geom dimension
0 thru 3 are representing geometry entities for geom topo tool and for igeom
implementation in moab (FBiGeom).
This change is required to make the method (FB)iGeom_getEntSets() more efficient.
We will retrieve only moab sets with geom dimension 4, and filter based on 
input set.
The convention is used already in MeshKit, so it should not come as a big 
surprise. 


Modified: MOAB/trunk/itaps/igeom/FBiGeom_MOAB.cpp
===================================================================
--- MOAB/trunk/itaps/igeom/FBiGeom_MOAB.cpp	2011-12-16 05:33:22 UTC (rev 5266)
+++ MOAB/trunk/itaps/igeom/FBiGeom_MOAB.cpp	2011-12-18 20:57:17 UTC (rev 5267)
@@ -5,6 +5,7 @@
 #include "moab/OrientedBoxTreeTool.hpp"
 #include "moab/CartVect.hpp"
 #include "FileOptions.hpp"
+#include "MBTagConventions.hpp"
 #include <stdlib.h>
 #include <cstring>
 #include <map>
@@ -1235,12 +1236,32 @@
 }
 
 void FBiGeom_getNumEntSets(FBiGeom_Instance instance,
-      iBase_EntitySetHandle entity_set_handle, int num_hops, int *num_sets,
+      iBase_EntitySetHandle entity_set_handle, int  /*num_hops*/, int *num_sets,
       int *err) {
-  // TODO  here, we should really get only the entity sets that have gents as members
-  // we have the convention that entity sets of geom dimension 4
-   iMesh_getNumEntSets(IMESH_INSTANCE(instance), entity_set_handle, num_hops,
-         num_sets, err);
+ //  here, we get only the entity sets that have gents as members
+  // we have the convention that entity sets of geom dimension 4 are
+  // sets of geo entities; they should contain only gentities as elements (or other sets of gents)
+   // we should also consider the number of hops
+  // first, get all sets of geo dim 4 from the entity_set_handle; then intersect with
+  // the range from geom topo tool
+  Tag geomTag;
+  ErrorCode rval = MBI->tag_get_handle(GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER, geomTag);
+  if (MB_SUCCESS != rval)
+    RETURN(iBase_FAILURE);
+  GeomTopoTool * gtt = GETGTT(instance);
+  const Range * gRange =gtt-> geoRanges();
+  // get all sets of geom dimension 4 from the entity set
+  EntityHandle moabSet = (EntityHandle)entity_set_handle;
+  const int four = 4;
+  const void* const four_val[] = { &four };
+  Range tmp;
+  rval = MBI->get_entities_by_type_and_tag(moabSet, MBENTITYSET, &geomTag,
+        four_val, 1, tmp);
+  CHKERR(rval,"can't get sets of geo dim 4 ");
+  tmp=intersect(tmp, gRange[4]);
+  *num_sets = tmp.size();// ignore, for the time being, number of hops
+
+  RETURN(iBase_SUCCESS);
 }
 
 void FBiGeom_getEntSets(FBiGeom_Instance instance,
@@ -1248,11 +1269,30 @@


More information about the moab-dev mailing list