Commit 5fea31a5 authored by Rajeev Jain's avatar Rajeev Jain

o Resolve merge conflicts

Merge branch 'iulian07/clang_osx_warnings' of https://bitbucket.org/fathomteam/moab into iulian07/clang_osx_warnings
parents ff472619 18862019
This diff is collapsed.
......@@ -745,6 +745,7 @@ EXPORT_LDFLAGS="$ZOLTAN_LIB_FLAGS $EXPORT_LDFLAGS"
################################################################################
# CGM
################################################################################
USING_DEV_CGM=no
AC_ARG_WITH(cgm,
[AS_HELP_STRING([--with-cgm=DIR],[Specify directory containing CGM])],
[CGM_DIR=$withval
......@@ -767,7 +768,7 @@ case "x$CGM_DIR" in
AC_CHECK_FILE([${CGM_DIR}/lib/cgm.make],
[CGM_MAKE="${CGM_DIR}/lib/cgm.make"],
[AC_CHECK_FILE([${CGM_DIR}/cgm.make],
[CGM_MAKE="${CGM_DIR}/cgm.make"],
[CGM_MAKE="${CGM_DIR}/cgm.make"; USING_DEV_CGM=yes],
[AC_MSG_ERROR([$CGM_DIR : not a configured CGM]);
CGM_MISSING=yes])
])
......@@ -777,7 +778,6 @@ esac
if test "x$CGM_MISSING" = "xno"; then
CGM_CONFIG_OPTIONS="include $CGM_MAKE"
AC_MSG_CHECKING([Checking for GeometryQueryTool::ray_fire(RefFace*,...)])
FATHOM_MAKE_INC_VAR([$CGM_MAKE],[CGM_DEFINES], [CGM_CPPFLAGS="$make_val"])
FATHOM_MAKE_INC_VAR([$CGM_MAKE],[CGM_INCLUDES],[CGM_CPPFLAGS="$CGM_CPPFLAGS $make_val"])
FATHOM_MAKE_INC_VAR([$CGM_MAKE],[CGM_LTFLAGS], [CGM_LTFLAGS="$make_val"])
......@@ -789,40 +789,49 @@ if test "x$CGM_MISSING" = "xno"; then
CPPFLAGS="$CGM_CPPFLAGS $CPPFLAGS"
HAVE_OCC=no
HAVE_FACET=no
AC_CHECK_HEADER([OCCPoint.hpp],
[HAVE_OCC=yes; AC_DEFINE(HAVE_CGM_OCC, [1], [MOAB uses CGM configured with OpenCascade]) ],
[HAVE_FACET=yes; AC_DEFINE(HAVE_CGM_FACET, [1], [MOAB uses CGM configured with Facet Engine only]) ]
)
AC_MSG_CHECKING([for underlying geometry engine in CGM])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([@%:@include <CGMConfig.h>],
[ #ifndef CGM_HAVE_FACET_ENGINE_ONLY
// Perfect!
#else
# error Only Facet engine available
#endif
])
],
[HAVE_OCC=yes
AC_DEFINE(HAVE_CGM_OCC, [1], [MOAB uses CGM configured with OpenCascade])
AC_MSG_RESULT(OCC)],
[HAVE_FACET=yes
AC_DEFINE(HAVE_CGM_FACET, [1], [MOAB uses CGM configured with Facet Engine only])
AC_MSG_RESULT(Facets)] )
CPPFLAGS="$old_CPPFLAGS"
AC_LANG_POP([C++])
if (test "x$HAVE_CUBIT" != "xno"); then
AC_LANG_PUSH([C++])
old_CPPFLAGS="$CPPFLAGS"
old_LDFLAGS="$LDFLAGS"
old_LIBS="$LIBS"
CPPFLAGS="$CGM_CPPFLAGS $CPPFLAGS"
LDFLAGS="$CGM_LDFLAGS $CPPFLAGS"
LIBS="$CGM_LIBS $LIBS"
HAVE_CGM_FIRE_RAY=no
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include "GeometryQueryTool.hpp"
#include "CubitVector.hpp"],
[CubitVector a,b;
DLIList<double> c;
GeometryQueryTool::instance()->fire_ray((RefFace*)0, a, b, c );
])],
[HAVE_CGM_FIRE_RAY=yes;
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
CPPFLAGS="$old_CPPFLAGS"
LDFLAGS="$old_LDFLAGS"
LIBS="$old_LIBS"
# LDFLAGS="$old_LDFLAGS"
# LIBS="$old_LIBS"
AC_LANG_POP([C++])
fi
AC_MSG_CHECKING([for GeometryQueryTool::ray_fire(RefFace*,...)])
AC_LANG_PUSH([C++])
old_CPPFLAGS="$CPPFLAGS"
old_LDFLAGS="$LDFLAGS"
old_LIBS="$LIBS"
CPPFLAGS="$CGM_CPPFLAGS $CPPFLAGS"
LDFLAGS="$CGM_LDFLAGS $CPPFLAGS"
LIBS="$CGM_LIBS $LIBS"
HAVE_CGM_FIRE_RAY=no
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include "GeometryQueryTool.hpp"
#include "CubitVector.hpp"],
[CubitVector a,b;
DLIList<double> c;
GeometryQueryTool::instance()->fire_ray((RefFace*)0, a, b, c );
])],
[HAVE_CGM_FIRE_RAY=yes;
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
CPPFLAGS="$old_CPPFLAGS"
LDFLAGS="$old_LDFLAGS"
LIBS="$old_LIBS"
AC_LANG_POP([C++])
EXPORT_LDFLAGS="$EXPORT_LDFLAGS $CGM_LDFLAGS"
EXPORT_LTFLAGS="$EXPORT_LTFLAGS $CGM_LTFLAGS"
fi
......@@ -851,6 +860,7 @@ fi
AC_MSG_CHECKING([if iRel support is to be built])
AC_MSG_RESULT([$ENABLE_irel])
AM_CONDITIONAL([ENABLE_irel],[test "xyes" = "x$ENABLE_irel"])
if test "x$ENABLE_irel" = "xyes"; then
if (test "x$ENABLE_imesh" != "xyes" || test "x$CGM_MISSING" != "xno"); then
AC_MSG_ERROR([Cannot build iRel API. Enable both iGeom (CGM) and iMesh implementations.])
......@@ -861,9 +871,9 @@ if test "x$ENABLE_irel" = "xyes"; then
[IGEOM_CONFIG_OPTIONS="include ${CGM_DIR}/lib/iGeom-Defs.inc";
FATHOM_MAKE_INC_VAR([${CGM_DIR}/lib/iGeom-Defs.inc],[IGEOM_DEFINES], [IGEOM_DEFINES="$make_val"],
[IGEOM_DEFINES=]) ],
[AC_CHECK_FILE([${CGM_DIR}/iGeom-Defs.inc],
[IGEOM_CONFIG_OPTIONS="include ${CGM_DIR}/iGeom-Defs.inc"],
[AC_MSG_WARN([$CGM_DIR : not a configured iGeom])]
[AC_CHECK_FILE([${CGM_DIR}/itaps/iGeom-Defs.inc],
[IGEOM_CONFIG_OPTIONS="include ${CGM_DIR}/itaps/iGeom-Defs.inc"],
[AC_MSG_WARN([$CGM_DIR : iGeom is not configured correctly])]
)
])
AC_SUBST(IGEOM_DEFINES)
......@@ -879,6 +889,7 @@ test "x$ENABLE_irel" != "xyes" || HAVE_IREL="yes"
AC_SUBST(HAVE_IGEOM)
AC_SUBST(HAVE_IMESH)
AC_SUBST(HAVE_IREL)
AM_CONDITIONAL([USING_DEV_CGM],[test "xyes" = "x$USING_DEV_CGM"])
###############################################################################
# Optional Tools
......
......@@ -64,7 +64,7 @@ program DirectAccessNoHolesF90
character*120 opt
! initialize interface and get root set
call iMesh_newMesh("", %REF(imesh), ierr)
call iMesh_newMesh("", imesh, ierr)
CHECK(ierr)
call iMesh_getRootSet(%val(imesh), root_set, ierr)
CHECK(ierr)
......
......@@ -15,7 +15,7 @@
! NOTE: not integer*4 (see meaning of _LP64 in GNU docs)
# define IBASE_HANDLE_T integer
# endif
#elif defined(__INTEL_COMPILER)
#elif defined(__INTEL_COMPILER) || defined(__PGI)
# ifdef __x86_64
# define IBASE_HANDLE_T integer*8
# else
......
......@@ -2354,7 +2354,7 @@ int test_entity_copies( iMesh_Instance imesh, iMeshP_PartitionHandle prtn, const
// add all vertices to local_data
for (size_t j = 0; j < verts.size(); ++j) {
int tag;
int tag=0;
ierr = vertex_tag( imesh, verts[j], tag );
if (ierr)
break;
......
......@@ -18,6 +18,6 @@ IMESH_LIBS = $(IMESH_LDFLAGS) -L$(MOAB_LIBDIR) \
@FCLIBS@ @LIBS@
IMESH_INCLUDEDIR = @abs_srcdir@
IMESH_INCLUDEDIR2 = -I@abs_builddir@ -I@abs_srcdir@/.. -I@abs_builddir@/.. -I@abs_top_builddir@/src
IMESH_INCLUDEDIR2 = -I@abs_builddir@ -I@abs_srcdir@/.. -I@abs_builddir@/.. -I@abs_top_builddir@/src -I@abs_srcdir@/../../src
IMESH_LIBDIR = @abs_builddir@/.libs
MOAB_LIBDIR = @abs_top_builddir@/src/.libs
......@@ -2406,7 +2406,7 @@ extern "C" {
EntityHandle set1 = ENTITY_HANDLE(entity_set_1),
set2 = ENTITY_HANDLE(entity_set_2);
int isList1, isList2;
int isList1=0, isList2=0;
iMesh_isList(instance, entity_set_1, &isList1, err);
if (*err != iBase_SUCCESS) return;
iMesh_isList(instance, entity_set_2, &isList2, err);
......@@ -2455,7 +2455,7 @@ extern "C" {
EntityHandle set1 = ENTITY_HANDLE(entity_set_1),
set2 = ENTITY_HANDLE(entity_set_2);
int isList1, isList2;
int isList1=0, isList2=0;
iMesh_isList(instance, entity_set_1, &isList1, err);
if (*err != iBase_SUCCESS) return;
iMesh_isList(instance, entity_set_2, &isList2, err);
......@@ -2561,7 +2561,7 @@ extern "C" {
EntityHandle set1 = ENTITY_HANDLE(entity_set_1),
set2 = ENTITY_HANDLE(entity_set_2);
int isList1, isList2;
int isList1=0, isList2=0;
iMesh_isList(instance, entity_set_1, &isList1, err);
if (*err != iBase_SUCCESS) return;
iMesh_isList(instance, entity_set_2, &isList2, err);
......
......@@ -65,10 +65,16 @@ if HAVE_CGM
libiRel_la_SOURCES += \
GeomAssocPairSide.cpp \
GeomAssocPairSide.hpp
if USING_DEV_CGM
libiRel_la_LIBADD += \
${IGEOM_LTFLAGS} ${IGEOM_LDFLAGS} ${CGM_DIR}/itaps/libiGeom.la
TEST_DEPS += ${CGM_DIR}/itaps/libiGeom.la
else
libiRel_la_LIBADD += \
${IGEOM_LTFLAGS} ${IGEOM_LDFLAGS} ${CGM_DIR}/lib/libiGeom.la
LIBS += ${CGM_LIBS}
TEST_DEPS += ${CGM_DIR}/lib/libiGeom.la
endif
LIBS += ${CGM_LIBS}
endif
TEST_DEPS += ${MOAB_CXX_LINKFLAGS} ${MOAB_CXX_LIBS}
......
......@@ -34,7 +34,7 @@ typedef void* iRel_EntityHandle;
*/
void handle_error_code(const int result,
int *number_failed,
int *number_not_implemented,
int * /*number_not_implemented*/,
int *number_successful)
{
if (result) {
......
......@@ -5,6 +5,7 @@ MOAB_LIBDIR = @abs_builddir@/src/.libs
MOAB_INCLUDES = -I@abs_srcdir@/src \
-I@abs_builddir@/src \
-I@abs_srcdir@/src/oldinc \
-I@abs_srcdir@/src/verdict \
-I@abs_srcdir@/src/parallel \
-I@abs_builddir@/src/parallel \
-I@abs_srcdir@/src/LocalDiscretization \
......
......@@ -815,6 +815,7 @@ bool BSPTreePoly::is_point_contained( const CartVect& point ) const
if (!faceList) // empty (zero-dimension) polyhedron
return false;
const double EPSILON = 1e-6;
// Test that point is below the plane of each face
// NOTE: This will NOT work for polyhedra w/ concavities
for (Face* face = faceList; face; face = face->nextPtr) {
......@@ -828,7 +829,7 @@ bool BSPTreePoly::is_point_contained( const CartVect& point ) const
CartVect norm = (*pt3 - *pt2) * (*pt1 - *pt2);
double coeff = -(norm % *pt2);
if (norm % point > -coeff) // if above plane
if ( (norm % point + coeff) > EPSILON) // if above plane, with some -epsilon
return false;
}
......
This diff is collapsed.
......@@ -785,24 +785,26 @@ namespace moab{
timeall.tm_refine += tm->time_elapsed() - tstart;
// Go into parallel communication
if (!optimize) {
#ifdef MOAB_HAVE_MPI
if (pcomm && (pcomm->size()> 1) && !optimize)
{
if (pcomm && (pcomm->size()> 1)) {
double tpstart = tm->time_elapsed();
error = resolve_shared_ents_parmerge(l, hm_set[l]);MB_CHK_ERR(error);
timeall.tm_resolve += tm->time_elapsed() - tpstart;
}
#endif
}
}
if (optimize) {
#ifdef MOAB_HAVE_MPI
if (pcomm && (pcomm->size()> 1)&& optimize)
{
double tpstart = tm->time_elapsed();
error = resolve_shared_ents_opt(hm_set, nlevels);MB_CHK_ERR(error);
timeall.tm_resolve = tm->time_elapsed() - tpstart;
}
if (pcomm && (pcomm->size()> 1)) {
double tpstart = tm->time_elapsed();
error = resolve_shared_ents_opt(hm_set, nlevels);MB_CHK_ERR(error);
timeall.tm_resolve = tm->time_elapsed() - tpstart;
}
#endif
}
timeall.tm_total = timeall.tm_refine + timeall.tm_resolve;
return MB_SUCCESS;
......@@ -1922,14 +1924,13 @@ namespace moab{
* Parallel Communication *
* ********************************/
#ifdef MOAB_HAVE_MPI
ErrorCode NestedRefine::resolve_shared_ents_parmerge(int level, EntityHandle levelset)
{
// TEMP: Add the adjacencies for MOAB-native DS
// NOTE (VSM): This is expensive since it creates a doubly
// redundant copy of the adjacency data in both MOAB-native
// and AHF. Need to fix this with AHF optimized branch.
#ifdef MOAB_HAVE_MPI
ErrorCode error;
ReadUtilIface *read_iface;
error = mbImpl->query_interface(read_iface);MB_CHK_ERR(error);
......@@ -1992,15 +1993,11 @@ namespace moab{
}
}
#else
MB_SET_ERR(MB_FAILURE, "Resolving shared interface for serial mesh");
#endif
return MB_SUCCESS;
}
ErrorCode NestedRefine::resolve_shared_ents_opt(EntityHandle *hm_set, int num_levels)
{
#ifdef MOAB_HAVE_MPI
assert(pcomm->size() > 1);
ErrorCode error;
......@@ -2019,13 +2016,11 @@ namespace moab{
//All shared processors
std::set<unsigned int> shprocs;
error = pcomm->get_comm_procs(shprocs);MB_CHK_ERR(error);
// std::cout<<"#shprocs = "<<shprocs.size()<<std::endl;
std::vector<int> sharedprocs;
for (std::set<unsigned int>::iterator it = shprocs.begin(); it != shprocs.end(); it++)
sharedprocs.push_back(*it);
int nprocs = sharedprocs.size();
// std::cout<<"nprocs = "<<nprocs<<std::endl;
//Create buffer variables storing the entities to be sent and received
std::vector<std::vector<int> > nsharedEntsperproc(nprocs);
......@@ -2046,17 +2041,11 @@ namespace moab{
Range allEnts;
error = collect_shared_entities_by_dimension(sharedentities, allEnts);MB_CHK_ERR(error);
// std::cout<<"collect_shared_entities_by_dimension"<<std::endl;
Range V0, E0, F0;
V0 = allEnts.subset_by_dimension(0);
E0 = allEnts.subset_by_dimension(1);
F0 = allEnts.subset_by_dimension(2);
// std::cout<<"#sharedFaces with proc = "<<sharedprocs[i]<<" :: "<<F0.size()<<std::endl;
// std::cout<<"#sharedEdges with proc = "<<sharedprocs[i]<<" :: "<<E0.size()<<std::endl;
// std::cout<<"#sharedVerts with proc = "<<sharedprocs[i]<<" :: "<<V0.size()<<std::endl;
// Step 2A: Prepare msg to be sent:
//
// FList = <F, FC, FE> where F, FC and FE are vectors containing the faces, their connectivities and edges.
......@@ -2103,9 +2092,6 @@ namespace moab{
msgsz.push_back(V0.size()); msgsz.push_back(locVList.size());
nsharedEntsperproc[i].insert(nsharedEntsperproc[i].end(),msgsz.begin(), msgsz.end());
// for (int j=0; j<msgsz.size(); j++)
// std::cout<<"msg_sizes["<<j<<"] = "<<msgsz[j]<<std::endl;
if (!F0.empty())
{
localBuffs[i].insert(localBuffs[i].end(), locFList.begin(), locFList.end());
......@@ -2134,13 +2120,11 @@ namespace moab{
// Step 6: Update pcomm tags
error = update_parallel_tags(rprocs, rhandles);MB_CHK_ERR(error);
#else
MB_SET_ERR(MB_FAILURE, "Resolving shared interface for serial mesh");
#endif
return MB_SUCCESS;
}
ErrorCode NestedRefine::collect_shared_entities_by_dimension(Range sharedEnts, Range &allEnts)
{
ErrorCode error;
......@@ -2209,7 +2193,6 @@ namespace moab{
ErrorCode NestedRefine::collect_FList(int to_proc, Range faces, std::vector<EntityHandle> &FList, std::vector<EntityHandle> &RList)
{
#ifdef MOAB_HAVE_MPI
ErrorCode error;
FList.clear();
......@@ -2277,9 +2260,6 @@ namespace moab{
RList.insert(RList.end(), FC.begin(), FC.end());
RList.insert(RList.end(), rFE.begin(), rFE.end());
RList.insert(RList.end(), FE.begin(), FE.end());
#else
MB_SET_ERR(MB_FAILURE, "Requesting collection of faces on shared interface for serial mesh");
#endif
return MB_SUCCESS;
}
......@@ -2287,7 +2267,6 @@ namespace moab{
ErrorCode NestedRefine::collect_EList(int to_proc, Range edges, std::vector<EntityHandle> &EList, std::vector<EntityHandle> &RList)
{
#ifdef MOAB_HAVE_MPI
ErrorCode error;
EList.clear();
std::vector<EntityHandle> E, EC, lE, lEC, rE, rEC;
......@@ -2340,9 +2319,6 @@ namespace moab{
RList.insert(RList.end(), E.begin(), E.end());
RList.insert(RList.end(), rEC.begin(), rEC.end());
RList.insert(RList.end(), EC.begin(), EC.end());
#else
MB_SET_ERR(MB_FAILURE, "Requesting collection of edges on shared interface for serial mesh");
#endif
return MB_SUCCESS;
}
......@@ -2350,23 +2326,18 @@ namespace moab{
ErrorCode NestedRefine::collect_VList(int to_proc, Range verts, std::vector<EntityHandle> &VList, std::vector<EntityHandle> &RList)
{
#ifdef MOAB_HAVE_MPI
ErrorCode error;
std::vector<EntityHandle> V, lV, rV;
VList.clear();
// std::cout<<"shared_proc = "<<to_proc<<std::endl;
//Add the vertices at the coarsest level first.
for (Range::iterator it = verts.begin(); it != verts.end(); it++)
{
EntityHandle v = *it;
// std::cout<<"v = "<<v<<std::endl;
lV.push_back(v);
EntityHandle rval = 0;
error = pcomm->get_remote_handles(&v, &rval, 1, to_proc);MB_CHK_ERR(error);
// std::cout<<"rv = "<<rval<<std::endl;
rV.push_back(rval);
}
......@@ -2390,23 +2361,9 @@ namespace moab{
RList.insert(RList.end(), rV.begin(), rV.end());
RList.insert(RList.end(), V.begin(), V.end());
//DBG
// std::cout<<"shared_proc = "<<to_proc<<std::endl;
//std::cout<<"|VList| = "<<VList.size()<<std::endl;
// std::cout<<"|RList| = "<<RList.size()<<std::endl;
// for (int i=0; i<VList.size(); i++)
// std::cout<<"VList["<<i<<"] = "<<VList[i]<<", RList["<<i<<"] = "<<RList[i]<<std::endl;
//DBG
#else
MB_SET_ERR(MB_FAILURE, "Requesting collection of vertices on shared interface for serial mesh");
#endif
return MB_SUCCESS;
}
ErrorCode NestedRefine::decipher_remote_handles(std::vector<int> &sharedprocs, std::vector<std::vector<int> > &auxinfo, std::vector<std::vector<EntityHandle> > &localbuffers, std::vector<std::vector<EntityHandle> > &remotebuffers, std::multimap<EntityHandle, int> &remProcs, std::multimap<EntityHandle, EntityHandle> &remHandles)
{
ErrorCode error;
......@@ -2488,17 +2445,6 @@ namespace moab{
LVList.insert(LVList.end(), localbuffers[i].begin(), localbuffers[i].end());
RVList.insert(RVList.end(), remotebuffers[i].begin(), remotebuffers[i].end());
//DBG
//std::cout<<"|LVList| = "<<LVList.size()<<", |RVList| = "<<RVList.size()<<std::endl;
// std::cout<<"from_proc = "<<sharedprocs[i]<<std::endl;
// for (int j=0; j<LVList.size(); j++)
// std::cout<<"LVList["<<j<<"] = "<<LVList[j]<<std::endl;
// for (int j=0; j<RVList.size(); j++)
// std::cout<<"RVList["<<j<<"] = "<<RVList[j]<<std::endl;
//DBG
error = decipher_remote_handles_vertex(sharedprocs[i], msgsz[4], LVList, RVList, remProcs, remHandles);MB_CHK_ERR(error);
}
else
......@@ -2618,7 +2564,6 @@ namespace moab{
}
}
return MB_SUCCESS;
}
......@@ -2761,7 +2706,6 @@ namespace moab{
ErrorCode NestedRefine::update_parallel_tags(std::multimap<EntityHandle, int> &remProcs, std::multimap<EntityHandle, EntityHandle> & remHandles)
{
#ifdef MOAB_HAVE_MPI
ErrorCode error;
std::vector<int> rprocs;
......@@ -2798,9 +2742,7 @@ namespace moab{
it = remProcs.upper_bound(it->first);
}
#else
MB_SET_ERR(MB_FAILURE, "Requesting updation of parallel tags for serial mesh");
#endif
return MB_SUCCESS;
}
......@@ -3018,6 +2960,8 @@ namespace moab{
return MB_SUCCESS;
}
#endif
/**********************************
* Update AHF maps *
......
This diff is collapsed.
......@@ -27,24 +27,6 @@
namespace moab {
inline
static ErrorCode not_found(const std::string& /*name*/, EntityHandle /*h*/)
{
// MB_TAG_NOT_FOUND could be a non-error condition, do not call MB_SET_ERR on it
// Print warning messages for debugging only
#if 0
if (h)
fprintf(stderr, "[Warning]: No sparse tag %s value for %s %lu\n",
name.c_str(),
CN::EntityTypeName(TYPE_FROM_HANDLE(h)),
(unsigned long)ID_FROM_HANDLE(h));
else
fprintf(stderr, "[Warning]: No sparse tag %s value for root set\n", name.c_str());
#endif
return MB_TAG_NOT_FOUND;
}
SparseTag::SparseTag(const char* name,
int size,
DataType type,
......@@ -117,14 +99,14 @@ ErrorCode SparseTag::get_data(Error* /* error */, EntityHandle entity_handle, vo
return MB_SUCCESS;
}
else
return not_found(get_name(), entity_handle);
return MB_TAG_NOT_FOUND;
}
ErrorCode SparseTag::remove_data(Error* /* error */, EntityHandle entity_handle)
{
MapType::iterator i = mData.find(entity_handle);
if (i == mData.end())
return not_found(get_name(), entity_handle);
if (i == mData.end())
return MB_TAG_NOT_FOUND;
mAllocator.destroy(i->second);
mData.erase(i);
......@@ -141,7 +123,8 @@ ErrorCode SparseTag::get_data(const SequenceManager*,
ErrorCode rval;
unsigned char* ptr = reinterpret_cast<unsigned char*>(data);
for (size_t i = 0; i < num_entities; ++i, ptr += get_size()) {
rval = get_data(NULL, entities[i], ptr);MB_CHK_ERR(rval);
rval = get_data(NULL, entities[i], ptr);
if (MB_SUCCESS != rval) return rval;
}
return MB_SUCCESS;
......@@ -156,7 +139,8 @@ ErrorCode SparseTag::get_data(const SequenceManager*,
unsigned char* ptr = reinterpret_cast<unsigned char*>(data);
Range::const_iterator i;
for (i = entities.begin(); i != entities.end(); ++i, ptr += get_size()) {
rval = get_data(NULL, *i, ptr);MB_CHK_ERR(rval);
rval = get_data(NULL, *i, ptr);
if (MB_SUCCESS != rval) return rval;
}
return MB_SUCCESS;
......@@ -181,7 +165,7 @@ ErrorCode SparseTag::get_data(const SequenceManager*,
*pointers = get_default_value();
}
else if (MB_SUCCESS != rval_tmp) {
rval = not_found(get_name(), entities[i]);
return MB_TAG_NOT_FOUND;
}
}
......@@ -207,7 +191,7 @@ ErrorCode SparseTag::get_data(const SequenceManager*,
*pointers = get_default_value();
}
else if (MB_SUCCESS != rval_tmp) {
rval = not_found(get_name(), *i);
return MB_TAG_NOT_FOUND;
}
}
......@@ -329,7 +313,9 @@ ErrorCode SparseTag::remove_data(SequenceManager*,
{
ErrorCode rval;
for (size_t i = 0; i < num_entities; ++i) {
rval = remove_data(NULL, entities[i]);MB_CHK_ERR(rval);
rval = remove_data(NULL, entities[i]);
if (MB_SUCCESS != rval)
return rval;
}
return MB_SUCCESS;
......@@ -382,7 +368,7 @@ ErrorCode SparseTag::tag_iterate(SequenceManager* seqman,
// the count can be computed properly
if (get_default_value() && !allocate)
++iter;
return not_found(get_name(), *iter);
// return not_found(get_name(), *iter);
}
// Increment iterator and return
......
......@@ -26,23 +26,6 @@
namespace moab {
inline
static ErrorCode not_found(const std::string& /*name*/, EntityHandle /*h*/)
{
// MB_TAG_NOT_FOUND could be a non-error condition, do not call MB_SET_ERR on it
#if 0
if (h)
fprintf(stderr, "[Warning]: No variable-length sparse tag %s value for %s %lu\n",
name.c_str(),
CN::EntityTypeName(TYPE_FROM_HANDLE(h)),
(unsigned long)ID_FROM_HANDLE(h));
else
fprintf(stderr, "[Warning]: No variable-length sparse tag %s value for root set\n", name.c_str());
#endif
return MB_TAG_NOT_FOUND;
}
VarLenSparseTag::VarLenSparseTag(const char* name,
DataType type,
const void* default_value,
......@@ -82,7 +65,7 @@ ErrorCode VarLenSparseTag::get_data_ptr(Error* /* error */,
length = get_default_value_size();
}
else
return not_found(get_name(), entity_handle);
return MB_TAG_NOT_FOUND;
return MB_SUCCESS;
}
......@@ -117,7 +100,8 @@ ErrorCode VarLenSparseTag::get_data(const SequenceManager*,
ErrorCode rval;
for (size_t i = 0; i < num_entities; ++i) {
rval = get_data_ptr(NULL, entities[i], pointers[i], lengths[i]);MB_CHK_ERR(rval);
rval = get_data_ptr(NULL, entities[i], pointers[i], lengths[i]);
if (rval != MB_SUCCESS) return rval;
}
return MB_SUCCESS;
......@@ -136,7 +120,8 @@ ErrorCode VarLenSparseTag::get_data(const SequenceManager*,
ErrorCode rval;
Range::const_iterator i;
for (i = entities.begin(); i != entities.end(); ++i, ++pointers, ++lengths) {
rval = get_data_ptr(NULL, *i, *pointers, *lengths);MB_CHK_ERR(rval);
rval = get_data_ptr(NULL, *i, *pointers, *lengths);
if (rval != MB_SUCCESS) return rval;
}
return MB_SUCCESS;
......@@ -264,7 +249,7 @@ ErrorCode VarLenSparseTag::remove_data(SequenceManager*,
for (size_t i = 0; i < num_entities; ++i) {
MapType::iterator p = mData.find(entities[i]);
if (p == mData.end())
result = not_found(get_name(), entities[i]);
return MB_TAG_NOT_FOUND;
else {
p->second.clear();
mData.erase(p);
......@@ -282,7 +267,7 @@ ErrorCode VarLenSparseTag::remove_data(SequenceManager*,
for (Range::iterator i = entities.begin(); i != entities.end(); ++i) {
MapType::iterator p = mData.find(*i);
if (p == mData.end())
result = not_found(get_name(), *i);
return MB_TAG_NOT_FOUND;
else {
p->second.clear();
mData.erase(p);
......
......@@ -97,7 +97,10 @@ else
endif
if HAVE_CGM
AM_CPPFLAGS += @CGM_CPPFLAGS@
AM_CPPFLAGS += @CGM_CPPFLAGS@
if USING_DEV_CGM
AM_CPPFLAGS += -I$(CGM_DIR)/src
endif
MOAB_CGM_SRCS = ReadCGM.cpp ReadCGM.hpp
libmoabio_la_LIBADD += @CGM_LIBS@
else
......
......@@ -188,7 +188,7 @@ ErrorCode ReadSTL::ascii_read_triangles(const char* name,
{
FILE* file = fopen(name, "r");
if (!file) {
MB_SET_ERR(MB_FILE_DOES_NOT_EXIST, name << ": " << strerror(errno));
return MB_FILE_DOES_NOT_EXIST;
}
char header[81];
......@@ -198,7 +198,7 @@ ErrorCode ReadSTL::ascii_read_triangles(const char* name,
memcmp(header, "solid", 5) || // Must begin with "solid"
!isspace(header[5])) { // Followed by a whitespace char
fclose(file);
MB_SET_ERR(MB_FILE_WRITE_ERROR, name << ": " << strerror(errno));
return MB_FILE_WRITE_ERROR;
}
// Use tokenizer for remainder of parsing
......@@ -262,14 +262,14 @@ ErrorCode ReadSTL::binary_read_triangles(const char* name,
{
FILE* file = fopen(name, "rb");
if (!file) {
MB_SET_ERR(MB_FILE_DOES_NOT_EXIST, name << ": " << strerror(errno));
return MB_FILE_DOES_NOT_EXIST;
}
// Read header block
BinaryHeader header;
if (fread(&header, 84, 1, file) != 1) {
fclose(file);
MB_SET_ERR(MB_FILE_WRITE_ERROR, name << ": " << strerror(errno));
return MB_FILE_WRITE_ERROR;
}
// Allow user setting for byte order, default to little endian
......@@ -309,7 +309,7 @@ ErrorCode ReadSTL::binary_read_triangles(const char* name,
ULONG_MAX / 50 - 84 < num_tri_swap || // Watch for overflow in next line
84 + 50 * num_tri_swap != (unsigned long)filesize) {
fclose(file);
MB_SET_ERR(MB_FILE_DOES_NOT_EXIST, name << ": not a binary STL file");
return MB_FILE_WRITE_ERROR;
}
swap_bytes = !swap_bytes;
num_tri = num_tri_swap;
......@@ -324,7 +324,7 @@ ErrorCode ReadSTL::binary_read_triangles(const char* name,
for (std::vector<Triangle>::iterator i = tris.begin(); i != tris.end(); ++i) {
if (fread(&tri, 50, 1, file) != 1) {
fclose(file);
MB_SET_ERR(MB_FILE_WRITE_ERROR, name << ": " << strerror(errno));