[MOAB-dev] r4922 - in MOAB/trunk: examples itaps/igeom itaps/imesh src src/io src/moab src/parallel src/parallel/moab test test/dual test/h5file test/io test/obb test/parallel test/perf tools tools/dagmc tools/mbcoupler tools/mbzoltan tools/mcnpmit tools/qvdual tools/refiner tools/vtkMOABReader

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Thu Jun 2 10:03:20 CDT 2011


Author: kraftche
Date: 2011-06-02 10:03:19 -0500 (Thu, 02 Jun 2011)
New Revision: 4922

Modified:
   MOAB/trunk/examples/GeomSetHierarchy.cpp
   MOAB/trunk/examples/SetsNTags.cpp
   MOAB/trunk/examples/SkinMesh.cpp
   MOAB/trunk/examples/SurfArea.cpp
   MOAB/trunk/itaps/igeom/SmoothFaceEval.cpp
   MOAB/trunk/itaps/igeom/iGeom_MOAB.cpp
   MOAB/trunk/itaps/imesh/iMeshP_MOAB.cpp
   MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
   MOAB/trunk/src/AdaptiveKDTree.cpp
   MOAB/trunk/src/AffineXform.cpp
   MOAB/trunk/src/AxisBox.cpp
   MOAB/trunk/src/BSPTree.cpp
   MOAB/trunk/src/Core.cpp
   MOAB/trunk/src/DualTool.cpp
   MOAB/trunk/src/FBEngine.cpp
   MOAB/trunk/src/GeomTopoTool.cpp
   MOAB/trunk/src/HigherOrderFactory.cpp
   MOAB/trunk/src/MergeMesh.cpp
   MOAB/trunk/src/OrientedBox.cpp
   MOAB/trunk/src/OrientedBoxTreeTool.cpp
   MOAB/trunk/src/ScdInterface.cpp
   MOAB/trunk/src/Skinner.cpp
   MOAB/trunk/src/SmoothCurve.cpp
   MOAB/trunk/src/SmoothFace.cpp
   MOAB/trunk/src/WriteUtil.cpp
   MOAB/trunk/src/io/ReadABAQUS.cpp
   MOAB/trunk/src/io/ReadABAQUS.hpp
   MOAB/trunk/src/io/ReadCCMIO.cpp
   MOAB/trunk/src/io/ReadCGM.cpp
   MOAB/trunk/src/io/ReadGmsh.cpp
   MOAB/trunk/src/io/ReadHDF5.cpp
   MOAB/trunk/src/io/ReadIDEAS.cpp
   MOAB/trunk/src/io/ReadMCNP5.cpp
   MOAB/trunk/src/io/ReadNASTRAN.cpp
   MOAB/trunk/src/io/ReadNC.cpp
   MOAB/trunk/src/io/ReadNCDF.cpp
   MOAB/trunk/src/io/ReadSms.cpp
   MOAB/trunk/src/io/ReadTetGen.cpp
   MOAB/trunk/src/io/ReadVtk.cpp
   MOAB/trunk/src/io/Tqdcfr.cpp
   MOAB/trunk/src/io/WriteAns.cpp
   MOAB/trunk/src/io/WriteCCMIO.cpp
   MOAB/trunk/src/io/WriteGMV.cpp
   MOAB/trunk/src/io/WriteGmsh.cpp
   MOAB/trunk/src/io/WriteHDF5.cpp
   MOAB/trunk/src/io/WriteNCDF.cpp
   MOAB/trunk/src/io/WriteSLAC.cpp
   MOAB/trunk/src/io/WriteSLAC.hpp
   MOAB/trunk/src/io/WriteTemplate.cpp
   MOAB/trunk/src/io/WriteTemplate.hpp
   MOAB/trunk/src/moab/Core.hpp
   MOAB/trunk/src/moab/Interface.hpp
   MOAB/trunk/src/moab/OrientedBoxTreeTool.hpp
   MOAB/trunk/src/moab/Types.hpp
   MOAB/trunk/src/parallel/ParallelComm.cpp
   MOAB/trunk/src/parallel/ParallelData.cpp
   MOAB/trunk/src/parallel/ReadParallel.cpp
   MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
   MOAB/trunk/src/parallel/moab/ParallelComm.hpp
   MOAB/trunk/test/MBTest.cpp
   MOAB/trunk/test/TagTest.cpp
   MOAB/trunk/test/dual/dual_test.cpp
   MOAB/trunk/test/gttool_test.cpp
   MOAB/trunk/test/h5file/h5file_test.cpp
   MOAB/trunk/test/h5file/h5legacy.cpp
   MOAB/trunk/test/h5file/h5partial.cpp
   MOAB/trunk/test/h5file/h5portable.cpp
   MOAB/trunk/test/h5file/h5regression.cpp
   MOAB/trunk/test/h5file/h5sets_test.cpp
   MOAB/trunk/test/h5file/h5varlen.cpp
   MOAB/trunk/test/io/VtkTest.cpp
   MOAB/trunk/test/io/cub_file_test.cc
   MOAB/trunk/test/io/exodus_test.cc
   MOAB/trunk/test/io/gmsh_test.cc
   MOAB/trunk/test/io/ideas_test.cc
   MOAB/trunk/test/io/nastran_test.cc
   MOAB/trunk/test/kd_tree_test.cpp
   MOAB/trunk/test/kd_tree_tool.cpp
   MOAB/trunk/test/mbfacet_test.cpp
   MOAB/trunk/test/obb/obb_test.cpp
   MOAB/trunk/test/obb/obb_time.cpp
   MOAB/trunk/test/obb/obb_tree_tool.cpp
   MOAB/trunk/test/parallel/mbparallelcomm_test.cpp
   MOAB/trunk/test/parallel/parallel_hdf5_test.cc
   MOAB/trunk/test/parallel/parallel_unit_tests.cpp
   MOAB/trunk/test/parallel/parallel_write_test.cc
   MOAB/trunk/test/parallel/pcomm_unit.cpp
   MOAB/trunk/test/parallel/scdtest.cpp
   MOAB/trunk/test/parallel/structured3.cpp
   MOAB/trunk/test/perf/perftool.cpp
   MOAB/trunk/tools/SphereDecomp.cpp
   MOAB/trunk/tools/convert.cpp
   MOAB/trunk/tools/dagmc/DagMC.cpp
   MOAB/trunk/tools/dagmc/cub2h5m.cc
   MOAB/trunk/tools/dagmc/dagmc_preproc.cpp
   MOAB/trunk/tools/dagmc/quads_to_tris.cpp
   MOAB/trunk/tools/dagmc/test_geom.cc
   MOAB/trunk/tools/depth.cpp
   MOAB/trunk/tools/gsets.cc
   MOAB/trunk/tools/mbcoupler/Coupler.cpp
   MOAB/trunk/tools/mbcoupler/addfield.cpp
   MOAB/trunk/tools/mbcoupler/mbcoupler_test.cpp
   MOAB/trunk/tools/mbmem.cpp
   MOAB/trunk/tools/mbzoltan/MBZoltan.cpp
   MOAB/trunk/tools/mcnpmit/main.cpp
   MOAB/trunk/tools/mcnpmit/mcnpmit.cpp
   MOAB/trunk/tools/parse.cpp
   MOAB/trunk/tools/propagate_tags.cpp
   MOAB/trunk/tools/qvdual/DrawDual.cpp
   MOAB/trunk/tools/qvdual/vtkMOABUtils.cxx
   MOAB/trunk/tools/refiner/RefinerTagManager.cpp
   MOAB/trunk/tools/size.cpp
   MOAB/trunk/tools/skin.cpp
   MOAB/trunk/tools/sphere_decomp.cpp
   MOAB/trunk/tools/surfplot.cpp
   MOAB/trunk/tools/vtkMOABReader/vtkMOABMesh.cpp
   MOAB/trunk/tools/vtkMOABReader/vtkMOABReader.cxx
