moab
|
#include "ReadNCDF.hpp"
#include "netcdf.h"
#include <algorithm>
#include <string>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <cmath>
#include <sstream>
#include <iostream>
#include <map>
#include "moab/CN.hpp"
#include "moab/Range.hpp"
#include "moab/Interface.hpp"
#include "ExoIIUtil.hpp"
#include "MBTagConventions.hpp"
#include "Internals.hpp"
#include "moab/ReadUtilIface.hpp"
#include "exodus_order.h"
#include "moab/FileOptions.hpp"
#include "moab/AdaptiveKDTree.hpp"
#include "moab/CartVect.hpp"
Go to the source code of this file.
Namespaces | |
namespace | moab |
Class representing axis-aligned bounding box. | |
Defines | |
#define | INS_ID(stringvar, prefix, id) sprintf(stringvar, prefix, id) |
#define | GET_DIM(ncdim, name, val) |
#define | GET_DIMB(ncdim, name, varname, id, val) |
#define | GET_VAR(name, id, dims) |
#define | GET_1D_INT_VAR(name, id, vals) |
#define | GET_1D_DBL_VAR(name, id, vals) |
#define GET_1D_DBL_VAR | ( | name, | |
id, | |||
vals | |||
) |
{std::vector<int> dum_dims; \ GET_VAR(name, id, dum_dims);\ if (-1 != id) {\ size_t ntmp;\ int dvfail = nc_inq_dimlen(ncFile, dum_dims[0], &ntmp);\ vals.resize(ntmp);\ size_t ntmp1 = 0; \ dvfail = nc_get_vara_double(ncFile, id, &ntmp1, &ntmp, &vals[0]);\ if (NC_NOERR != dvfail) {\ readMeshIface->report_error("ReadNCDF:: Problem getting variable %s.", name);\ return MB_FAILURE;}}}
Definition at line 91 of file ReadNCDF.cpp.
#define GET_1D_INT_VAR | ( | name, | |
id, | |||
vals | |||
) |
{GET_VAR(name, id, vals); \ if (-1 != id) {\ size_t ntmp;\ int ivfail = nc_inq_dimlen(ncFile, vals[0], &ntmp);\ vals.resize(ntmp);\ size_t ntmp1 = 0; \ ivfail = nc_get_vara_int(ncFile, id, &ntmp1, &ntmp, &vals[0]);\ if (NC_NOERR != ivfail) {\ readMeshIface->report_error("ReadNCDF:: Problem getting variable %s.", name);\ return MB_FAILURE;}}}
Definition at line 78 of file ReadNCDF.cpp.
#define GET_DIM | ( | ncdim, | |
name, | |||
val | |||
) |
{ \ int gdfail = nc_inq_dimid(ncFile, name, &ncdim); \ if (NC_NOERR == gdfail) { \ size_t tmp_val; \ gdfail = nc_inq_dimlen(ncFile, ncdim, &tmp_val); \ if (NC_NOERR != gdfail) { \ readMeshIface->report_error("ReadNCDF:: couldn't get dimension length."); \ return MB_FAILURE; \ } \ else val = tmp_val; \ } else val = 0;}
Definition at line 50 of file ReadNCDF.cpp.
#define GET_DIMB | ( | ncdim, | |
name, | |||
varname, | |||
id, | |||
val | |||
) |
INS_ID(name, varname, id); \ GET_DIM(ncdim, name, val);
Definition at line 63 of file ReadNCDF.cpp.
#define GET_VAR | ( | name, | |
id, | |||
dims | |||
) |
{ \ id = -1;\ int gvfail = nc_inq_varid(ncFile, name, &id); \ if (NC_NOERR == gvfail) { \ int ndims;\ gvfail = nc_inq_varndims(ncFile, id, &ndims);\ if (NC_NOERR == gvfail) {\ dims.resize(ndims); \ gvfail = nc_inq_vardimid(ncFile, id, &dims[0]);}}}
Definition at line 67 of file ReadNCDF.cpp.
#define INS_ID | ( | stringvar, | |
prefix, | |||
id | |||
) | sprintf(stringvar, prefix, id) |
Definition at line 47 of file ReadNCDF.cpp.