[MOAB-dev] r3939 - MOAB/trunk/src/io

tautges at mcs.anl.gov tautges at mcs.anl.gov
Fri May 21 15:38:43 CDT 2010


Author: tautges
Date: 2010-05-21 15:38:42 -0500 (Fri, 21 May 2010)
New Revision: 3939

Modified:
   MOAB/trunk/src/io/WriteCCMIO.cpp
Log:
Another small logic error in marking adjacent cells and checking
those marks.



Modified: MOAB/trunk/src/io/WriteCCMIO.cpp
===================================================================
--- MOAB/trunk/src/io/WriteCCMIO.cpp	2010-05-21 19:13:03 UTC (rev 3938)
+++ MOAB/trunk/src/io/WriteCCMIO.cpp	2010-05-21 20:38:42 UTC (rev 3939)
@@ -730,7 +730,7 @@
     //================================================
     // mark tag, for face marking on each non-polyhedral element
   Tag fmark_tag;
-  unsigned char mval = 0x0;
+  unsigned char mval = 0x0, omval;
   result = mbImpl->tag_create("__fmark", 1, MB_TAG_DENSE, MB_TYPE_OPAQUE, 
                               fmark_tag, &mval);
   CHKERR(result, "Couldn't create mark tag.");
@@ -849,12 +849,12 @@
         CN::SideNumber(TYPE_FROM_HANDLE(tmp_face_cells[1]), oconnectc, connectf, num_connectf,
                        mDimension-1, side_num, sense, offset);
           // set mark for that face on the other cell
-        result = mbImpl->tag_get_data(fmark_tag, &tmp_face_cells[1], 1, &mval);
+        result = mbImpl->tag_get_data(fmark_tag, &tmp_face_cells[1], 1, &omval);
         CHKERR(result, "Couldn't get mark data for other cell.");
       }
         
-      mval |= (0x1 << (unsigned int)side_num);
-      result = mbImpl->tag_set_data(fmark_tag, &tmp_face_cells[1], 1, &mval);
+      omval |= (0x1 << (unsigned int)side_num);
+      result = mbImpl->tag_set_data(fmark_tag, &tmp_face_cells[1], 1, &omval);
       CHKERR(result, "Couldn't set mark data for other cell.");
 
     } // loop over faces in elem
@@ -957,11 +957,11 @@
       // check we don't bound more than one cell being output
     result = mbImpl->tag_get_data(mEntityMark, &cells[0], cells.size(), cmarks);
     CHKERR(result, "Trouble getting mark tags on cells bounding facets.");
-    if (cells.size() == 2 && (cmarks[0] & 0x1) && (cmarks[1] & 0x1)) {
+    if (cells.size() == 2 && (mWholeMesh || (cmarks[0] && cmarks[1]))) {
       result = MB_FILE_WRITE_ERROR;
       CHKERR(result, "External facet with two output bounding cells.");
     }
-    else if (1 == cells.size() && (mWholeMesh || !(cmarks[0] | 0x0))) {
+    else if (1 == cells.size() && !mWholeMesh && !cmarks[0]) {
       result = MB_FILE_WRITE_ERROR;
       CHKERR(result, "External facet with no output bounding cells.");
     }










More information about the moab-dev mailing list