Child helper class for MPAS grid. More...
#include <NCHelperMPAS.hpp>
Inheritance diagram for moab::NCHelperMPAS:
Collaboration diagram for moab::NCHelperMPAS:Public Member Functions | |
| NCHelperMPAS (ReadNC *readNC, int fileId, const FileOptions &opts, EntityHandle fileSet) | |
Public Member Functions inherited from moab::UcdNCHelper | |
| UcdNCHelper (ReadNC *readNC, int fileId, const FileOptions &opts, EntityHandle fileSet) | |
| virtual | ~UcdNCHelper () |
Public Member Functions inherited from moab::NCHelper | |
| NCHelper (ReadNC *readNC, int fileId, const FileOptions &opts, EntityHandle fileSet) | |
| virtual | ~NCHelper () |
| ErrorCode | create_conventional_tags (const std::vector< int > &tstep_nums) |
| Create NC conventional tags. More... | |
| ErrorCode | update_time_tag_vals () |
| Update time tag values if timesteps spread across files. More... | |
Static Public Member Functions | |
| static bool | can_read_file (ReadNC *readNC) |
Static Public Member Functions inherited from moab::NCHelper | |
| static ReadNC::NCFormatType | get_nc_format (ReadNC *readNC, int fileId) |
| Get appropriate format to read the file. More... | |
| static std::string | get_default_ncformat_options (ReadNC::NCFormatType format) |
| Get appropriate format to read the file. More... | |
| static NCHelper * | get_nc_helper (ReadNC *readNC, int fileId, const FileOptions &opts, EntityHandle fileSet) |
| Get appropriate helper instance for ReadNC class. More... | |
Private Member Functions | |
| virtual ErrorCode | init_mesh_vals () |
| Implementation of NCHelper::init_mesh_vals() More... | |
| virtual ErrorCode | check_existing_mesh () |
| Implementation of NCHelper::check_existing_mesh() More... | |
| virtual ErrorCode | create_mesh (Range &faces) |
| Implementation of NCHelper::create_mesh() More... | |
| virtual std::string | get_mesh_type_name () |
| Implementation of NCHelper::get_mesh_type_name() More... | |
| virtual ErrorCode | read_ucd_variables_to_nonset_allocate (std::vector< ReadNC::VarData > &vdatas, std::vector< int > &tstep_nums) |
| Implementation of UcdNCHelper::read_ucd_variables_to_nonset_allocate() More... | |
| virtual ErrorCode | read_ucd_variables_to_nonset (std::vector< ReadNC::VarData > &vdatas, std::vector< int > &tstep_nums) |
| Implementation of UcdNCHelper::read_ucd_variables_to_nonset() More... | |
| ErrorCode | create_local_vertices (const std::vector< int > &vertices_on_local_cells, EntityHandle &start_vertex) |
| Create local vertices. More... | |
| ErrorCode | create_local_edges (EntityHandle start_vertex, const std::vector< int > &num_edges_on_local_cells) |
| Create local edges (optional) More... | |
| ErrorCode | create_local_cells (const std::vector< int > &vertices_on_local_cells, const std::vector< int > &num_edges_on_local_cells, EntityHandle start_vertex, Range &faces) |
| Create local cells without padding (cells are divided into groups based on the number of edges) More... | |
| ErrorCode | create_padded_local_cells (const std::vector< int > &vertices_on_local_cells, EntityHandle start_vertex, Range &faces) |
| Create local cells with padding (padded cells will have the same number of edges) More... | |
| ErrorCode | create_gather_set_vertices (EntityHandle gather_set, EntityHandle &gather_set_start_vertex) |
| Create gather set vertices. More... | |
| ErrorCode | create_gather_set_edges (EntityHandle gather_set, EntityHandle gather_set_start_vertex) |
| Create gather set edges (optional) More... | |
| ErrorCode | create_gather_set_cells (EntityHandle gather_set, EntityHandle gather_set_start_vertex) |
| Create gather set cells without padding (cells are divided into groups based on the number of edges) More... | |
| ErrorCode | create_padded_gather_set_cells (EntityHandle gather_set, EntityHandle gather_set_start_vertex) |
| Create gather set cells with padding (padded cells will have the same number of edges) More... | |
Private Attributes | |
| int | maxEdgesPerCell |
| int | numCellGroups |
| bool | createGatherSet |
| std::map< EntityHandle, int > | cellHandleToGlobalID |
| Range | facesOwned |
Additional Inherited Members | |
Protected Member Functions inherited from moab::UcdNCHelper | |
| template<typename T > | |
| void | kji_to_jik_stride (size_t, size_t nj, size_t nk, void *dest, T *source, Range &localGid) |
| This version takes as input the moab range, from which we actually need just the size of each sequence, for a proper transpose of the data. More... | |
Protected Member Functions inherited from moab::NCHelper | |
| ErrorCode | read_variables_setup (std::vector< std::string > &var_names, std::vector< int > &tstep_nums, std::vector< ReadNC::VarData > &vdatas, std::vector< ReadNC::VarData > &vsetdatas) |
| Separate set and non-set variables (common to scd mesh and ucd mesh) More... | |
| ErrorCode | read_variables_to_set (std::vector< ReadNC::VarData > &vdatas, std::vector< int > &tstep_nums) |
| Read set variables (common to scd mesh and ucd mesh) More... | |
| ErrorCode | read_coordinate (const char *var_name, int lmin, int lmax, std::vector< double > &cvals) |
| ErrorCode | get_tag_to_set (ReadNC::VarData &var_data, int tstep_num, Tag &tagh) |
| ErrorCode | get_tag_to_nonset (ReadNC::VarData &var_data, int tstep_num, Tag &tagh, int num_lev) |
| ErrorCode | create_attrib_string (const std::map< std::string, ReadNC::AttData > &attMap, std::string &attString, std::vector< int > &attLen) |
| Create a character string attString of attMap. with '\0' terminating each attribute name, ';' separating the data type and value, and ';' separating one name/data type/value from the next'. attLen stores the end position for each name/data type/ value. More... | |
| ErrorCode | create_dummy_variables () |
| For a dimension that does not have a corresponding coordinate variable (e.g. ncol for HOMME), create a dummy variable with a sparse tag to store the dimension length. More... | |
Protected Attributes inherited from moab::UcdNCHelper | |
| int | nCells |
| Dimensions of global grid in file. More... | |
| int | nEdges |
| int | nVertices |
| int | nLocalCells |
| Dimensions of my local part of grid. More... | |
| int | nLocalEdges |
| int | nLocalVertices |
| std::vector< double > | xVertVals |
| Coordinate values for vertices. More... | |
| std::vector< double > | yVertVals |
| std::vector< double > | zVertVals |
| int | cDim |
| Dimension numbers for nCells, nEdges and nVertices. More... | |
| int | eDim |
| int | vDim |
| Range | localGidCells |
| Local global ID for cells, edges and vertices. More... | |
| Range | localGidEdges |
| Range | localGidVerts |
Protected Attributes inherited from moab::NCHelper | |
| ReadNC * | _readNC |
| Allow NCHelper to directly access members of ReadNC. More... | |
| int | _fileId |
| Cache some information from ReadNC. More... | |
| const FileOptions & | _opts |
| EntityHandle | _fileSet |
| int | nTimeSteps |
| Dimensions of time and level. More... | |
| int | nLevels |
| std::vector< double > | tVals |
| Values for time and level. More... | |
| std::vector< double > | levVals |
| int | tDim |
| Dimension numbers for time and level. More... | |
| int | levDim |
| std::set< std::string > | ignoredVarNames |
| Ignored variables. More... | |
| std::set< std::string > | dummyVarNames |
| Dummy variables. More... | |
Child helper class for MPAS grid.
Definition at line 20 of file NCHelperMPAS.hpp.
| moab::NCHelperMPAS::NCHelperMPAS | ( | ReadNC * | readNC, |
| int | fileId, | ||
| const FileOptions & | opts, | ||
| EntityHandle | fileSet | ||
| ) |
Definition at line 18 of file NCHelperMPAS.cpp.
References moab::NCHelper::ignoredVarNames.
|
static |
Definition at line 68 of file NCHelperMPAS.cpp.
References moab::ReadNC::dimNames.
Referenced by moab::NCHelper::get_nc_format().
|
privatevirtual |
Implementation of NCHelper::check_existing_mesh()
Implements moab::NCHelper.
Definition at line 252 of file NCHelperMPAS.cpp.
References moab::NCHelper::_fileSet, moab::NCHelper::_readNC, moab::Range::begin(), cellHandleToGlobalID, moab::Range::empty(), moab::Range::end(), moab::Interface::get_entities_by_dimension(), moab::UcdNCHelper::localGidCells, moab::UcdNCHelper::localGidEdges, moab::UcdNCHelper::localGidVerts, MB_CHK_SET_ERR, MB_SUCCESS, MB_TYPE_INTEGER, moab::ReadNC::mbImpl, moab::ReadNC::mGlobalIdTag, moab::UcdNCHelper::nLocalCells, moab::UcdNCHelper::nLocalEdges, moab::UcdNCHelper::nLocalVertices, moab::ReadNC::noMesh, numCellGroups, moab::Range::size(), moab::Interface::tag_get_data(), and moab::Interface::tag_get_handle().
|
private |
Create gather set cells without padding (cells are divided into groups based on the number of edges)
Definition at line 1691 of file NCHelperMPAS.cpp.
References moab::NCHelper::_fileId, moab::NCHelper::_readNC, moab::Interface::add_entities(), moab::DEFAULT_MAX_EDGES_PER_CELL, moab::ReadUtilIface::get_element_connect(), moab::Range::insert(), maxEdgesPerCell, MB_CHK_SET_ERR, MB_SET_ERR, MB_SUCCESS, moab::ReadNC::mbImpl, MBPOLYGON, NCDF_SIZE, moab::UcdNCHelper::nCells, NCFUNC, NCFUNCG, moab::ReadNC::readMeshIface, and moab::Range::size().
Referenced by create_mesh().
|
private |
Create gather set edges (optional)
Definition at line 1636 of file NCHelperMPAS.cpp.
References moab::NCHelper::_fileId, moab::NCHelper::_readNC, moab::Interface::add_entities(), moab::ReadUtilIface::get_element_connect(), MB_CHK_SET_ERR, MB_SET_ERR, MB_SUCCESS, MBEDGE, moab::ReadNC::mbImpl, NCDF_SIZE, NCFUNC, NCFUNCG, moab::UcdNCHelper::nEdges, and moab::ReadNC::readMeshIface.
Referenced by create_mesh().
|
private |
Create gather set vertices.
Definition at line 1524 of file NCHelperMPAS.cpp.
References moab::NCHelper::_fileId, moab::NCHelper::_readNC, moab::Interface::add_entities(), moab::Range::begin(), moab::Range::end(), moab::ReadUtilIface::get_node_coords(), MB_CHK_SET_ERR, MB_SET_ERR, MB_SUCCESS, moab::ReadNC::mbImpl, moab::ReadNC::mGlobalIdTag, moab::ReadNC::mpFileIdTag, NCDF_SIZE, NCFUNC, NCFUNCG, moab::UcdNCHelper::nVertices, moab::ReadNC::readMeshIface, moab::Interface::tag_get_bytes(), and moab::Interface::tag_iterate().
Referenced by create_mesh().
|
private |
Create local cells without padding (cells are divided into groups based on the number of edges)
Definition at line 1388 of file NCHelperMPAS.cpp.
References moab::NCHelper::_fileSet, moab::NCHelper::_readNC, moab::Interface::add_entities(), moab::Range::begin(), cellHandleToGlobalID, moab::DEFAULT_MAX_EDGES_PER_CELL, moab::Range::end(), moab::ReadUtilIface::get_element_connect(), moab::Range::index(), moab::Range::insert(), moab::UcdNCHelper::localGidCells, moab::UcdNCHelper::localGidVerts, maxEdgesPerCell, MB_CHK_SET_ERR, MB_SUCCESS, moab::ReadNC::mbImpl, MBPOLYGON, moab::ReadNC::mGlobalIdTag, moab::UcdNCHelper::nLocalCells, numCellGroups, moab::ReadNC::readMeshIface, and moab::Interface::tag_iterate().
Referenced by create_mesh().
|
private |
Create local edges (optional)
Definition at line 1238 of file NCHelperMPAS.cpp.
References moab::NCHelper::_fileId, moab::NCHelper::_fileSet, moab::NCHelper::_readNC, moab::Interface::add_entities(), moab::Range::begin(), createGatherSet, moab::ReadNC::dbgOut, moab::Range::end(), moab::ReadUtilIface::get_element_connect(), moab::Range::index(), moab::UcdNCHelper::localGidCells, moab::UcdNCHelper::localGidEdges, moab::UcdNCHelper::localGidVerts, maxEdgesPerCell, MB_CHK_SET_ERR, MB_SET_ERR, MB_SUCCESS, MBEDGE, moab::ReadNC::mbImpl, moab::ReadNC::mGlobalIdTag, NCDF_SIZE, NCFUNC, NCFUNCAG, moab::UcdNCHelper::nEdges, moab::UcdNCHelper::nLocalCells, moab::UcdNCHelper::nLocalEdges, moab::Range::pair_begin(), moab::Range::pair_end(), moab::Range::psize(), moab::ReadNC::readMeshIface, moab::Range::size(), moab::Interface::tag_iterate(), and moab::DebugOutput::tprintf().
Referenced by create_mesh().
|
private |
Create local vertices.
Definition at line 1059 of file NCHelperMPAS.cpp.
References moab::NCHelper::_fileId, moab::NCHelper::_fileSet, moab::NCHelper::_readNC, moab::Interface::add_entities(), moab::Range::begin(), createGatherSet, moab::ReadNC::dbgOut, moab::Range::end(), moab::ReadUtilIface::get_node_coords(), moab::UcdNCHelper::localGidVerts, MB_CHK_SET_ERR, MB_SET_ERR, MB_SUCCESS, moab::ReadNC::mbImpl, moab::ReadNC::mGlobalIdTag, moab::ReadNC::mpFileIdTag, NCDF_SIZE, NCFUNC, NCFUNCAG, moab::UcdNCHelper::nLocalVertices, moab::UcdNCHelper::nVertices, moab::Range::pair_begin(), moab::Range::pair_end(), moab::Range::psize(), moab::ReadNC::readMeshIface, moab::Range::size(), moab::Interface::tag_get_bytes(), moab::Interface::tag_iterate(), and moab::DebugOutput::tprintf().
Referenced by create_mesh().
Implementation of NCHelper::create_mesh()
Implements moab::NCHelper.
Definition at line 346 of file NCHelperMPAS.cpp.
References moab::NCHelper::_fileId, moab::NCHelper::_fileSet, moab::NCHelper::_readNC, moab::ReadUtilIface::create_gather_set(), create_gather_set_cells(), create_gather_set_edges(), create_gather_set_vertices(), create_local_cells(), create_local_edges(), create_local_vertices(), create_padded_gather_set_cells(), create_padded_local_cells(), createGatherSet, moab::ReadNC::dbgOut, moab::ReadNC::gatherSetRank, moab::Range::insert(), moab::ReadNC::isParallel, moab::UcdNCHelper::localGidCells, maxEdgesPerCell, MB_CHK_SET_ERR, MB_SET_ERR, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_SPARSE, MB_TYPE_INTEGER, moab::ReadNC::mbImpl, NCDF_SIZE, moab::UcdNCHelper::nCells, NCFUNC, NCFUNCAG, moab::UcdNCHelper::nLocalCells, moab::ReadNC::noEdges, moab::ReadNC::noMixedElements, numCellGroups, moab::Range::pair_begin(), moab::Range::pair_end(), moab::ProcConfig::proc_comm(), moab::ParallelComm::proc_config(), moab::ProcConfig::proc_rank(), moab::ProcConfig::proc_size(), moab::Range::psize(), moab::ReadNC::readMeshIface, moab::Range::size(), moab::Interface::tag_get_handle(), moab::Interface::tag_set_data(), moab::DebugOutput::tprintf(), and moab::ReadNC::trivialPartitionShift.
|
private |
Create gather set cells with padding (padded cells will have the same number of edges)
Definition at line 1790 of file NCHelperMPAS.cpp.
References moab::NCHelper::_fileId, moab::NCHelper::_readNC, moab::Interface::add_entities(), moab::ReadUtilIface::get_element_connect(), maxEdgesPerCell, MB_CHK_SET_ERR, MB_SET_ERR, MB_SUCCESS, moab::ReadNC::mbImpl, MBPOLYGON, NCDF_SIZE, moab::UcdNCHelper::nCells, NCFUNC, NCFUNCG, and moab::ReadNC::readMeshIface.
Referenced by create_mesh().
|
private |
Create local cells with padding (padded cells will have the same number of edges)
Definition at line 1471 of file NCHelperMPAS.cpp.
References moab::NCHelper::_fileSet, moab::NCHelper::_readNC, moab::Interface::add_entities(), moab::Range::begin(), createGatherSet, moab::Range::end(), moab::ReadUtilIface::get_element_connect(), moab::Range::index(), moab::Range::insert(), moab::UcdNCHelper::localGidCells, moab::UcdNCHelper::localGidVerts, maxEdgesPerCell, MB_CHK_SET_ERR, MB_SUCCESS, moab::ReadNC::mbImpl, MBPOLYGON, moab::ReadNC::mGlobalIdTag, moab::UcdNCHelper::nCells, moab::UcdNCHelper::nLocalCells, numCellGroups, moab::ReadNC::readMeshIface, and moab::Interface::tag_iterate().
Referenced by create_mesh().
|
inlineprivatevirtual |
Implementation of NCHelper::get_mesh_type_name()
Implements moab::NCHelper.
Definition at line 34 of file NCHelperMPAS.hpp.
|
privatevirtual |
Implementation of NCHelper::init_mesh_vals()
Implements moab::NCHelper.
Definition at line 78 of file NCHelperMPAS.cpp.
References moab::NCHelper::_readNC, moab::UcdNCHelper::cDim, moab::NCHelper::create_dummy_variables(), moab::DEFAULT_MAX_EDGES_PER_CELL, moab::ReadNC::dimLens, moab::ReadNC::dimNames, moab::UcdNCHelper::eDim, moab::ReadNC::VarData::entLoc, moab::ReadNC::ENTLOCEDGE, moab::ReadNC::ENTLOCFACE, moab::ReadNC::ENTLOCVERT, moab::NCHelper::ignoredVarNames, moab::NCHelper::levDim, maxEdgesPerCell, MB_CHK_SET_ERR, MB_INVALID_SIZE, MB_SET_ERR, MB_SUCCESS, moab::UcdNCHelper::nCells, moab::UcdNCHelper::nEdges, moab::NCHelper::nLevels, moab::NCHelper::nTimeSteps, moab::ReadNC::VarData::numLev, moab::UcdNCHelper::nVertices, moab::NCHelper::read_coordinate(), moab::NCHelper::tDim, moab::NCHelper::tVals, moab::ReadNC::VarData::varDims, moab::ReadNC::varInfo, moab::ReadNC::VarData::varName, and moab::UcdNCHelper::vDim.
|
privatevirtual |
Implementation of UcdNCHelper::read_ucd_variables_to_nonset()
Implements moab::UcdNCHelper.
Definition at line 866 of file NCHelperMPAS.cpp.
References moab::NCHelper::_fileId, moab::NCHelper::_readNC, moab::Range::begin(), cellHandleToGlobalID, moab::ReadNC::dbgOut, moab::Range::end(), moab::ReadNC::ENTLOCEDGE, moab::ReadNC::ENTLOCFACE, moab::ReadNC::ENTLOCVERT, facesOwned, moab::DebugOutput::get_verbosity(), moab::Range::index(), moab::UcdNCHelper::localGidCells, moab::UcdNCHelper::localGidEdges, moab::UcdNCHelper::localGidVerts, MB_CHK_SET_ERR, MB_SET_ERR, MB_SUCCESS, moab::ReadNC::mbImpl, NCDF_SIZE, NCFUNCAG, moab::ReadNC::noEdges, numCellGroups, moab::Range::pair_begin(), moab::Range::pair_end(), moab::DebugOutput::printf(), moab::Range::psize(), read_ucd_variables_to_nonset_allocate(), moab::Interface::tag_iterate(), and moab::DebugOutput::tprintf().
|
privatevirtual |
Implementation of UcdNCHelper::read_ucd_variables_to_nonset_allocate()
Implements moab::UcdNCHelper.
Definition at line 580 of file NCHelperMPAS.cpp.
References moab::NCHelper::_fileSet, moab::NCHelper::_readNC, moab::Range::begin(), moab::ReadNC::dbgOut, moab::ReadNC::dimLens, moab::Range::end(), moab::ReadNC::ENTLOCEDGE, moab::ReadNC::ENTLOCFACE, moab::ReadNC::ENTLOCVERT, facesOwned, moab::ParallelComm::filter_pstatus(), moab::Interface::get_entities_by_dimension(), moab::NCHelper::get_tag_to_nonset(), moab::ReadNC::isParallel, moab::UcdNCHelper::localGidCells, moab::UcdNCHelper::localGidEdges, moab::UcdNCHelper::localGidVerts, MB_CHK_SET_ERR, MB_INDEX_OUT_OF_RANGE, MB_SET_ERR, MB_SUCCESS, moab::ReadNC::mbImpl, moab::UcdNCHelper::nLocalCells, moab::UcdNCHelper::nLocalEdges, moab::UcdNCHelper::nLocalVertices, moab::ReadNC::noEdges, numCellGroups, moab::Range::psize(), PSTATUS_NOT, PSTATUS_NOT_OWNED, moab::Range::size(), moab::Interface::tag_iterate(), moab::NCHelper::tDim, and moab::DebugOutput::tprintf().
Referenced by read_ucd_variables_to_nonset().
|
private |
Definition at line 92 of file NCHelperMPAS.hpp.
Referenced by check_existing_mesh(), create_local_cells(), and read_ucd_variables_to_nonset().
|
private |
Definition at line 91 of file NCHelperMPAS.hpp.
Referenced by create_local_edges(), create_local_vertices(), create_mesh(), and create_padded_local_cells().
|
private |
Definition at line 93 of file NCHelperMPAS.hpp.
Referenced by read_ucd_variables_to_nonset(), and read_ucd_variables_to_nonset_allocate().
|
private |
Definition at line 89 of file NCHelperMPAS.hpp.
Referenced by create_gather_set_cells(), create_local_cells(), create_local_edges(), create_mesh(), create_padded_gather_set_cells(), create_padded_local_cells(), and init_mesh_vals().
|
private |
Definition at line 90 of file NCHelperMPAS.hpp.
Referenced by check_existing_mesh(), create_local_cells(), create_mesh(), create_padded_local_cells(), read_ucd_variables_to_nonset(), and read_ucd_variables_to_nonset_allocate().