[MOAB-dev] r5575 - MOAB/branches/nc_to_2.5d/src/io
xbxu at mcs.anl.gov
xbxu at mcs.anl.gov
Thu Jun 14 10:37:03 CDT 2012
Author: xbxu
Date: 2012-06-14 10:37:03 -0500 (Thu, 14 Jun 2012)
New Revision: 5575
Modified:
MOAB/branches/nc_to_2.5d/src/io/ReadNC.cpp
Log:
read dimension varibles by default
Modified: MOAB/branches/nc_to_2.5d/src/io/ReadNC.cpp
===================================================================
--- MOAB/branches/nc_to_2.5d/src/io/ReadNC.cpp 2012-06-14 15:27:09 UTC (rev 5574)
+++ MOAB/branches/nc_to_2.5d/src/io/ReadNC.cpp 2012-06-14 15:37:03 UTC (rev 5575)
@@ -234,11 +234,16 @@
ERRORR(rval, "Trouble creating vertices.");
}
- // Read variables onto grid
+ // Read variables onto grid
if (!novars) {
rval = read_variables(tmp_set, var_names, tstep_nums);
if (MB_FAILURE == rval) return rval;
}
+ else {
+ // read dimension variable by default
+ rval = read_variables(tmp_set, dimNames, tstep_nums);
+ if (MB_FAILURE == rval) return rval;
+ }
#ifdef USE_MPI
// create partition set, and populate with elements
@@ -1224,15 +1229,6 @@
ErrorCode ReadNC::convert_variable(EntityHandle file_set, VarData &var_data, int tstep_num)
{
- ErrorCode rval;
-
- // get vertices in set
- Range quads;
- rval = mbImpl->get_entities_by_dimension(file_set, 2, quads);
- ERRORR(rval, "Trouble getting vertices in set.");
- assert("Should only have a single vertex subrange, since they were read in one shot" &&
- quads.psize() == 1);
-
// get ptr to tag space
void *data = var_data.varDatas[tstep_num];
@@ -1272,7 +1268,7 @@
case NC_DOUBLE:
case NC_FLOAT:
ddata = (double*)data;
- if (quads.empty()) break;
+ if (sz == 0) break;
dmin = dmax = ddata[0];
for (unsigned int i = 1; i < sz; i++) {
@@ -1284,7 +1280,7 @@
case NC_INT:
case NC_SHORT:
idata = (int*)data;
More information about the moab-dev
mailing list