[MOAB-dev] r4954 - in MOAB/trunk: itaps/imesh src src/io src/moab src/parallel test test/h5file test/io test/obb test/parallel tools tools/refiner
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Mon Jun 6 14:24:53 CDT 2011
Author: kraftche
Date: 2011-06-06 14:24:52 -0500 (Mon, 06 Jun 2011)
New Revision: 4954
Modified:
MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
MOAB/trunk/src/AdaptiveKDTree.cpp
MOAB/trunk/src/BSPTree.cpp
MOAB/trunk/src/Core.cpp
MOAB/trunk/src/FBEngine.cpp
MOAB/trunk/src/GeomTopoTool.cpp
MOAB/trunk/src/OrientedBoxTreeTool.cpp
MOAB/trunk/src/ReadUtil.cpp
MOAB/trunk/src/ReorderTool.cpp
MOAB/trunk/src/WriteUtil.cpp
MOAB/trunk/src/io/ReadHDF5.cpp
MOAB/trunk/src/io/ReadNCDF.cpp
MOAB/trunk/src/io/Tqdcfr.cpp
MOAB/trunk/src/io/WriteCCMIO.cpp
MOAB/trunk/src/io/WriteHDF5.cpp
MOAB/trunk/src/io/WriteVtk.cpp
MOAB/trunk/src/moab/Core.hpp
MOAB/trunk/src/moab/Interface.hpp
MOAB/trunk/src/parallel/ParallelComm.cpp
MOAB/trunk/src/parallel/ParallelData.cpp
MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
MOAB/trunk/test/OBBTest.cpp
MOAB/trunk/test/TagTest.cpp
MOAB/trunk/test/h5file/h5file_test.cpp
MOAB/trunk/test/h5file/h5partial.cpp
MOAB/trunk/test/h5file/h5portable.cpp
MOAB/trunk/test/h5file/h5regression.cpp
MOAB/trunk/test/h5file/h5varlen.cpp
MOAB/trunk/test/io/VtkTest.cpp
MOAB/trunk/test/obb/obb_tree_tool.cpp
MOAB/trunk/test/parallel/parallel_hdf5_test.cc
MOAB/trunk/test/parallel/pcomm_unit.cpp
MOAB/trunk/test/reorder_test.cpp
MOAB/trunk/tools/mbmem.cpp
MOAB/trunk/tools/parse.cpp
MOAB/trunk/tools/propagate_tags.cpp
MOAB/trunk/tools/refiner/RefinerTagManager.cpp
MOAB/trunk/tools/refiner/SimplexTemplateTagAssigner.cpp
Log:
Remaining tag API changes: convert from sizes in bytes to sizes as number of
values where appropriate:
o Mark Interface::tag_get_size as deprecated and add new functions:
tag_get_length and tag_get_bytes, where the former returns the number
of values of the tag data type (e.g. number of doubles for tag with
MB_TYPE_DOUBLE), returning the number of bits for bit tags and the
number of bytes for opaque tags. The latter is the same as the old
tag_get_size, *except* that it always returns 1 for bit tags.
o Make the tag_get/set_data functions that work with arrays of pointers
to tag values and arrays of lengths as deprecated, replacing them with
analogous tag_get/set_by_ptr functions that work with lengths in terms
of number of values rather than number of bytes. Function rename will
also help to avoid memory corruption when attempting to call the old
functions w/out the optional length array and accidentally calling the
non-pointer variants due to accidental cast to void*.
o Change seldom used optional size argument to tag_get_default_value and
tag_clear_data to be interpreted as number of values rather than number
of bytes.
o Update all MOAB code for these changes.
Modified: MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
===================================================================
--- MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp 2011-06-06 18:57:55 UTC (rev 4953)
+++ MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp 2011-06-06 19:24:52 UTC (rev 4954)
@@ -194,9 +194,8 @@
rval = mb->tag_get_data_type( t, type );
if (MB_SUCCESS != rval) return rval;
if (MB_TYPE_HANDLE != type) return MB_TYPE_OUT_OF_RANGE;
- rval = mb->tag_get_size( t, size );
+ rval = mb->tag_get_length( t, size );
if (MB_SUCCESS != rval) return rval;
- size /= sizeof(EntityHandle);
std::vector<EntityHandle> data(size);
// check for global/mesh value
@@ -242,7 +241,7 @@
int size;
size_t r, w = 0;
for (r = 0; r < tags.size(); ++r)
- if (MB_SUCCESS == mb->tag_get_size( tags[r], size ))
+ if (MB_SUCCESS == mb->tag_get_length( tags[r], size ))
tags[w++] = tags[r];
}
@@ -1619,7 +1618,7 @@
// check if tag value is set on mesh
const void* data_ptr;
EntityHandle root = 0;
- result = MOABI->tag_get_data( this_tag, &root, 1, &data_ptr );
+ result = MOABI->tag_get_by_ptr( this_tag, &root, 1, &data_ptr );
if (MB_SUCCESS == result)
ERROR(iBase_TAG_IN_USE, "iMesh_destroyTag: forced=false and mesh"
" is still assigned this tag.");
@@ -1680,30 +1679,9 @@
/*in*/ const iBase_TagHandle tag_handle,
int *tag_size_val, int *err)
{
- ErrorCode result = MOABI->tag_get_size(TAG_HANDLE(tag_handle), *tag_size_val);
+ ErrorCode result = MOABI->tag_get_length(TAG_HANDLE(tag_handle), *tag_size_val);
CHKERR(result, "iMesh_getTagSize: problem getting size.");
- DataType this_type;
- result = MOABI->tag_get_data_type(TAG_HANDLE(tag_handle), this_type);
- CHKERR(result, "iMesh_getTagSize: problem getting type.");
-
- switch (this_type) {
- case MB_TYPE_INTEGER:
- *tag_size_val /= sizeof(int);
- break;
- case MB_TYPE_DOUBLE:
- *tag_size_val /= sizeof(double);
More information about the moab-dev
mailing list