[MOAB-dev] r1779 - in MOAB/trunk: . parallel test/h5file test/obb test/perf tools/converter tools/dagmc tools/iMesh tools/iMesh/SIDL tools/mbzoltan tools/qvdual tools/skin tools/surfplot tools/tagprop
tautges at mcs.anl.gov
tautges at mcs.anl.gov
Mon Apr 28 11:35:24 CDT 2008
Author: tautges
Date: 2008-04-28 11:35:24 -0500 (Mon, 28 Apr 2008)
New Revision: 1779
Modified:
MOAB/trunk/DualTool.hpp
MOAB/trunk/HomXform.cpp
MOAB/trunk/MBCN.cpp
MOAB/trunk/MBCN.hpp
MOAB/trunk/MBParallelConventions.h
MOAB/trunk/MBTest.cpp
MOAB/trunk/Makefile.am
MOAB/trunk/TagTest.cpp
MOAB/trunk/Tqdcfr.cpp
MOAB/trunk/configure.in
MOAB/trunk/kd_tree_tool.cpp
MOAB/trunk/parallel/MBParallelComm.cpp
MOAB/trunk/parallel/ReadParallel.cpp
MOAB/trunk/parallel/errmem.h
MOAB/trunk/parallel/gs.h
MOAB/trunk/parallel/pcomm_unit.cpp
MOAB/trunk/test/h5file/h5legacy.cpp
MOAB/trunk/test/h5file/mhdf_parallel.c
MOAB/trunk/test/h5file/parallel.cpp
MOAB/trunk/test/obb/obb_tree_tool.cpp
MOAB/trunk/test/perf/Makefile.am
MOAB/trunk/test/perf/perf.cpp
MOAB/trunk/test_adj.cpp
MOAB/trunk/tools/converter/convert.cpp
MOAB/trunk/tools/dagmc/DagMC.cpp
MOAB/trunk/tools/dagmc/pt_vol_test.cc
MOAB/trunk/tools/iMesh/Makefile.am
MOAB/trunk/tools/iMesh/SIDL/common.make.in
MOAB/trunk/tools/iMesh/iBase_f.h
MOAB/trunk/tools/iMesh/iMesh.h
MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp
MOAB/trunk/tools/iMesh/iMesh_protos.h
MOAB/trunk/tools/iMesh/partest.cpp
MOAB/trunk/tools/mbzoltan/MBZoltan.cpp
MOAB/trunk/tools/mbzoltan/MBZoltan.hpp
MOAB/trunk/tools/qvdual/DrawDual.cpp
MOAB/trunk/tools/qvdual/uiQVDual.ui.h
MOAB/trunk/tools/skin/skin.cpp
MOAB/trunk/tools/surfplot/surfplot.cpp
MOAB/trunk/tools/tagprop/propagate_tags.cpp
Log:
- Make a C/Fortran interface for MBCN
- Remove warnings, many that appear after compiling with gcc 4.3.0
- Add some extensions to iMesh, e.g. for getting entities recursively
and for getting by type and tag
- Changing some name tags created by Tqdcfr (cub reader) to
fixed-length for consistency with rest of cub readre
- assign partition sets after parallel read
Passes make check for serial and parallel on 32- and 64-bit linux.
Modified: MOAB/trunk/DualTool.hpp
===================================================================
--- MOAB/trunk/DualTool.hpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/DualTool.hpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -424,7 +424,7 @@
inline MBErrorCode DualTool::dualSurface_tag(const MBTag tag)
{
MBErrorCode result = MB_FAILURE;
- if (0 == dualSurfaceTag && tag || dualSurfaceTag != tag) {
+ if ((0 == dualSurfaceTag && tag) || dualSurfaceTag != tag) {
dualSurfaceTag = tag;
result = MB_SUCCESS;
}
@@ -436,7 +436,7 @@
inline MBErrorCode DualTool::dualCurve_tag(const MBTag tag)
{
MBErrorCode result = MB_FAILURE;
- if (0 == dualCurveTag && tag || dualCurveTag != tag) {
+ if ((0 == dualCurveTag && tag) || dualCurveTag != tag) {
dualCurveTag = tag;
result = MB_SUCCESS;
}
@@ -448,7 +448,7 @@
inline MBErrorCode DualTool::isDualCell_tag(const MBTag tag)
{
MBErrorCode result = MB_FAILURE;
- if (0 == isDualCellTag && tag || isDualCellTag != tag) {
+ if ((0 == isDualCellTag && tag) || isDualCellTag != tag) {
isDualCellTag = tag;
result = MB_SUCCESS;
}
@@ -460,7 +460,7 @@
inline MBErrorCode DualTool::dualEntity_tag(const MBTag tag)
{
MBErrorCode result = MB_FAILURE;
- if (0 == dualEntityTag && tag || dualEntityTag != tag) {
+ if ((0 == dualEntityTag && tag) || dualEntityTag != tag) {
dualEntityTag = tag;
result = MB_SUCCESS;
}
@@ -472,7 +472,7 @@
inline MBErrorCode DualTool::extraDualEntity_tag(const MBTag tag)
{
MBErrorCode result = MB_FAILURE;
- if (0 == extraDualEntityTag && tag || extraDualEntityTag != tag) {
+ if ((0 == extraDualEntityTag && tag) || extraDualEntityTag != tag) {
extraDualEntityTag = tag;
result = MB_SUCCESS;
}
@@ -484,7 +484,7 @@
inline MBErrorCode DualTool::dualGraphicsPoint_tag(const MBTag tag)
{
MBErrorCode result = MB_FAILURE;
- if (0 == dualGraphicsPointTag && tag || dualGraphicsPointTag != tag) {
+ if ((0 == dualGraphicsPointTag && tag) || dualGraphicsPointTag != tag) {
dualGraphicsPointTag = tag;
result = MB_SUCCESS;
}
@@ -496,7 +496,7 @@
inline MBErrorCode DualTool::globalId_tag(const MBTag tag)
{
MBErrorCode result = MB_FAILURE;
- if (0 == globalIdTag && tag || globalIdTag != tag) {
+ if ((0 == globalIdTag && tag) || globalIdTag != tag) {
globalIdTag = tag;
result = MB_SUCCESS;
}
Modified: MOAB/trunk/HomXform.cpp
===================================================================
--- MOAB/trunk/HomXform.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/HomXform.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -179,8 +179,6 @@
// other constructors
int coordsa[4] = {1, 2, 3, 1};
int coordsb[4] = {4, 3, 2, 1};
- int coordsc[4] = {4, 3, 2, 1};
- int coordsd[4] = {1, 1, 1, 1};
HomCoord coords1(coordsa);
Modified: MOAB/trunk/MBCN.cpp
===================================================================
--- MOAB/trunk/MBCN.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/MBCN.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -15,35 +15,36 @@
#include "MBCN.hpp"
#include "MBCNArrays.hpp"
+#include "MBCN_protos.h"
#include <assert.h>
#include <string.h>
const char *MBCN::entityTypeNames[] = {
-"Vertex",
-"Edge",
-"Tri",
-"Quad",
-"Polygon",
-"Tet",
-"Pyramid",
-"Prism",
-"Knife",
-"Hex",
-"Polyhedron",
-"EntitySet",
-"MaxType"
+ "Vertex",
+ "Edge",
+ "Tri",
+ "Quad",
+ "Polygon",
+ "Tet",
+ "Pyramid",
+ "Prism",
+ "Knife",
+ "Hex",
+ "Polyhedron",
+ "EntitySet",
+ "MaxType"
};
int MBCN::numberBasis = 0;
const MBDimensionPair MBCN::TypeDimensionMap[] =
{
- MBDimensionPair(MBVERTEX, MBVERTEX),
- MBDimensionPair(MBEDGE, MBEDGE),
- MBDimensionPair(MBTRI, MBPOLYGON),
- MBDimensionPair(MBTET, MBPOLYHEDRON),
- MBDimensionPair(MBENTITYSET, MBENTITYSET),
- MBDimensionPair(MBMAXTYPE, MBMAXTYPE)
+ MBDimensionPair(MBVERTEX, MBVERTEX),
+ MBDimensionPair(MBEDGE, MBEDGE),
+ MBDimensionPair(MBTRI, MBPOLYGON),
+ MBDimensionPair(MBTET, MBPOLYHEDRON),
+ MBDimensionPair(MBENTITYSET, MBENTITYSET),
+ MBDimensionPair(MBMAXTYPE, MBMAXTYPE)
};
//! set the basis of the numbering system; may or may not do things besides setting the
@@ -90,12 +91,12 @@
//! given an entity and a target dimension & side number, get that entity
int MBCN::AdjacentSubEntities(const MBEntityType this_type,
- const int *source_indices,
- const int num_source_indices,
- const int source_dim,
- const int target_dim,
- std::vector<int> &index_list,
- const int operation_type)
+ const int *source_indices,
+ const int num_source_indices,
+ const int source_dim,
+ const int target_dim,
+ std::vector<int> &index_list,
+ const int operation_type)
{
// first get all the vertex indices
std::vector<int> tmp_indices;
@@ -164,72 +165,72 @@
return 0;
}
-/*
-int MBCN::SideNumber(const void *parent_conn,
- const MBEntityType parent_type,
- const void *child_conn,
- const int child_num_verts,
- const int child_dim,
- int &side_no,
- int &sense,
- int &offset)
+
+template <typename T>
+int side_number(const T *parent_conn,
+ const MBEntityType parent_type,
+ const T *child_conn,
+ const int child_num_verts,
+ const int child_dim,
+ int &side_no,
+ int &sense,
+ int &offset)
{
- int parent_dim = Dimension(parent_type);
- int parent_num_verts = VerticesPerEntity(parent_type);
-
- const int *parent_conn_i = static_cast<const int *>(parent_conn);
- const int *child_conn_i = static_cast<const int *>(child_conn);
+ int parent_num_verts = MBCN::VerticesPerEntity(parent_type);
+ std::vector<int> side_indices(child_num_verts);
- if (child_dim == 0) {
- // getting the vertex number - special case this
-
- const int *parent_it =
- std::find(parent_conn_i, parent_conn_i+parent_num_verts, *child_conn_i);
- side_no = (parent_it != parent_conn_i+parent_num_verts) ? parent_it - parent_conn_i : -1;
- sense = 0;
- offset = 0;
- return 0;
+ for (int i = 0; i < child_num_verts; i++) {
+ const T *tmp = std::find(parent_conn, parent_conn+parent_num_verts, child_conn[i]);
+ if (tmp == parent_conn+parent_num_verts) return -1;
+ else side_indices[i] = tmp - parent_conn;
}
-
- // given a parent and child element, find the corresponding side number
+
+ return MBCN::SideNumber(parent_type, &side_indices[0], child_num_verts,
+ child_dim, side_no, sense, offset);
+}
- // dim_diff should be -1, 0 or 1 (same dimension, one less dimension, two less, resp.)
- if (0 > child_dim || 3 < child_dim) return 1;
+int MBCN::SideNumber(const int *parent_conn, const MBEntityType parent_type,
+ const int *child_conn, const int child_num_verts,
+ const int child_dim,
+ int &side_no, int &sense, int &offset)
+{
+ return side_number(parent_conn, parent_type, child_conn, child_num_verts,
+ child_dim, side_no, sense, offset);
+}
- // different types of same dimension won't be the same
- if (parent_dim == child_dim &&
- parent_num_verts != child_num_verts) {
- side_no = -1;
- sense = 0;
- return 0;
- }
+int MBCN::SideNumber(const unsigned int *parent_conn, const MBEntityType parent_type,
+ const unsigned int *child_conn, const int child_num_verts,
+ const int child_dim,
+ int &side_no, int &sense, int &offset)
+{
+ return side_number(parent_conn, parent_type, child_conn, child_num_verts,
+ child_dim, side_no, sense, offset);
+}
+int MBCN::SideNumber(const long *parent_conn, const MBEntityType parent_type,
+ const long *child_conn, const int child_num_verts,
+ const int child_dim,
+ int &side_no, int &sense, int &offset)
+{
+ return side_number(parent_conn, parent_type, child_conn, child_num_verts,
+ child_dim, side_no, sense, offset);
+}
+int MBCN::SideNumber(const unsigned long *parent_conn, const MBEntityType parent_type,
+ const unsigned long *child_conn, const int child_num_verts,
+ const int child_dim,
+ int &side_no, int &sense, int &offset)
+{
+ return side_number(parent_conn, parent_type, child_conn, child_num_verts,
+ child_dim, side_no, sense, offset);
+}
+int MBCN::SideNumber(void * const *parent_conn, const MBEntityType parent_type,
+ void * const *child_conn, const int child_num_verts,
+ const int child_dim,
+ int &side_no, int &sense, int &offset)
+{
+ return side_number(parent_conn, parent_type, child_conn, child_num_verts,
+ child_dim, side_no, sense, offset);
+}
- // loop over the sub-elements, comparing to child connectivity
- int sub_conn[10];
- for (int i = 0; i < NumSubEntities(parent_type, child_dim); i++) {
- if (VerticesPerEntity(SubEntityType(parent_type, child_dim, i)) !=
- child_num_verts) continue;
-
- // for this sub-element, get the right vertex handles
- for (int j = 0; j < VerticesPerEntity(SubEntityType(parent_type, child_dim, i)); j++)
- sub_conn[j] = parent_conn_i[mConnectivityMap[parent_type][child_dim-1].conn[i][j]];
-
- bool they_match = ConnectivityMatch(child_conn_i, sub_conn,
- VerticesPerEntity(SubEntityType(parent_type, child_dim, i)),
- sense, offset);
- if (they_match) {
- side_no = i;
- return 0;
- }
- }
-
- // if we've gotten here, we don't match
- side_no = -1;
-
- // return value is still success, we didn't have any fatal errors or anything
- return 0;
-}
-*/
int MBCN::SideNumber( const MBEntityType parent_type,
const int *child_conn_indices,
const int child_num_verts,
@@ -308,67 +309,67 @@
{
switch (parent_type) {
case MBEDGE:
- if (0 != child_dim) return -1;
- else opposite_index = 1-child_index;
- opposite_dim = 0;
- break;
+ if (0 != child_dim) return -1;
+ else opposite_index = 1-child_index;
+ opposite_dim = 0;
+ break;
case MBTRI:
- switch (child_dim) {
- case 0:
- opposite_dim = 1;
- opposite_index = (child_index+1)%3;
- break;
- case 1:
- opposite_dim = 0;
- opposite_index = (child_index+2)%3;
- break;
- default:
- return -1;
- }
- break;
+ switch (child_dim) {
+ case 0:
+ opposite_dim = 1;
+ opposite_index = (child_index+1)%3;
+ break;
+ case 1:
+ opposite_dim = 0;
+ opposite_index = (child_index+2)%3;
+ break;
+ default:
+ return -1;
+ }
+ break;
case MBQUAD:
- switch (child_dim) {
- case 0:
- case 1:
- opposite_dim = child_dim;
- opposite_index = (child_index+2)%4;
- break;
- default:
- return -1;
- }
- break;
+ switch (child_dim) {
+ case 0:
+ case 1:
+ opposite_dim = child_dim;
+ opposite_index = (child_index+2)%4;
+ break;
+ default:
+ return -1;
+ }
+ break;
case MBTET:
- switch (child_dim) {
- case 0:
- opposite_dim = 2;
- opposite_index = (child_index+2)%3 + 2*(child_index/3);
- break;
- case 1:
- opposite_dim = 1;
- opposite_index = 3 + (child_index + 5)%3;
- break;
- case 2:
- opposite_dim = 0;
- opposite_index = (child_index+2)%3 + child_index/3;
- break;
- default:
- return -1;
- }
- break;
+ switch (child_dim) {
+ case 0:
+ opposite_dim = 2;
+ opposite_index = (child_index+2)%3 + 2*(child_index/3);
+ break;
+ case 1:
+ opposite_dim = 1;
+ opposite_index = 3 + (child_index + 5)%3;
+ break;
+ case 2:
+ opposite_dim = 0;
+ opposite_index = (child_index+2)%3 + child_index/3;
+ break;
+ default:
+ return -1;
+ }
+ break;
case MBHEX:
default:
- return -1;
+ return -1;
}
return 0;
}
template <typename T>
-static inline bool connectivity_match( const T* conn1_i,
+inline bool connectivity_match( const T* conn1_i,
const T* conn2_i,
const int num_vertices,
int& direct, int& offset )
@@ -485,7 +486,7 @@
//! for an entity of this type and a specified subfacet (dimension and index), return
//! the index of the higher order node for that entity in this entity's connectivity array
int MBCN::HONodeIndex(const MBEntityType this_type, const int num_verts,
- const int subfacet_dim, const int subfacet_index)
+ const int subfacet_dim, const int subfacet_index)
{
int i;
int has_mids[4];
@@ -548,7 +549,7 @@
return;
}
else {
- index += NumSubEntities(elem_type, i);
+ index += NumSubEntities(elem_type, i);
}
}
}
@@ -559,3 +560,333 @@
parent_index = 0;
}
}
+
+ //! get the basis of the numbering system
+void MBCN_GetBasis(int *rval) {*rval = MBCN::GetBasis();}
+
+ //! set the basis of the numbering system
+void MBCN_SetBasis(const int in_basis) {MBCN::SetBasis(in_basis);}
+
+ //! return the string type name for this type
+void MBCN_EntityTypeName(const int this_type, char *rval, int rval_len)
+{
+ const char *rval_tmp = MBCN::EntityTypeName((MBEntityType)this_type);
+ int rval_len_tmp = strlen(rval_tmp);
+ rval_len_tmp = (rval_len_tmp < rval_len ? rval_len_tmp : rval_len);
+ strncpy(rval, rval_tmp, rval_len_tmp);
+}
+
+ //! given a name, find the corresponding entity type
+void MBCN_EntityTypeFromName(const char *name, int *rval)
+{
+ *rval = MBCN::EntityTypeFromName(name);
+}
+
+ //! return the topological entity dimension
+void MBCN_Dimension(const int t, int *rval)
+{
+ *rval = MBCN::Dimension((MBEntityType)t);
+}
+
+ //! return the number of (corner) vertices contained in the specified type.
+void MBCN_VerticesPerEntity(const int t, int *rval)
+{
+ *rval = MBCN::VerticesPerEntity((MBEntityType)t);
+}
+
+ //! return the number of sub-entities bounding the entity.
+void MBCN_NumSubEntities(const int t, const int d, int *rval)
+{
+ *rval = MBCN::NumSubEntities((MBEntityType)t, d);
+}
+
+ //! return the type of a particular sub-entity.
+ //! \param this_type Type of entity for which sub-entity type is being queried
+ //! \param sub_dimension Topological dimension of sub-entity whose type is being queried
+ //! \param index Index of sub-entity whose type is being queried
+ //! \return type Entity type of sub-entity with specified dimension and index
+void MBCN_SubEntityType(const int this_type,
+ const int sub_dimension,
+ const int index, int *rval)
+
+{
+
+ *rval = MBCN::SubEntityType((MBEntityType)this_type, sub_dimension, index);
+
+}
+
+
+ //! return the vertex indices of the specified sub-entity.
+ //! \param this_type Type of entity for which sub-entity connectivity is being queried
+ //! \param sub_dimension Dimension of sub-entity
+ //! \param sub_index Index of sub-entity
+ //! \param sub_entity_conn Connectivity of sub-entity (returned to calling function)
+void MBCN_SubEntityVertexIndices(const int this_type,
+ const int sub_dimension,
+ const int sub_index,
+ int sub_entity_conn[])
+{
+ MBCN::SubEntityVertexIndices((MBEntityType)this_type, sub_dimension,
+ sub_index, sub_entity_conn);
+}
+
+ //! return the vertices of the specified sub entity
+ //! \param parent_conn Connectivity of parent entity
+ //! \param parent_type Entity type of parent entity
+ //! \param sub_dimension Dimension of sub-entity being queried
+ //! \param sub_index Index of sub-entity being queried
+ //! \param sub_entity_conn Connectivity of sub-entity, based on parent_conn and canonical
+ //! ordering for parent_type
+ //! \param num_sub_vertices Number of vertices in sub-entity
+// void MBCN_SubEntityConn(const void *parent_conn, const int parent_type,
+// const int sub_dimension,
+// const int sub_index,
+// void *sub_entity_conn, int &num_sub_vertices) {return MBCN::SubEntityConn();}
+
+ //! For a specified set of sides of given dimension, return the intersection
+ //! or union of all sides of specified target dimension adjacent to those sides.
+ //! \param this_type Type of entity for which sub-entity connectivity is being queried
+ //! \param source_indices Indices of sides being queried
+ //! \param num_source_indices Number of entries in <em>source_indices</em>
+ //! \param source_dim Dimension of source entity
+ //! \param target_dim Dimension of target entity
+ //! \param index_list Indices of target entities (returned)
+ //! \param operation_type Specify either MBCN::INTERSECT (0) or MBCN::UNION (1) to get intersection
+ //! or union of target entity lists over source entities
+void MBCN_AdjacentSubEntities(const int this_type,
+ const int *source_indices,
+ const int num_source_indices,
+ const int source_dim,
+ const int target_dim,
+ int *index_list,
+ int *num_indices,
+ const int operation_type, int *rval)
+{
+ std::vector<int> tmp_index_list;
+ *rval = MBCN::AdjacentSubEntities((MBEntityType)this_type, source_indices,
+ num_source_indices, source_dim, target_dim,
+ tmp_index_list, operation_type);
+ std::copy(tmp_index_list.begin(), tmp_index_list.end(), index_list);
+ *num_indices = tmp_index_list.size();
+}
+
+ //! return the side index represented in the input sub-entity connectivity
+ //! \param parent_type Entity type of parent entity
+ //! \param child_conn_indices Child connectivity to query, specified as indices
+ //! into the connectivity list of the parent.
+ //! \param child_num_verts Number of values in <em>child_conn_indices</em>
+ //! \param child_dim Dimension of child entity being queried
+ //! \param side_no Side number of child entity (returned)
+ //! \param sense Sense of child entity with respect to order in <em>child_conn</em> (returned)
+ //! \param offset Offset of <em>child_conn</em> with respect to canonical ordering data (returned)
+ //! \return status Returns zero if successful, -1 if not
+void MBCN_SideNumber(const int parent_type,
+ const int *child_conn_indices, const int child_num_verts,
+ const int child_dim,
+ int *side_no, int *sense, int *offset)
+{
+ MBCN::SideNumber((MBEntityType)parent_type, child_conn_indices, child_num_verts, child_dim,
+ *side_no, *sense, *offset);
+}
+
+void MBCN_SideNumberInt(const int *parent_conn, const MBEntityType parent_type,
+ const int *child_conn, const int child_num_verts,
+ const int child_dim,
+ int *side_no, int *sense, int *offset)
+{
+ side_number(parent_conn, parent_type, child_conn, child_num_verts,
+ child_dim, *side_no, *sense, *offset);
+}
+
+void MBCN_SideNumberUint(const unsigned int *parent_conn, const MBEntityType parent_type,
+ const unsigned int *child_conn, const int child_num_verts,
+ const int child_dim,
+ int *side_no, int *sense, int *offset)
+{
+ side_number(parent_conn, parent_type, child_conn, child_num_verts,
+ child_dim, *side_no, *sense, *offset);
+}
+
+void MBCN_SideNumberLong(const long *parent_conn, const MBEntityType parent_type,
+ const long *child_conn, const int child_num_verts,
+ const int child_dim,
+ int *side_no, int *sense, int *offset)
+{
+ side_number(parent_conn, parent_type, child_conn, child_num_verts,
+ child_dim, *side_no, *sense, *offset);
+}
+
+void MBCN_SideNumberUlong(const unsigned long *parent_conn, const MBEntityType parent_type,
+ const unsigned long *child_conn, const int child_num_verts,
+ const int child_dim,
+ int *side_no, int *sense, int *offset)
+{
+ side_number(parent_conn, parent_type, child_conn, child_num_verts,
+ child_dim, *side_no, *sense, *offset);
+}
+
+void MBCN_SideNumberVoid(void * const *parent_conn, const MBEntityType parent_type,
+ void * const *child_conn, const int child_num_verts,
+ const int child_dim,
+ int *side_no, int *sense, int *offset)
+{
+ side_number(parent_conn, parent_type, child_conn, child_num_verts,
+ child_dim, *side_no, *sense, *offset);
+}
+
+ //! return the dimension and index of the opposite side, given parent entity type and child
+ //! dimension and index. This function is only defined for certain types of parent/child types:
+ //! (Parent, Child dim->Opposite dim):
+ //! (Tri, 1->0), (Tri, 0->1), (Quad, 1->1), (Quad, 0->0),
+ //! (Tet, 2->0), (Tet, 1->1), (Tet, 0->2),
+ //! (Hex, 2->2), (Hex, 1->1)(diagonally across element), (Hex, 0->0) (diagonally across element)
+ //! All other parent types and child dimensions return an error.
+ //!
+ //! \param parent_type The type of parent element
+ //! \param child_type The type of child element
+ //! \param child_index The index of the child element
+ //! \param opposite_index The index of the opposite element
+ //! \return status Returns 0 if successful, -1 if not
+void MBCN_OppositeSide(const int parent_type,
+ const int child_index,
+ const int child_dim,
+ int *opposite_index,
+ int *opposite_dim, int *rval)
+{
+ *rval = MBCN::OppositeSide((MBEntityType)parent_type, child_index, child_dim,
+ *opposite_index, *opposite_dim);
+}
+
+ //! given two connectivity arrays, determine whether or not they represent the same entity.
+ //! \param conn1 Connectivity array of first entity
+ //! \param conn2 Connectivity array of second entity
+ //! \param num_vertices Number of entries in <em>conn1</em> and <em>conn2</em>
+ //! \param direct If positive, entities have the same sense (returned)
+ //! \param offset Offset of <em>conn2</em>'s first vertex in <em>conn1</em>
+ //! \return int Returns true if <em>conn1</em> and <em>conn2</em> match
+void MBCN_ConnectivityMatchInt(const int *conn1,
+ const int *conn2,
+ const int num_vertices,
+ int *direct, int *offset, int *rval)
+{
+ *rval = MBCN::ConnectivityMatch(conn1, conn2, num_vertices,
+ *direct, *offset);
+}
+
+void MBCN_ConnectivityMatchUint(const unsigned int *conn1,
+ const unsigned int *conn2,
+ const int num_vertices,
+ int *direct, int *offset, int *rval)
+{
+ *rval = MBCN::ConnectivityMatch(conn1, conn2, num_vertices,
+ *direct, *offset);
+}
+
+void MBCN_ConnectivityMatchLong(const long* conn1,
+ const long* conn2,
+ const int num_vertices,
+ int* direct, int* offset , int *rval)
+{
+ *rval = MBCN::ConnectivityMatch(conn1, conn2, num_vertices,
+ *direct, *offset);
+}
+
+void MBCN_ConnectivityMatchUlong(const unsigned long* conn1,
+ const unsigned long* conn2,
+ const int num_vertices,
+ int *direct, int* offset , int *rval)
+{
+ *rval = MBCN::ConnectivityMatch(conn1, conn2, num_vertices,
+ *direct, *offset);
+}
+
+void MBCN_ConnectivityMatchVoid(void* const* conn1,
+ void* const* conn2,
+ const int num_vertices,
+ int* direct, int* offset , int *rval)
+{
+ *rval = MBCN::ConnectivityMatch(conn1, conn2, num_vertices,
+ *direct, *offset);
+}
+
+ //! true if entities of a given type and number of nodes indicates mid edge nodes are present.
+ //! \param this_type Type of entity for which sub-entity connectivity is being queried
+ //! \param num_verts Number of nodes defining entity
+ //! \return int Returns true if <em>this_type</em> combined with <em>num_nodes</em> indicates
+ //! mid-edge nodes are likely
+void MBCN_HasMidEdgeNodes(const int this_type,
+ const int num_verts, int *rval)
+{
+ *rval = MBCN::HasMidEdgeNodes((MBEntityType)this_type, num_verts);
+}
+
+ //! true if entities of a given type and number of nodes indicates mid face nodes are present.
+ //! \param this_type Type of entity for which sub-entity connectivity is being queried
+ //! \param num_verts Number of nodes defining entity
+ //! \return int Returns true if <em>this_type</em> combined with <em>num_nodes</em> indicates
+ //! mid-face nodes are likely
+void MBCN_HasMidFaceNodes(const int this_type,
+ const int num_verts, int *rval)
+{
+ *rval = MBCN::HasMidFaceNodes((MBEntityType)this_type, num_verts);
+}
+
+ //! true if entities of a given type and number of nodes indicates mid region nodes are present.
+ //! \param this_type Type of entity for which sub-entity connectivity is being queried
+ //! \param num_verts Number of nodes defining entity
+ //! \return int Returns true if <em>this_type</em> combined with <em>num_nodes</em> indicates
+ //! mid-region nodes are likely
+void MBCN_HasMidRegionNodes(const int this_type,
+ const int num_verts, int *rval)
+{
+ *rval = MBCN::HasMidRegionNodes((MBEntityType)this_type, num_verts);
+}
+
+ //! true if entities of a given type and number of nodes indicates mid edge/face/region nodes
+ //! are present.
+ //! \param this_type Type of entity for which sub-entity connectivity is being queried
+ //! \param num_verts Number of nodes defining entity
+ //! \param mid_nodes If <em>mid_nodes[i], i=0..2</em> is true, indicates that mid-edge
+ //! (i=0), mid-face (i=1), and/or mid-region (i=2) nodes are likely
+void MBCN_HasMidNodes(const int this_type,
+ const int num_verts,
+ int mid_nodes[4])
+{
+ return MBCN::HasMidNodes((MBEntityType)this_type, num_verts, mid_nodes);
+}
+
+ //! given data about an element and a vertex in that element, return the dimension
+ //! and index of the sub-entity that the vertex resolves. If it does not resolve a
+ //! sub-entity, either because it's a corner node or it's not in the element, -1 is
+ //! returned in both return values.
+ //! \param elem_type Type of entity being queried
+ //! \param num_nodes The number of nodes in the element connectivity
+ //! \param ho_node_index The position of the HO node in the connectivity list (zero based)
+ //! \param parent_dim Dimension of sub-entity high-order node resolves (returned)
+ //! \param parent_index Index of sub-entity high-order node resolves (returned)
+void MBCN_HONodeParent( int elem_type,
+ int num_nodes,
+ int ho_node_index,
+ int *parent_dim,
+ int *parent_index )
+{
+ return MBCN::HONodeParent((MBEntityType)elem_type, num_nodes, ho_node_index,
+ *parent_dim, *parent_index);
+}
+
+ //! for an entity of this type with num_verts vertices, and a specified subfacet
+ //! (dimension and index), return the index of the higher order node for that entity
+ //! in this entity's connectivity array
+ //! \param this_type Type of entity being queried
+ //! \param num_verts Number of vertices for the entity being queried
+ //! \param subfacet_dim Dimension of sub-entity being queried
+ //! \param subfacet_index Index of sub-entity being queried
+ //! \return index Index of sub-entity's higher-order node
+void MBCN_HONodeIndex(const int this_type, const int num_verts,
+ const int subfacet_dim, const int subfacet_index, int *rval)
+
+{
+
+ *rval = MBCN::HONodeIndex((MBEntityType)this_type, num_verts, subfacet_dim, subfacet_index);
+
+}
Modified: MOAB/trunk/MBCN.hpp
===================================================================
--- MOAB/trunk/MBCN.hpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/MBCN.hpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -29,10 +29,13 @@
* Numbering Conventions", Timothy J. Tautges, Sandia National Laboratories
* Report #SAND2004-xxxx.
*/
-//
#ifndef MBCN_HPP
#define MBCN_HPP
+#include "MBCN_protos.h"
+
+#ifdef __cplusplus
+
#include <vector>
#include <algorithm>
@@ -65,7 +68,7 @@
public:
//! enum used to specify operation type
- enum {INTERSECT, UNION};
+ enum {INTERSECT = 0, UNION};
// each entity type has two ConnMap objects, holding information about the bounding
// edges and faces for each entity; see comment for mConnectivityMap
@@ -202,10 +205,26 @@
//! \param sense Sense of child entity with respect to order in <em>child_conn</em> (returned)
//! \param offset Offset of <em>child_conn</em> with respect to canonical ordering data (returned)
//! \return status Returns zero if successful, -1 if not
-// static int SideNumber(const void *parent_conn, const MBEntityType parent_type,
-// const void *child_conn, const int child_num_verts,
-// const int child_dim,
-// int &side_number, int &sense, int &offset);
+ static int SideNumber(const int *parent_conn, const MBEntityType parent_type,
+ const int *child_conn, const int child_num_verts,
+ const int child_dim,
+ int &side_number, int &sense, int &offset);
+ static int SideNumber(const unsigned int *parent_conn, const MBEntityType parent_type,
+ const unsigned int *child_conn, const int child_num_verts,
+ const int child_dim,
+ int &side_number, int &sense, int &offset);
+ static int SideNumber(const long *parent_conn, const MBEntityType parent_type,
+ const long *child_conn, const int child_num_verts,
+ const int child_dim,
+ int &side_number, int &sense, int &offset);
+ static int SideNumber(const unsigned long *parent_conn, const MBEntityType parent_type,
+ const unsigned long *child_conn, const int child_num_verts,
+ const int child_dim,
+ int &side_number, int &sense, int &offset);
+ static int SideNumber(void * const *parent_conn, const MBEntityType parent_type,
+ void * const *child_conn, const int child_num_verts,
+ const int child_dim,
+ int &side_number, int &sense, int &offset);
//! return the side index represented in the input sub-entity connectivity
//! \param parent_type Entity type of parent entity
@@ -450,5 +469,127 @@
mid_nodes[3] = HasMidRegionNodes(this_type, num_nodes);
}
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ void MBCN_GetBasis(int *rval);
+
+ void MBCN_SetBasis(const int in_basis);
+
+ void MBCN_EntityTypeName(const int this_type, char *rval, int rval_len);
+
+ void MBCN_EntityTypeFromName(const char *name, int *rval);
+
+ void MBCN_Dimension(const int t, int *rval);
+
+ void MBCN_VerticesPerEntity(const int t, int *rval);
+
+ void MBCN_NumSubEntities(const int t, const int d, int *rval);
+
+ void MBCN_SubEntityType(const int this_type,
+ const int sub_dimension,
+ const int index, int *rval);
+
+ void SubEntityVertexIndices(const int this_type,
+ const int sub_dimension,
+ const int sub_index,
+ int sub_entity_conn[]);
+
+ void MBCN_AdjacentSubEntities(const int this_type,
+ const int *source_indices,
+ const int num_source_indices,
+ const int source_dim,
+ const int target_dim,
+ int *index_list,
+ int *num_indices,
+ const int operation_type, int *rval);
+
+ void MBCN_SideNumberInt(const int *parent_conn, const MBEntityType parent_type,
+ const int *child_conn, const int child_num_verts,
+ const int child_dim,
+ int *side_no, int *sense, int *offset);
+
+ void MBCN_SideNumberUint(const unsigned int *parent_conn, const MBEntityType parent_type,
+ const unsigned int *child_conn, const int child_num_verts,
+ const int child_dim,
+ int *side_no, int *sense, int *offset);
+
+ void MBCN_SideNumberLong(const long *parent_conn, const MBEntityType parent_type,
+ const long *child_conn, const int child_num_verts,
+ const int child_dim,
+ int *side_no, int *sense, int *offset);
+
+ void MBCN_SideNumberUlong(const unsigned long *parent_conn, const MBEntityType parent_type,
+ const unsigned long *child_conn, const int child_num_verts,
+ const int child_dim,
+ int *side_no, int *sense, int *offset);
+
+ void MBCN_SideNumberVoid(void * const *parent_conn, const MBEntityType parent_type,
+ void * const *child_conn, const int child_num_verts,
+ const int child_dim,
+ int *side_no, int *sense, int *offset);
+
+ void MBCN_SideNumber(const int parent_type,
+ const int *child_conn_indices, const int child_num_verts,
+ const int child_dim,
+ int *side_no, int *sense, int *offset);
+
+ void MBCN_OppositeSide(const int parent_type,
+ const int child_index,
+ const int child_dim,
+ int *opposite_index,
+ int *opposite_dim, int *rval);
+
+ void MBCN_ConnectivityMatchInt(const int *conn1,
+ const int *conn2,
+ const int num_vertices,
+ int *direct, int *offset, int *rval);
+ void MBCN_ConnectivityMatchUint(const unsigned int *conn1,
+ const unsigned int *conn2,
+ const int num_vertices,
+ int *direct, int *offset,
+ int *rval);
+ void MBCN_ConnectivityMatchLong(const long* conn1,
+ const long* conn2,
+ const int num_vertices,
+ int* direct, int* offset , int *rval);
+ void MBCN_ConnectivityMatchUlong(const unsigned long* conn1,
+ const unsigned long* conn2,
+ const int num_vertices,
+ int *direct, int* offset,
+ int *rval);
+ void MBCN_ConnectivityMatchVoid(void* const* conn1,
+ void* const* conn2,
+ const int num_vertices,
+ int* direct, int* offset , int *rval);
+
+ void MBCN_HasMidEdgeNodes(const int this_type,
+ const int num_verts, int *rval);
+
+ void MBCN_HasMidFaceNodes(const int this_type,
+ const int num_verts, int *rval);
+
+ void MBCN_HasMidRegionNodes(const int this_type,
+ const int num_verts, int *rval);
+
+ void MBCN_HasMidNodes(const int this_type,
+ const int num_verts,
+ int mid_nodes[4]);
+
+ void MBCN_HONodeParent( int elem_type,
+ int num_nodes,
+ int ho_node_index,
+ int *parent_dim,
+ int *parent_index );
+
+ void MBCN_HONodeIndex(const int this_type, const int num_verts,
+ const int subfacet_dim, const int subfacet_index, int *rval);
+
+#ifdef __cplusplus
+}
#endif
+
+#endif
Modified: MOAB/trunk/MBParallelConventions.h
===================================================================
--- MOAB/trunk/MBParallelConventions.h 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/MBParallelConventions.h 2008-04-28 16:35:24 UTC (rev 1779)
@@ -12,7 +12,7 @@
* An integer identifier common to the corresponding mesh entity
* instances on each processor for a mesh entity on the interface.
*/
-#define PARALLEL_GID_TAG_NAME "PARALLEL_GID"
+#define PARALLEL_GID_TAG_NAME "GLOBAL_ID"
/** \brief Tag on a meshset representing a parallel partition.
*
Modified: MOAB/trunk/MBTest.cpp
===================================================================
--- MOAB/trunk/MBTest.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/MBTest.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -3626,8 +3626,8 @@
//! and they should be quad1 and quad2. Note that we are not saying anything
//! about order in the array.
- if ( (quad_adjacencies[0] != quad1) || (quad_adjacencies[1] != quad1) &&
- (quad_adjacencies[0] != quad2) || (quad_adjacencies[1] != quad2) )
+ if ( (quad_adjacencies[0] != quad1 || quad_adjacencies[1] != quad1) &&
+ (quad_adjacencies[0] != quad2 || quad_adjacencies[1] != quad2) )
return error;
//! clean up on exit
Modified: MOAB/trunk/Makefile.am
===================================================================
--- MOAB/trunk/Makefile.am 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/Makefile.am 2008-04-28 16:35:24 UTC (rev 1779)
@@ -212,6 +212,8 @@
HomXform.hpp \
MBAdaptiveKDTree.hpp \
MBCN.hpp \
+ MBCN_FCDefs.h \
+ MBCN_protos.h \
MBCartVect.hpp \
MBCore.hpp \
MBEntityType.h \
Modified: MOAB/trunk/TagTest.cpp
===================================================================
--- MOAB/trunk/TagTest.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/TagTest.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -1,6 +1,7 @@
#include "MBCore.hpp"
#include "TestUtil.hpp"
#include <stdlib.h>
+#include <algorithm>
void test_create_tag();
void test_invalid_tag_size();
Modified: MOAB/trunk/Tqdcfr.cpp
===================================================================
--- MOAB/trunk/Tqdcfr.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/Tqdcfr.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -799,9 +799,9 @@
}
}
if (0 == entityNameTag) return MB_FAILURE;
- char *this_char = new char[md_entry->mdStringValue.length()+1];
- strcpy(this_char, md_entry->mdStringValue.c_str());
- result = mdbImpl->tag_set_data(entityNameTag, &grouph->setHandle, 1, &this_char);
+ assert(md_entry->mdStringValue.length()+1 <= NAME_TAG_SIZE);
+ result = mdbImpl->tag_set_data(entityNameTag, &grouph->setHandle, 1,
+ md_entry->mdStringValue.c_str());
// look for extra names
md_index = model->groupMD.get_md_entry(group_index, "NumExtraNames");
@@ -814,16 +814,16 @@
md_index = model->groupMD.get_md_entry(group_index, extra_name_label);
if (-1 != md_index) {
md_entry = &(model->groupMD.metadataEntries[md_index]);
- this_char = new char[md_entry->mdStringValue.length()+1];
- strcpy(this_char, md_entry->mdStringValue.c_str());
MBTag extra_name_tag;
result = mdbImpl->tag_get_handle(moab_extra_name, extra_name_tag);
+ assert(md_entry->mdStringValue.length()+1 <= NAME_TAG_SIZE);
if (MB_SUCCESS != result || 0 == extra_name_tag) {
char dum_val[NAME_TAG_SIZE]; dum_val[0] = '\0';
result = mdbImpl->tag_create(moab_extra_name, NAME_TAG_SIZE, MB_TAG_SPARSE,
extra_name_tag, &dum_val);
}
- result = mdbImpl->tag_set_data(extra_name_tag, &grouph->setHandle, 1, &this_char);
+ result = mdbImpl->tag_set_data(extra_name_tag, &grouph->setHandle, 1,
+ md_entry->mdStringValue.c_str());
}
}
}
@@ -2105,17 +2105,18 @@
// set the name
if (NULL != name_tag) {
if (0 == entityNameTag) {
- result = mdbImpl->tag_get_handle("NAME", entityNameTag);
+ result = mdbImpl->tag_get_handle(NAME_TAG_NAME, entityNameTag);
if (MB_SUCCESS != result || 0 == entityNameTag) {
char *dum_val = NULL;
- result = mdbImpl->tag_create("NAME", sizeof(char*), MB_TAG_SPARSE,
+ result = mdbImpl->tag_create(NAME_TAG_NAME, NAME_TAG_SIZE, MB_TAG_SPARSE,
entityNameTag, &dum_val);
}
}
if (0 == entityNameTag) return MB_FAILURE;
- result = mdbImpl->tag_set_data(entityNameTag, &(records[entity_rec_num].entity), 1, &name_tag);
+ result = mdbImpl->tag_set_data(entityNameTag, &(records[entity_rec_num].entity), 1, name_tag);
if (MB_SUCCESS != result) return result;
+ delete [] name_tag;
}
if (NULL != attrib_vec) {
Modified: MOAB/trunk/configure.in
===================================================================
--- MOAB/trunk/configure.in 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/configure.in 2008-04-28 16:35:24 UTC (rev 1779)
@@ -27,6 +27,10 @@
SNL_TEMPLATE_SPECIALIZATION
DEFINES="$DEFINES $TEMPLATE_SPECIALIZATION"
+if test "x" != "x$FC"; then
+ AC_FC_WRAPPERS
+fi
+
################################################################################
# Version Stuff
################################################################################
@@ -250,9 +254,6 @@
case $enableval in
yes)
- if test "x" != "x$FC"; then
- AC_FC_WRAPPERS
- fi
ENABLE_imesh=yes
;;
nofortran|NoFortran|noFORTRAN|NoFORTRAN|Nofortran)
@@ -790,7 +791,7 @@
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_HEADERS([MBVersion.h])
AC_CONFIG_HEADERS([MBEntityHandle.h])
-AC_CONFIG_HEADERS([tools/iMesh/iBase_FCDefs.h])
+AC_CONFIG_HEADERS([MBCN_FCDefs.h])
AC_CONFIG_FILES([Makefile
moab.make
testdir.h
Modified: MOAB/trunk/kd_tree_tool.cpp
===================================================================
--- MOAB/trunk/kd_tree_tool.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/kd_tree_tool.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -5,6 +5,7 @@
#include "MBInternals.hpp"
#include <iostream>
#include <iomanip>
+#include <limits>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
Modified: MOAB/trunk/parallel/MBParallelComm.cpp
===================================================================
--- MOAB/trunk/parallel/MBParallelComm.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/parallel/MBParallelComm.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -1705,8 +1705,8 @@
if (tag_size != tag_info->get_size() ||
tag_type != this_type ||
tag_data_type != tag_info->get_data_type() ||
- (def_val_ptr && !tag_info->default_value() ||
- !def_val_ptr && tag_info->default_value())) {
+ (def_val_ptr && !tag_info->default_value()) ||
+ (!def_val_ptr && tag_info->default_value())) {
RR("Didn't get correct tag info when unpacking tag.");
}
}
Modified: MOAB/trunk/parallel/ReadParallel.cpp
===================================================================
--- MOAB/trunk/parallel/ReadParallel.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/parallel/ReadParallel.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -340,7 +340,6 @@
int proc_sz = mbImpl->proc_size();
int proc_rk = mbImpl->proc_rank();
- unsigned int num_partsets = partition_sets.size();
if (!ptag_vals.empty()) {
// values input, get sets with those values
@@ -376,7 +375,36 @@
partition_sets.print();
}
- return delete_nonlocal_entities(partition_sets, file_set);
+ result = delete_nonlocal_entities(partition_sets, file_set); RR(" ");
+
+ if (ptag_name != PARALLEL_PARTITION_TAG_NAME) {
+ // tag the partition sets with a standard tag name
+ result = mbImpl->tag_create(PARALLEL_PARTITION_TAG_NAME, sizeof(int),
+ MB_TAG_SPARSE,
+ MB_TYPE_INTEGER, ptag,
+ 0, true);
+ if (MB_ALREADY_ALLOCATED == result) {
+ // this tag already exists; better check to see that tagged sets
+ // agree with this partition
+ MBRange tagged_sets;
+ int *proc_rk_ptr = &proc_rk;
+ result = mbImpl->get_entities_by_type_and_tag(0, MBENTITYSET, &ptag,
+ (const void* const*)&proc_rk_ptr, 1,
+ tagged_sets); RR(" ");
+ if (!tagged_sets.empty() && tagged_sets != partition_sets) {
+ result = mbImpl->tag_delete_data(ptag, tagged_sets); RR(" ");
+ }
+ else if (tagged_sets == partition_sets) return MB_SUCCESS;
+ }
+
+ // if we get here, we need to assign the tag
+ std::vector<int> values(partition_sets.size());
+ for (unsigned int i = 0; i < partition_sets.size(); i++)
+ values[i] = proc_rk;
+ result = mbImpl->tag_set_data(ptag, partition_sets, &values[0]); RR(" ");
+ }
+
+ return result;
}
MBErrorCode ReadParallel::delete_nonlocal_entities(MBRange &partition_sets,
Modified: MOAB/trunk/parallel/errmem.h
===================================================================
--- MOAB/trunk/parallel/errmem.h 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/parallel/errmem.h 2008-04-28 16:35:24 UTC (rev 1779)
@@ -10,6 +10,8 @@
Memory Allocation Wrappers to Catch Out-of-memory
--------------------------------------------------------------------------*/
+#include "malloc.h"
+
#ifdef __GNUC__
void fail(const char *fmt, ...) __attribute__ ((noreturn));
#else
Modified: MOAB/trunk/parallel/gs.h
===================================================================
--- MOAB/trunk/parallel/gs.h 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/parallel/gs.h 2008-04-28 16:35:24 UTC (rev 1779)
@@ -34,7 +34,7 @@
#endif
} gs_data;
-gs_data *gs_data_setup(uint n, const long *label, const ulong *label,
+gs_data *gs_data_setup(uint n, const long *label, const ulong *ulabel,
uint maxv, const unsigned int nlabels,
const unsigned int nulabels,
crystal_data *crystal);
Modified: MOAB/trunk/parallel/pcomm_unit.cpp
===================================================================
--- MOAB/trunk/parallel/pcomm_unit.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/parallel/pcomm_unit.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -1,6 +1,7 @@
#include "MBParallelComm.hpp"
#include "MBCore.hpp"
#include "TestUtil.hpp"
+#include <algorithm>
#ifdef USE_MPI
# include <mpi.h>
Modified: MOAB/trunk/test/h5file/h5legacy.cpp
===================================================================
--- MOAB/trunk/test/h5file/h5legacy.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/test/h5file/h5legacy.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -2,6 +2,7 @@
#include "testdir.h"
#include "TestUtil.hpp"
+#include <algorithm>
#include <iostream>
#include <stdlib.h>
#include <math.h>
Modified: MOAB/trunk/test/h5file/mhdf_parallel.c
===================================================================
--- MOAB/trunk/test/h5file/mhdf_parallel.c 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/test/h5file/mhdf_parallel.c 2008-04-28 16:35:24 UTC (rev 1779)
@@ -229,7 +229,7 @@
offset = (0 == RANK) ? 0 : 4 + 4*RANK;
offset += 2*RANK;
list[count++] = first_set + 2 + RANK;
- mhdf_openSparseTagData( file, proc_tag_name, &ntag, handles, &status );
+ mhdf_openSparseTagData( file, proc_tag_name, &ntag, &ntag, handles, &status );
CHECK(status);
assert( ntag == total_num_nodes + total_num_hexes + NUM_PROC );
mhdf_writeSparseTagEntities( handles[0], offset, count, H5T_NATIVE_INT, list, &status );
Modified: MOAB/trunk/test/h5file/parallel.cpp
===================================================================
--- MOAB/trunk/test/h5file/parallel.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/test/h5file/parallel.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -75,9 +75,9 @@
iFace = new MBCore();
- char* defaults[] = { "out.blocks.h5m", "../../" TEST_DIR "/h5file/blocks.h5m" };
+ const char* defaults[] = { "out.blocks.h5m", "../../" TEST_DIR "/h5file/blocks.h5m" };
bool wait_for_sig = false;
- char** fnames = argv + 1;
+ const char** fnames = (const char**) argv + 1;
int fname_count = argc - 1;
if (argc > 1 && !strcmp( argv[i], "-w" )) {
++fnames;
@@ -127,7 +127,9 @@
rval = iFace->tag_create( PARALLEL_SHARED_PROC_TAG_NAME, 2*sizeof(int),
MB_TAG_SPARSE, ifaceTag, 0 ); assert(!rval);
rval = iFace->tag_create( PARALLEL_GID_TAG_NAME, sizeof(MBEntityHandle),
- MB_TAG_SPARSE, gidTag, 0 ); assert(!rval);
+ MB_TAG_SPARSE, gidTag, 0 ); assert(!rval ||
+ // might have already been allocated
+ rval == MB_ALREADY_ALLOCATED);
// Get the list of geometry volumes this processor is to export
// (id % numproc == rank).
Modified: MOAB/trunk/test/obb/obb_tree_tool.cpp
===================================================================
--- MOAB/trunk/test/obb/obb_tree_tool.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/test/obb/obb_tree_tool.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -6,6 +6,7 @@
#include "MBInternals.hpp"
#include <iostream>
#include <iomanip>
+#include <limits>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
Modified: MOAB/trunk/test/perf/Makefile.am
===================================================================
--- MOAB/trunk/test/perf/Makefile.am 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/test/perf/Makefile.am 2008-04-28 16:35:24 UTC (rev 1779)
@@ -7,11 +7,8 @@
LDADD = $(top_builddir)/libMOAB.la
-check_PROGRAMS = perf seqperf #cubit_perf tstt_perf tstt_perf_binding
+check_PROGRAMS = perf seqperf
perf_SOURCES = perf.cpp
seqperf_SOURCES = seqperf.cpp
-#cubit_perf_SOURCES = cubit_perf.cpp
-#tstt_perf_SOURCES = tstt_perf.cpp
-#tstt_perf_binding_SOURCES = tstt_perf_binding.cpp
Modified: MOAB/trunk/test/perf/perf.cpp
===================================================================
--- MOAB/trunk/test/perf/perf.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/test/perf/perf.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -530,7 +530,6 @@
}
MBEntityHandle dum_conn[8];
- int idx;
for (i=0; i < nelem; i++) {
for (int j=0; j < nelem; j++) {
for (int k=0; k < nelem; k++) {
Modified: MOAB/trunk/test_adj.cpp
===================================================================
--- MOAB/trunk/test_adj.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/test_adj.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -49,12 +49,12 @@
//faces to nodes
- for(int i=0; i<tris.size(); i++)
+ for(unsigned int i=0; i<tris.size(); i++)
{
err = iface->get_adjacencies( &tris[i], 1, 0, true, nodes );
std::cout << "edge " << ID_FROM_HANDLE(tris[i]) << std::endl;
std::cout << "nodes = ";
- for(int j=0; j<nodes.size(); j++)
+ for(unsigned int j=0; j<nodes.size(); j++)
std::cout << nodes[j] << " ";
std::cout << std::endl;
}
Modified: MOAB/trunk/tools/converter/convert.cpp
===================================================================
--- MOAB/trunk/tools/converter/convert.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/converter/convert.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -27,6 +27,8 @@
#include <iostream>
#include <iomanip>
#include <set>
+#include <cstdlib>
+#include <algorithm>
#ifndef WIN32
# include <sys/times.h>
# include <limits.h>
Modified: MOAB/trunk/tools/dagmc/DagMC.cpp
===================================================================
--- MOAB/trunk/tools/dagmc/DagMC.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/dagmc/DagMC.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -21,6 +21,7 @@
#include <fstream>
#include <sstream>
#include <limits>
+#include <algorithm>
#include <ctype.h>
#include <string.h>
Modified: MOAB/trunk/tools/dagmc/pt_vol_test.cc
===================================================================
--- MOAB/trunk/tools/dagmc/pt_vol_test.cc 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/dagmc/pt_vol_test.cc 2008-04-28 16:35:24 UTC (rev 1779)
@@ -7,6 +7,7 @@
#include <iostream>
#include <math.h>
#include <limits>
+#include <stdlib.h>
#define CHKERR if (MB_SUCCESS != rval) return rval
Modified: MOAB/trunk/tools/iMesh/Makefile.am
===================================================================
--- MOAB/trunk/tools/iMesh/Makefile.am 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/iMesh/Makefile.am 2008-04-28 16:35:24 UTC (rev 1779)
@@ -32,8 +32,7 @@
iMesh_f.h \
iMesh_protos.h \
iBase.h \
- iBase_f.h \
- iBase_FCDefs.h
+ iBase_f.h
lib_LTLIBRARIES = libiMesh.la
Modified: MOAB/trunk/tools/iMesh/SIDL/common.make.in
===================================================================
--- MOAB/trunk/tools/iMesh/SIDL/common.make.in 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/iMesh/SIDL/common.make.in 2008-04-28 16:35:24 UTC (rev 1779)
@@ -6,7 +6,8 @@
-I$(builddir) -I$(srcdir) \
-I$(imesh_srcdir) \
-I$(imesh_builddir) \
- -I$(sidl_srcdir)
+ -I$(sidl_srcdir) \
+ -I$(top_srcdir)
imesh_srcdir = $(sidl_srcdir)/..
imesh_builddir = ../..
Modified: MOAB/trunk/tools/iMesh/iBase_f.h
===================================================================
--- MOAB/trunk/tools/iMesh/iBase_f.h 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/iMesh/iBase_f.h 2008-04-28 16:35:24 UTC (rev 1779)
@@ -66,29 +66,29 @@
integer iBase_NOT_SUPPORTED
integer iBase_FAILURE
- parameter (iBase_SUCCESS = 0)
- parameter (iBase_MESH_ALREADY_LOADED = 1)
- parameter (iBase_NO_MESH_DATA = 2)
- parameter (iBase_FILE_NOT_FOUND = 3)
- parameter (iBase_FILE_WRITE_ERROR = 4)
- parameter (iBase_NIL_ARRAY = 5)
- parameter (iBase_BAD_ARRAY_SIZE = 6)
- parameter (iBase_BAD_ARRAY_DIMENSION = 7)
- parameter (iBase_INVALID_ENTITY_HANDLE = 8)
- parameter (iBase_INVALID_ENTITY_COUNT = 9)
- parameter (iBase_INVALID_ENTITY_TYPE = 10)
+ parameter (iBase_SUCCESS = 0)
+ parameter (iBase_MESH_ALREADY_LOADED = 1)
+ parameter (iBase_NO_MESH_DATA = 2)
+ parameter (iBase_FILE_NOT_FOUND = 3)
+ parameter (iBase_FILE_WRITE_ERROR = 4)
+ parameter (iBase_NIL_ARRAY = 5)
+ parameter (iBase_BAD_ARRAY_SIZE = 6)
+ parameter (iBase_BAD_ARRAY_DIMENSION = 7)
+ parameter (iBase_INVALID_ENTITY_HANDLE = 8)
+ parameter (iBase_INVALID_ENTITY_COUNT = 9)
+ parameter (iBase_INVALID_ENTITY_TYPE = 10)
parameter (iBase_INVALID_ENTITY_TOPOLOGY = 11)
- parameter (iBase_BAD_TYPE_AND_TOPO = 12)
+ parameter (iBase_BAD_TYPE_AND_TOPO = 12)
parameter (iBase_ENTITY_CREATION_ERROR = 13)
parameter (iBase_INVALID_TAG_HANDLE = 14)
- parameter (iBase_TAG_NOT_FOUND = 15)
+ parameter (iBase_TAG_NOT_FOUND = 15)
parameter (iBase_TAG_ALREADY_EXISTS = 16)
parameter (iBase_TAG_IN_USE = 17)
- parameter (iBase_INVALID_ENTITYSET_HANDLE = 18)
- parameter (iBase_INVALID_ITERATOR_HANDLE = 19)
- parameter (iBase_INVALID_ARGUMENT = 20)
+ parameter (iBase_INVALID_ENTITYSET_HANDLE = 18)
+ parameter (iBase_INVALID_ITERATOR_HANDLE = 19)
+ parameter (iBase_INVALID_ARGUMENT = 20)
parameter (iBase_MEMORY_ALLOCATION_FAILED = 21)
- parameter (iBase_NOT_SUPPORTED = 22)
+ parameter (iBase_NOT_SUPPORTED = 22)
parameter (iBase_FAILURE = 23)
Modified: MOAB/trunk/tools/iMesh/iMesh.h
===================================================================
--- MOAB/trunk/tools/iMesh/iMesh.h 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/iMesh/iMesh.h 2008-04-28 16:35:24 UTC (rev 1779)
@@ -670,16 +670,16 @@
* \param instance iMesh instance for this call
* \param entity_handles Entities from which adjacencies are requested
* \param entity_handles_size Number of entities whose adjacencies are requested
- * \param bridge_dimension Bridge dimension for 2nd order adjacencies
- * \param to_dimension Dimension of adjacent entities returned
- * \param adj_entity_handles Adjacent entities
- * \param adj_entity_handles_allocated Allocated size of returned array
- * \param adj_entity_handles_size Occupied size of returned array
- * \param offset Offset[i] is offset into adj_entity_handles of 2nd order
+ * \param order_adjacent_key Bridge dimension for 2nd order adjacencies
+ * \param requested_entity_type Dimension of adjacent entities returned
+ * \param *adj_entity_handles Adjacent entities
+ * \param *adj_entity_handles_allocated Allocated size of returned array
+ * \param *adj_entity_handles_size Occupied size of returned array
+ * \param *offset Offset[i] is offset into adj_entity_handles of 2nd order
* adjacencies of ith entity in entity_handles
- * \param offset_allocated Allocated size of offset array
- * \param offset_size Occupied size of offset array
- * \param err
+ * \param *offset_allocated Allocated size of offset array
+ * \param *offset_size Occupied size of offset array
+ * \param *err Pointer to error type returned from function
*/
void iMesh_getEntArr2ndAdj( iMesh_Instance instance,
iBase_EntityHandle const* entity_handles,
@@ -1958,12 +1958,12 @@
* specified "to" dimension.
* \param instance iMesh instance for this call
* \param entity_handle Entity from which adjacencies are requested
- * \param bridge_dimension Bridge dimension for 2nd order adjacencies
- * \param to_dimension Dimension of adjacent entities returned
- * \param adjacent_entities Adjacent entities
- * \param adjacent_entities_allocated Allocated size of returned array
- * \param adjacent_entities_size Occupied size of returned array
- * \param err
+ * \param order_adjacent_key Bridge dimension for 2nd order adjacencies
+ * \param requested_entity_type Dimension of adjacent entities returned
+ * \param *adjacent_entities Pointer to array of adjacent entities
+ * \param *adjacent_entities_allocated Pointer to allocated size of returned array
+ * \param *adjacent_entities_size Pointer to occupied size of returned array
+ * \param *err Pointer to error type returned from function
*/
void iMesh_getEnt2ndAdj( iMesh_Instance instance,
iBase_EntityHandle entity_handle,
Modified: MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp
===================================================================
--- MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -1,4 +1,4 @@
-#include "iMesh.h"
+#include "iMesh_extensions.h"
#include "MBCore.hpp"
#include "MBRange.hpp"
#include "MBCN.hpp"
@@ -56,12 +56,12 @@
}
#define CHECK_SIZE(array, allocated, size, type, retval) \
- if (NULL != array && 0 != array ## _allocated && array ## _allocated < (size)) {\
+ if (0 != allocated && NULL != array && allocated < (size)) {\
iMesh_processError(iBase_MEMORY_ALLOCATION_FAILED, \
"Allocated array not large enough to hold returned contents.");\
RETURN(iBase_MEMORY_ALLOCATION_FAILED);\
}\
- if (NULL == array || allocated == 0) {\
+ if (allocated == 0 || NULL == array) {\
array = (type*)malloc((size)*sizeof(type));\
allocated=(size);\
if (NULL == array) {iMesh_processError(iBase_MEMORY_ALLOCATION_FAILED, \
@@ -70,7 +70,7 @@
// TAG_CHECK_SIZE is like CHECK_SIZE except it checks for and makes the allocated memory
// size a multiple of sizeof(void*), and the pointer is assumed to be type char*
#define TAG_CHECK_SIZE(array, allocated, size) \
- if (NULL != array && 0 != array ## _allocated && array ## _allocated < (size)) {\
+ if (0 != allocated && NULL != array && allocated < (size)) {\
iMesh_processError(iBase_MEMORY_ALLOCATION_FAILED, \
"Allocated array not large enough to hold returned contents.");\
RETURN(iBase_MEMORY_ALLOCATION_FAILED);\
@@ -195,6 +195,8 @@
extern "C" {
#endif
+void eatwhitespace(std::string &this_string);
+
MBErrorCode iMesh_tag_set_vertices(iMesh_Instance instance,
MBEntityHandle in_set,
const int req_dimension,
@@ -290,6 +292,9 @@
std::string tmp_filename(name, name_len),
tmp_options(options, options_len);
+ eatwhitespace(tmp_filename);
+ eatwhitespace(tmp_options);
+
MBEntityHandle file_set;
MBErrorCode result = MBI->load_file(tmp_filename.c_str(), file_set,
@@ -310,9 +315,13 @@
int *err, const int name_len, int options_len)
{
// get filename & attempt to NULL-terminate
- std::string tmp_filename( name, name_len );
+ std::string tmp_filename( name, name_len ), tmp_options(options, options_len);
- MBErrorCode result = MBI->write_mesh(tmp_filename.c_str(), CONST_HANDLE_ARRAY_PTR(&handle), 1);
+ eatwhitespace(tmp_filename);
+ eatwhitespace(tmp_options);
+
+ MBErrorCode result = MBI->write_file(tmp_filename.c_str(), NULL, tmp_options.c_str(),
+ CONST_HANDLE_ARRAY_PTR(&handle), 1);
if (MB_SUCCESS != result) {
std::string msg("iMesh_save:ERROR saving a mesh, with error type: ");
@@ -362,25 +371,8 @@
/*in*/ const int entity_type,
int *num_type, int *err)
{
- *num_type = 0;
- MBErrorCode result;
- if (entity_type == iBase_ALL_TYPES)
- result = MBI->get_number_entities_by_handle
- (ENTITY_HANDLE(entity_set_handle), *num_type);
- else
- result = MBI->get_number_entities_by_dimension
- (ENTITY_HANDLE(entity_set_handle), entity_type, *num_type);
-
- if (result != MB_SUCCESS) {
- std::string msg("iMesh_entitysetGetNumberEntityOfType: ERROR getting number of entities"
- " by type, with error type: ");
- msg += MBI->get_error_string(result);
- iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
- *num_type = 0;
- RETURN(iBase_ERROR_MAP[result]);
- }
-
- RETURN(iBase_SUCCESS);
+ iMesh_getNumOfTypeRec(instance, entity_set_handle, entity_type, false,
+ num_type, err);
}
void iMesh_getNumOfTopo(iMesh_Instance instance,
@@ -388,27 +380,8 @@
/*in*/ const int entity_topology,
int *num_topo, int *err)
{
- if (entity_topology == iMesh_SEPTAHEDRON) {
- *num_topo = 0;
- RETURN(iBase_SUCCESS);
- }
-
- *num_topo = 0;
- MBErrorCode result =
- MBI->get_number_entities_by_type(ENTITY_HANDLE(entity_set_handle),
- mb_topology_table[entity_topology],
- *num_topo);
- if (MB_SUCCESS != result) {
- std::string msg("iMesh_entitysetGetNumberEntityOfTopology: ERROR getting "
- "number of entities by topology., with error type: ");
- msg += MBI->get_error_string(result);
- iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
- *num_topo = -1;
- RETURN(iBase_ERROR_MAP[result]);
- }
- else {
- RETURN(iBase_SUCCESS);
- }
+ iMesh_getNumOfTopoRec(instance, entity_set_handle, entity_topology,
+ false, num_topo, err);
}
void iMesh_areEHValid( iMesh_Instance instance,
@@ -621,69 +594,10 @@
/*out*/ int* entity_handles_size,
int *err)
{
- bool use_top = false;
- bool use_type = false;
- // initialize just to get rid of compiler warning
- MBEntityType type = mb_topology_table[iMesh_ALL_TOPOLOGIES];
- MBRange out_entities;
-
- if (entity_topology >= iMesh_POINT
- && entity_topology < iMesh_ALL_TOPOLOGIES) {
- type = mb_topology_table[entity_topology];
- use_top = true;
- }
- else if (entity_type >= iBase_VERTEX
- && entity_type <= iBase_ALL_TYPES)
- use_type = true;
- else {
- iMesh_processError(iBase_ERROR_MAP[iBase_BAD_TYPE_AND_TOPO],
- "iMesh_getEntities:ERROR not valid entity type or topology");
- RETURN(iBase_ERROR_MAP[iBase_BAD_TYPE_AND_TOPO]);
- }
-
- MBEntityHandle handle = ENTITY_HANDLE(entity_set_handle);
- MBErrorCode result;
-
- if (use_top) {
- if (entity_topology == iMesh_SEPTAHEDRON)
- result = MB_SUCCESS; // MOAB doesn't do septahedrons, so there are never any.
- else
- result = MBI->get_entities_by_type(handle, type, out_entities);
- }
- else if (use_type && entity_type != iBase_ALL_TYPES)
- result = MBI->get_entities_by_dimension(handle, entity_type, out_entities);
- else
- result = MBI->get_entities_by_handle(handle, out_entities);
-
- if (result != MB_SUCCESS) {
- std::string msg("iMesh_GetEntities:ERROR getting entities, with error type: ");
- msg += MBI->get_error_string(result);
- iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
- RETURN(iBase_ERROR_MAP[result]);
- }
-
- CHECK_SIZE(*entity_handles, *entity_handles_allocated,
- (int)out_entities.size(), iBase_EntityHandle, iBase_MEMORY_ALLOCATION_FAILED);
-
- MBRange::iterator iter = out_entities.begin();
- MBRange::iterator end_iter = out_entities.end();
- int k = 0;
-
- // filter out entity sets here
- if (iBase_ALL_TYPES == entity_type && iMesh_ALL_TOPOLOGIES == entity_topology) {
- for (; iter != end_iter && MBI->type_from_handle(*iter) != MBENTITYSET; iter++)
- (*entity_handles)[k++] = (iBase_EntityHandle)*iter;
- }
- else {
- for (; iter != end_iter; iter++)
- (*entity_handles)[k++] = (iBase_EntityHandle)*iter;
- }
-
- // now it's safe to set the size; set it to k, not out_entities.size(), to
- // account for sets which might have been removed
- *entity_handles_size = k;
-
- RETURN(iBase_SUCCESS);
+ iMesh_getEntitiesRec(instance, entity_set_handle, entity_type,
+ entity_topology, false,
+ entity_handles, entity_handles_allocated, entity_handles_size,
+ err);
}
void iMesh_getVtxArrCoords (iMesh_Instance instance,
@@ -1678,6 +1592,10 @@
{
MBTag new_tag;
int this_size = tag_size;
+
+ std::string tmp_tagname(tag_name);
+ eatwhitespace(tmp_tagname);
+
switch (tag_type) {
case iBase_INTEGER:
this_size *= sizeof(int);
@@ -1692,7 +1610,7 @@
break;
}
- MBErrorCode result = MBI->tag_create(tag_name, this_size,
+ MBErrorCode result = MBI->tag_create(tmp_tagname.c_str(), this_size,
MB_TAG_SPARSE,
mb_data_type_table[tag_type],
new_tag,
@@ -2692,7 +2610,341 @@
return result;
}
+
+void iMesh_getEntitiesRec(iMesh_Instance instance,
+ /*in*/ const iBase_EntitySetHandle entity_set_handle,
+ /*in*/ const int entity_type,
+ /*in*/ const int entity_topology,
+ /*in*/ const int recursive,
+ /*out*/ iBase_EntityHandle** entity_handles,
+ /*out*/ int* entity_handles_allocated,
+ /*out*/ int* entity_handles_size,
+ /*out*/ int *err)
+{
+ bool use_top = false;
+ bool use_type = false;
+ // initialize just to get rid of compiler warning
+ MBEntityType type = mb_topology_table[iMesh_ALL_TOPOLOGIES];
+ MBRange out_entities;
+
+ if (entity_topology >= iMesh_POINT
+ && entity_topology < iMesh_ALL_TOPOLOGIES) {
+ type = mb_topology_table[entity_topology];
+ use_top = true;
+ }
+ else if (entity_type >= iBase_VERTEX
+ && entity_type <= iBase_ALL_TYPES)
+ use_type = true;
+ else {
+ iMesh_processError(iBase_ERROR_MAP[iBase_BAD_TYPE_AND_TOPO],
+ "iMesh_getEntities:ERROR not valid entity type or topology");
+ RETURN(iBase_ERROR_MAP[iBase_BAD_TYPE_AND_TOPO]);
+ }
+
+ MBEntityHandle handle = ENTITY_HANDLE(entity_set_handle);
+ MBErrorCode result;
+
+ if (use_top) {
+ if (entity_topology == iMesh_SEPTAHEDRON)
+ result = MB_SUCCESS; // MOAB doesn't do septahedrons, so there are never any.
+ else
+ result = MBI->get_entities_by_type(handle, type, out_entities, recursive);
+ }
+ else if (use_type && entity_type != iBase_ALL_TYPES)
+ result = MBI->get_entities_by_dimension(handle, entity_type, out_entities, recursive);
+ else
+ result = MBI->get_entities_by_handle(handle, out_entities, recursive);
+
+ if (result != MB_SUCCESS) {
+ std::string msg("iMesh_GetEntities:ERROR getting entities, with error type: ");
+ msg += MBI->get_error_string(result);
+ iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
+ RETURN(iBase_ERROR_MAP[result]);
+ }
+
+ CHECK_SIZE(*entity_handles, *entity_handles_allocated,
+ (int)out_entities.size(), iBase_EntityHandle, iBase_MEMORY_ALLOCATION_FAILED);
+ MBRange::iterator iter = out_entities.begin();
+ MBRange::iterator end_iter = out_entities.end();
+ int k = 0;
+
+ // filter out entity sets here
+ if (iBase_ALL_TYPES == entity_type && iMesh_ALL_TOPOLOGIES == entity_topology) {
+ for (; iter != end_iter && MBI->type_from_handle(*iter) != MBENTITYSET; iter++)
+ (*entity_handles)[k++] = (iBase_EntityHandle)*iter;
+ }
+ else {
+ for (; iter != end_iter; iter++)
+ (*entity_handles)[k++] = (iBase_EntityHandle)*iter;
+ }
+
+ // now it's safe to set the size; set it to k, not out_entities.size(), to
+ // account for sets which might have been removed
+ *entity_handles_size = k;
+
+ RETURN(iBase_SUCCESS);
+}
+
+ /**\brief Get the number of entities with the specified type in the instance or set, recursive
+ *
+ * Get the number of entities with the specified type in the instance
+ * or set. If recursive is passed in non-zero, includes entities in owned sets.
+ * If entity set handle is zero, return information for instance,
+ * otherwise for set. Value of entity type must be from the
+ * iBase_EntityType enumeration. If iBase_ALL_TYPES is specified,
+ * total number of entities (excluding entity sets) is returned.
+ * \param instance iMesh instance handle
+ * \param entity_set_handle Entity set being queried
+ * \param entity_type Type of entity requested
+ * \param recursive If non-zero, includes entities in owned sets too
+ * \param num_type Pointer to number of entities, returned from function
+ * \param *err Pointer to error type returned from function
+ */
+void iMesh_getNumOfTypeRec(iMesh_Instance instance,
+ /*in*/ const iBase_EntitySetHandle entity_set_handle,
+ /*in*/ const int entity_type,
+ /*in*/ const int recursive,
+ /*out*/ int *num_type,
+ /*out*/ int *err)
+{
+ *num_type = 0;
+ MBErrorCode result;
+ if (entity_type == iBase_ALL_TYPES)
+ result = MBI->get_number_entities_by_handle
+ (ENTITY_HANDLE(entity_set_handle), *num_type, recursive);
+ else
+ result = MBI->get_number_entities_by_dimension
+ (ENTITY_HANDLE(entity_set_handle), entity_type, *num_type, recursive);
+
+ if (result != MB_SUCCESS) {
+ std::string msg("iMesh_entitysetGetNumberEntityOfType: ERROR getting number of entities"
+ " by type, with error type: ");
+ msg += MBI->get_error_string(result);
+ iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
+ *num_type = 0;
+ RETURN(iBase_ERROR_MAP[result]);
+ }
+
+ RETURN(iBase_SUCCESS);
+}
+
+
+ /**\brief Get the number of entities with the specified topology in the instance or set
+ *
+ * Get the number of entities with the specified topology in the instance
+ * or set. If recursive is passed in non-zero, includes entities in owned sets.
+ * If entity set handle is zero, return information for instance,
+ * otherwise for set. Value of entity topology must be from the
+ * iMesh_EntityTopology enumeration. If iMesh_ALL_TOPOLOGIES is specified,
+ * total number of entities (excluding entity sets) is returned.
+ * \param instance iMesh instance handle
+ * \param entity_set_handle Entity set being queried
+ * \param entity_topology Topology of entity requested
+ * \param recursive If non-zero, includes entities in owned sets too
+ * \param num_topo Pointer to number of entities, returned from function
+ * \param *err Pointer to error type returned from function
+ */
+void iMesh_getNumOfTopoRec(iMesh_Instance instance,
+ /*in*/ const iBase_EntitySetHandle entity_set_handle,
+ /*in*/ const int entity_topology,
+ /*in*/ const int recursive,
+ /*out*/ int *num_topo,
+ /*out*/ int *err)
+{
+ if (entity_topology == iMesh_SEPTAHEDRON) {
+ *num_topo = 0;
+ RETURN(iBase_SUCCESS);
+ }
+
+ *num_topo = 0;
+ MBErrorCode result =
+ MBI->get_number_entities_by_type(ENTITY_HANDLE(entity_set_handle),
+ mb_topology_table[entity_topology],
+ *num_topo, recursive);
+ if (MB_SUCCESS != result) {
+ std::string msg("iMesh_entitysetGetNumberEntityOfTopology: ERROR getting "
+ "number of entities by topology., with error type: ");
+ msg += MBI->get_error_string(result);
+ iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
+ *num_topo = -1;
+ RETURN(iBase_ERROR_MAP[result]);
+ }
+ else {
+ RETURN(iBase_SUCCESS);
+ }
+}
+
+ /**\brief Get entities with specified type, topology, tag(s) and (optionally) tag value(s)
+ *
+ * Get entities with the specified type, topology, tag(s), and optionally tag value(s).
+ * If tag values pointer is input as zero, entities with specified tag(s) are returned,
+ * regardless of their value.
+ * \param instance iMesh instance handle
+ * \param entity_set_handle Entity set being queried
+ * \param entity_type Type of entities being requested
+ * \param entity_topology Topology of entities being requested
+ * \param tag_handles Array of tag handles
+ * \param tag_vals Array of tag values (zero if values not requested)
+ * \param num_tags_vals Number of tags and optionally values
+ * \param recursive If non-zero, gets entities in owned sets too
+ * \param *entity_handles Pointer to array of entity handles returned
+ * from function
+ * \param *entity_handles_allocated Pointer to allocated size of
+ * entity_handles array
+ * \param *entity_handles_size Pointer to occupied size of entity_handles array
+ * \param *err Pointer to error type returned from function
+ */
+void iMesh_getEntsByTagsRec(iMesh_Instance instance,
+ /*in*/ const iBase_EntitySetHandle entity_set_handle,
+ /*in*/ const int entity_type,
+ /*in*/ const int entity_topology,
+ /*in*/ const iBase_TagHandle *tag_handles,
+ /*in*/ const char * const *tag_vals,
+ /*in*/ const int num_tags_vals,
+ /*in*/ const int recursive,
+ /*out*/ iBase_EntityHandle** entity_handles,
+ /*out*/ int* entity_handles_allocated,
+ /*out*/ int* entity_handles_size,
+ /*out*/ int *err)
+{
+ bool use_top = false;
+ bool use_type = false;
+ // initialize just to get rid of compiler warning
+ MBEntityType type = mb_topology_table[iMesh_ALL_TOPOLOGIES];
+ MBRange out_entities;
+
+ if (entity_topology >= iMesh_POINT
+ && entity_topology < iMesh_ALL_TOPOLOGIES) {
+ type = mb_topology_table[entity_topology];
+ use_top = true;
+ }
+ else if (entity_type >= iBase_VERTEX
+ && entity_type <= iBase_ALL_TYPES)
+ use_type = true;
+ else {
+ iMesh_processError(iBase_ERROR_MAP[iBase_BAD_TYPE_AND_TOPO],
+ "iMesh_getEntities:ERROR not valid entity type or topology");
+ RETURN(iBase_ERROR_MAP[iBase_BAD_TYPE_AND_TOPO]);
+ }
+
+ MBEntityHandle handle = ENTITY_HANDLE(entity_set_handle);
+ MBErrorCode result;
+
+ if (use_top) {
+ if (entity_topology == iMesh_SEPTAHEDRON)
+ result = MB_SUCCESS; // MOAB doesn't do septahedrons, so there are never any.
+ else
+ result = MBI->get_entities_by_type_and_tag(handle, type, (MBTag*)tag_handles,
+ (const void* const *)tag_vals,
+ num_tags_vals, out_entities,
+ MBInterface::INTERSECT, recursive);
+ }
+ else if (use_type && entity_type != iBase_ALL_TYPES) {
+ // need to loop over all types of this dimension
+ for (MBEntityType tp = MBCN::TypeDimensionMap[entity_type].first;
+ tp <= MBCN::TypeDimensionMap[entity_type].second; tp++) {
+ MBRange tmp_range;
+ MBErrorCode tmp_result = MBI->get_entities_by_type_and_tag(handle, type, (MBTag*)tag_handles,
+ (const void* const *)tag_vals,
+ num_tags_vals, tmp_range,
+ MBInterface::INTERSECT, recursive);
+ if (MB_SUCCESS != tmp_result) result = tmp_result;
+ else out_entities.merge(tmp_range);
+ }
+ }
+ else
+ result = MBI->get_entities_by_type_and_tag(handle, type, (MBTag*)tag_handles,
+ (const void* const *)tag_vals,
+ num_tags_vals, out_entities,
+ MBInterface::INTERSECT, recursive);
+
+ if (result != MB_SUCCESS) {
+ std::string msg("iMesh_GetEntities:ERROR getting entities, with error type: ");
+ msg += MBI->get_error_string(result);
+ iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
+ RETURN(iBase_ERROR_MAP[result]);
+ }
+
+ CHECK_SIZE(*entity_handles, *entity_handles_allocated,
+ (int)out_entities.size(), iBase_EntityHandle, iBase_MEMORY_ALLOCATION_FAILED);
+
+ MBRange::iterator iter = out_entities.begin();
+ MBRange::iterator end_iter = out_entities.end();
+ int k = 0;
+
+ // filter out entity sets here
+ if (iBase_ALL_TYPES == entity_type && iMesh_ALL_TOPOLOGIES == entity_topology) {
+ for (; iter != end_iter && MBI->type_from_handle(*iter) != MBENTITYSET; iter++)
+ (*entity_handles)[k++] = (iBase_EntityHandle)*iter;
+ }
+ else {
+ for (; iter != end_iter; iter++)
+ (*entity_handles)[k++] = (iBase_EntityHandle)*iter;
+ }
+
+ // now it's safe to set the size; set it to k, not out_entities.size(), to
+ // account for sets which might have been removed
+ *entity_handles_size = k;
+
+ RETURN(iBase_SUCCESS);
+}
+
+void iMesh_getEntSetsByTagsRec(iMesh_Instance instance,
+ /*in*/ const iBase_EntitySetHandle entity_set_handle,
+ /*in*/ const iBase_TagHandle *tag_handles,
+ /*in*/ const char * const *tag_vals,
+ /*in*/ const int num_tags_vals,
+ /*in*/ const int recursive,
+ /*out*/ iBase_EntityHandle** set_handles,
+ /*out*/ int* set_handles_allocated,
+ /*out*/ int* set_handles_size,
+ /*out*/ int *err)
+{
+ MBRange out_entities;
+
+ MBEntityHandle handle = ENTITY_HANDLE(entity_set_handle);
+ MBErrorCode result;
+
+ result = MBI->get_entities_by_type_and_tag(handle, MBENTITYSET, (MBTag*)tag_handles,
+ (const void* const *)tag_vals,
+ num_tags_vals, out_entities,
+ MBInterface::INTERSECT, recursive);
+ if (result != MB_SUCCESS) {
+ std::string msg("ERROR getting entities, with error type: ");
+ msg += MBI->get_error_string(result);
+ iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
+ RETURN(iBase_ERROR_MAP[result]);
+ }
+
+ CHECK_SIZE(*set_handles, *set_handles_allocated,
+ (int)out_entities.size(), iBase_EntityHandle, iBase_MEMORY_ALLOCATION_FAILED);
+
+ std::copy(out_entities.begin(), out_entities.end(), ((MBEntityHandle*) *set_handles));
+
+ // now it's safe to set the size; set it to k, not out_entities.size(), to
+ // account for sets which might have been removed
+ *set_handles_size = out_entities.size();
+
+ RETURN(iBase_SUCCESS);
+}
+
+void iMesh_MBCNType(/*in*/ const int imesh_entity_topology,
+ /*out*/ int *mbcn_type)
+{
+ if (iMesh_POINT > imesh_entity_topology ||
+ iMesh_ALL_TOPOLOGIES <= imesh_entity_topology)
+ *mbcn_type = -1;
+ else
+ *mbcn_type = mb_topology_table[imesh_entity_topology];
+}
+
+void eatwhitespace(std::string &this_string)
+{
+ std::string::size_type len = this_string.find_last_not_of(" ");
+ if (len != this_string.npos) this_string[len+1] = '\0';
+}
+
void cfunc_(int arg3, char *mystr, char *mystr2, int arg2,
int strsz, int strsz2)
{
Modified: MOAB/trunk/tools/iMesh/iMesh_protos.h
===================================================================
--- MOAB/trunk/tools/iMesh/iMesh_protos.h 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/iMesh/iMesh_protos.h 2008-04-28 16:35:24 UTC (rev 1779)
@@ -1,4 +1,4 @@
-#include "iBase_FCDefs.h"
+#include "MBCN_FCDefs.h"
#ifdef FC_FUNC_
#define iMesh_getErrorType FC_FUNC_(imesh_geterrortype, IMESH_GETERRORTYPE)
Modified: MOAB/trunk/tools/iMesh/partest.cpp
===================================================================
--- MOAB/trunk/tools/iMesh/partest.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/iMesh/partest.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -1,5 +1,6 @@
#include <iostream>
#include <stdio.h>
+#include <string.h>
#include "mpi.h"
#include "iMesh.h"
Modified: MOAB/trunk/tools/mbzoltan/MBZoltan.cpp
===================================================================
--- MOAB/trunk/tools/mbzoltan/MBZoltan.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/mbzoltan/MBZoltan.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -102,17 +102,19 @@
SetHypergraph_Parameters("auto");
else
SetHypergraph_Parameters(other_method);
- else if (!strcmp(zmethod, "PARMETIS"))
+ else if (!strcmp(zmethod, "PARMETIS")) {
if (NULL == other_method)
SetPARMETIS_Parameters("RepartGDiffusion");
else
SetPARMETIS_Parameters(other_method);
- else if (!strcmp(zmethod, "OCTPART"))
+ }
+ else if (!strcmp(zmethod, "OCTPART")) {
if (NULL == other_method)
SetOCTPART_Parameters("2");
else
SetOCTPART_Parameters(other_method);
-
+ }
+
// Call backs:
myZZ->Set_Num_Obj_Fn(mbGetNumberOfAssignedObjects, NULL);
@@ -237,22 +239,25 @@
SetRIB_Parameters();
else if (!strcmp(zmethod, "HSFC"))
SetHSFC_Parameters();
- else if (!strcmp(zmethod, "Hypergraph") || !strcmp(zmethod, "PHG"))
+ else if (!strcmp(zmethod, "Hypergraph") || !strcmp(zmethod, "PHG")) {
if (NULL == other_method)
SetHypergraph_Parameters("auto");
else
SetHypergraph_Parameters(other_method);
- else if (!strcmp(zmethod, "PARMETIS"))
+ }
+ else if (!strcmp(zmethod, "PARMETIS")) {
if (NULL == other_method)
SetPARMETIS_Parameters("RepartGDiffusion");
else
SetPARMETIS_Parameters(other_method);
- else if (!strcmp(zmethod, "OCTPART"))
+ }
+ else if (!strcmp(zmethod, "OCTPART")) {
if (NULL == other_method)
SetOCTPART_Parameters("2");
else
SetOCTPART_Parameters(other_method);
-
+ }
+
// set # requested partitions
char buff[10];
sprintf(buff, "%d", nparts);
@@ -532,7 +537,7 @@
int MBZoltan::mbInitializePoints(int npts, double *pts, int *ids,
int *adjs, int *length)
{
- unsigned int i;
+ int i;
int j;
int *numPts, *nborProcs;
int sum, ptsPerProc, ptsAssigned, mySize;
@@ -551,7 +556,7 @@
ptsPerProc = npts / mbImpl->proc_size();
ptsAssigned = 0;
- for (i=0; i<mbImpl->proc_size()-1; i++)
+ for (i=0; (int) i < mbImpl->proc_size()-1; i++)
{
numPts[i] = ptsPerProc;
ptsAssigned += ptsPerProc;
@@ -583,7 +588,7 @@
sendProcs = nborProcs + (sendNborId - adjs);
- for (i=1; i<mbImpl->proc_size(); i++)
+ for (i=1; (int)i<mbImpl->proc_size(); i++)
{
MPI_Send(&numPts[i], 1, MPI_INT, i, 0x00,MPI_COMM_WORLD);
MPI_Send(sendPts, 3 * numPts[i], MPI_DOUBLE, i, 0x01,MPI_COMM_WORLD);
@@ -684,7 +689,7 @@
int MBZoltan::mbGlobalSuccess(int rc)
{
int fail = 0;
- unsigned int i;
+ int i;
int *vals = (int *)malloc(mbImpl->proc_size() * sizeof(int));
MPI_Allgather(&rc, 1, MPI_INT, vals, 1, MPI_INT, MPI_COMM_WORLD);
@@ -702,10 +707,10 @@
return fail;
}
-void MBZoltan::mbPrintGlobalResult(char *s,
+void MBZoltan::mbPrintGlobalResult(const char *s,
int begin, int import, int exp, int change)
{
- unsigned int i;
+ int i;
int *v1 = (int *)malloc(4 * sizeof(int));
int *v2 = NULL;
int *v;
@@ -737,7 +742,7 @@
free(v1);
}
-void MBZoltan::mbShowError(int val, char *s)
+void MBZoltan::mbShowError(int val, const char *s)
{
if (s)
{
Modified: MOAB/trunk/tools/mbzoltan/MBZoltan.hpp
===================================================================
--- MOAB/trunk/tools/mbzoltan/MBZoltan.hpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/mbzoltan/MBZoltan.hpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -48,9 +48,9 @@
ZOLTAN_ID_PTR nborGlobalIds, int *nborProcs, int wgt_dim,
float *edge_wgts, int *err);
- void mbShowError(int val, char *s, int me);
+ void mbShowError(int val, const char *s, int me);
- void mbPrintGlobalResult(char *s,
+ void mbPrintGlobalResult(const char *s,
int begin, int import, int exp, int change);
}
@@ -119,10 +119,10 @@
int mbGlobalSuccess(int rc);
- void mbPrintGlobalResult(char *s,
+ void mbPrintGlobalResult(const char *s,
int begin, int import, int exp, int change);
- void mbShowError(int val, char *s);
+ void mbShowError(int val, const char *s);
// given the dimension, assemble the vertices and store in coords and
// moab_ids
Modified: MOAB/trunk/tools/qvdual/DrawDual.cpp
===================================================================
--- MOAB/trunk/tools/qvdual/DrawDual.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/qvdual/DrawDual.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -578,7 +578,7 @@
if (useGraphviz) agwrite(this_gw.gvizGraph, stdout);
}
// neato_init_graph(this_gw.gvizGraph);
- if (useGraphviz) gvLayout(gvContext(), this_gw.gvizGraph, "neato");
+ if (useGraphviz) gvLayout(gvContext(), this_gw.gvizGraph, (char*)"neato");
else smooth_dual_surf(dual_surf, dcells, dedges, dverts,
face_verts, loop_edges);
@@ -1620,7 +1620,7 @@
asym = agfindattr(surfDrawrings[dual_surf].gvizGraph->proto->n,
const_cast<char*>(name));
if (NULL == asym) {
- if (NULL == def_val) asym = agnodeattr(surfDrawrings[dual_surf].gvizGraph, const_cast<char*>(name), "");
+ if (NULL == def_val) asym = agnodeattr(surfDrawrings[dual_surf].gvizGraph, const_cast<char*>(name), (char*)"");
else asym = agnodeattr(surfDrawrings[dual_surf].gvizGraph, const_cast<char*>(name),
const_cast<char*>(def_val));
@@ -1630,7 +1630,7 @@
asym = agfindattr(surfDrawrings[dual_surf].gvizGraph->proto->e,
const_cast<char*>(name));
if (NULL == asym) {
- if (NULL == def_val) asym = agedgeattr(surfDrawrings[dual_surf].gvizGraph, const_cast<char*>(name), "");
+ if (NULL == def_val) asym = agedgeattr(surfDrawrings[dual_surf].gvizGraph, const_cast<char*>(name), (char*)"");
else asym = agedgeattr(surfDrawrings[dual_surf].gvizGraph, const_cast<char*>(name),
const_cast<char*>(def_val));
@@ -1725,7 +1725,7 @@
// set position and pin attributes for the node
sprintf(tmp_pos, "%d,%d!", xpos_pts, ypos_pts);
agxset(this_gpt, asym_pos->index, tmp_pos);
- agxset(this_gpt, asym_pin->index, "true");
+ agxset(this_gpt, asym_pin->index, (char*)"true");
// also try setting them in the data structure directly
ND_coord_i(this_gpt).x = xpos_pts;
@@ -1761,7 +1761,7 @@
Agnode_t *this_gpt = (Agnode_t*)this_gv->gvizPoints[index];
sprintf(tmp_pos, "%d,%d!", xpos_pts, ypos_pts);
agxset(this_gpt, asym_pos->index, tmp_pos);
- agxset(this_gpt, asym_pin->index, "true");
+ agxset(this_gpt, asym_pin->index, (char*)"true");
// also try setting them in the data structure directly
ND_coord_i(this_gpt).x = xpos_pts;
@@ -2453,8 +2453,8 @@
// should only be 2 distinct curves; don't handle all dual curves the same
// for now, to avoid geometric check
assert((dual_curves[0] == dual_curves[1] && dual_curves[0] != dual_curves[2]) ||
- (dual_curves[0] == dual_curves[2]) && dual_curves[0] != dual_curves[1] ||
- (dual_curves[0] == dual_curves[3]) && dual_curves[0] != dual_curves[1]);
+ (dual_curves[0] == dual_curves[2] && dual_curves[0] != dual_curves[1]) ||
+ (dual_curves[0] == dual_curves[3] && dual_curves[0] != dual_curves[1]));
// if same curves are next to each other, switch edges
if (dual_curves[0] == dual_curves[1]) {
Modified: MOAB/trunk/tools/qvdual/uiQVDual.ui.h
===================================================================
--- MOAB/trunk/tools/qvdual/uiQVDual.ui.h 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/qvdual/uiQVDual.ui.h 2008-04-28 16:35:24 UTC (rev 1779)
@@ -39,6 +39,7 @@
#include "vtkRenderer.h"
#include "vtkExtractGeometry.h"
#include "vtkPlane.h"
+#include <algorithm>
void uiQVDual::fileNew()
{
Modified: MOAB/trunk/tools/skin/skin.cpp
===================================================================
--- MOAB/trunk/tools/skin/skin.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/skin/skin.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -1,6 +1,7 @@
#include <iostream>
#include <time.h>
#include <vector>
+#include <cstdlib>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
Modified: MOAB/trunk/tools/surfplot/surfplot.cpp
===================================================================
--- MOAB/trunk/tools/surfplot/surfplot.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/surfplot/surfplot.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -4,6 +4,7 @@
#include <iostream>
#include <fstream>
#include <limits>
+#include <cstdlib>
#include <math.h>
/* Exit values */
Modified: MOAB/trunk/tools/tagprop/propagate_tags.cpp
===================================================================
--- MOAB/trunk/tools/tagprop/propagate_tags.cpp 2008-04-25 19:24:47 UTC (rev 1778)
+++ MOAB/trunk/tools/tagprop/propagate_tags.cpp 2008-04-28 16:35:24 UTC (rev 1779)
@@ -25,6 +25,7 @@
#include <iostream>
#include <vector>
+#include <cstdlib>
#include "parse.hpp"
More information about the moab-dev
mailing list