Log:
o Mark the following functions in Interface as deprecated: tag_create, tag_create_variable_length, tag_get_handle( const char*, Tag& )
o Change all MOAB code that uses above functions to use new tag_get_handle 
o Fix old test code in MBTest that never ran and would have failed if it did
o Fix gttool_test always succeeded (never exited with non-zero exit code)
o Fix mbfacet_test always succeeded (never exited with non-zero exit code)
o Make MB_TAG_EXCL imply MB_TAG_CREAT for Interface::tag_get_handle
o Ignore storage type (dense/sparse) if specified for bit tags in Interface::tag_get_handle
o Match passed default value of zero with a dense tag with no default value because existing code passes that and dense tags kinda have an implicit default of zero.
o Add flag to Interface::tag_get_handle to skip checking the default value

Rational for changes to tag API:

o One function for both get_handle and create because most code is fine with
  either as long as it gets the desired tag handle
o Distinction between failure and error: callers can specify arguments to
  tag_get_handle such that either they get back MB_SUCCESS or they cannot
  continue (no more checking for other error codes such as MB_ALREADY_ALLOCATED
  that could also mean success in some cases.)
o MOAB does type checking for tag when returning an existing tag handle.
o Sizes specified in number of values rather than number of bytes

Some examples:

OLD: tag_create( name, 4*sizeof(int), MB_TAG_SPARSE, MB_TYPE_INTEGER, handle, NULL, true )
NEW: tag_get_handle( name, 4, MB_TYPE_INTEGER, handle, MB_TAG_SPARSE|MB_TAG_CREAT )

