Implementation of iMOAB C API for MOAB mesh database operations. More...
#include "moab/MOABConfig.h"#include "moab/Core.hpp"#include "moab_mpi.h"#include "moab/ParallelComm.hpp"#include "moab/ParCommGraph.hpp"#include "moab/ParallelMergeMesh.hpp"#include "moab/IntxMesh/IntxUtils.hpp"#include "DebugOutput.hpp"#include "moab/iMOAB.h"#include "mhdf.h"#include <H5Tpublic.h>#include "moab/CartVect.hpp"#include "MBTagConventions.hpp"#include "moab/MeshTopoUtil.hpp"#include "moab/ReadUtilIface.hpp"#include "moab/MergeMesh.hpp"#include <cassert>#include <sstream>#include <iostream>
Include dependency graph for iMOAB.cpp:Go to the source code of this file.
Classes | |
| struct | appData |
| struct | GlobalContext |
Functions | |
| ErrCode | iMOAB_Initialize (int argc, iMOAB_String *argv) |
| Initialize iMOAB library and create MOAB instance. More... | |
| ErrCode | iMOAB_InitializeFortran () |
| Fortran-compatible wrapper for iMOAB_Initialize. More... | |
| ErrCode | iMOAB_Finalize () |
| Finalize iMOAB library and cleanup MOAB instance. More... | |
| static int | apphash (const iMOAB_String str, int identifier=0) |
| Fast string-to-integer hash function for generating application IDs. More... | |
| ErrCode | iMOAB_RegisterApplication (const iMOAB_String app_name, MPI_Comm *comm, int *compid, iMOAB_AppID pid) |
| Register a new application instance with iMOAB. More... | |
| ErrCode | iMOAB_RegisterApplicationFortran (const iMOAB_String app_name, int *comm, int *compid, iMOAB_AppID pid) |
| Fortran-compatible wrapper for iMOAB_RegisterApplication. More... | |
| ErrCode | iMOAB_DeregisterApplication (iMOAB_AppID pid) |
| Deregister an application instance and cleanup associated resources. More... | |
| ErrCode | iMOAB_DeregisterApplicationFortran (iMOAB_AppID pid) |
| Fortran-compatible wrapper for iMOAB_DeregisterApplication. More... | |
| 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... | |
| static ErrCode | internal_WriteMesh (iMOAB_AppID pid, const iMOAB_String filename, const iMOAB_String write_options, bool primary_set=true) |
| 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... | |
| ErrCode | iMOAB_UpdateMeshInfo (iMOAB_AppID pid) |
| Update application's mesh information after loading or modification. More... | |
| ErrCode | iMOAB_GetMeshInfo (iMOAB_AppID pid, int *num_visible_vertices, int *num_visible_elements, int *num_visible_blocks, int *num_visible_surfaceBC, int *num_visible_vertexBC) |
| Query mesh statistics including vertices, elements, and boundary conditions. More... | |
| ErrCode | iMOAB_GetVertexID (iMOAB_AppID pid, int *vertices_length, iMOAB_GlobalID *global_vertex_ID) |
| Retrieve global IDs for all vertices in application's mesh. More... | |
| ErrCode | iMOAB_GetVertexOwnership (iMOAB_AppID pid, int *vertices_length, int *visible_global_rank_ID) |
| Retrieve parallel ownership information for all vertices. More... | |
| ErrCode | iMOAB_GetVisibleVerticesCoordinates (iMOAB_AppID pid, int *coords_length, double *coordinates) |
| Retrieve coordinates for all vertices in interleaved format. More... | |
| ErrCode | iMOAB_GetBlockID (iMOAB_AppID pid, int *block_length, iMOAB_GlobalID *global_block_IDs) |
| Retrieve global IDs for all material blocks in mesh. More... | |
| ErrCode | iMOAB_GetBlockInfo (iMOAB_AppID pid, iMOAB_GlobalID *global_block_ID, int *vertices_per_element, int *num_elements_in_block) |
| Retrieve information about a specific material block. More... | |
| ErrCode | iMOAB_GetVisibleElementsInfo (iMOAB_AppID pid, int *num_visible_elements, iMOAB_GlobalID *element_global_IDs, int *ranks, iMOAB_GlobalID *block_IDs) |
| Get the visible elements information. More... | |
| ErrCode | iMOAB_GetBlockElementConnectivities (iMOAB_AppID pid, iMOAB_GlobalID *global_block_ID, int *connectivity_length, int *element_connectivity) |
| Get the connectivities for elements contained within a certain block. More... | |
| ErrCode | iMOAB_GetElementConnectivity (iMOAB_AppID pid, iMOAB_LocalID *elem_index, int *connectivity_length, int *element_connectivity) |
| Get the connectivity for one element only. More... | |
| ErrCode | iMOAB_GetElementOwnership (iMOAB_AppID pid, iMOAB_GlobalID *global_block_ID, int *num_elements_in_block, int *element_ownership) |
| Get the element ownership within a certain block i.e., processor ID of the element owner. More... | |
| ErrCode | iMOAB_GetElementID (iMOAB_AppID pid, iMOAB_GlobalID *global_block_ID, int *num_elements_in_block, iMOAB_GlobalID *global_element_ID, iMOAB_LocalID *local_element_ID) |
| Get the global IDs for all locally visible elements belonging to a particular block. More... | |
| ErrCode | iMOAB_GetPointerToSurfaceBC (iMOAB_AppID pid, int *surface_BC_length, iMOAB_LocalID *local_element_ID, int *reference_surface_ID, int *boundary_condition_value) |
| Get the surface boundary condition information. More... | |
| ErrCode | iMOAB_GetPointerToVertexBC (iMOAB_AppID pid, int *vertex_BC_length, iMOAB_LocalID *local_vertex_ID, int *boundary_condition_value) |
| Get the vertex boundary condition information. More... | |
| static void | split_tag_names (std::string input_names, std::string &separator, std::vector< std::string > &list_tag_names) |
| ErrCode | iMOAB_DefineTagStorage (iMOAB_AppID pid, const iMOAB_String tag_storage_name, int *tag_type, int *components_per_entity, int *tag_index) |
| Define a MOAB Tag corresponding to the application depending on requested types. More... | |
| ErrCode | iMOAB_SetIntTagStorage (iMOAB_AppID pid, const iMOAB_String tag_storage_name, int *num_tag_storage_length, int *ent_type, int *tag_storage_data) |
| Store the specified values in a MOAB integer Tag. More... | |
| ErrCode | iMOAB_GetIntTagStorage (iMOAB_AppID pid, const iMOAB_String tag_storage_name, int *num_tag_storage_length, int *ent_type, int *tag_storage_data) |
| Get the specified values in a MOAB integer Tag. More... | |
| ErrCode | iMOAB_SetDoubleTagStorage (iMOAB_AppID pid, const iMOAB_String tag_storage_names, int *num_tag_storage_length, int *ent_type, double *tag_storage_data) |
| Store the specified values in a MOAB double Tag. More... | |
| ErrCode | iMOAB_SetDoubleTagStorageWithGid (iMOAB_AppID pid, const iMOAB_String tag_storage_names, int *num_tag_storage_length, int *ent_type, double *tag_storage_data, int *globalIds) |
| Store the specified values in a MOAB double Tag, for given ids. More... | |
| ErrCode | iMOAB_GetDoubleTagStorage (iMOAB_AppID pid, const iMOAB_String tag_storage_names, int *num_tag_storage_length, int *ent_type, double *tag_storage_data) |
| Retrieve the specified values in a MOAB double Tag. More... | |
| ErrCode | iMOAB_SynchronizeTags (iMOAB_AppID pid, int *num_tag, int *tag_indices, int *ent_type) |
| Exchange tag values for the given tags across process boundaries. More... | |
| ErrCode | iMOAB_ReduceTagsMax (iMOAB_AppID pid, int *tag_index, int *ent_type) |
| Perform global reductions with the processes in the current applications communicator. Specifically this routine performs reductions on the maximum value of the tag indicated by tag_index. More... | |
| ErrCode | iMOAB_GetNeighborElements (iMOAB_AppID pid, iMOAB_LocalID *local_index, int *num_adjacent_elements, iMOAB_LocalID *adjacent_element_IDs) |
| Retrieve the adjacencies for the element entities. More... | |
| ErrCode | iMOAB_CreateVertices (iMOAB_AppID pid, int *coords_len, int *dim, double *coordinates) |
| Create vertices for an app; it assumes no other vertices. More... | |
| ErrCode | iMOAB_CreateElements (iMOAB_AppID pid, int *num_elem, int *type, int *num_nodes_per_element, int *connectivity, int *block_ID) |
| Create elements for an app; it assumes connectivity from local vertices, in order. More... | |
| ErrCode | iMOAB_SetGlobalInfo (iMOAB_AppID pid, int *num_global_verts, int *num_global_elems) |
| Set global information for number of vertices and number of elements; It is usually available from the h5m file, or it can be computed with a MPI_Reduce. More... | |
| ErrCode | iMOAB_GetGlobalInfo (iMOAB_AppID pid, int *num_global_verts, int *num_global_elems) |
| Get global information about number of vertices and number of elements. More... | |
| ErrCode | iMOAB_ResolveSharedEntities (iMOAB_AppID pid, int *num_verts, int *marker) |
| Resolve shared entities using global markers on shared vertices. More... | |
| ErrCode | iMOAB_DetermineGhostEntities (iMOAB_AppID pid, int *ghost_dim, int *num_ghost_layers, int *bridge_dim) |
| Create the requested number of ghost layers for the parallel mesh. More... | |
| ErrCode | iMOAB_SendMesh (iMOAB_AppID pid, MPI_Comm *joint_communicator, MPI_Group *receivingGroup, int *rcompid, int *method) |
| Transfer mesh data from sender component to receiver component. More... | |
| ErrCode | iMOAB_ReceiveMesh (iMOAB_AppID pid, MPI_Comm *joint_communicator, MPI_Group *sendingGroup, int *scompid) |
| Receive mesh data on target component from sending component. More... | |
| ErrCode | iMOAB_SendElementTag (iMOAB_AppID pid, const iMOAB_String tag_storage_name, MPI_Comm *joint_communicator, int *context_id) |
| Send element tag data from calling component to another component. More... | |
| ErrCode | iMOAB_ReceiveElementTag (iMOAB_AppID pid, const iMOAB_String tag_storage_name, MPI_Comm *joint_communicator, int *context_id) |
| Receive element tag data from another component. More... | |
| ErrCode | iMOAB_FreeSenderBuffers (iMOAB_AppID pid, int *context_id) |
| ErrCode | iMOAB_ComputeCommGraph (iMOAB_AppID pid1, iMOAB_AppID pid2, MPI_Comm *joint_communicator, MPI_Group *group1, MPI_Group *group2, int *type1, int *type2, int *comp1, int *comp2) |
| Compute communication graph between two components using rendezvous algorithm. More... | |
| ErrCode | iMOAB_MergeVertices (iMOAB_AppID pid) |
| Merge duplicate vertices in a mesh and update connectivity information. More... | |
Variables | |
| static struct GlobalContext | context |
Implementation of iMOAB C API for MOAB mesh database operations.
This file implements the iMOAB interface - a C API for MOAB (Mesh Oriented datABase) that provides simplified access to MOAB functionality for coupled applications, particularly in climate and multiphysics simulations.
Definition in file iMOAB.cpp.
|
static |
Fast string-to-integer hash function for generating application IDs.
Uses Fowler-Noll-Vo (FNV) hash algorithm to generate unique integer IDs from application names combined with component IDs. Non-cryptographic but fast and robust.
| [in] | str | Application name string to hash |
| [in] | identifier | Optional component ID to incorporate into hash (default 0) |
Definition at line 335 of file iMOAB.cpp.
Referenced by iMOAB_RegisterApplication().
| ErrCode iMOAB_CreateElements | ( | iMOAB_AppID | pid, |
| int * | num_elem, | ||
| int * | type, | ||
| int * | num_nodes_per_element, | ||
| int * | connectivity, | ||
| int * | block_ID | ||
| ) |
Create elements for an app; it assumes connectivity from local vertices, in order.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | num_elem | (int*) Number of elements. |
| [in] | type | (int*) Type of element (moab type). |
| [in] | num_nodes_per_element | (int*) Number of nodes per element. |
| [in] | connectivity | (int *) Connectivity array, with respect to vertices (assumed contiguous). |
| [in] | block_ID | (int *) The local block identifier, which will now contain the elements. |
add the new ents to the clock set
Definition at line 2931 of file iMOAB.cpp.
References moab::Interface::add_entities(), GlobalContext::appDatas, context, moab::Interface::create_meshset(), moab::Range::empty(), ErrorCode, appData::file_set, moab::ReadUtilIface::get_element_connect(), moab::Interface::get_entities_by_type_and_tag(), appData::local_verts, GlobalContext::material_tag, MB_CHK_ERR, MB_SUCCESS, MBENTITYSET, GlobalContext::MBI, moab::Range::merge(), MESHSET_SET, appData::primary_elems, moab::Interface::query_interface(), moab::Interface::tag_set_data(), and moab::ReadUtilIface::update_adjacencies().
| ErrCode iMOAB_CreateVertices | ( | iMOAB_AppID | pid, |
| int * | coords_len, | ||
| int * | dim, | ||
| double * | coordinates | ||
| ) |
Create vertices for an app; it assumes no other vertices.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | coords_len | (int*) Size of the coordinates array (nverts * dim). |
| [in] | dim | (int*) Dimension of the vertex coordinates (usually 3). |
| [in] | coordinates | (double*) Coordinates of all vertices, interleaved. |
Definition at line 2911 of file iMOAB.cpp.
References moab::Interface::add_entities(), appData::all_verts, GlobalContext::appDatas, context, moab::Interface::create_vertices(), moab::Range::empty(), appData::file_set, appData::local_verts, MB_CHK_ERR, MB_SUCCESS, GlobalContext::MBI, and moab::Range::merge().
| ErrCode iMOAB_DefineTagStorage | ( | iMOAB_AppID | pid, |
| const iMOAB_String | tag_storage_name, | ||
| int * | tag_type, | ||
| int * | components_per_entity, | ||
| int * | tag_index | ||
| ) |
Define a MOAB Tag corresponding to the application depending on requested types.
Operations: Collective
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | tag_storage_name | (iMOAB_String) The tag name to store/retrieve the data in MOAB. |
| [in] | tag_type | (int*) The type of MOAB tag (Dense/Sparse, Double/Int/EntityHandle), enum MOAB_TAG_TYPE. |
| [in] | components_per_entity | (int*) The total size of vector dimension per entity for the tag (e.g., number of doubles per entity). |
| [out] | tag_index | (int*) The tag index which can be used as identifier in synchronize methods. |
Definition at line 2068 of file iMOAB.cpp.
References GlobalContext::appDatas, context, ErrorCode, appData::global_id, MB_ALREADY_ALLOCATED, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TAG_EXCL, MB_TAG_SPARSE, MB_TYPE_DOUBLE, MB_TYPE_HANDLE, MB_TYPE_INTEGER, GlobalContext::MBI, appData::name, moab::ParallelComm::rank(), split_tag_names(), moab::Interface::tag_get_handle(), appData::tagList, appData::tagMap, and TagType.
Referenced by iMOAB_ReceiveMesh().
| ErrCode iMOAB_DetermineGhostEntities | ( | iMOAB_AppID | pid, |
| int * | ghost_dim, | ||
| int * | num_ghost_layers, | ||
| int * | bridge_dim | ||
| ) |
Create the requested number of ghost layers for the parallel mesh.
Operations: Collective.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | ghost_dim | (int*) Desired ghost dimension (2 or 3, most of the time). |
| [in] | num_ghost_layers | (int*) Number of ghost layers requested. |
| [in] | bridge_dim | (int*) Bridge dimension (0 for vertices, 1 for edges, 2 for faces). |
Definition at line 3076 of file iMOAB.cpp.
References GlobalContext::appDatas, context, moab::ParallelComm::correct_thin_ghost_layers(), moab::ParallelComm::exchange_ghost_cells(), appData::file_set, iMOAB_UpdateMeshInfo(), MB_CHK_ERR, MB_SUCCESS, and appData::num_ghost_layers.
| ErrCode iMOAB_FreeSenderBuffers | ( | iMOAB_AppID | pid, |
| int * | context_id | ||
| ) |
Definition at line 3692 of file iMOAB.cpp.
References GlobalContext::appDatas, context, MB_SUCCESS, and appData::pgraph.
| ErrCode iMOAB_GetBlockElementConnectivities | ( | iMOAB_AppID | pid, |
| iMOAB_GlobalID * | global_block_ID, | ||
| int * | connectivity_length, | ||
| int * | element_connectivity | ||
| ) |
Get the connectivities for elements contained within a certain block.
Operations: Not Collective
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | global_block_ID | (iMOAB_GlobalID*) The global block ID of the set being queried. |
| [in] | connectivity_length | (int*) The allocated size of array. (typical size := vertices_per_element*num_elements_in_block) |
| [out] | element_connectivity | (int*) The connectivity array to store element ordering in MOAB canonical numbering scheme (array allocated by user); array contains vertex indices in the local numbering order for vertices elements are in the same order as provided by GetElementOwnership and GetElementID. |
Definition at line 1745 of file iMOAB.cpp.
References appData::all_verts, GlobalContext::appDatas, context, moab::Interface::get_connectivity(), moab::Interface::get_entities_by_handle(), moab::Range::index(), appData::mat_sets, appData::matIndex, MB_CHK_SET_ERR, MB_SUCCESS, and GlobalContext::MBI.
| ErrCode iMOAB_GetDoubleTagStorage | ( | iMOAB_AppID | pid, |
| const iMOAB_String | tag_storage_name, | ||
| int * | num_tag_storage_length, | ||
| int * | entity_type, | ||
| double * | tag_storage_data | ||
| ) |
Retrieve the specified values in a MOAB double Tag.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | tag_storage_name | (iMOAB_String) The tag names to retrieve the data in MOAB. |
| [in] | num_tag_storage_length | (int) The size of total tag storage data (e.g., num_visible_vertices*components_per_entity*num_tags or num_visible_elements*components_per_entity*num_tags) |
| [in] | entity_type | (int*) Type=0 for vertices, and Type=1 for primary elements. |
| [out] | tag_storage_data | (double*) The array data of type double to replace the internal tag memory; The data is assumed to be contiguous over the local set of visible entities (either vertices or elements). unrolled by tags |
Definition at line 2729 of file iMOAB.cpp.
References appData::all_verts, GlobalContext::appDatas, context, MB_CHK_ERR, MB_SUCCESS, MB_TYPE_DOUBLE, GlobalContext::MBI, appData::primary_elems, moab::Range::size(), split_tag_names(), moab::Interface::tag_get_data(), moab::Interface::tag_get_data_type(), moab::Interface::tag_get_length(), and appData::tagMap.
| ErrCode iMOAB_GetElementConnectivity | ( | iMOAB_AppID | pid, |
| iMOAB_LocalID * | elem_index, | ||
| int * | connectivity_length, | ||
| int * | element_connectivity | ||
| ) |
Get the connectivity for one element only.
Operations: Not Collective
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | elem_index | (iMOAB_LocalID *) Local element index. |
| [in,out] | connectivity_length | (int *) On input, maximum length of connectivity. On output, actual length. |
| [out] | element_connectivity | (int*) The connectivity array to store connectivity in MOAB canonical numbering scheme. Array contains vertex indices in the local numbering order for vertices. |
Definition at line 1793 of file iMOAB.cpp.
References appData::all_verts, GlobalContext::appDatas, context, moab::Interface::get_connectivity(), moab::index, moab::Range::index(), MB_CHK_SET_ERR, MB_SUCCESS, GlobalContext::MBI, appData::primary_elems, and moab::Range::size().
| ErrCode iMOAB_GetElementID | ( | iMOAB_AppID | pid, |
| iMOAB_GlobalID * | global_block_ID, | ||
| int * | num_elements_in_block, | ||
| iMOAB_GlobalID * | global_element_ID, | ||
| iMOAB_LocalID * | local_element_ID | ||
| ) |
Get the global IDs for all locally visible elements belonging to a particular block.
Operations: Not Collective
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | global_block_ID | (iMOAB_GlobalID*) The global block ID of the set being queried. |
| [in] | num_elements_in_block | (int*) The allocated size of global element ID array, same as num_elements_in_block returned from GetBlockInfo(). |
| [out] | global_element_ID | (iMOAB_GlobalID*) The global IDs for all locally visible elements (array allocated by user). |
| [out] | local_element_ID | (iMOAB_LocalID*) (Optional) The local IDs for all locally visible elements (index in the range of all primary elements in the rank) |
Definition at line 1880 of file iMOAB.cpp.
References GlobalContext::appDatas, context, moab::Range::empty(), moab::Interface::get_entities_by_handle(), GlobalContext::globalID_tag, moab::Range::index(), appData::mat_sets, appData::matIndex, MB_CHK_SET_ERR, MB_SUCCESS, GlobalContext::MBI, appData::primary_elems, moab::Range::size(), and moab::Interface::tag_get_data().
| ErrCode iMOAB_GetElementOwnership | ( | iMOAB_AppID | pid, |
| iMOAB_GlobalID * | global_block_ID, | ||
| int * | num_elements_in_block, | ||
| int * | element_ownership | ||
| ) |
Get the element ownership within a certain block i.e., processor ID of the element owner.
Operations: Not Collective
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | global_block_ID | (iMOAB_GlobalID) The global block ID of the set being queried. |
| [in] | num_elements_in_block | (int*) The allocated size of ownership array, same as num_elements_in_block returned from GetBlockInfo(). |
| [out] | element_ownership | (int*) The ownership array to store processor ID for all elements (array allocated by user). |
Definition at line 1833 of file iMOAB.cpp.
References GlobalContext::appDatas, moab::Range::begin(), context, moab::Range::empty(), moab::Range::end(), moab::Interface::get_entities_by_handle(), moab::ParallelComm::get_owner(), MB_CHK_SET_ERR, MB_SUCCESS, GlobalContext::MBI, and moab::Range::size().
| ErrCode iMOAB_GetGlobalInfo | ( | iMOAB_AppID | pid, |
| int * | num_global_verts, | ||
| int * | num_global_elems | ||
| ) |
Get global information about number of vertices and number of elements.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | num_global_verts | (int*) The number of total vertices in the mesh. |
| [in] | num_global_elems | (MPI_Comm) The number of total elements in the mesh. |
Definition at line 3007 of file iMOAB.cpp.
References GlobalContext::appDatas, context, MB_SUCCESS, appData::num_global_elements, and appData::num_global_vertices.
| ErrCode iMOAB_GetIntTagStorage | ( | iMOAB_AppID | pid, |
| const iMOAB_String | tag_storage_name, | ||
| int * | num_tag_storage_length, | ||
| int * | entity_type, | ||
| int * | tag_storage_data | ||
| ) |
Get the specified values in a MOAB integer Tag.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | tag_storage_name | (iMOAB_String) The tag name to store/retreive the data in MOAB. |
| [in] | num_tag_storage_length | (int*) The size of tag storage data (e.g., num_visible_vertices*components_per_entity or num_visible_elements*components_per_entity). |
| [in] | entity_type | (int*) Type=0 for vertices, and Type=1 for primary elements. |
| [out] | tag_storage_data | (int*) The array data of type int to be copied from the internal tag memory; The data is assumed to be contiguous over the local set of visible entities (either vertices or elements). |
Definition at line 2241 of file iMOAB.cpp.
References appData::all_verts, GlobalContext::appDatas, context, MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, MB_TYPE_INTEGER, GlobalContext::MBI, appData::primary_elems, moab::Range::size(), moab::Interface::tag_get_data(), moab::Interface::tag_get_data_type(), moab::Interface::tag_get_length(), and appData::tagMap.
| ErrCode iMOAB_GetNeighborElements | ( | iMOAB_AppID | pid, |
| iMOAB_LocalID * | local_index, | ||
| int * | num_adjacent_elements, | ||
| iMOAB_LocalID * | adjacent_element_IDs | ||
| ) |
Retrieve the adjacencies for the element entities.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | local_index | (iMOAB_LocalID*) The local element ID for which adjacency information is needed. |
| [out] | num_adjacent_elements | (int*) The total number of adjacent elements. |
| [out] | adjacent_element_IDs | (iMOAB_LocalID*) The local element IDs of all adjacent elements to the current one (typically, num_total_sides for internal elements or num_total_sides-num_sides_on_boundary for boundary elements). |
Definition at line 2872 of file iMOAB.cpp.
References GlobalContext::appDatas, context, appData::dimension, moab::MeshTopoUtil::get_bridge_adjacencies(), moab::Range::index(), MB_CHK_SET_ERR, MB_SUCCESS, GlobalContext::MBI, appData::primary_elems, and moab::Range::size().
| ErrCode iMOAB_GetPointerToSurfaceBC | ( | iMOAB_AppID | pid, |
| int * | surface_BC_length, | ||
| iMOAB_LocalID * | local_element_ID, | ||
| int * | reference_surface_ID, | ||
| int * | boundary_condition_value | ||
| ) |
Get the surface boundary condition information.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | surface_BC_length | (int*) The allocated size of surface boundary condition array, same as num_visible_surfaceBC returned by GetMeshInfo(). |
| [out] | local_element_ID | (iMOAB_LocalID*) The local element IDs that contains the side with the surface BC. |
| [out] | reference_surface_ID | (int*) The surface number with the BC in the canonical reference element (e.g., 1 to 6 for HEX, 1-4 for TET). |
| [out] | boundary_condition_value | (int*) The boundary condition type as obtained from the mesh description (value of the NeumannSet defined on the element). |
Definition at line 1928 of file iMOAB.cpp.
References GlobalContext::appDatas, moab::Range::begin(), context, appData::dimension, moab::Range::end(), moab::Interface::get_adjacencies(), moab::Interface::get_entities_by_dimension(), moab::index, moab::Range::index(), MB_CHK_SET_ERR, MB_SUCCESS, GlobalContext::MBI, appData::neu_sets, GlobalContext::neumann_tag, appData::primary_elems, moab::Interface::side_number(), moab::side_number(), moab::Range::size(), and moab::Interface::tag_get_data().
| ErrCode iMOAB_GetPointerToVertexBC | ( | iMOAB_AppID | pid, |
| int * | vertex_BC_length, | ||
| iMOAB_LocalID * | local_vertex_ID, | ||
| int * | boundary_condition_value | ||
| ) |
Get the vertex boundary condition information.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | vertex_BC_length | (int) The allocated size of vertex boundary condition array, same as num_visible_vertexBC returned by GetMeshInfo(). |
| [out] | local_vertex_ID | (iMOAB_LocalID*) The local vertex ID that has Dirichlet BC defined. |
| [out] | boundary_condition_value | (int*) The boundary condition type as obtained from the mesh description (value of the Dirichlet_Set tag defined on the vertex). |
Definition at line 1998 of file iMOAB.cpp.
References appData::all_verts, GlobalContext::appDatas, moab::Range::begin(), context, appData::diri_sets, GlobalContext::dirichlet_tag, moab::Range::end(), moab::Interface::get_entities_by_dimension(), moab::index, moab::Range::index(), MB_CHK_SET_ERR, MB_SUCCESS, GlobalContext::MBI, moab::Range::size(), and moab::Interface::tag_get_data().
| ErrCode iMOAB_GetVisibleElementsInfo | ( | iMOAB_AppID | pid, |
| int * | num_visible_elements, | ||
| iMOAB_GlobalID * | element_global_IDs, | ||
| int * | ranks, | ||
| iMOAB_GlobalID * | block_IDs | ||
| ) |
Get the visible elements information.
Return for all visible elements the global IDs, ranks they belong to, block ids they belong to.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | num_visible_elements | (int*) The number of visible elements (returned by GetMeshInfo). |
| [out] | element_global_IDs | (iMOAB_GlobalID*) Element global ids to be added to the block. |
| [out] | ranks | (int*) The owning ranks of elements. |
| [out] | block_IDs | (iMOAB_GlobalID*) The block ids containing the elements. |
Definition at line 1686 of file iMOAB.cpp.
References GlobalContext::appDatas, moab::Range::begin(), context, moab::Range::end(), moab::Interface::get_entities_by_handle(), moab::ParallelComm::get_owner(), GlobalContext::globalID_tag, moab::index, moab::Range::index(), appData::mat_sets, GlobalContext::material_tag, MB_CHK_SET_ERR, MB_SUCCESS, GlobalContext::MBI, appData::primary_elems, and moab::Interface::tag_get_data().
| ErrCode iMOAB_ReduceTagsMax | ( | iMOAB_AppID | pid, |
| int * | tag_index, | ||
| int * | ent_type | ||
| ) |
Perform global reductions with the processes in the current applications communicator. Specifically this routine performs reductions on the maximum value of the tag indicated by tag_index.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | tag_index | (int*) The tag index of interest. |
| [in] | ent_type | (int*) The type of entity for tag reduction operation (vertices = 0, elements = 1) |
Definition at line 2833 of file iMOAB.cpp.
References appData::all_verts, GlobalContext::appDatas, context, MB_CHK_ERR, MB_SUCCESS, appData::primary_elems, moab::ParallelComm::reduce_tags(), appData::tagList, and UNUSED.
| ErrCode iMOAB_ResolveSharedEntities | ( | iMOAB_AppID | pid, |
| int * | num_verts, | ||
| int * | marker | ||
| ) |
Resolve shared entities using global markers on shared vertices.
Operations: Collective .
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | num_verts | (int*) Number of vertices. |
| [in] | marker | (int*) Resolving marker (global id marker). |
Definition at line 3025 of file iMOAB.cpp.
References GlobalContext::appDatas, context, moab::Range::empty(), ErrorCode, appData::file_set, appData::local_verts, MB_ALREADY_ALLOCATED, MB_CHK_ERR, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TAG_SPARSE, MB_TYPE_INTEGER, GlobalContext::MBI, appData::primary_elems, moab::ParallelComm::rank(), moab::ParallelComm::resolve_shared_ents(), moab::Range::size(), moab::Interface::tag_delete(), moab::Interface::tag_get_handle(), and moab::Interface::tag_set_data().
| ErrCode iMOAB_SetDoubleTagStorage | ( | iMOAB_AppID | pid, |
| const iMOAB_String | tag_storage_name, | ||
| int * | num_tag_storage_length, | ||
| int * | entity_type, | ||
| double * | tag_storage_data | ||
| ) |
Store the specified values in a MOAB double Tag.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | tag_storage_name | (iMOAB_String) The tag names, separated, to store the data. |
| [in] | num_tag_storage_length | (int*) The size of total tag storage data (e.g., num_visible_vertices*components_per_entity or num_visible_elements*components_per_entity*num_tags). |
| [in] | entity_type | (int*) Type=0 for vertices, and Type=1 for primary elements. |
| [out] | tag_storage_data | (double*) The array data of type double to replace the internal tag memory; The data is assumed to be contiguous over the local set of visible entities (either vertices or elements). unrolled by tags |
Definition at line 2285 of file iMOAB.cpp.
References appData::all_verts, GlobalContext::appDatas, context, MB_CHK_ERR, MB_SUCCESS, MB_TYPE_DOUBLE, GlobalContext::MBI, appData::primary_elems, moab::Range::size(), split_tag_names(), moab::Interface::tag_get_data_type(), moab::Interface::tag_get_length(), moab::Interface::tag_set_data(), and appData::tagMap.
| ErrCode iMOAB_SetDoubleTagStorageWithGid | ( | iMOAB_AppID | pid, |
| const iMOAB_String | tag_storage_names, | ||
| int * | num_tag_storage_length, | ||
| int * | entity_type, | ||
| double * | tag_storage_data, | ||
| int * | globalIds | ||
| ) |
Store the specified values in a MOAB double Tag, for given ids.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | tag_storage_name | (iMOAB_String) The tag names, separated, to store the data. |
| [in] | num_tag_storage_length | (int*) The size of total tag storage data (e.g., num_visible_vertices*components_per_entity or num_visible_elements*components_per_entity*num_tags). |
| [in] | entity_type | (int*) Type=0 for vertices, and Type=1 for primary elements. |
| [in] | tag_storage_data | (double*) The array data of type double to replace the internal tag memory; The data is assumed to be permuted over the local set of visible entities (either vertices or elements). unrolled by tags in parallel, might be different order, or different entities on the task |
| [in] | globalIds | global ids of the cells to be set; |
Definition at line 2336 of file iMOAB.cpp.
References appData::all_verts, GlobalContext::appDatas, moab::Range::begin(), context, moab::ProcConfig::crystal_router(), moab::TupleList::enableWriteAccess(), moab::Range::end(), moab::TupleList::get_n(), moab::Interface::globalId_tag(), moab::TupleList::inc_n(), moab::TupleList::initialize(), MB_CHK_ERR, MB_SET_ERR, MB_SUCCESS, MB_TYPE_DOUBLE, GlobalContext::MBI, appData::primary_elems, moab::ParallelComm::proc_config(), moab::TupleList::reserve(), moab::TupleList::buffer::reset(), moab::Range::size(), moab::ParallelComm::size(), moab::TupleList::sort(), split_tag_names(), moab::Interface::tag_get_data(), moab::Interface::tag_get_data_type(), moab::Interface::tag_get_length(), moab::Interface::tag_set_data(), appData::tagMap, moab::TupleList::vi_rd, moab::TupleList::vi_wr, moab::TupleList::vr_rd, and moab::TupleList::vr_wr.
| ErrCode iMOAB_SetGlobalInfo | ( | iMOAB_AppID | pid, |
| int * | num_global_verts, | ||
| int * | num_global_elems | ||
| ) |
Set global information for number of vertices and number of elements; It is usually available from the h5m file, or it can be computed with a MPI_Reduce.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | num_global_verts | (int*) The number of total vertices in the mesh. |
| [in] | num_global_elems | (MPI_Comm) The number of total elements in the mesh. |
Definition at line 2999 of file iMOAB.cpp.
References GlobalContext::appDatas, context, MB_SUCCESS, appData::num_global_elements, and appData::num_global_vertices.
Referenced by iMOAB_UpdateMeshInfo().
| ErrCode iMOAB_SetIntTagStorage | ( | iMOAB_AppID | pid, |
| const iMOAB_String | tag_storage_name, | ||
| int * | num_tag_storage_length, | ||
| int * | entity_type, | ||
| int * | tag_storage_data | ||
| ) |
Store the specified values in a MOAB integer Tag.
Values are set on vertices or elements, depending on entity_type
Operations: Collective
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | tag_storage_name | (iMOAB_String) The tag name to store/retreive the data in MOAB. |
| [in] | num_tag_storage_length | (int*) The size of tag storage data (e.g., num_visible_vertices*components_per_entity or num_visible_elements*components_per_entity). |
| [in] | entity_type | (int*) Type=0 for vertices, and Type=1 for primary elements. |
| [out] | tag_storage_data | (int*) The array data of type int to replace the internal tag memory; The data is assumed to be contiguous over the local set of visible entities (either vertices or elements). |
Definition at line 2199 of file iMOAB.cpp.
References appData::all_verts, GlobalContext::appDatas, context, MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, MB_TYPE_INTEGER, GlobalContext::MBI, appData::primary_elems, moab::Range::size(), moab::Interface::tag_get_data_type(), moab::Interface::tag_get_length(), moab::Interface::tag_set_data(), and appData::tagMap.
| ErrCode iMOAB_SynchronizeTags | ( | iMOAB_AppID | pid, |
| int * | num_tag, | ||
| int * | tag_indices, | ||
| int * | ent_type | ||
| ) |
Exchange tag values for the given tags across process boundaries.
| [in] | pid | (iMOAB_AppID) The unique pointer to the application ID. |
| [in] | num_tags | (int*) Number of tags to exchange. |
| [in] | tag_indices | (int*) Array with tag indices of interest (size = *num_tags). |
| [in] | ent_type | (int*) The type of entity for tag exchange. |
Definition at line 2788 of file iMOAB.cpp.
References appData::all_verts, GlobalContext::appDatas, context, moab::ParallelComm::exchange_tags(), MB_CHK_ERR, MB_SUCCESS, appData::primary_elems, appData::tagList, and UNUSED.
|
static |
Definition at line 991 of file iMOAB.cpp.
References GlobalContext::appDatas, context, moab::Remapper::CoveringMesh, appData::file_set, moab::ParallelComm::get_id(), moab::Interface::globalId_tag(), IMOAB_ASSERT, IMOAB_CHECKPOINTER, MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, GlobalContext::MBI, appData::pcomm, moab::Interface::tag_get_handle(), appData::tagList, appData::tagMap, and moab::Interface::write_file().
Referenced by iMOAB_WriteMesh().
|
static |
Definition at line 2047 of file iMOAB.cpp.
Referenced by iMOAB_DefineTagStorage(), iMOAB_GetDoubleTagStorage(), iMOAB_ReceiveElementTag(), iMOAB_SendElementTag(), iMOAB_SetDoubleTagStorage(), and iMOAB_SetDoubleTagStorageWithGid().
|
static |
Definition at line 1 of file iMOAB.cpp.
Referenced by iMOAB_ComputeCommGraph(), iMOAB_CreateElements(), iMOAB_CreateVertices(), iMOAB_DefineTagStorage(), iMOAB_DeregisterApplication(), iMOAB_DeregisterApplicationFortran(), iMOAB_DetermineGhostEntities(), iMOAB_Finalize(), iMOAB_FreeSenderBuffers(), iMOAB_GetBlockElementConnectivities(), iMOAB_GetBlockID(), iMOAB_GetBlockInfo(), iMOAB_GetDoubleTagStorage(), iMOAB_GetElementConnectivity(), iMOAB_GetElementID(), iMOAB_GetElementOwnership(), iMOAB_GetGlobalInfo(), iMOAB_GetIntTagStorage(), iMOAB_GetMeshInfo(), iMOAB_GetNeighborElements(), iMOAB_GetPointerToSurfaceBC(), iMOAB_GetPointerToVertexBC(), iMOAB_GetVertexID(), iMOAB_GetVertexOwnership(), iMOAB_GetVisibleElementsInfo(), iMOAB_GetVisibleVerticesCoordinates(), iMOAB_Initialize(), iMOAB_LoadMesh(), iMOAB_MergeVertices(), iMOAB_ReceiveElementTag(), iMOAB_ReceiveMesh(), iMOAB_ReduceTagsMax(), iMOAB_RegisterApplication(), iMOAB_RegisterApplicationFortran(), iMOAB_ResolveSharedEntities(), iMOAB_SendElementTag(), iMOAB_SendMesh(), iMOAB_SetDoubleTagStorage(), iMOAB_SetDoubleTagStorageWithGid(), iMOAB_SetGlobalInfo(), iMOAB_SetIntTagStorage(), iMOAB_SynchronizeTags(), iMOAB_UpdateMeshInfo(), iMOAB_WriteLocalMesh(), internal_WriteMesh(), and main().