[MOAB-dev] r2537 - MOAB/trunk/tools/iMesh
kraftche at mcs.anl.gov
kraftche at mcs.anl.gov
Tue Jan 13 15:11:40 CST 2009
Author: kraftche
Date: 2009-01-13 15:11:40 -0600 (Tue, 13 Jan 2009)
New Revision: 2537
Modified:
MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp
Log:
Add new option for iMesh_createMesh: HIGHER_ORDER_ADJ. If this option
is specified, getEntAdj and getEntArrAdj will include higher-order nodes
in adjacency output (if the target dimension of the query is zero.)
Modified: MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp
===================================================================
--- MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp 2009-01-13 21:06:15 UTC (rev 2536)
+++ MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp 2009-01-13 21:11:40 UTC (rev 2537)
@@ -17,8 +17,9 @@
#include <cassert>
#define MIN(a,b) (a < b ? a : b)
-MBiMesh::MBiMesh()
- : haveDeletedEntities(false)
+MBiMesh::MBiMesh(bool adj_includes_ho)
+ : haveDeletedEntities(false),
+ fullConnectivity(adj_includes_ho)
{
memset(AdjTable, 0, 16*sizeof(int));
for (int i = 0; i < 4; i++) AdjTable[4*i] = AdjTable[i] = 1;
@@ -254,6 +255,7 @@
FileOptions opts((std::string(";") + tmp_options).c_str());
MBInterface* core;
+ bool full_conn = (MB_SUCCESS == opts.get_null_option("HIGHER_ORDER_ADJ"));
MBErrorCode result = opts.get_null_option("PARALLEL");
if (MB_SUCCESS == result) {
@@ -267,7 +269,7 @@
// mpi not initialized yet - initialize here
retval = MPI_Init(&argc, &argv);
}
- core = new MBiMesh;
+ core = new MBiMesh(full_conn);
#else
//mError->set_last_error( "PARALLEL option not valid, this instance"
// " compiled for serial execution.\n" );
@@ -275,7 +277,7 @@
return;
#endif
}
- else core = new MBiMesh;
+ else core = new MBiMesh(full_conn);
*instance = reinterpret_cast<iMesh_Instance>(core);
if (0 == *instance) {
@@ -990,6 +992,7 @@
std::vector<MBEntityHandle> adj_ents;
const MBEntityHandle *connect;
int num_connect;
+ const bool topo_only = !reinterpret_cast<MBiMesh*>(instance)->adj_includes_ho_nodes();
MBEntityHandle* array; // ptr to working array of result handles
int array_alloc; // allocated size of 'array'
@@ -1010,7 +1013,8 @@
if (iBase_VERTEX == entity_type_requested &&
TYPE_FROM_HANDLE(*entity_iter) != MBPOLYHEDRON) {
- result = MBI->get_connectivity(*entity_iter, connect, num_connect, true, &conn_storage);
+ result = MBI->get_connectivity(*entity_iter, connect, num_connect,
+ topo_only, &conn_storage);
if (MB_SUCCESS != result) {
iMesh_processError(iBase_ERROR_MAP[result], "iMesh_getEntArrAdj: trouble getting adjacency list.");
RETURN(iBase_ERROR_MAP[result]);
More information about the moab-dev
mailing list