OLD: tag_get_handle( GLOBAL_ID_TAG_NAME, handle )
NEW: tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, handle )

OLD: tag_create_variable_length( name, MB_TAG_DENSE, MB_TYPE_HANDLE, handle, def_val, def_val_len*sizeof(EntityHandle) )
NEW: tag_get_handle( name, def_val_len, MB_TYPE_HANDLE, handle, MB_TAG_DENSE|MB_TAG_VARLEN|MB_TAG_CREAT, def_val )

OLD: tag_create( name, 2, MB_TAG_BIT, MB_TYPE_BIT, handle )
NEW: tag_get_handle( name, 2, MB_TYPE_BIT, handle, MB_TAG_CREAT )



Modified: MOAB/trunk/examples/GeomSetHierarchy.cpp
===================================================================
--- MOAB/trunk/examples/GeomSetHierarchy.cpp	2011-06-02 14:11:27 UTC (rev 4921)
+++ MOAB/trunk/examples/GeomSetHierarchy.cpp	2011-06-02 15:03:19 UTC (rev 4922)
@@ -19,8 +19,8 @@
 
     // get the geometric topology tag handle
   moab::Tag geom_tag, gid_tag;
-  rval = mb->tag_get_handle(GEOM_DIMENSION_TAG_NAME, geom_tag);
-  rval = mb->tag_get_handle(GLOBAL_ID_TAG_NAME, gid_tag);
+  rval = mb->tag_get_handle(GEOM_DIMENSION_TAG_NAME, 1, moab::MB_TYPE_INTEGER, geom_tag);
+  rval = mb->tag_get_handle(GLOBAL_ID_TAG_NAME, 1, moab::MB_TYPE_INTEGER, gid_tag);
 
     // traverse the model, from dimension 3 downward
   moab::Range psets, chsets;

Modified: MOAB/trunk/examples/SetsNTags.cpp
===================================================================
--- MOAB/trunk/examples/SetsNTags.cpp	2011-06-02 14:11:27 UTC (rev 4921)
+++ MOAB/trunk/examples/SetsNTags.cpp	2011-06-02 15:03:19 UTC (rev 4922)
@@ -21,7 +21,7 @@
 
     // loop over set types
   for (int i = 0; i < 3; i++) {
-    rval = mb->tag_get_handle(tag_nms[i], mtag);
+    rval = mb->tag_get_handle(tag_nms[i], 1, MB_TYPE_INTEGER, mtag);
 
       // get all the sets of that type in the mesh
     sets.clear();

Modified: MOAB/trunk/examples/SkinMesh.cpp
===================================================================
--- MOAB/trunk/examples/SkinMesh.cpp	2011-06-02 14:11:27 UTC (rev 4921)
+++ MOAB/trunk/examples/SkinMesh.cpp	2011-06-02 15:03:19 UTC (rev 4922)
@@ -136,8 +136,7 @@
 
   // get surface sets
   MBTag geom_tag;
-  rval = mb->tag_create( GEOM_DIMENSION_TAG_NAME, sizeof(int), MB_TAG_DENSE,
-                         MB_TYPE_INTEGER, geom_tag, 0, true );
+  rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER, geom_tag );
   if(MB_SUCCESS != rval) return 0;
   MBRange surf_sets;
   int two = 2;

Modified: MOAB/trunk/examples/SurfArea.cpp
===================================================================
--- MOAB/trunk/examples/SurfArea.cpp	2011-06-02 14:11:27 UTC (rev 4921)
+++ MOAB/trunk/examples/SurfArea.cpp	2011-06-02 15:03:19 UTC (rev 4922)
@@ -38,8 +38,8 @@
   rval = mb->load_file(argv[1]);


More information about the moab-dev mailing list