r5406 - MOAB/trunk/itaps/imesh
Author: sjackson Date: 2012-02-17 15:17:41 -0600 (Fri, 17 Feb 2012) New Revision: 5406 Modified: MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp MOAB/trunk/itaps/imesh/iMesh_extensions.h Log: Simplify the behavior of iMesh_createStructureMesh Change the behavior of the set_handle parameter so that it is either set equal to the underly ScdBox's entity set, or else has that set added to it. Vertices and mesh elements are no longer added directly to the set_handle set under any circumstance. Modified: MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp =================================================================== --- MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp 2012-02-17 18:58:21 UTC (rev 5405) +++ MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp 2012-02-17 21:17:41 UTC (rev 5406) @@ -3225,16 +3225,15 @@ if (set_handle) { if (!(*set_handle)) { - // make a new set - EntityHandle tmp_set; - rval = MOABI->create_meshset(MESHSET_SET, tmp_set); - CHKERR(rval, "Couldn't create entity set."); - *set_handle = (iBase_EntitySetHandle)tmp_set; + // return the new ScdBox's set + *set_handle = reinterpret_cast<iBase_EntitySetHandle>(scd_box->box_set()); } - - // add box set and new vertices, elements to the file set - rval = MOABI->add_entities(ENTITY_HANDLE(*set_handle), tmp_range); - CHKERR(rval, "Couldn't add new vertices to file set."); + else{ + // add the new ScdBox's set to the given file set + EntityHandle s = scd_box->box_set(); + rval = MOABI->add_entities(ENTITY_HANDLE(*set_handle), &s, 1 ); + CHKERR(rval, "Couldn't add box set to file set."); + } } // get a ptr to global id memory Modified: MOAB/trunk/itaps/imesh/iMesh_extensions.h =================================================================== --- MOAB/trunk/itaps/imesh/iMesh_extensions.h 2012-02-17 18:58:21 UTC (rev 5405) +++ MOAB/trunk/itaps/imesh/iMesh_extensions.h 2012-02-17 21:17:41 UTC (rev 5406) @@ -296,7 +296,8 @@ int elem_gids, /**< [in] If non-zero, assigns global ids to elements, according to global parameterization. */ iBase_EntitySetHandle* set_handle, - /**< [inout] Entity set handle in which to put box and vertices/elements, NULL if not desired, *NULL if function should create one. */ + /**< [inout] A set to which the underlying ScdBox set will be added. NULL if not desired. + * If *NULL, will be set directly to the underlying ScdBox's set. */ int *err /**< [out] Error flag. */ );
participants (1)
-
sjackson@cae.wisc.edu