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

tautges at mcs.anl.gov tautges at mcs.anl.gov
Fri May 21 16:12:46 CDT 2010


Author: tautges
Date: 2010-05-21 16:12:46 -0500 (Fri, 21 May 2010)
New Revision: 3940

Modified:
   MOAB/trunk/src/io/ReadCCMIO.cpp
   MOAB/trunk/src/io/ReadCCMIO.hpp
Log:
A start at correct parsing of neumann sets.




Modified: MOAB/trunk/src/io/ReadCCMIO.cpp
===================================================================
--- MOAB/trunk/src/io/ReadCCMIO.cpp	2010-05-21 20:38:42 UTC (rev 3939)
+++ MOAB/trunk/src/io/ReadCCMIO.cpp	2010-05-21 21:12:46 UTC (rev 3940)
@@ -238,8 +238,11 @@
   }
 
   rval = load_matset_data(problemID);
-  CHKERR(rval, NULL);
+  CHKERR(rval, "Failure loading matset data.");
   
+//  rval = load_neuset_data(problemID);
+//  CHKERR(rval, "Failure loading neuset data.");
+  
   return rval;
 }
 
@@ -307,6 +310,44 @@
   return MB_SUCCESS;
 }
 
+ErrorCode ReadCCMIO::load_neuset_data(CCMIOID problemID) 
+{
+    // make sure there are matsets
+  if (newNeusets.empty()) return MB_SUCCESS;
+  
+    // ... walk through each neumann set type
+  CCMIOSize_t i = CCMIOSIZEC(0);
+  CCMIOID next;
+  std::vector<char> set_name;
+  CCMIOError error = kCCMIONoErr;
+  ErrorCode rval;
+  
+  while (CCMIONextEntity(NULL, problemID, kCCMIOBoundaryRegion, &i, &next)
+         == kCCMIONoErr) {
+    int csize, mindex, idum;
+
+    CCMIOGetEntityIndex(&error, next, &mindex);
+    assert(mindex > 0 && mindex <= (int)newNeusets.size()+1);
+    mindex--;
+    EntityHandle dum_ent = newNeusets[mindex];
+
+      // BoundaryName encodes the id as well as the name
+    if (kCCMIONoErr == CCMIOReadOptstr(NULL, next, "BoundaryName", &csize, NULL)) {
+      set_name.resize(csize+1, '\0');
+      CCMIOReadOptstr(&error, next, "BoundaryName", &csize, &set_name[0]);
+      idum = atoi(&set_name[0]);
+      rval = mbImpl->tag_set_data(mNeumannSetTag, &dum_ent, 1, &idum);
+      CHKERR(rval, "Failed to set matNameTag.");
+      
+    }


More information about the moab-dev mailing list