[MOAB-dev] r2173 - MOAB/trunk/parallel

tautges at mcs.anl.gov tautges at mcs.anl.gov
Thu Oct 23 10:42:42 CDT 2008


Author: tautges
Date: 2008-10-23 10:42:41 -0500 (Thu, 23 Oct 2008)
New Revision: 2173

Modified:
   MOAB/trunk/parallel/MBParallelComm.cpp
   MOAB/trunk/parallel/Makefile.am
   MOAB/trunk/parallel/pcomm_unit.cpp
Log:
Adding arguments to some get_connectivity calls so they
work with structured meshes.

Changing some array declarations to work with --pedantic.



Modified: MOAB/trunk/parallel/MBParallelComm.cpp
===================================================================
--- MOAB/trunk/parallel/MBParallelComm.cpp	2008-10-22 19:11:10 UTC (rev 2172)
+++ MOAB/trunk/parallel/MBParallelComm.cpp	2008-10-23 15:42:41 UTC (rev 2173)
@@ -992,6 +992,7 @@
     allr_it++;
     std::vector<int>::iterator nv_it = verts_per_entity.begin();
     std::vector<MBEntityType>::iterator et_it = ent_types.begin();
+    std::vector<MBEntityHandle> dum_connect;
     nv_it++; et_it++;
     
     for (; allr_it != all_ranges.end(); allr_it++, nv_it++, et_it++) {
@@ -1009,7 +1010,8 @@
       int num_connect;
       MBEntityHandle *start_vec = (MBEntityHandle*)buff_ptr;
       for (MBRange::const_iterator rit = allr_it->begin(); rit != allr_it->end(); rit++) {
-        result = mbImpl->get_connectivity(*rit, connect, num_connect);
+        result = mbImpl->get_connectivity(*rit, connect, num_connect, true,
+                                          &dum_connect);
         RRA("Failed to get connectivity.");
         assert(num_connect == *nv_it);
         PACK_EH(buff_ptr, &connect[0], num_connect);
@@ -2765,6 +2767,7 @@
   std::vector<int> sharing_procs, sharing_procs1, sharing_procs2;
   std::vector<int>::iterator vii;
   std::vector<unsigned char> pstatus_flags;
+  std::vector<MBEntityHandle> dum_connect;
 
   for (int d = 3; d > 0; d--) {
     if (resolve_dim == d) continue;
@@ -2772,7 +2775,8 @@
     for (MBRange::iterator rit = skin_ents[d].begin();
          rit != skin_ents[d].end(); rit++) {
         // get connectivity
-      result = mbImpl->get_connectivity(*rit, connect, num_connect);
+      result = mbImpl->get_connectivity(*rit, connect, num_connect, true,
+                                        &dum_connect);
       RRA("Failed to get connectivity on non-vertex skin entities.");
  
         // if any vertices not shared, this entity isn't

Modified: MOAB/trunk/parallel/Makefile.am
===================================================================

Modified: MOAB/trunk/parallel/pcomm_unit.cpp
===================================================================
--- MOAB/trunk/parallel/pcomm_unit.cpp	2008-10-22 19:11:10 UTC (rev 2172)
+++ MOAB/trunk/parallel/pcomm_unit.cpp	2008-10-23 15:42:41 UTC (rev 2173)
@@ -168,7 +168,7 @@
 void create_simple_grid( MBInterface& moab, unsigned x, unsigned y, unsigned z )
 {
   MBErrorCode rval;
-  MBEntityHandle verts[x*y*z];
+  MBEntityHandle *verts = new MBEntityHandle[x*y*z];
   for (unsigned k = 0; k < z; ++k)
     for (unsigned j = 0; j < y; ++j)
       for (unsigned i = 0; i < x; ++i) {
@@ -177,7 +177,7 @@
         CHECK_ERR(rval);
       }
   
-  MBEntityHandle elems[(x-1)*(y-1)*(z-1)];
+  MBEntityHandle *elems = new MBEntityHandle[(x-1)*(y-1)*(z-1)];
   for (unsigned k = 0; k < (z-1); ++k)
     for (unsigned j = 0; j < (y-1); ++j)
       for (unsigned i = 0; i < (x-1); ++i) {
@@ -193,6 +193,8 @@
         rval = moab.create_element( MBHEX, conn, 8, elems[(x-1)*(y-1)*k + (x-1)*j + i] );
         CHECK_ERR(rval);
       }
+  delete [] verts;
+  delete [] elems;
 }
 
 




More information about the moab-dev mailing list