[MOAB-dev] r3987 - MOAB/trunk/src/io
tautges at mcs.anl.gov
tautges at mcs.anl.gov
Tue Jun 1 15:27:09 CDT 2010
Author: tautges
Date: 2010-06-01 15:27:09 -0500 (Tue, 01 Jun 2010)
New Revision: 3987
Modified:
MOAB/trunk/src/io/ReadCCMIO.cpp
MOAB/trunk/src/io/ReadCCMIO.hpp
MOAB/trunk/src/io/WriteCCMIO.cpp
MOAB/trunk/src/io/WriteCCMIO.hpp
Log:
A little more cleanup of the star reader/writer. Should work for all known meshes now.
Modified: MOAB/trunk/src/io/ReadCCMIO.cpp
===================================================================
--- MOAB/trunk/src/io/ReadCCMIO.cpp 2010-06-01 20:13:17 UTC (rev 3986)
+++ MOAB/trunk/src/io/ReadCCMIO.cpp 2010-06-01 20:27:09 UTC (rev 3987)
@@ -76,7 +76,10 @@
{ return new ReadCCMIO( iface ); }
ReadCCMIO::ReadCCMIO(Interface* impl)
- : mbImpl(impl)
+ : mMaterialIdTag(0), mMaterialTypeTag(0),
+ mRadiationTag(0), mPorosityIdTag(0), mSpinIdTag(0), mGroupIdTag(0), mColorIdxTag(0),
+ mProcessorIdTag(0), mLightMaterialTag(0), mFreeSurfaceMaterialTag(0),
+ mThicknessTag(0), mProstarRegionNumberTag(0), mbImpl(impl)
{
assert(impl != NULL);
@@ -246,14 +249,9 @@
}
// creating program
- std::vector<char> opt_string;
- if (MB_SUCCESS == get_opt_string("CreatingProgram", processorID, opt_string)) {
- if (opt_string.size() >= NAME_TAG_SIZE) opt_string[NAME_TAG_SIZE-1] = '\0';
- else (opt_string.resize(NAME_TAG_SIZE, '\0'));
- rval = mbImpl->tag_set_data(mNameTag, file_set, (file_set ? 1 : 0), &opt_string[0]);
- CHKERR(rval, "Failed to set neuset Name Tag.");
- }
-
+ EntityHandle dumh = (file_set ? *file_set : 0);
+ rval = get_str_option("CreatingProgram", dumh, mNameTag, processorID, NAME_TAG_NAME);
+ CHKERR(rval, "Trouble getting CreatingProgram tag.");
rval = load_matset_data(problemID);
CHKERR(rval, "Failure loading matset data.");
@@ -300,43 +298,113 @@
CHKERR(rval, "Trouble setting name tag for material set.");
// material id
- int idum;
- if (kCCMIONoErr == CCMIOReadOpti(NULL, next, "MaterialId", &idum)) {
- Tag matid;
- rval = mbImpl->tag_create("MaterialId", sizeof(int), MB_TAG_SPARSE, MB_TYPE_INTEGER, matid, NULL, true);
- CHKERR(rval, "Trouble creating MaterialId tag.");
- rval = mbImpl->tag_set_data(matid, &dum_ent, 1, &idum);
- CHKERR(rval, "Failed to set material set id tag.");
+ rval = get_int_option("MaterialId", dum_ent, mMaterialIdTag, next);
+ CHKERR(rval, "Trouble getting MaterialId tag.");
+
+ rval = get_str_option("MaterialType", dum_ent, mMaterialTypeTag, next);
+ CHKERR(rval, "Trouble getting MaterialType tag.");
+
More information about the moab-dev
mailing list