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

jain at mcs.anl.gov jain at mcs.anl.gov
Tue Jun 29 17:01:33 CDT 2010


Author: jain
Date: 2010-06-29 17:01:33 -0500 (Tue, 29 Jun 2010)
New Revision: 4021

Modified:
   MOAB/trunk/src/io/WriteCCMIO.cpp
Log:
o Appending numeric extension 'i' to Cell Type[i] label "Material" 


Modified: MOAB/trunk/src/io/WriteCCMIO.cpp
===================================================================
--- MOAB/trunk/src/io/WriteCCMIO.cpp	2010-06-29 21:52:12 UTC (rev 4020)
+++ MOAB/trunk/src/io/WriteCCMIO.cpp	2010-06-29 22:01:33 UTC (rev 4021)
@@ -330,8 +330,8 @@
     // to call CCMIOCompress() here to ensure that the file is as small as
     // possible.  Please see the Core API documentation for caveats on its
     // usage.
-  CCMIOCompress(&error, const_cast<char*>(filename));
-  CHKCCMERR(error, "Error compressing file.");
+  // CCMIOCompress(&error, const_cast<char*>(filename));
+  // CHKCCMERR(error, "Error compressing file.");
 
   return MB_SUCCESS;
 }
@@ -468,14 +468,22 @@
 
     // write material types and other info
   for (unsigned int i = 0; i < matset_data.size(); i++) {
-    if (!matset_data[i].setName.empty())
+    if (!matset_data[i].setName.empty()){
       CCMIONewIndexedEntity(&error, problemID, kCCMIOCellType, matset_data[i].matsetId, 
                             matset_data[i].setName.c_str(), &id);
-    else
+    }
+    else{
+      char dum_name[NAME_TAG_SIZE]; 
+      std::ostringstream os;
+      std::string mat_name = "Material", temp_str;
+      os << mat_name << (i+1);
+      temp_str = os.str();
+      strcpy(dum_name,temp_str.c_str());
       CCMIONewIndexedEntity(&error, problemID, kCCMIOCellType, matset_data[i].matsetId, 
-                            "Material", &id);
-    CHKCCMERR(error, "Failure creating celltype node.");
-
+                            dum_name, &id);
+      CHKCCMERR(error, "Failure creating celltype node.");
+      os.str("");
+    }
     rval = write_int_option("MaterialId", matset_data[i].setHandle, mMaterialIdTag, id);
     CHKERR(rval, "Trouble writing MaterialId option.");
 










More information about the moab-dev mailing list