Functions for reading and writing mesh files. More...
Collaboration diagram for Mesh I/O Operations:Functions | |
| ErrCode | iMOAB_ReadHeaderInfo (const iMOAB_String filename, int *num_global_vertices, int *num_global_elements, int *num_dimension, int *num_parts) |
| Read mesh file header information without loading full mesh. More... | |
| ErrCode | iMOAB_LoadMesh (iMOAB_AppID pid, const iMOAB_String filename, const iMOAB_String read_options, int *num_ghost_layers) |
| Load mesh file into application's mesh set. More... | |
| ErrCode | iMOAB_WriteMesh (iMOAB_AppID pid, const iMOAB_String filename, const iMOAB_String write_options) |
| Write application's mesh to file. More... | |
| ErrCode | iMOAB_WriteLocalMesh (iMOAB_AppID pid, iMOAB_String prefix) |
| Write each process's local mesh to separate file for debugging. More... | |
Functions for reading and writing mesh files.
| ErrCode iMOAB_LoadMesh | ( | iMOAB_AppID | pid, |
| const iMOAB_String | filename, | ||
| const iMOAB_String | read_options, | ||
| int * | num_ghost_layers | ||
| ) |
Load mesh file into application's mesh set.
Load a MOAB mesh file in parallel and exchange ghost layers as requested.
Loads mesh from file (HDF5, Exodus, VTK, etc.) into application's mesh set with optional ghost layer exchange for parallel simulations. Automatically configures parallel reading options.
| [in] | pid | Application ID |
| [in] | filename | Path to mesh file to load |
| [in] | read_options | Optional reader options (semicolon-separated, can be NULL) |
| [in] | num_ghost_layers | Number of ghost element layers to exchange (0 for none) |
Definition at line 895 of file iMOAB.cpp.
References GlobalContext::appDatas, context, moab::ParallelComm::get_id(), IMOAB_ASSERT, IMOAB_CHECKPOINTER, iMOAB_UpdateMeshInfo(), moab::Interface::load_file(), MB_CHK_SET_ERR, GlobalContext::MBI, GlobalContext::MPI_initialized, moab::ParallelComm::rank(), moab::ParallelComm::size(), GlobalContext::worldprocs, and moab::Interface::write_file().
| ErrCode iMOAB_ReadHeaderInfo | ( | const iMOAB_String | filename, |
| int * | num_global_vertices, | ||
| int * | num_global_elements, | ||
| int * | num_dimension, | ||
| int * | num_parts | ||
| ) |
Read mesh file header information without loading full mesh.
It should be called on master task only, and information obtained could be broadcasted by the user. It is a fast lookup in the header of the file.
Quickly extracts metadata from HDF5 mesh file including vertex count, element count, spatial dimension, and partition count. Useful for memory planning before full load.
| [in] | filename | Path to HDF5 mesh file |
| [out] | num_global_vertices | Total number of vertices in mesh |
| [out] | num_global_elements | Total number of elements in mesh (all types) |
| [out] | num_dimension | Spatial dimension (2D or 3D) |
| [out] | num_parts | Number of parallel partitions |
Definition at line 714 of file iMOAB.cpp.
References mhdf_EntDesc::count, mhdf_ElemDesc::desc, mhdf_FileDesc::elems, IMOAB_ASSERT, IMOAB_CHECKPOINTER, MB_SUCCESS, mdhf_HEX_TYPE_NAME, mdhf_KNIFE_TYPE_NAME, mhdf_closeFile(), mhdf_EDGE_TYPE_NAME, mhdf_getFileSummary(), mhdf_isError(), mhdf_message(), mhdf_openFile(), mhdf_POLYGON_TYPE_NAME, mhdf_POLYHEDRON_TYPE_NAME, mhdf_PRISM_TYPE_NAME, mhdf_PYRAMID_TYPE_NAME, mhdf_QUAD_TYPE_NAME, mhdf_SEPTAHEDRON_TYPE_NAME, mhdf_TET_TYPE_NAME, mhdf_TRI_TYPE_NAME, mhdf_FileDesc::nodes, mhdf_FileDesc::num_elem_desc, mhdf_FileDesc::numEntSets, mhdf_ElemDesc::type, and mhdf_EntDesc::vals_per_ent.
| ErrCode iMOAB_WriteLocalMesh | ( | iMOAB_AppID | pid, |
| iMOAB_String | prefix | ||
| ) |
Write each process's local mesh to separate file for debugging.
Write a local MOAB mesh copy.
Creates per-process HDF5 file with naming convention: prefix_nprocs_rank.h5m. Useful for debugging parallel mesh distribution and ghost layer issues.
| [in] | pid | Application ID |
| [in] | prefix | Output file prefix (rank and process count appended automatically) |
Definition at line 1131 of file iMOAB.cpp.
References GlobalContext::appDatas, context, IMOAB_ASSERT, IMOAB_CHECKPOINTER, MB_CHK_ERR, MB_SUCCESS, GlobalContext::MBI, moab::ParallelComm::rank(), moab::ParallelComm::size(), and moab::Interface::write_file().
| ErrCode iMOAB_WriteMesh | ( | iMOAB_AppID | pid, |
| const iMOAB_String | filename, | ||
| const iMOAB_String | write_options | ||
| ) |
Write application's mesh to file.
Write a MOAB mesh along with the solution tags to a file.
Writes mesh data from application's mesh set to file in various formats (HDF5, Exodus, VTK, etc.). Automatically includes GLOBAL_ID and PARALLEL_PARTITION tags for parallel simulations.
| [in] | pid | Application ID |
| [in] | filename | Output file path |
| [in] | write_options | Optional writer options (semicolon-separated, can be NULL) |
Definition at line 1105 of file iMOAB.cpp.
References internal_WriteMesh().