MOAB: Mesh Oriented datABase  (version 5.2.1)
iMOAB.h
Go to the documentation of this file.
00001 #ifndef IMOAB_H
00002 #define IMOAB_H
00003 /** \file iMOAB.h
00004   iMOAB: a language-agnostic, lightweight interface to MOAB
00005 
00006   Supports usage from C/C++, Fortran (77/90/2003), Python
00007 
00008   \remark 1) All data in the interface are exposed via POD-types.
00009   \remark 2) Pass everything by reference, so we do not have to use %VAL()
00010   \remark 3) Arrays are allocated by the client code. No concerns about
00011      de-allocation of the data will be taken up by the interface.
00012   \remark 4) Always pass the pointer to the start of array along with the
00013      total allocated size for the array.
00014   \remark 5) Return the filled array requested by client along with
00015      optionally the actual length of the array that was filled.
00016      (for typical cases, should be the allocated length)
00017 */
00018 
00019 /** \Notes
00020   1) Fortran MPI_Comm won't work. Take an integer argument and use MPI_F2C calls to get the C-Comm object
00021   2) ReadHeaderInfo - Does it need the pid ?
00022   3) Reuse the comm object from the registration for both load and write operations.
00023      Do not take comm objects again to avoid confusion and retain consistency.
00024   4) Decipher the global comm object and the subset partioning for each application based on the comm object
00025   5) GetMeshInfo - return separately the owned and ghosted vertices/elements -- not together in visible_** but rather
00026      owned_** and ghosted_**. Make these arrays of size 2.
00027   6) Should we sort the vertices after ghosting, such that the locally owned is first, and the ghosted appended next.
00028   7) RCM only for the owned part of the mesh -- do not screw with the ghosted layers
00029   8) GetBlockID - identical to GetVertexID -- return the global numbering for block
00030   9) GetVertexID -- remember that the order of vertices returned have an implicit numbering embedded in it.
00031      DO NOT CHANGE THIS ORDERING...
00032   10) GetBlockInfo takes global Block ID; Remove blockname unless there is a separate use case for it..
00033   11) GetElementConnectivity - clarify whether we return global or local vertex numbering.
00034       Preferably local numbering else lot of deciphering for global.
00035 */
00036 #include "imoab_protos.h"
00037 
00038 #define iMOAB_AppID    int*
00039 #define iMOAB_String   char*
00040 #define iMOAB_GlobalID int
00041 #define iMOAB_LocalID  int
00042 #define ErrCode        int
00043 
00044 /*
00045  * tag types can be: dense/sparse, int/ double/entityhandle , they could be on both elements and vertices
00046  */
00047 enum MOAB_TAG_TYPE
00048 {
00049     DENSE_INTEGER = 0,
00050     DENSE_DOUBLE,
00051     DENSE_ENTITYHANDLE,
00052     SPARSE_INTEGER,
00053     SPARSE_DOUBLE,
00054     SPARSE_ENTITYHANDLE
00055 };
00056 
00057 enum MOAB_TAG_OWNER_TYPE
00058 {
00059     TAG_VERTEX = 0,
00060     TAG_EDGE,
00061     TAG_FACE,
00062     TAG_ELEMENT
00063 };
00064 
00065 #ifdef __cplusplus
00066 extern "C" {
00067 #endif
00068 
00069 /**
00070   \brief Initialize the iMOAB interface implementation.
00071 
00072    Will create the MOAB instance, if not created already (reference counted).
00073 
00074   <B>Operations:</B> Collective
00075 
00076   \param[in] argc (int)           Number of command line arguments
00077   \param[in] argv (iMOAB_String*) Command line arguments
00078 */
00079 ErrCode iMOAB_Initialize( int argc, iMOAB_String* argv );
00080 
00081 /**
00082   \brief Initialize the iMOAB interface implementation from Fortran driver.
00083 
00084    It will create the MOAB instance, if not created already (reference counted).
00085 
00086   <B>Operations:</B> Collective
00087 */
00088 ErrCode iMOAB_InitializeFortran();
00089 
00090 /**
00091   \brief Finalize the iMOAB interface implementation.
00092 
00093    It will delete the internally reference counted MOAB instance, if the reference count reaches 0.
00094 
00095   <B>Operations:</B> Collective
00096 */
00097 ErrCode iMOAB_Finalize();
00098 
00099 /**
00100   \brief Register application - Create a unique application ID and bootstrap interfaces for further queries.
00101 
00102   \note
00103   Internally, a mesh set will be associated with the application ID and all subsequent queries on the MOAB
00104   instance will be directed to this mesh/file set.
00105 
00106   <B>Operations:</B> Collective
00107 
00108   \param[in]  app_name (iMOAB_String) Application name (PROTEUS, NEK5000, etc)
00109   \param[in]  comm (MPI_Comm*)        MPI communicator to be used for all mesh-related queries originating from this
00110   application \param[in]  compid (int*)           external component id, unique identifier \param[out] pid (iMOAB_AppID)
00111   The unique pointer to the application ID
00112 */
00113 ErrCode iMOAB_RegisterApplication( const iMOAB_String app_name,
00114 #ifdef MOAB_HAVE_MPI
00115                                    MPI_Comm* comm,
00116 #endif
00117                                    int* compid, iMOAB_AppID pid );
00118 
00119 /**
00120    \brief Register a Fortran-based application - Create a unique application ID and bootstrap interfaces for further
00121   queries.
00122 
00123   \note
00124   Internally, the comm object, usually a 32 bit integer in Fortran, will be converted using MPI_Comm_f2c and stored as
00125   MPI_Comm. A mesh set will be associated with the application ID and all subsequent queries on the MOAB instance will
00126   be directed to this mesh/file set.
00127 
00128   <B>Operations:</B> Collective
00129 
00130   \param[in]  app_name (iMOAB_String) Application name (PROTEUS, NEK5000, etc)
00131   \param[in]  comm (int*)             Fortran MPI communicator to be used for all mesh-related queries originating from
00132   this application \param[in]  compid (int*)           external component id, unique identifier \param[out] pid
00133   (iMOAB_AppID)       The unique pointer to the application ID \param[in]  app_name_length (int)   Length of application
00134   name string.
00135 */
00136 ErrCode iMOAB_RegisterFortranApplication( const iMOAB_String app_name,
00137 #ifdef MOAB_HAVE_MPI
00138                                           int* comm,
00139 #endif
00140                                           int* compid, iMOAB_AppID pid, int app_name_length );
00141 
00142 /**
00143   \brief De-Register application: delete mesh (set) associated with the application ID.
00144 
00145   The associated communicator will be released, and all associated mesh entities and sets will be deleted from the
00146   mesh data structure. Associated tag storage data will be freed too.
00147 
00148   <B>Operations:</B> Collective
00149 
00150   \param[in] pid (iMOAB_AppID) The unique pointer to the application ID
00151 */
00152 ErrCode iMOAB_DeregisterApplication( iMOAB_AppID pid );
00153 
00154 /**
00155     \brief Get global information from the file.
00156 
00157     It should be called on master task only, and information obtained could be broadcasted by the user. It is a fast
00158     lookup in the header of the file.
00159 
00160   <B>Operations:</B> Not collective
00161 
00162   \param[in]  filename (iMOAB_String)    The MOAB mesh file (H5M) to probe for header information
00163   \param[out] num_global_vertices (int*) The total number of vertices in the mesh file
00164   \param[out] num_global_elements (int*) The total number of elements (of highest dimension only)
00165   \param[out] num_dimension (int*)       The highest dimension of elements in the mesh (Edge=1, Tri/Quad=2,
00166   Tet/Hex/Prism/Pyramid=3) \param[out] num_parts (int*)           The total number of partitions available in the mesh
00167   file, typically partitioned with mbpart during pre-processing \param[in]  filename_length (int)      Length of the
00168   file name string
00169 */
00170 ErrCode iMOAB_ReadHeaderInfo( const iMOAB_String filename, int* num_global_vertices, int* num_global_elements,
00171                               int* num_dimension, int* num_parts, int filename_length );
00172 
00173 /**
00174    \brief Load a MOAB mesh file in parallel and exchange ghost layers as requested.
00175 
00176    All communication is MPI-based, and read options include parallel loading information, resolving
00177    shared entities. Local MOAB instance is populated with mesh cells and vertices in the corresponding
00178    local partitions.
00179 
00180   \note
00181   This will also exchange ghost cells and vertices, as requested. The default bridge dimension is 0 (vertices),
00182   and all additional lower dimensional sub-entities are exchanged (mesh edges and faces). The tags in the file are not
00183   exchanged by default. Default tag information for GLOBAL_ID, MATERIAL_SET, NEUMANN_SET and DIRICHLET_SET is
00184   exchanged. Global ID tag is exchanged for all cells and vertices. Material sets, Neumann sets and Dirichlet sets
00185   are all augmented with the ghost entities.
00186 
00187   <B>Operations:</B> Collective
00188 
00189   \param[in] pid (iMOAB_AppID)            The unique pointer to the application ID
00190   \param[in] filename (iMOAB_String)      The MOAB mesh file (H5M) to load onto the internal application mesh set
00191   \param[in] read_options (iMOAB_String)  Additional options for reading the MOAB mesh file in parallel
00192   \param[in] num_ghost_layers (int*)      The total number of ghost layers to exchange during mesh loading
00193   \param[in] filename_length (int)        Length of the filename string
00194   \param[in] read_options_length (int)    Length of the read options string
00195 */
00196 ErrCode iMOAB_LoadMesh( iMOAB_AppID pid, const iMOAB_String filename, const iMOAB_String read_options,
00197                         int* num_ghost_layers, int filename_length, int read_options_length );
00198 
00199 /**
00200    \brief Create vertices for an app; it assumes no other vertices
00201 
00202 
00203   <B>Operations:</B> Not collective
00204 
00205   \param[in]  pid (iMOAB_AppID)                   The unique pointer to the application ID
00206   \param[in]  coords_len (int*)                   size of the coords array (nverts * dim)
00207   \param[in]  dim (int*)                          dimension (usually 3)
00208   \param[in]  coordinates (double*)               coordinates of all vertices, interleaved
00209 */
00210 ErrCode iMOAB_CreateVertices( iMOAB_AppID pid, int* coords_len, int* dim, double* coordinates );
00211 
00212 /**
00213    \brief Create elements for an app; it assumes connectivity from local vertices, in order
00214 
00215   <B>Operations:</B> Not collective
00216 
00217   \param[in]  pid (iMOAB_AppID)                   The unique pointer to the application ID
00218   \param[in]  num_elem (int*)                     number of elements
00219   \param[in]  type (int*)                         type of element (moab type)
00220   \param[in]  num_nodes_per_element (int*)        number of nodes per element
00221   \param[in]  connectivity (int *)                connectivity array, with respect to vertices; assumes vertices
00222   contiguous \param[in]  block_ID (int *)                    block_ID to which the elements will be added to
00223 */
00224 ErrCode iMOAB_CreateElements( iMOAB_AppID pid, int* num_elem, int* type, int* num_nodes_per_element, int* connectivity,
00225                               int* block_ID );
00226 
00227 /**
00228   \brief resolve shared entities using global markers on shared vertices.
00229 
00230   \note
00231   global markers can be a global node id, for example, or a global dof (as for homme)
00232 
00233   <B>Operations:</B> Collective .
00234 
00235   \param[in] pid (iMOAB_AppID)            The unique pointer to the application ID
00236   \param[in] num_verts (int*)             Number of vertices
00237   \param[in] marker (int*)                resolving marker (global id marker)
00238 */
00239 ErrCode iMOAB_ResolveSharedEntities( iMOAB_AppID pid, int* num_verts, int* marker );
00240 
00241 /**
00242   \brief create ghost layers.
00243 
00244   \note
00245   it assumes that the shared entities were resolved successfully, and that the mesh is properly
00246    distributed on separate tasks
00247 
00248   <B>Operations:</B> Collective .
00249 
00250   \param[in] pid (iMOAB_AppID)            The unique pointer to the application ID
00251   \param[in] ghost_dim (int*)             Desired ghost dimension (2 or 3, most of the time)
00252   \param[in] num_ghost_layers (int*)      Number of ghost layers requested
00253   \param[in] bridge_dim (int*)            Bridge dimension (0 for vertices, 1 for edges, 2 for faces)
00254 */
00255 ErrCode iMOAB_DetermineGhostEntities( iMOAB_AppID pid, int* ghost_dim, int* num_ghost_layers, int* bridge_dim );
00256 
00257 /**
00258   \brief Write a MOAB mesh along with the solution tags to a file.
00259 
00260   \note
00261   The interface will write one single file (H5M) and for serial files (VTK/Exodus), it will write one file per task.
00262   Write options include parallel write options, if needed. Only the mesh set and solution data associated to the
00263   application will be written to the file.
00264 
00265   <B>Operations:</B> Collective for parallel write, non collective for serial write.
00266 
00267   \param[in] pid (iMOAB_AppID)            The unique pointer to the application ID
00268   \param[in] filename (iMOAB_String)      The MOAB mesh file (H5M) to write all the entities contained in the internal
00269   application mesh set \param[in] write_options (iMOAB_String) Additional options for writing the MOAB mesh in parallel
00270   \param[in] filename_length (int)       Length of the filename string
00271   \param[in] write_options_length (int)  Length of the write options string
00272 */
00273 
00274 ErrCode iMOAB_WriteMesh( iMOAB_AppID pid, iMOAB_String filename, iMOAB_String write_options, int filename_length,
00275                          int write_options_length );
00276 
00277 /**
00278    \brief Update local mesh data structure, from file information.
00279 
00280    The method should be called after mesh modifications, for example reading a file or creating mesh in memory
00281   <B>Operations:</B> Not Collective
00282 
00283   \param[in]  pid (iMOAB_AppID)            The unique pointer to the application ID
00284 
00285 */
00286 ErrCode iMOAB_UpdateMeshInfo( iMOAB_AppID pid );
00287 
00288 /**
00289    \brief retrieve mesh information.
00290    Number of visible vertices and cells include ghost entities. All arrays returned have size 3.
00291    Local entities are first, then ghost entities are next. Shared vertices can be owned in MOAB sense by
00292    different tasks. Ghost vertices and cells are always owned by other tasks.
00293 
00294   <B>Operations:</B> Not Collective
00295 
00296   \param[in]  pid (iMOAB_AppID)            The unique pointer to the application ID
00297   \param[out] num_visible_vertices (int*)  The number of vertices in the current partition/process arranged as:
00298   owned/shared only, ghosted, total_visible (array allocated by client, <TT>size := 3</TT>) \param[out]
00299   num_visible_elements (int*)  The number of elements in current partition/process arranged as: owned only,
00300   ghosted/shared, total_visible (array allocated by client, <TT>size := 3</TT>) \param[out] num_visible_blocks (int*)
00301   The number of material sets in local mesh in current partition/process arranged as: owned only, ghosted/shared,
00302   total_visible (array allocated by client, <TT>size := 3</TT>) \param[out] num_visible_surfaceBC (int*) The number of
00303   mesh surfaces that have a NEUMANN_SET BC defined in local mesh in current partition/process arranged as: owned only,
00304   ghosted/shared, total_visible (array allocated by client, <TT>size := 3</TT>) \param[out] num_visible_vertexBC (int*)
00305   The number of vertices that have a DIRICHLET_SET BC defined in local mesh in current partition/process arranged as:
00306   owned only, ghosted/shared, total_visible (array allocated by client, <TT>size := 3</TT>)
00307 */
00308 ErrCode iMOAB_GetMeshInfo( iMOAB_AppID pid, int* num_visible_vertices, int* num_visible_elements,
00309                            int* num_visible_blocks, int* num_visible_surfaceBC, int* num_visible_vertexBC );
00310 
00311 /**
00312    \brief Get the global vertex IDs for all locally visible (owned and shared/ghosted) vertices.
00313 
00314    The array should be allocated by the client, sized with the total number of visible vertices from
00315    iMOAB_GetMeshInfo method.
00316 
00317   <B>Operations:</B> Not collective
00318 
00319   \param[in]  pid (iMOAB_AppID)                   The unique pointer to the application ID
00320   \param[in]  vertices_length (int*)              The allocated size of array (typical <TT>size :=
00321   num_visible_vertices</TT>) \param[out] global_vertex_ID (iMOAB_GlobalID*)  The global IDs for all locally visible
00322   vertices (array allocated by client)
00323 */
00324 ErrCode iMOAB_GetVertexID( iMOAB_AppID pid, int* vertices_length, iMOAB_GlobalID* global_vertex_ID );
00325 
00326 /**
00327    \brief Get vertex ownership information.
00328 
00329    For each vertex based on the local ID, return the process that owns the vertex (local, shared or ghost)
00330 
00331   \note
00332   Shared vertices could be owned by different tasks. Local and shared vertices are first, ghost vertices are next
00333   in the array. Ghost vertices are always owned by a different process ID. Array allocated by the client with
00334   total size of visible vertices.
00335 
00336   <B>Operations:</B> Not Collective
00337 
00338   \param[in]  pid (iMOAB_AppID)             The unique pointer to the application ID
00339   \param[in]  vertices_length (int*)         The allocated size of array (typically <TT>size :=
00340   num_visible_vertices</TT>) \param[out] visible_global_rank_ID (int*) The processor rank owning each of the local
00341   vertices
00342 */
00343 ErrCode iMOAB_GetVertexOwnership( iMOAB_AppID pid, int* vertices_length, int* visible_global_rank_ID );
00344 
00345 /**
00346   \brief Get vertex coordinates for all local (owned and ghosted) vertices.
00347 
00348   \note coordinates are returned in an array allocated by client, interleaved. (do need an option for blocked
00349   coordinates ?) size of the array is dimension times number of visible vertices. The local ordering is implicit,
00350   owned/shared vertices are first, then ghosts.
00351 
00352   <B>Operations:</B> Not Collective
00353 
00354   \param[in]  pid (iMOAB_AppID)     The unique pointer to the application ID
00355   \param[in]  coords_length (int*)   The size of the allocated coordinate array (array allocated by client, <TT>size :=
00356   3*num_visible_vertices</TT>) \param[out] coordinates (double*) The pointer to client allocated memory that will be
00357   filled with interleaved coordinates
00358 
00359 */
00360 ErrCode iMOAB_GetVisibleVerticesCoordinates( iMOAB_AppID pid, int* coords_length, double* coordinates );
00361 
00362 /**
00363   \brief Get the global block IDs for all locally visible (owned and shared/ghosted) blocks.
00364 
00365   Block IDs are corresponding to MATERIAL_SET tags for material sets. Usually the block ID is exported from Cubit
00366   as a unique integer value. First blocks are local, and next blocks are fully ghosted. First blocks have at least
00367   one owned cell/element, ghost blocks have only ghost cells. Internally, a block corresponds to a mesh set with a
00368   MATERIAL_SET tag value equal to the block ID.
00369 
00370   <B>Operations:</B> Not Collective
00371 
00372   \param[in]  pid (iMOAB_AppID)                  The unique pointer to the application ID
00373   \param[in]  block_length (int*)                The allocated size of array (typical <TT>size :=
00374   num_visible_blocks</TT>) \param[out] global_block_IDs (iMOAB_GlobalID*) The global IDs for all locally visible blocks
00375   (array allocated by client)
00376 */
00377 ErrCode iMOAB_GetBlockID( iMOAB_AppID pid, int* block_length, iMOAB_GlobalID* global_block_IDs );
00378 
00379 /**
00380   \brief Get the global block information and number of visible elements of belonging to a block (MATERIAL SET).
00381 
00382   A block has to be homogeneous, it can contain elements of a single type
00383 
00384   <B>Operations:</B> Not Collective
00385 
00386   \param[in]  pid (iMOAB_AppID)                 The unique pointer to the application ID
00387   \param[in]  global_block_ID (iMOAB_GlobalID)  The global block ID of the set to be queried
00388   \param[out] vertices_per_element (int*)       The number of vertices per element
00389   \param[out] num_elements_in_block (int*)      The number of elements in block
00390 */
00391 ErrCode iMOAB_GetBlockInfo( iMOAB_AppID pid, iMOAB_GlobalID* global_block_ID, int* vertices_per_element,
00392                             int* num_elements_in_block );
00393 
00394 /**
00395   \brief Get the visible elements information.
00396 
00397   Return for all visible elements the global IDs, ranks they belong to, block ids they belong to.
00398   \note : should we return also the index for each block?
00399 
00400   <B>Operations:</B> Not Collective
00401 
00402   \param[in]  pid (iMOAB_AppID)                     The unique pointer to the application ID
00403   \param[in]  num_visible_elements (int*)           The number of visible elements (returned by GetMeshInfo)
00404   \param[out] element_global_IDs (iMOAB_GlobalID*)  element global ids
00405   \param[out] ranks (int*)                          The owning ranks of elements
00406   \param[out] block_IDs (iMOAB_GlobalID*)           The block ids the elements belong to
00407 */
00408 ErrCode iMOAB_GetVisibleElementsInfo( iMOAB_AppID pid, int* num_visible_elements, iMOAB_GlobalID* element_global_IDs,
00409                                       int* ranks, iMOAB_GlobalID* block_IDs );
00410 
00411 /**
00412   \brief Get the connectivities for elements within a certain block.
00413 
00414   \note input is the block ID. Should we change to visible block local index?
00415 
00416   <B>Operations:</B> Not Collective
00417 
00418   \param[in]  pid (iMOAB_AppID)                 The unique pointer to the application ID
00419   \param[in]  global_block_ID (iMOAB_GlobalID*) The global block ID of the set being queried
00420   \param[in]  connectivity_length (int*)        The allocated size of array (typical <TT>size :=
00421   vertices_per_element*num_elements_in_block</TT>) \param[out] element_connectivity (int*)       The connectivity array
00422   to store element ordering in MOAB canonical numbering scheme (array allocated by client); array contains vertex
00423   indices in the local numbering order for vertices elements are in the same order as provided by GetElementOwnership
00424   and GetElementID
00425 */
00426 ErrCode iMOAB_GetBlockElementConnectivities( iMOAB_AppID pid, iMOAB_GlobalID* global_block_ID, int* connectivity_length,
00427                                              int* element_connectivity );
00428 
00429 /**
00430   \brief Get the connectivity for one element only.
00431 
00432   \note it was added for convenience, it should not be needed.
00433 
00434   <B>Operations:</B> Not Collective
00435   \param[in]  pid (iMOAB_AppID)                 The unique pointer to the application ID.
00436   \param[in]  elem_index (iMOAB_LocalID *)      Local element index.
00437   \param[in,out] connectivity_length (int *)     On input, maximum length of connectivity. On output, actual length.
00438   \param[out] element_connectivity (int*)       The connectivity array to store connectivity in MOAB canonical numbering
00439   scheme. Array contains vertex indices in the local numbering order for vertices
00440 
00441 */
00442 ErrCode iMOAB_GetElementConnectivity( iMOAB_AppID pid, iMOAB_LocalID* elem_index, int* connectivity_length,
00443                                       int* element_connectivity );
00444 
00445 /**
00446   \brief Get the element ownership within a certain block i.e., processor ID of the element owner.
00447 
00448   \note : Should we use local block index for input, instead of the global block ID ?
00449 
00450   <B>Operations:</B> Not Collective
00451 
00452   \param[in]  pid (iMOAB_AppID)                 The unique pointer to the application ID
00453   \param[in]  global_block_ID (iMOAB_GlobalID)  The global block ID of the set being queried
00454   \param[in]  num_elements_in_block (int*)      The allocated size of ownership array, same as
00455   <TT>num_elements_in_block</TT> returned from GetBlockInfo() \param[out] element_ownership (int*)          The
00456   ownership array to store processor ID for all elements (array allocated by client)
00457 */
00458 ErrCode iMOAB_GetElementOwnership( iMOAB_AppID pid, iMOAB_GlobalID* global_block_ID, int* num_elements_in_block,
00459                                    int* element_ownership );
00460 
00461 /**
00462   \brief Get the global IDs for all locally visible elements belonging to a particular block.
00463 
00464   The method will return also the local index of each element, in the local range that contains all visible elements
00465 
00466   <B>Operations:</B> Not Collective
00467 
00468   \param[in]  pid (iMOAB_AppID)                   The unique pointer to the application ID
00469   \param[in]  global_block_ID (iMOAB_GlobalID*)   The global block ID of the set being queried
00470   \param[in]  num_elements_in_block (int*)        The allocated size of global element ID array, same as
00471   <TT>num_elements_in_block</TT> returned from GetBlockInfo() \param[out] global_element_ID (iMOAB_GlobalID*) The global
00472   IDs for all locally visible elements (array allocated by client) \param[out] local_element_ID (iMOAB_LocalID*)
00473   (<I><TT>Optional</TT></I>) The local IDs for all locally visible elements (index in the range of all primary elements
00474   in the rank)
00475 */
00476 ErrCode iMOAB_GetElementID( iMOAB_AppID pid, iMOAB_GlobalID* global_block_ID, int* num_elements_in_block,
00477                             iMOAB_GlobalID* global_element_ID, iMOAB_LocalID* local_element_ID );
00478 
00479 /**
00480   \brief Get the surface boundary condition information.
00481 
00482   <B>Operations:</B> Not Collective
00483 
00484   \param[in]  pid (iMOAB_AppID)                   The unique pointer to the application ID
00485   \param[in]  surface_BC_length (int*)             The allocated size of surface boundary condition array, same as
00486   <TT>num_visible_surfaceBC</TT> returned by GetMeshInfo() \param[out] local_element_ID (iMOAB_LocalID*)   The local
00487   element IDs that contains the side with the surface BC \param[out] reference_surface_ID (int*)         The surface
00488   number with the BC in the canonical reference element (e.g., 1 to 6 for HEX, 1-4 for TET) \param[out]
00489   boundary_condition_value (int*)     The boundary condition type as obtained from the mesh description (value of the
00490   NeumannSet defined on the element)
00491 */
00492 ErrCode iMOAB_GetPointerToSurfaceBC( iMOAB_AppID pid, int* surface_BC_length, iMOAB_LocalID* local_element_ID,
00493                                      int* reference_surface_ID, int* boundary_condition_value );
00494 
00495 /**
00496   \brief Get the vertex boundary condition information
00497 
00498   <B>Operations:</B> Not Collective
00499 
00500   \param[in]  pid (iMOAB_AppID)                   The unique pointer to the application ID
00501   \param[in]  vertex_BC_length (int)              The allocated size of vertex boundary condition array, same as
00502   <TT>num_visible_vertexBC</TT> returned by GetMeshInfo() \param[out] local_vertex_ID (iMOAB_LocalID*)    The local
00503   vertex ID that has Dirichlet BC defined \param[out] boundary_condition_value (int*)     The boundary condition type as
00504   obtained from the mesh description (value of the Dirichlet_Set tag defined on the vertex)
00505 */
00506 ErrCode iMOAB_GetPointerToVertexBC( iMOAB_AppID pid, int* vertex_BC_length, iMOAB_LocalID* local_vertex_ID,
00507                                     int* boundary_condition_value );
00508 
00509 /**
00510   \brief Define a MOAB Tag corresponding to the application depending on requested types.
00511 
00512   \note
00513   In MOAB, for most solution vectors, we only need to create a "Dense", "Double" Tag. A sparse tag can
00514   be created too. If the tag is already existing in the file, it will not be created. If it is a new tag,
00515   memory will be allocated when setting the values. Default values are 0 for for integer tags, 0.0 for double tags,
00516   0 for entity handle tags.
00517 
00518   <B>Operations:</B> Collective
00519 
00520    \param[in] pid (iMOAB_AppID)               The unique pointer to the application ID
00521    \param[in] tag_storage_name (iMOAB_String) The tag name to store/retrieve the data in MOAB
00522    \param[in] tag_type (int*)                 The type of MOAB tag (Dense/Sparse, Double/Int/EntityHandle), enum
00523   MOAB_TAG_TYPE \param[in] components_per_entity (int*)    The total size of vector dimension per entity for the tag
00524   (e.g., number of doubles per entity) \param[out] tag_index (int*)               The tag index which can be used as
00525   identifier in synchronize methods \param[in] tag_storage_name_length (int)   The length of the tag_storage_name string
00526 */
00527 ErrCode iMOAB_DefineTagStorage( iMOAB_AppID pid, const iMOAB_String tag_storage_name, int* tag_type,
00528                                 int* components_per_entity, int* tag_index, int tag_storage_name_length );
00529 
00530 /**
00531     \brief Store the specified values in a MOAB integer Tag.
00532 
00533     Values are set on vertices or elements, depending on entity_type
00534 
00535    \note we could change the api to accept as input the tag index, as returned by iMOAB_DefineTagStorage.
00536 
00537    <B>Operations:</B> Collective
00538 
00539    \param[in]  pid (iMOAB_AppID)                       The unique pointer to the application ID
00540    \param[in]  tag_storage_name (iMOAB_String)         The tag name to store/retreive the data in MOAB
00541    \param[in]  num_tag_storage_length (int*)           The size of tag storage data (e.g.,
00542    num_visible_vertices*components_per_entity or num_visible_elements*components_per_entity) \param[in]  entity_type
00543    (int*)                      type 0 for vertices, 1 for primary elements \param[out] tag_storage_data (int*) The array
00544    data of type <I>int</I> to replace the internal tag memory; The data is assumed to be contiguous over the local set
00545    of visible entities (either vertices or elements) \param[in]  tag_storage_name_length (iMOAB_String)  The length of
00546    the tag_storage_name string
00547 */
00548 ErrCode iMOAB_SetIntTagStorage( iMOAB_AppID pid, const iMOAB_String tag_storage_name, int* num_tag_storage_length,
00549                                 int* entity_type, int* tag_storage_data, int tag_storage_name_length );
00550 
00551 /**
00552    \brief Get the specified values in a MOAB integer Tag.
00553 
00554    <B>Operations:</B> Collective
00555 
00556    \param[in]  pid (iMOAB_AppID)                       The unique pointer to the application ID
00557    \param[in]  tag_storage_name (iMOAB_String)         The tag name to store/retreive the data in MOAB
00558    \param[in]  num_tag_storage_length (int*)            The size of tag storage data (e.g.,
00559    num_visible_vertices*components_per_entity or num_visible_elements*components_per_entity) \param[in]  entity_type
00560    (int*)                      type 0 for vertices, 1 for primary elements \param[out] tag_storage_data (int*) The array
00561    data of type <I>int</I> to be copied from the internal tag memory; The data is assumed to be contiguous over the
00562    local set of visible entities (either vertices or elements) \param[in]  tag_storage_name_length (iMOAB_String)  The
00563    length of the tag_storage_name string
00564 */
00565 ErrCode iMOAB_GetIntTagStorage( iMOAB_AppID pid, const iMOAB_String tag_storage_name, int* num_tag_storage_length,
00566                                 int* entity_type, int* tag_storage_data, int tag_storage_name_length );
00567 
00568 /**
00569    \brief Store the specified values in a MOAB double Tag.
00570 
00571    <B>Operations:</B> Collective
00572 
00573    \param[in]  pid (iMOAB_AppID)                       The unique pointer to the application ID
00574    \param[in]  tag_storage_name (iMOAB_String)         The tag name to store/retreive the data in MOAB
00575    \param[in]  num_tag_storage_length (int*)            The size of tag storage data (e.g.,
00576    num_visible_vertices*components_per_entity or num_visible_elements*components_per_entity) \param[in]  entity_type
00577    (int*)                      type 0 for vertices, 1 for primary elements \param[out] tag_storage_data (double*) The
00578    array data of type <I>double</I> to replace the internal tag memory; The data is assumed to be contiguous over the
00579    local set of visible entities (either vertices or elements) \param[in]  tag_storage_name_length (iMOAB_String)  The
00580    length of the tag_storage_name string
00581 */
00582 ErrCode iMOAB_SetDoubleTagStorage( iMOAB_AppID pid, const iMOAB_String tag_storage_name, int* num_tag_storage_length,
00583                                    int* entity_type, double* tag_storage_data, int tag_storage_name_length );
00584 
00585 /**
00586    \brief Retrieve the specified values in a MOAB double Tag.
00587 
00588    <B>Operations:</B> Collective
00589 
00590    \param[in]  pid (iMOAB_AppID)                The unique pointer to the application ID
00591    \param[in]  tag_storage_name (iMOAB_String)  The tag name to store/retreive the data in MOAB
00592    \param[in]  num_tag_storage_length (int)     The size of tag storage data (e.g.,
00593    num_visible_vertices*components_per_entity or num_visible_elements*components_per_entity) \param[in]  entity_type
00594    (int*)                      type 0 for vertices, 1 for primary elements \param[out] tag_storage_data (double*) The
00595    array data of type <I>double</I> to be copied from the internal tag memory; The data is assumed to be contiguous over
00596    the local set of visible entities (either vertices or elements) \param[in]  tag_storage_name_length (int)    The
00597    length of the tag_storage_name string
00598 */
00599 ErrCode iMOAB_GetDoubleTagStorage( iMOAB_AppID pid, const iMOAB_String tag_storage_name, int* num_tag_storage_length,
00600                                    int* entity_type, double* tag_storage_data, int tag_storage_name_length );
00601 
00602 /**
00603    \fn ErrCode iMOAB_SynchronizeTags(iMOAB_AppID pid,  int * num_tags, int * tag_indices, int * ent_type )
00604    \brief Exchange tag values for given tags
00605 
00606    <B>Operations:</B> Collective
00607 
00608    \param[in]  pid (iMOAB_AppID)                The unique pointer to the application ID
00609    \param[in]  num_tags (int*)                  Number of tags to exchange
00610    \param[in]  tag_indices (int*)               Array with tag indices of interest (size  = *num_tags)
00611    \param[in]  ent_type (int*)                  type of entity for tag exchange
00612   */
00613 ErrCode iMOAB_SynchronizeTags( iMOAB_AppID pid, int* num_tag, int* tag_indices, int* ent_type );
00614 
00615 /**
00616    \fn ErrCode iMOAB_ReduceTagsMax(iMOAB_AppID pid,  int * tag_index, int * ent_type )
00617    \brief reduce max tag for a given tag
00618 
00619    <B>Operations:</B> Collective
00620 
00621    \param[in]  pid (iMOAB_AppID)                The unique pointer to the application ID
00622    \param[in]  tag_index   (int*)               tag index of interest
00623    \param[in]  ent_type (int*)                  type of entity for tag reduce 0 verts, 1 elems
00624   */
00625 ErrCode iMOAB_ReduceTagsMax( iMOAB_AppID pid, int* tag_index, int* ent_type );
00626 
00627 /**
00628    \brief retrieve the adjacencies for the element entities.
00629 
00630    <B>Operations:</B> Not Collective
00631 
00632    \param[in]  pid (iMOAB_AppID)                      The unique pointer to the application ID
00633    \param[in]  local_index (iMOAB_LocalID*)           The local element ID for which adjacency information is needed
00634    \param[out] num_adjacent_elements (int*)           The total number of adjacent elements
00635    \param[out] adjacent_element_IDs (iMOAB_LocalID*)  The local element IDs of all adjacent elements to the current one
00636    (typically, num_total_sides for internal elements or num_total_sides-num_sides_on_boundary for boundary elements)
00637 */
00638 ErrCode iMOAB_GetNeighborElements( iMOAB_AppID pid, iMOAB_LocalID* local_index, int* num_adjacent_elements,
00639                                    iMOAB_LocalID* adjacent_element_IDs );
00640 
00641 /**
00642    \brief Get the adjacencies for the vertex entities. (not implemented yet)
00643 
00644    <B>Operations:</B> Not Collective
00645 
00646    \param[in]  pid (iMOAB_AppID)                      The unique pointer to the application ID
00647    \param[in]  local_vertex_ID (iMOAB_LocalID*)       The local vertex ID for which adjacency information is needed
00648    \param[out] num_adjacent_vertices (int*)           The total number of adjacent vertices
00649    \param[out] adjacent_vertex_IDs (iMOAB_LocalID*)   The local element IDs of all adjacent vertices to the current one
00650    (typically, num_total_sides for internal elements or num_total_sides-num_sides_on_boundary for boundary elements)
00651 */
00652 ErrCode iMOAB_GetNeighborVertices( iMOAB_AppID pid, iMOAB_LocalID* local_vertex_ID, int* num_adjacent_vertices,
00653                                    iMOAB_LocalID* adjacent_vertex_IDs );
00654 
00655 /**
00656    \brief Set global information for number of vertices and number of elements
00657    it is usually available from hdf5 file or it can be computed with MPI_Reduce
00658    \param[in]  pid (iMOAB_AppID)                      The unique pointer to the application ID
00659    \param[in]  num_global_verts (int*)                number of total vertices
00660    \param[in]  global (MPI_Comm)                      number of total elements
00661  */
00662 
00663 ErrCode iMOAB_SetGlobalInfo( iMOAB_AppID pid, int* num_global_verts, int* num_global_elems );
00664 
00665 /**
00666    \brief Get global information about number of vertices and number of elements
00667    \param[in]  pid (iMOAB_AppID)                      The unique pointer to the application ID
00668    \param[in]  num_global_verts (int*)                number of total vertices
00669    \param[in]  global (MPI_Comm)                      number of total elements
00670  */
00671 ErrCode iMOAB_GetGlobalInfo( iMOAB_AppID pid, int* num_global_verts, int* num_global_elems );
00672 
00673 #ifdef MOAB_HAVE_MPI
00674 /**
00675   \brief migrate (send) a set of elements from a group of tasks (senders) to another group of tasks (receivers)
00676   <B>Operations:</B>  Collective on sender group
00677 
00678    \param[in]  pid (iMOAB_AppID)                      The unique pointer to the application ID source mesh
00679    \param[in]  join (MPI_Comm)                        communicator that overlaps both groups
00680    \param[in]  receivingGroup (MPI_Group *)           receiving group
00681    \param[in]  rcompid  (int*)                        external id of application that receives the mesh
00682    \param[in]  method (int*)                          method of partitioning (0 trivial, 1 graph, 2 geometric)
00683  */
00684 
00685 ErrCode iMOAB_SendMesh( iMOAB_AppID pid, MPI_Comm* join, MPI_Group* receivingGroup, int* rcompid, int* method );
00686 
00687 /**
00688    \brief during nonblocking send, buffers were allocated, to keep data until received
00689    Free them after requests are completed
00690    \param[in]  pid (iMOAB_AppID)                      The unique pointer to the application ID sender mesh
00691    \param[in]  context_id  (int*)                     context used for sending, to identify the communication graph
00692    */
00693 
00694 ErrCode iMOAB_FreeSenderBuffers( iMOAB_AppID pid, int* context_d );
00695 
00696 /**
00697   \brief migrate (receive) a set of elements from a sender group of tasks
00698   <B>Operations:</B>  Collective on receiver group
00699 
00700    \param[in]  pid (iMOAB_AppID)                      The unique pointer to the application ID  mesh (receiver)
00701    \param[in]  join (MPI_Comm)                        communicator that overlaps both groups
00702    \param[in]  sendingGroup (MPI_Group *)             sending group
00703    \param[in]  scompid ( int *)                       external id of application that sends the mesh
00704  */
00705 
00706 ErrCode iMOAB_ReceiveMesh( iMOAB_AppID pid, MPI_Comm* join, MPI_Group* sendingGroup, int* scompid );
00707 
00708 /**
00709   \brief migrate (send) a list of tags, from a sender group of tasks to a receiver group of tasks
00710   <B>Operations:</B> Collective over the sender group, nonblocking sends
00711 
00712    \param[in]  pid (iMOAB_AppID)                      The unique pointer to the application ID source mesh
00713    \param[in]  tag_storage_name(const iMOAB_String)   name of the tags; concatenated, separated by ";"
00714    \param[in]  join (MPI_Comm)                        communicator that overlaps both groups
00715    \param[in]  context_id (int*)                      id of the other component in intersection; -1 if original migrate
00716    \param[in]  tag_storage_name_length (int)          The length of the tag_storage_name string
00717  */
00718 
00719 ErrCode iMOAB_SendElementTag( iMOAB_AppID pid, const iMOAB_String tag_storage_name, MPI_Comm* join, int* context_id,
00720                               int tag_storage_name_length );
00721 
00722 /**
00723   \brief migrate (receive) a list of tags, from a sender group of tasks to a receiver group of tasks
00724   <B>Operations:</B> Collective over the receiver group, blocking receives
00725 
00726    \param[in]  pid (iMOAB_AppID)                      The unique pointer to the application ID  mesh (receiver)
00727    \param[in]  tag_storage_name (iMOAB_String)        name of the tags to be received; concatenated, separated by ";"
00728    \param[in]  join (MPI_Comm)                        communicator that overlaps both groups
00729    \param[in]  context_id (int*)                      id of the other component in intersection; -1 if original migrate
00730    \param[in]  tag_storage_name_length (int)          The length of the tag_storage_name string
00731  */
00732 ErrCode iMOAB_ReceiveElementTag( iMOAB_AppID pid, const iMOAB_String tag_storage_name, MPI_Comm* join, int* context_id,
00733                                  int tag_storage_name_length );
00734 
00735 /**
00736 \brief compute a comm graph between 2 moab apps, based on ID matching
00737 <B>Operations:</B> Collective
00738 
00739  \param[in]  pid1 (iMOAB_AppID)                     The unique pointer to the first application ID
00740  \param[in]  pid2 (iMOAB_AppID)                     The unique pointer to the second application ID
00741  \param[in]  join (MPI_Comm)                        communicator that overlaps both groups
00742  \param[in]  group1 (MPI_Group *)                   MPI group for first comp
00743  \param[in]  group2 (MPI_Group *)                   MPI group for second comp
00744  \param[in]  type1 (int *)                          type of mesh (spectral with GLOBAL_DOFS, etc)
00745  \param[in]  type2 (int *)                          type of mesh (point cloud with GLOBAL_ID, etc)
00746  \param[in]  comp1 (int*)                           id of the component 1
00747  \param[in]  cpmp2 (int*)                           id of the component 2
00748 
00749 */
00750 ErrCode iMOAB_ComputeCommGraph( iMOAB_AppID pid1, iMOAB_AppID pid2, MPI_Comm* join, MPI_Group* group1,
00751                                 MPI_Group* group2, int* type1, int* type2, int* comp1, int* comp2 );
00752 
00753 /**
00754   \brief Recompute the communication graph between component and coupler, considering intersection coverage .
00755   \note
00756   Original communication graph for source used an initial partition, while during intersection some of the source
00757   elements were sent to multiple tasks; send back the intersection coverage information for a direct communication
00758   between source cx mesh on coupler tasks and source cc mesh on interested tasks on the component.
00759   The intersection tasks will send to the original source component tasks, in a nonblocking way, the ids of all the
00760 cells involved in intersection with the target cells. The new ParCommGraph between cc source mesh and cx source mesh
00761 will be used just for tag migration, later on; The original ParCommGraph will stay unchanged, because this source mesh
00762 could be used for other intersection (atm with lnd) ? on component source tasks, we will wait for information; from each
00763 intx task, will receive cells ids involved in intx \param[in]  join (MPI_Comm)                        communicator that
00764 overlaps component source PEs and coupler PEs \param[in]  pid_src (iMOAB_AppID)                  moab id for the
00765 component mesh on component PE \param[in]  pid_migr (iMOAB_AppID)                 moab id for the migrated mesh on
00766 coupler PEs \param[in]  pid_intx (iMOAB_AppID)                 moab id for intersection mesh (on coupler PEs) \param[in]
00767 context_id (int*)                      id of the other component in intersection
00768   */
00769 ErrCode iMOAB_CoverageGraph( MPI_Comm* join, iMOAB_AppID pid_src, iMOAB_AppID pid_migr, iMOAB_AppID pid_intx,
00770                              int* context_id );
00771 
00772 /**
00773   \brief Dump info about communication graph.
00774   <B>Operations:</B> Collective per sender or receiver group
00775 
00776   \param[in] pid  (iMOAB_AppID)                            The unique pointer to the application ID
00777   \param[in] context_id  (int*)                            context id names are separated by ";", the same way as for
00778   tag migration \param[in] is_sender (int*)                              is it called from sender or receiver side
00779   \param[in] prefix  (iMOAB_String)                        prefix for file names; to differentiate stages
00780   \param[in] prefix_len   (int)                            The length of the prefix string
00781 */
00782 ErrCode iMOAB_DumpCommGraph( iMOAB_AppID pid, int* context_id, int* is_sender, const iMOAB_String prefix,
00783                              int prefix_length );
00784 
00785 /**
00786   \brief merge vertices in an explicit, parallel mesh; it will also reassign global IDs on vertices,
00787      and resolve parallel sharing of vertices
00788    <B>Operations:</B> Collective
00789 
00790    \param[in]  pid1 (iMOAB_AppID)                     The unique pointer to the application ID
00791 */
00792 ErrCode iMOAB_MergeVertices( iMOAB_AppID pid );
00793 
00794 #endif  // #ifdef MOAB_HAVE_MPI
00795 #ifdef MOAB_HAVE_TEMPESTREMAP
00796 
00797 /**
00798   \brief Compute intersection of the surface meshes defined on a sphere. The resulting intersected mesh consists
00799   of (convex) polygons with 1-1 associativity with both the source and destination meshes provided.
00800 
00801   \note
00802   The mesh intersection between two heterogeneous resolutions will be computed and stored in the fileset corresponding
00803   to the \p pid_intx application. This intersection data can be used to compute solution projection weights between
00804   these meshes.
00805 
00806   <B>Operations:</B> Collective on coupler tasks
00807 
00808   \param[in]  pid_source (iMOAB_AppID)               The unique pointer to the source application ID
00809   \param[in]  pid_target (iMOAB_AppID)               The unique pointer to the destination application ID
00810   \param[in/out] pid_intersection (iMOAB_AppID)      The unique pointer to the intersection application ID
00811   \param[in] radius_source (double *)                The radius of the sphere on which the source mesh is defined
00812   \param[in] radius_target (double *)                The radius of the sphere on which the target mesh is defined
00813   \param[in] epsrel (double *)                       The relative tolerance to be used to compute the mesh intersectoin
00814   between source and target meshes \param[in] boxeps (double *)                       The tolerance to be used to
00815   compute the box mesh
00816 */
00817 ErrCode iMOAB_ComputeMeshIntersectionOnSphere( iMOAB_AppID pid_source, iMOAB_AppID pid_target,
00818                                                iMOAB_AppID pid_intersection );
00819 
00820 /**
00821   \brief Compute the intersection of DoFs corresponding to surface meshes defined on a sphere. The resulting intersected
00822   mesh essentially contains a communication pattern or a permutation matrix that couples both the source and destination
00823   DoFs.
00824 
00825   <B>Operations:</B> Collective on coupler tasks
00826 
00827   \param[in]  pid_source (iMOAB_AppID)               The unique pointer to the source application ID
00828   \param[in]  pid_target (iMOAB_AppID)               The unique pointer to the destination application ID
00829   \param[in/out] pid_intersection (iMOAB_AppID)      The unique pointer to the intersection application ID
00830 */
00831 ErrCode iMOAB_ComputePointDoFIntersection( iMOAB_AppID pid_src, iMOAB_AppID pid_tgt, iMOAB_AppID pid_intx );
00832 
00833 #ifdef MOAB_HAVE_NETCDF
00834 
00835 /**
00836   \brief Load the projection weights from disk to transfer a solution from a source surface mesh to a destination mesh defined on a sphere.
00837   The intersection of the mesh should be computed a-priori.
00838 
00839   <B>Operations:</B> Collective
00840 
00841   \param[in/out] pid_intersection (iMOAB_AppID)           The unique pointer to the application ID to store the map
00842   \param[in] solution_weights_identifier  (iMOAB_String)  The unique identifier used to store the computed projection weights locally. Typically,
00843                                                           values could be identifiers such as "scalar", "flux" or "custom".
00844   \param[in] remap_weights_filename  (iMOAB_String)       The filename path to the mapping file to load in memory.
00845   \param[in] owned_dof_ids   (int *)                      The list of DoF global IDs that the current process owns and expects back from the root process
00846   \param[in] owned_dof_ids_length   (int *)               The length of the owned_dof_ids parameter array
00847   \param[in] row_major_ownership   (int *)                The flag to indicate whether specified global IDs correspond to source (0) or target grid (1)
00848   \param[in] remap_weights_filename_length   (int)        The length of the mapping file name string
00849   \param[in] solution_weights_identifier_length   (int)   The length of the solution weights identifier string
00850 */
00851 ErrCode iMOAB_LoadMappingWeightsFromFile ( iMOAB_AppID pid_intersection,
00852                                            const iMOAB_String solution_weights_identifier, /* "scalar", "flux", "custom" */
00853                                            const iMOAB_String remap_weights_filename,
00854                                            int* owned_dof_ids,
00855                                            int* owned_dof_ids_length,
00856                                            int* row_major_ownership,
00857                                            int solution_weights_identifier_length,
00858                                            int remap_weights_filename_length );
00859 
00860 /**
00861   \brief Write the projection weights to disk in order to transfer a solution from a source surface mesh to a destination mesh defined on a sphere.
00862 
00863   <B>Operations:</B> Collective
00864 
00865   \param[in/out] pid_intersection (iMOAB_AppID)           The unique pointer to the application ID to store the map
00866   \param[in] solution_weights_identifier  (iMOAB_String)  The unique identifier used to store the computed projection weights locally. Typically,
00867                                                           values could be identifiers such as "scalar", "flux" or "custom".
00868   \param[in] remap_weights_filename  (iMOAB_String)       The filename path to the mapping file to load in memory.
00869   \param[in] remap_weights_filename_length   (int)        The length of the mapping file name string
00870   \param[in] solution_weights_identifier_length   (int)   The length of the solution weights identifier string
00871 */
00872 ErrCode iMOAB_WriteMappingWeightsToFile ( iMOAB_AppID pid_intersection,
00873                                           const iMOAB_String solution_weights_identifier, /* "scalar", "flux", "custom" */
00874                                           const iMOAB_String remap_weights_filename,
00875                                           int solution_weights_identifier_length,
00876                                           int remap_weights_filename_length );
00877 
00878 #endif
00879 
00880 /**
00881   \brief Compute the projection weights to transfer a solution from a source surface mesh to a destination mesh defined
00882   on a sphere. The intersection of the mesh should be computed a-priori.
00883 
00884   \note
00885   The mesh intersection data-structure is used along with conservative remapping techniques in TempestRemap to compute
00886   the projection weights for transferring the tag (\p soln_tag_name) from \p pid_src to \p pid_target applications.
00887 
00888   <B>Operations:</B> Collective
00889 
00890   \param[in/out] pid_intersection (iMOAB_AppID)            The unique pointer to the intersection application ID
00891   \param[in] solution_weights_identifier  (iMOAB_String)   The unique identifier used to store the computed projection weights locally. Typically,
00892                                                            values could be identifiers such as "scalar", "flux" or "custom".
00893   \param[in] disc_method_source  (iMOAB_String)            The discretization type ("fv", "cgll", "dgll") for the solution field on the source grid
00894   \param[in] disc_order_source   (int *)                   The discretization order for the solution field on the source grid
00895   \param[in] disc_method_target  (iMOAB_String)            The discretization type ("fv", "cgll", "dgll") for the solution field on the source grid
00896   \param[in] disc_order_target   (int *)                   The discretization order for the solution field on the source grid
00897   \param[in] fMonotoneTypeID   (int *)                     The flag to indicate whether solution monotonicity is to be preserved. 0: none, 1:
00898   \param[in] fVolumetric   (int *)                         The flag to indicate whether we need to compute volumetric projection weights
00899   \param[in] fNoConservation   (int *)                     The flag to indicate whether to ignore conservation of solution field during projection
00900   \param[in] fValidate   (int *)                           The flag to indicate whether to validate the consistency and conservation of solution field during projection;
00901                                                            Production runs should not have this flag enabled to minimize collective operations.
00902   \param[in] source_solution_tag_dof_name   (iMOAB_String) The global DoF IDs corresponding to participating degrees-of-freedom for the source discretization
00903   \param[in] target_solution_tag_dof_name   (iMOAB_String) The global DoF IDs corresponding to participating degrees-of-freedom for the target discretization
00904   \param[in] solution_weights_identifier_length   (int)    The length of the solution weights identifier string
00905   \param[in] disc_method_src_length   (int)                The length of the discretization type string on the source mesh
00906   \param[in] disc_method_tgt_length   (int)                The length of the discretization type string on the target mesh
00907   \param[in] source_solution_tag_dof_name_length   (int)   The length of the source solution DoF tag name string
00908   \param[in] target_solution_tag_dof_name_length   (int)   The length of the target solution DoF tag name string
00909 */
00910 ErrCode iMOAB_ComputeScalarProjectionWeights ( iMOAB_AppID pid_intersection,
00911                                                const iMOAB_String solution_weights_identifier, /* "scalar", "flux", "custom" */
00912                                                const iMOAB_String disc_method_source, int* disc_order_source,
00913                                                const iMOAB_String disc_method_target, int* disc_order_target,
00914                                                int* fMonotoneTypeID, int* fVolumetric, int* fNoConservation, int* fValidate,
00915                                                const iMOAB_String source_solution_tag_dof_name,
00916                                                const iMOAB_String target_solution_tag_dof_name,
00917                                                int solution_weights_identifier_length,
00918                                                int disc_method_src_length,
00919                                                int disc_method_tgt_length,
00920                                                int source_solution_tag_dof_name_length,
00921                                                int target_solution_tag_dof_name_length );
00922 
00923 /**
00924   \brief Apply the projection weights matrix operator onto the source tag in order to compute the solution (tag)
00925   repersented on the target grid. This operation can be understood as the application of a matrix vector product
00926   (Y=P*X).
00927 
00928   <B>Operations:</B> Collective
00929 
00930   \param[in/out] pid_intersection (iMOAB_AppID)            The unique pointer to the intersection application ID
00931   \param[in] solution_weights_identifier  (iMOAB_String)   The unique identifier used to store the computed projection weights locally. Typically,
00932                                                            values could be identifiers such as "scalar", "flux" or "custom".
00933   \param[in] source_solution_tag_name   (iMOAB_String)     list of tag names corresponding to participating degrees-of-freedom for the source discretization;
00934                                                            names are separated by ";", the same way as for tag migration
00935   \param[in] target_solution_tag_name   (iMOAB_String)     list of tag names corresponding to participating degrees-of-freedom for the target discretization;
00936                                                            names are separated by ";", the same way as for tag migration
00937   \param[in] source_solution_tag_name_length   (int)       The length of the source solution field tag name string
00938   \param[in] target_solution_tag_name_length   (int)       The length of the target solution field tag name string
00939 */
00940 ErrCode iMOAB_ApplyScalarProjectionWeights (   iMOAB_AppID pid_intersection,
00941                                                const iMOAB_String solution_weights_identifier, /* "scalar", "flux", "custom" */
00942                                                const iMOAB_String source_solution_tag_name,
00943                                                const iMOAB_String target_solution_tag_name,
00944                                                int solution_weights_identifier_length,
00945                                                int source_solution_tag_name_length,
00946                                                int target_solution_tag_name_length );
00947 
00948 #endif // #ifdef MOAB_HAVE_TEMPESTREMAP
00949 
00950 #ifdef __cplusplus
00951 }
00952 #endif  // #ifdef __cplusplus
00953 
00954 #endif  // #ifndef IMOAB_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines