[MOAB-dev] r5728 - in MOAB/trunk: src src/moab src/parallel/moab tools/vtkMOABReader

tautges at mcs.anl.gov tautges at mcs.anl.gov
Thu Sep 6 09:03:19 CDT 2012


Author: tautges
Date: 2012-09-06 09:03:19 -0500 (Thu, 06 Sep 2012)
New Revision: 5728

Modified:
   MOAB/trunk/src/ScdInterface.cpp
   MOAB/trunk/src/moab/ScdInterface.hpp
   MOAB/trunk/src/parallel/moab/gs.hpp
   MOAB/trunk/tools/vtkMOABReader/vtkMOABReader.cxx
   MOAB/trunk/tools/vtkMOABReader/vtkMOABReader.xml
Log:
Fixes to the structured mesh interface so 1d now works (woo-hoo, thanks Milad!).

Also inserting some changes from Kitware to make the Paraview plugin work
and work better.



Modified: MOAB/trunk/src/ScdInterface.cpp
===================================================================
--- MOAB/trunk/src/ScdInterface.cpp	2012-09-05 20:18:07 UTC (rev 5727)
+++ MOAB/trunk/src/ScdInterface.cpp	2012-09-06 14:03:19 UTC (rev 5728)
@@ -99,15 +99,15 @@
   return scd_box;
 }
 
-ErrorCode ScdInterface::construct_box(HomCoord low, HomCoord high, double *coords, unsigned int num_coords,
+ErrorCode ScdInterface::construct_box(HomCoord low, HomCoord high, const double * const coords, unsigned int num_coords,
                                       ScdBox *& new_box, int * const lperiodic, ScdParData *par_data)
 {
     // create a rectangular structured mesh block
   ErrorCode rval;
 
   HomCoord tmp_size = high - low + HomCoord(1, 1, 1, 0);
-  if ((tmp_size[1] && num_coords && (int)num_coords <= tmp_size[0]) ||
-      (tmp_size[2] && num_coords && (int)num_coords <= tmp_size[0]*tmp_size[1]))
+  if ((tmp_size[1] && num_coords && (int)num_coords < tmp_size[0]) ||
+      (tmp_size[2] && num_coords && (int)num_coords < tmp_size[0]*tmp_size[1]))
     return MB_FAILURE;
 
   rval = create_scd_sequence(low, high, MBVERTEX, 0, new_box);
@@ -179,8 +179,9 @@
                                             int *is_periodic)
 {
   HomCoord tmp_size = high - low + HomCoord(1, 1, 1, 0);
-  if ((tp == MBHEX && 1 >= tmp_size[2]) ||
-      (tp == MBQUAD && 1 >= tmp_size[1]))
+  if ((tp == MBHEX && 1 >= tmp_size[2])  ||
+      (tp == MBQUAD && 1 >= tmp_size[1]) || 
+      (tp == MBEDGE && 1 >= tmp_size[0]))
     return MB_TYPE_OUT_OF_RANGE;
 
   SequenceManager *seq_mgr = mbImpl->sequence_manager();
@@ -366,7 +367,7 @@
   }
   else {
     Range elems;
-    sc_impl->mbImpl->get_entities_by_dimension(box_set, (boxDims[2] == boxDims[5] ? 2 : 3), elems);
+    sc_impl->mbImpl->get_entities_by_dimension(box_set, (boxDims[2] == boxDims[5] ? (boxDims[1] == boxDims[4] ? 1 : 2) : 3), elems);
     if (!elems.empty()) startElem = *elems.begin();
       // call the following w/o looking at return value, since it doesn't really need to be there
     if (sc_impl->boxPeriodicTag) 
@@ -597,7 +598,11 @@
     // send our own start handles
   shandles[0] = box->start_vertex();
   shandles[1] = 0;
-  if (box->box_dimension() == 2) {
+  if (box->box_dimension() == 1) {
+    shandles[1] = box->start_element();


More information about the moab-dev mailing list