Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
ReadNCDF.cpp File Reference
#include "ReadNCDF.hpp"
#include "netcdf.h"
#include <algorithm>
#include <string>
#include <cassert>
#include <cstdio>
#include <cstring>
#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"
+ Include dependency graph for ReadNCDF.cpp:

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 Documentation

#define GET_1D_DBL_VAR (   name,
  id,
  vals 
)
Value:
{                                                                                         \
        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 );                         \
            if( NC_NOERR != dvfail )                                                          \
            {                                                                                 \
                MB_SET_ERR( MB_FAILURE, "ReadNCDF:: Couldn't get dimension length" );         \
            }                                                                                 \
            ( vals ).resize( ntmp );                                                          \
            size_t ntmp1 = 0;                                                                 \
            dvfail       = nc_get_vara_double( ncFile, id, &ntmp1, &ntmp, &( vals )[0] );     \
            if( NC_NOERR != dvfail )                                                          \
            {                                                                                 \
                MB_SET_ERR( MB_FAILURE, "ReadNCDF:: Problem getting variable " << ( name ) ); \
            }                                                                                 \
        }                                                                                     \
    }

Definition at line 113 of file ReadNCDF.cpp.

Referenced by moab::ReadNCDF::create_ss_elements(), moab::ReadNCDF::read_nodesets(), and moab::ReadNCDF::update().

#define GET_1D_INT_VAR (   name,
  id,
  vals 
)
Value:
{                                                                                         \
        GET_VAR( name, id, vals );                                                            \
        if( -1 != ( id ) )                                                                    \
        {                                                                                     \
            size_t ntmp;                                                                      \
            int ivfail = nc_inq_dimlen( ncFile, ( vals )[0], &ntmp );                         \
            if( NC_NOERR != ivfail )                                                          \
            {                                                                                 \
                MB_SET_ERR( MB_FAILURE, "ReadNCDF:: Couldn't get dimension length" );         \
            }                                                                                 \
            ( vals ).resize( ntmp );                                                          \
            size_t ntmp1 = 0;                                                                 \
            ivfail       = nc_get_vara_int( ncFile, id, &ntmp1, &ntmp, &( vals )[0] );        \
            if( NC_NOERR != ivfail )                                                          \
            {                                                                                 \
                MB_SET_ERR( MB_FAILURE, "ReadNCDF:: Problem getting variable " << ( name ) ); \
            }                                                                                 \
        }                                                                                     \
    }

Definition at line 92 of file ReadNCDF.cpp.

Referenced by moab::ReadNCDF::read_block_headers(), moab::ReadNCDF::read_face_blocks_headers(), moab::ReadNCDF::read_global_ids(), moab::ReadNCDF::read_nodesets(), moab::ReadNCDF::read_sidesets(), moab::ReadNCDF::read_tag_values(), and moab::ReadNCDF::update().

#define GET_DIM (   ncdim,
  name,
  val 
)
Value:
{                                                                                 \
        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 )                                                  \
            {                                                                         \
                MB_SET_ERR( MB_FAILURE, "ReadNCDF:: Couldn't get dimension length" ); \
            }                                                                         \
            else                                                                      \
                ( val ) = tmp_val;                                                    \
        }                                                                             \
        else                                                                          \
            ( val ) = 0;                                                              \
    }

Definition at line 50 of file ReadNCDF.cpp.

Referenced by moab::ReadNCDF::read_exodus_header(), moab::ReadNCDF::read_qa_information(), and moab::ReadNCDF::update().

#define GET_DIMB (   ncdim,
  name,
  varname,
  id,
  val 
)
#define GET_VAR (   name,
  id,
  dims 
)
Value:
{                                                                                           \
        ( 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] );                           \
                if( NC_NOERR != gvfail )                                                        \
                {                                                                               \
                    MB_SET_ERR( MB_FAILURE, "ReadNCDF:: Couldn't get variable dimension IDs" ); \
                }                                                                               \
            }                                                                                   \
        }                                                                                       \
    }

Definition at line 72 of file ReadNCDF.cpp.

Referenced by moab::ReadNCDF::read_elements(), moab::ReadNCDF::read_polyhedra_faces(), moab::ReadNCDF::read_qa_string(), and moab::ReadNCDF::update().

#define INS_ID (   stringvar,
  prefix,
  id 
)    sprintf( stringvar, prefix, id )
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines