Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
00001 ! iMOAB Interface for Fortran 90/2003/2008 compatible compilers 00002 00003 #include "moab/MOABConfig.h" 00004 00005 module iMOAB 00006 00007 use iso_c_binding 00008 implicit none 00009 00010 ! constant parameters for tag type and layout 00011 ! equivalent to enum MOAB_TAG_TYPE in iMOAB.h 00012 integer, parameter :: TAG_DENSE_INTEGER = 0 00013 integer, parameter :: TAG_DENSE_DOUBLE = 1 00014 integer, parameter :: TAG_DENSE_HANDLE = 2 00015 integer, parameter :: TAG_SPARSE_INTEGER = 3 00016 integer, parameter :: TAG_SPARSE_DOUBLE = 4 00017 integer, parameter :: TAG_SPARSE_HANDLE = 5 00018 00019 ! constant parameters for tag definition on entities 00020 ! equivalent to enum MOAB_TAG_OWNER_TYPE in iMOAB.h 00021 integer, parameter :: TAG_OWNER_VERTICES = 0 00022 integer, parameter :: TAG_OWNER_EDGES = 1 00023 integer, parameter :: TAG_OWNER_FACES = 2 00024 integer, parameter :: TAG_OWNER_ELEMENTS = 3 00025 00026 ! Interface to all the API routines 00027 interface 00028 00029 integer(c_int) function iMOAB_Initialize() bind(C, name='iMOAB_InitializeFortran') 00030 ! Directly forward the call 00031 use, intrinsic :: iso_c_binding, only: c_int 00032 end function iMOAB_Initialize 00033 00034 integer(c_int) function iMOAB_Finalize() bind(C, name='iMOAB_Finalize') 00035 ! Directly forward the call 00036 use, intrinsic :: iso_c_binding, only: c_int 00037 end function iMOAB_Finalize 00038 00039 #ifdef MOAB_HAVE_MPI 00040 integer(c_int) function iMOAB_RegisterApplication(app_name, fcomm, compid, pid) & 00041 bind(C, name='iMOAB_RegisterApplicationFortran') 00042 #else 00043 integer(c_int) function iMOAB_RegisterApplication(app_name, compid, pid) & 00044 bind(C, name='iMOAB_RegisterApplicationFortran') 00045 #endif 00046 ! Interface blocks don't know about their context, 00047 ! so we need to use iso_c_binding inside all interface functions again 00048 use, intrinsic :: iso_c_binding, only: c_int, c_char, c_ptr 00049 character(kind=c_char), intent(in) :: app_name(*) 00050 #ifdef MOAB_HAVE_MPI 00051 integer, intent(in) :: fcomm 00052 #endif 00053 integer(c_int), intent(in) :: compid 00054 integer(c_int), intent(out) :: pid 00055 end function iMOAB_RegisterApplication 00056 00057 integer(c_int) function iMOAB_DeregisterApplication(pid) bind(C, name='iMOAB_DeregisterApplicationFortran') 00058 use, intrinsic :: iso_c_binding, only: c_int 00059 integer(c_int), intent(in) :: pid 00060 end function iMOAB_DeregisterApplication 00061 00062 integer(c_int) function iMOAB_ReadHeaderInfo(filename, num_global_vertices, num_global_elements, & 00063 num_dimension, num_parts) bind(C, name='iMOAB_ReadHeaderInfo') 00064 use, intrinsic :: iso_c_binding, only: c_int, c_char 00065 character(kind=c_char), intent(in) :: filename(*) 00066 integer(c_int), intent(out) :: num_global_vertices 00067 integer(c_int), intent(out) :: num_global_elements 00068 integer(c_int), intent(out) :: num_dimension 00069 integer(c_int), intent(out) :: num_parts 00070 end function iMOAB_ReadHeaderInfo 00071 00072 integer(c_int) function iMOAB_LoadMesh(pid, filename, read_options, num_ghost_layers) bind(C, name='iMOAB_LoadMesh') 00073 use, intrinsic :: iso_c_binding, only: c_int, c_char 00074 integer(c_int), intent(in) :: pid 00075 character(kind=c_char), intent(in) :: filename(*) 00076 character(kind=c_char), intent(in) :: read_options(*) 00077 integer(c_int), intent(in) :: num_ghost_layers 00078 end function iMOAB_LoadMesh 00079 00080 integer(c_int) function iMOAB_CreateVertices(pid, coords_len, dim, coordinates) bind(C, name='iMOAB_CreateVertices') 00081 use, intrinsic :: iso_c_binding, only: c_int, c_double 00082 integer(c_int), intent(in) :: pid 00083 integer(c_int), intent(in) :: coords_len 00084 integer(c_int), intent(in) :: dim 00085 real(c_double), intent(in) :: coordinates(*) 00086 end function iMOAB_CreateVertices 00087 00088 integer(c_int) function iMOAB_CreateElements(pid, num_elem, type, num_nodes_per_element, & 00089 connectivity, block_ID) bind(C, name='iMOAB_CreateElements') 00090 use, intrinsic :: iso_c_binding, only: c_int 00091 integer(c_int), intent(in) :: pid 00092 integer(c_int), intent(in) :: num_elem 00093 integer(c_int), intent(in) :: type 00094 integer(c_int), intent(in) :: num_nodes_per_element 00095 integer(c_int), intent(in) :: connectivity(*) 00096 integer(c_int), intent(in) :: block_ID 00097 end function iMOAB_CreateElements 00098 00099 integer(c_int) function iMOAB_ResolveSharedEntities(pid, num_verts, marker) bind(C, name='iMOAB_ResolveSharedEntities') 00100 use, intrinsic :: iso_c_binding, only: c_int 00101 integer(c_int), intent(in) :: pid 00102 integer(c_int), intent(in) :: num_verts 00103 integer(c_int), intent(in) :: marker(*) 00104 end function iMOAB_ResolveSharedEntities 00105 00106 integer(c_int) function iMOAB_DetermineGhostEntities(pid, ghost_dim, num_ghost_layers, bridge_dim) & 00107 bind(C, name='iMOAB_DetermineGhostEntities') 00108 use, intrinsic :: iso_c_binding, only: c_int 00109 integer(c_int), intent(in) :: pid 00110 integer(c_int), intent(in) :: ghost_dim 00111 integer(c_int), intent(in) :: num_ghost_layers 00112 integer(c_int), intent(in) :: bridge_dim 00113 end function iMOAB_DetermineGhostEntities 00114 00115 integer(c_int) function iMOAB_WriteMesh(pid, filename, write_options) bind(C, name='iMOAB_WriteMesh') 00116 use, intrinsic :: iso_c_binding, only: c_int, c_char 00117 integer(c_int), intent(in) :: pid 00118 character(kind=c_char), intent(in) :: filename(*) 00119 character(kind=c_char), intent(in) :: write_options(*) 00120 end function iMOAB_WriteMesh 00121 00122 integer(c_int) function iMOAB_UpdateMeshInfo(pid) bind(C, name='iMOAB_UpdateMeshInfo') 00123 use, intrinsic :: iso_c_binding, only: c_int 00124 integer(c_int), intent(in) :: pid 00125 end function iMOAB_UpdateMeshInfo 00126 00127 integer(c_int) function iMOAB_GetMeshInfo(pid, num_visible_vertices, num_visible_elements, & 00128 num_visible_blocks, num_visible_surfaceBC, & 00129 num_visible_vertexBC) bind(C, name='iMOAB_GetMeshInfo') 00130 use, intrinsic :: iso_c_binding, only: c_int 00131 integer(c_int), intent(in) :: pid 00132 integer(c_int), intent(out) :: num_visible_vertices(3) 00133 integer(c_int), intent(out) :: num_visible_elements(3) 00134 integer(c_int), intent(out) :: num_visible_blocks(3) 00135 integer(c_int), intent(out) :: num_visible_surfaceBC(3) 00136 integer(c_int), intent(out) :: num_visible_vertexBC(3) 00137 end function iMOAB_GetMeshInfo 00138 00139 integer(c_int) function iMOAB_GetVertexID(pid, vertices_length, global_vertex_ID) bind(C, name='iMOAB_GetVertexID') 00140 use, intrinsic :: iso_c_binding, only: c_int 00141 integer(c_int), intent(in) :: pid 00142 integer(c_int), intent(in) :: vertices_length 00143 integer(c_int), intent(out) :: global_vertex_ID(*) 00144 end function iMOAB_GetVertexID 00145 00146 integer(c_int) function iMOAB_GetVertexOwnership(pid, vertices_length, visible_global_rank_ID) & 00147 bind(C, name='iMOAB_GetVertexOwnership') 00148 use, intrinsic :: iso_c_binding, only: c_int 00149 integer(c_int), intent(in) :: pid 00150 integer(c_int), intent(in) :: vertices_length 00151 integer(c_int), intent(out) :: visible_global_rank_ID(*) 00152 end function iMOAB_GetVertexOwnership 00153 00154 integer(c_int) function iMOAB_GetVisibleVerticesCoordinates(pid, coords_length, coordinates) & 00155 bind(C, name='iMOAB_GetVisibleVerticesCoordinates') 00156 use, intrinsic :: iso_c_binding, only: c_int, c_double 00157 integer(c_int), intent(in) :: pid 00158 integer(c_int), intent(in) :: coords_length 00159 real(c_double), intent(out) :: coordinates(*) 00160 end function iMOAB_GetVisibleVerticesCoordinates 00161 00162 integer(c_int) function iMOAB_GetBlockID(pid, block_length, global_block_IDs) bind(C, name='iMOAB_GetBlockID') 00163 use, intrinsic :: iso_c_binding, only: c_int 00164 integer(c_int), intent(in) :: pid 00165 integer(c_int), intent(in) :: block_length 00166 integer(c_int), intent(out) :: global_block_IDs(*) 00167 end function iMOAB_GetBlockID 00168 00169 integer(c_int) function iMOAB_GetBlockInfo(pid, global_block_ID, vertices_per_element, & 00170 num_elements_in_block) bind(C, name='iMOAB_GetBlockInfo') 00171 use, intrinsic :: iso_c_binding, only: c_int 00172 integer(c_int), intent(in) :: pid 00173 integer(c_int), intent(in) :: global_block_ID 00174 integer(c_int), intent(out) :: vertices_per_element 00175 integer(c_int), intent(out) :: num_elements_in_block 00176 end function iMOAB_GetBlockInfo 00177 00178 integer(c_int) function iMOAB_GetVisibleElementsInfo(pid, num_visible_elements, element_global_IDs, & 00179 ranks, block_IDs) bind(C, name='iMOAB_GetVisibleElementsInfo') 00180 use, intrinsic :: iso_c_binding, only: c_int 00181 integer(c_int), intent(in) :: pid 00182 integer(c_int), intent(out) :: num_visible_elements 00183 integer(c_int), intent(out) :: element_global_IDs(*) 00184 integer(c_int), intent(out) :: ranks(*) 00185 integer(c_int), intent(out) :: block_IDs(*) 00186 end function iMOAB_GetVisibleElementsInfo 00187 00188 integer(c_int) function iMOAB_GetBlockElementConnectivities(pid, global_block_ID, connectivity_length, & 00189 element_connectivity) & 00190 bind(C, name='iMOAB_GetBlockElementConnectivities') 00191 use, intrinsic :: iso_c_binding, only: c_int 00192 integer(c_int), intent(in) :: pid 00193 integer(c_int), intent(in) :: global_block_ID 00194 integer(c_int), intent(in) :: connectivity_length 00195 integer(c_int), intent(out) :: element_connectivity(*) 00196 end function iMOAB_GetBlockElementConnectivities 00197 00198 integer(c_int) function iMOAB_GetElementConnectivity(pid, elem_index, connectivity_length, & 00199 element_connectivity) bind(C, name='iMOAB_GetElementConnectivity') 00200 use, intrinsic :: iso_c_binding, only: c_int 00201 integer(c_int), intent(in) :: pid 00202 integer(c_int), intent(in) :: elem_index 00203 integer(c_int), intent(in) :: connectivity_length 00204 integer(c_int), intent(out) :: element_connectivity(*) 00205 end function iMOAB_GetElementConnectivity 00206 00207 integer(c_int) function iMOAB_GetElementOwnership(pid, global_block_ID, num_elements_in_block, & 00208 element_ownership) bind(C, name='iMOAB_GetElementOwnership') 00209 use, intrinsic :: iso_c_binding, only: c_int 00210 integer(c_int), intent(in) :: pid 00211 integer(c_int), intent(in) :: global_block_ID 00212 integer(c_int), intent(out) :: num_elements_in_block 00213 integer(c_int), intent(out) :: element_ownership(*) 00214 end function iMOAB_GetElementOwnership 00215 00216 integer(c_int) function iMOAB_GetElementID(pid, global_block_ID, num_elements_in_block, & 00217 global_element_ID, local_element_ID) bind(C, name='iMOAB_GetElementID') 00218 use, intrinsic :: iso_c_binding, only: c_int 00219 integer(c_int), intent(in) :: pid 00220 integer(c_int), intent(in) :: global_block_ID 00221 integer(c_int), intent(in) :: num_elements_in_block 00222 integer(c_int), intent(in) :: global_element_ID 00223 integer(c_int), intent(out) :: local_element_ID 00224 end function iMOAB_GetElementID 00225 00226 integer(c_int) function iMOAB_GetPointerToSurfaceBC(pid, surface_BC_length, local_element_ID, & 00227 reference_surface_ID, boundary_condition_value) & 00228 bind(C, name='iMOAB_GetPointerToSurfaceBC') 00229 use, intrinsic :: iso_c_binding, only: c_int 00230 integer(c_int), intent(in) :: pid 00231 integer(c_int), intent(in) :: surface_BC_length 00232 integer(c_int), intent(in) :: local_element_ID 00233 integer(c_int), intent(in) :: reference_surface_ID 00234 integer(c_int), intent(out) :: boundary_condition_value 00235 end function iMOAB_GetPointerToSurfaceBC 00236 00237 integer(c_int) function iMOAB_GetPointerToVertexBC(pid, vertex_BC_length, local_vertex_ID, & 00238 boundary_condition_value) bind(C, name='iMOAB_GetPointerToVertexBC') 00239 use, intrinsic :: iso_c_binding, only: c_int 00240 integer(c_int), intent(in) :: pid 00241 integer(c_int), intent(in) :: vertex_BC_length 00242 integer(c_int), intent(in) :: local_vertex_ID 00243 integer(c_int), intent(out) :: boundary_condition_value 00244 end function iMOAB_GetPointerToVertexBC 00245 00246 integer(c_int) function iMOAB_DefineTagStorage(pid, tag_storage_name, tag_type, components_per_entity, & 00247 tag_index) bind(C, name='iMOAB_DefineTagStorage') 00248 use, intrinsic :: iso_c_binding, only: c_int, c_char 00249 integer(c_int), intent(in) :: pid 00250 character(kind=c_char), intent(in) :: tag_storage_name(*) 00251 integer(c_int), intent(in) :: tag_type 00252 integer(c_int), intent(in) :: components_per_entity 00253 integer(c_int), intent(in) :: tag_index 00254 end function iMOAB_DefineTagStorage 00255 00256 integer(c_int) function iMOAB_SetIntTagStorage(pid, tag_storage_name, num_tag_storage_length, entity_type, & 00257 tag_storage_data) bind(C, name='iMOAB_SetIntTagStorage') 00258 use, intrinsic :: iso_c_binding, only: c_int, c_char 00259 integer(c_int), intent(in) :: pid 00260 character(kind=c_char), intent(in) :: tag_storage_name(*) 00261 integer(c_int), intent(in) :: num_tag_storage_length 00262 integer(c_int), intent(in) :: entity_type 00263 integer(c_int), intent(in) :: tag_storage_data(*) 00264 end function iMOAB_SetIntTagStorage 00265 00266 integer(c_int) function iMOAB_GetIntTagStorage(pid, tag_storage_name, num_tag_storage_length, entity_type, & 00267 tag_storage_data) bind(C, name='iMOAB_GetIntTagStorage') 00268 use, intrinsic :: iso_c_binding, only: c_int, c_char 00269 integer(c_int), intent(in) :: pid 00270 character(kind=c_char), intent(in) :: tag_storage_name(*) 00271 integer(c_int), intent(in) :: num_tag_storage_length 00272 integer(c_int), intent(in) :: entity_type 00273 integer(c_int), intent(out) :: tag_storage_data(*) 00274 end function iMOAB_GetIntTagStorage 00275 00276 integer(c_int) function iMOAB_SetDoubleTagStorage(pid, tag_storage_name, num_tag_storage_length, entity_type, & 00277 tag_storage_data) bind(C, name='iMOAB_SetDoubleTagStorage') 00278 use, intrinsic :: iso_c_binding, only: c_int, c_char, c_double 00279 integer(c_int), intent(in) :: pid 00280 character(kind=c_char), intent(in) :: tag_storage_name(*) 00281 integer(c_int), intent(in) :: num_tag_storage_length 00282 integer(c_int), intent(in) :: entity_type 00283 real(c_double), intent(in) :: tag_storage_data(*) 00284 end function iMOAB_SetDoubleTagStorage 00285 00286 integer(c_int) function iMOAB_SetDoubleTagStorageWithGid(pid, tag_storage_name, num_tag_storage_length, entity_type, & 00287 tag_storage_data, globalIds) bind(C, name='iMOAB_SetDoubleTagStorageWithGid') 00288 use, intrinsic :: iso_c_binding, only: c_int, c_char, c_double 00289 integer(c_int), intent(in) :: pid 00290 character(kind=c_char), intent(in) :: tag_storage_name(*) 00291 integer(c_int), intent(in) :: num_tag_storage_length 00292 integer(c_int), intent(in) :: entity_type 00293 real(c_double), intent(in) :: tag_storage_data(*) 00294 integer(c_int), intent(in) :: globalIds(*) 00295 end function iMOAB_SetDoubleTagStorageWithGid 00296 00297 00298 integer(c_int) function iMOAB_GetDoubleTagStorage(pid, tag_storage_name, num_tag_storage_length, entity_type, & 00299 tag_storage_data) bind(C, name='iMOAB_GetDoubleTagStorage') 00300 use, intrinsic :: iso_c_binding, only: c_int, c_char, c_double 00301 integer(c_int), intent(in) :: pid 00302 character(kind=c_char), intent(in) :: tag_storage_name(*) 00303 integer(c_int), intent(in) :: num_tag_storage_length 00304 integer(c_int), intent(in) :: entity_type 00305 real(c_double), intent(out) :: tag_storage_data(*) 00306 end function iMOAB_GetDoubleTagStorage 00307 00308 integer(c_int) function iMOAB_SynchronizeTags(pid, num_tag, tag_indices, entity_type) bind(C, name='iMOAB_SynchronizeTags') 00309 use, intrinsic :: iso_c_binding, only: c_int 00310 integer(c_int), intent(in) :: pid 00311 integer(c_int), intent(in) :: num_tag 00312 integer(c_int), intent(in) :: tag_indices(*) 00313 integer(c_int), intent(in) :: entity_type(*) 00314 end function iMOAB_SynchronizeTags 00315 00316 integer(c_int) function iMOAB_ReduceTagsMax(pid, tag_index, entity_type) bind(C, name='iMOAB_ReduceTagsMax') 00317 use, intrinsic :: iso_c_binding, only: c_int 00318 integer(c_int), intent(in) :: pid 00319 integer(c_int), intent(in) :: tag_index 00320 integer(c_int), intent(in) :: entity_type 00321 end function iMOAB_ReduceTagsMax 00322 00323 integer(c_int) function iMOAB_GetNeighborElements(pid, local_index, num_adjacent_elements, adjacent_element_IDs) & 00324 bind(C, name='iMOAB_GetNeighborElements') 00325 use, intrinsic :: iso_c_binding, only: c_int 00326 integer(c_int), intent(in) :: pid 00327 integer(c_int), intent(in) :: local_index 00328 integer(c_int), intent(out) :: num_adjacent_elements 00329 integer(c_int), intent(out) :: adjacent_element_IDs 00330 end function iMOAB_GetNeighborElements 00331 00332 integer(c_int) function iMOAB_GetNeighborVertices(pid, local_index, num_adjacent_vertices, adjacent_vertex_IDs) & 00333 bind(C, name='iMOAB_GetNeighborVertices') 00334 use, intrinsic :: iso_c_binding, only: c_int 00335 integer(c_int), intent(in) :: pid 00336 integer(c_int), intent(in) :: local_index 00337 integer(c_int), intent(out) :: num_adjacent_vertices 00338 integer(c_int), intent(out) :: adjacent_vertex_IDs 00339 end function iMOAB_GetNeighborVertices 00340 00341 integer(c_int) function iMOAB_SetGlobalInfo(pid, num_global_verts, num_global_elems) bind(C, name='iMOAB_SetGlobalInfo') 00342 use, intrinsic :: iso_c_binding, only: c_int 00343 integer(c_int), intent(in) :: pid 00344 integer(c_int), intent(in) :: num_global_verts 00345 integer(c_int), intent(in) :: num_global_elems 00346 end function iMOAB_SetGlobalInfo 00347 00348 integer(c_int) function iMOAB_GetGlobalInfo(pid, num_global_verts, num_global_elems) bind(C, name='iMOAB_GetGlobalInfo') 00349 use, intrinsic :: iso_c_binding, only: c_int 00350 integer(c_int), intent(in) :: pid 00351 integer(c_int), intent(out) :: num_global_verts 00352 integer(c_int), intent(out) :: num_global_elems 00353 end function iMOAB_GetGlobalInfo 00354 00355 integer(c_int) function iMOAB_DuplicateAppMesh( pid, poid )bind(C, name='iMOAB_DuplicateAppMesh') 00356 use, intrinsic :: iso_c_binding, only: c_int 00357 integer(c_int), intent(in) :: pid 00358 integer(c_int), intent(in) :: poid 00359 end function iMOAB_DuplicateAppMesh 00360 00361 integer(c_int) function iMOAB_WriteLocalMesh(pid, prefix) bind(C, name='iMOAB_WriteLocalMesh') 00362 use, intrinsic :: iso_c_binding, only : c_int, c_char 00363 integer(c_int), intent(in) :: pid 00364 character(kind=c_char), intent(in) :: prefix(*) 00365 end function iMOAB_WriteLocalMesh 00366 00367 #ifdef MOAB_HAVE_MPI 00368 00369 integer(c_int) function iMOAB_SendMesh(pid, joint_comm, receivingGroup, rcompid, method) bind(C, name='iMOAB_SendMesh') 00370 use, intrinsic :: iso_c_binding, only: c_int, c_ptr 00371 integer(c_int), intent(in) :: pid 00372 integer, intent(in) :: joint_comm ! MPI_Comm 00373 integer, intent(in) :: receivingGroup ! MPI_Group 00374 integer(c_int), intent(in) :: rcompid 00375 integer(c_int), intent(in) :: method 00376 end function iMOAB_SendMesh 00377 00378 integer(c_int) function iMOAB_ReceiveMesh(pid, joint_comm, sendingGroup, scompid) bind(C, name='iMOAB_ReceiveMesh') 00379 use, intrinsic :: iso_c_binding, only: c_int, c_ptr 00380 integer(c_int), intent(in) :: pid 00381 integer, intent(in) :: joint_comm ! MPI_Comm 00382 integer, intent(in) :: sendingGroup ! MPI_Group 00383 integer(c_int), intent(in) :: scompid 00384 end function iMOAB_ReceiveMesh 00385 00386 integer(c_int) function iMOAB_FreeSenderBuffers(pid, context_id) bind(C, name='iMOAB_FreeSenderBuffers') 00387 use, intrinsic :: iso_c_binding, only: c_int 00388 integer(c_int), intent(in) :: pid 00389 integer(c_int), intent(in) :: context_id 00390 end function iMOAB_FreeSenderBuffers 00391 00392 integer(c_int) function iMOAB_SendElementTag(pid, tag_storage_name, joint_comm, context_id) & 00393 bind(C, name='iMOAB_SendElementTag') 00394 use, intrinsic :: iso_c_binding, only: c_int, c_char, c_ptr 00395 integer(c_int), intent(in) :: pid 00396 character(kind=c_char), intent(in) :: tag_storage_name(*) 00397 integer, intent(in) :: joint_comm ! MPI_Comm 00398 integer(c_int), intent(in) :: context_id 00399 end function iMOAB_SendElementTag 00400 00401 integer(c_int) function iMOAB_ReceiveElementTag(pid, tag_storage_name, joint_comm, context_id) & 00402 bind(C, name='iMOAB_ReceiveElementTag') 00403 use, intrinsic :: iso_c_binding, only: c_int, c_char, c_ptr 00404 integer(c_int), intent(in) :: pid 00405 character(kind=c_char), intent(in) :: tag_storage_name(*) 00406 integer, intent(in) :: joint_comm ! MPI_Comm 00407 integer(c_int), intent(in) :: context_id 00408 end function iMOAB_ReceiveElementTag 00409 00410 integer(c_int) function iMOAB_ComputeCommGraph(pid1, pid2, joint_comm, group1, group2, type1, type2, & 00411 comp1, comp2) bind(C, name='iMOAB_ComputeCommGraph') 00412 use, intrinsic :: iso_c_binding, only: c_int, c_ptr 00413 integer(c_int), intent(in) :: pid1 00414 integer(c_int), intent(in) :: pid2 00415 integer, intent(in) :: joint_comm ! MPI_Comm 00416 integer, intent(in) :: group1 ! MPI_Group 00417 integer, intent(in) :: group2 ! MPI_Group 00418 integer(c_int), intent(in) :: type1 00419 integer(c_int), intent(in) :: type2 00420 integer(c_int), intent(in) :: comp1 00421 integer(c_int), intent(in) :: comp2 00422 end function iMOAB_ComputeCommGraph 00423 00424 integer(c_int) function iMOAB_CoverageGraph(joint_comm, pid_source, pid_migration, pid_intx, source_id, & 00425 migration_id, context_id) bind(C, name='iMOAB_CoverageGraph') 00426 use, intrinsic :: iso_c_binding, only: c_int, c_ptr 00427 integer, intent(in) :: joint_comm ! MPI_Comm 00428 integer(c_int), intent(in) :: pid_source 00429 integer(c_int), intent(in) :: pid_migration 00430 integer(c_int), intent(in) :: pid_intx 00431 integer(c_int), intent(in) :: source_id 00432 integer(c_int), intent(in) :: migration_id 00433 integer(c_int), intent(in) :: context_id 00434 end function iMOAB_CoverageGraph 00435 00436 integer(c_int) function iMOAB_DumpCommGraph(pid, context_id, is_sender, prefix) bind(C, name='iMOAB_DumpCommGraph') 00437 use, intrinsic :: iso_c_binding, only: c_int, c_char 00438 integer(c_int), intent(in) :: pid 00439 integer(c_int), intent(in) :: context_id 00440 integer(c_int), intent(in) :: is_sender 00441 character(kind=c_char), intent(in) :: prefix(*) 00442 end function iMOAB_DumpCommGraph 00443 00444 integer(c_int) function iMOAB_MergeVertices(pid) bind(C, name='iMOAB_MergeVertices') 00445 use, intrinsic :: iso_c_binding, only: c_int 00446 integer(c_int), intent(in) :: pid 00447 end function iMOAB_MergeVertices 00448 00449 integer(c_int) function iMOAB_MigrateMapMesh( pid1, pid2, pid3, jointcomm, groupA, groupB, type, comp1, comp2, & 00450 direction) bind(C, name='iMOAB_MigrateMapMesh') 00451 use, intrinsic :: iso_c_binding, only : c_int 00452 integer(c_int), intent(in) :: pid1 00453 integer(c_int), intent(in) :: pid2 00454 integer(c_int), intent(in) :: pid3 00455 integer, intent(in) :: jointcomm ! MPI_Comm 00456 integer, intent(in) :: groupA ! MPI_Group 00457 integer, intent(in) :: groupB ! MPI_Group 00458 integer(c_int), intent(in) :: type 00459 integer(c_int), intent(in) :: comp1 00460 integer(c_int), intent(in) :: comp2 00461 integer(c_int), intent(in) :: direction 00462 end function iMOAB_MigrateMapMesh 00463 00464 ! closing endif: MOAB_HAVE_MPI 00465 #endif 00466 00467 #ifdef MOAB_HAVE_TEMPESTREMAP 00468 00469 integer(c_int) function iMOAB_ComputeMeshIntersectionOnSphere(pid_source, pid_target, pid_intersection) & 00470 bind(C, name='iMOAB_ComputeMeshIntersectionOnSphere') 00471 use, intrinsic :: iso_c_binding, only: c_int 00472 integer(c_int), intent(in) :: pid_source 00473 integer(c_int), intent(in) :: pid_target 00474 integer(c_int), intent(in) :: pid_intersection 00475 end function iMOAB_ComputeMeshIntersectionOnSphere 00476 00477 integer(c_int) function iMOAB_ComputePointDoFIntersection(pid_source, pid_target, pid_intersection) & 00478 bind(C, name='iMOAB_ComputePointDoFIntersection') 00479 use, intrinsic :: iso_c_binding, only: c_int 00480 integer(c_int), intent(in) :: pid_source 00481 integer(c_int), intent(in) :: pid_target 00482 integer(c_int), intent(in) :: pid_intersection 00483 end function iMOAB_ComputePointDoFIntersection 00484 00485 #ifdef MOAB_HAVE_NETCDF 00486 00487 integer(c_int) function iMOAB_LoadMappingWeightsFromFile(pid_intersection, pid_cpl, column_or_row, mtype, & 00488 solution_weights_identifier, remap_weights_filename) & 00489 bind(C, name='iMOAB_LoadMappingWeightsFromFile') 00490 use, intrinsic :: iso_c_binding, only : c_int, c_char 00491 integer(c_int), intent(in) :: pid_intersection 00492 integer(c_int), intent(in) :: pid_cpl 00493 integer(c_int), intent(in) :: column_or_row 00494 integer(c_int), intent(in) :: mtype 00495 character(kind=c_char), intent(in) :: solution_weights_identifier(*) 00496 character(kind=c_char), intent(in) :: remap_weights_filename(*) 00497 end function iMOAB_LoadMappingWeightsFromFile 00498 00499 integer(c_int) function iMOAB_WriteMappingWeightsToFile(pid_intersection, solution_weights_identifier, & 00500 remap_weights_filename) bind(C, name='iMOAB_WriteMappingWeightsToFile') 00501 use, intrinsic :: iso_c_binding, only: c_int, c_char 00502 integer(c_int), intent(in) :: pid_intersection 00503 character(kind=c_char), intent(in) :: solution_weights_identifier(*) 00504 character(kind=c_char), intent(in) :: remap_weights_filename(*) 00505 end function iMOAB_WriteMappingWeightsToFile 00506 00507 ! closing endif: MOAB_HAVE_NETCDF 00508 #endif 00509 00510 integer(c_int) function iMOAB_ComputeScalarProjectionWeights(pid_intersection, solution_weights_identifier, & 00511 disc_method_source, disc_order_source, & 00512 disc_method_target, disc_order_target, & 00513 fNoBubble, fMonotoneTypeID, fVolumetric, & 00514 fInverseDistanceMap, fNoConservation, fValidate, & 00515 source_solution_tag_dof_name, target_solution_tag_dof_name) & 00516 bind(C, name='iMOAB_ComputeScalarProjectionWeights') 00517 use, intrinsic :: iso_c_binding, only: c_int, c_char 00518 integer(c_int), intent(in) :: pid_intersection 00519 character(kind=c_char), intent(in) :: solution_weights_identifier(*) 00520 character(kind=c_char), intent(in) :: disc_method_source(*) 00521 integer(c_int), intent(in) :: disc_order_source 00522 character(kind=c_char), intent(in) :: disc_method_target(*) 00523 integer(c_int), intent(in) :: disc_order_target 00524 integer(c_int), intent(in) :: fNoBubble 00525 integer(c_int), intent(in) :: fMonotoneTypeID 00526 integer(c_int), intent(in) :: fVolumetric 00527 integer(c_int), intent(in) :: fInverseDistanceMap 00528 integer(c_int), intent(in) :: fNoConservation 00529 integer(c_int), intent(in) :: fValidate 00530 character(kind=c_char), intent(in) :: source_solution_tag_dof_name(*) 00531 character(kind=c_char), intent(in) :: target_solution_tag_dof_name(*) 00532 end function iMOAB_ComputeScalarProjectionWeights 00533 00534 integer(c_int) function iMOAB_ApplyScalarProjectionWeights(pid_intersection, solution_weights_identifier, & 00535 source_solution_tag_name, target_solution_tag_name) & 00536 bind(C, name='iMOAB_ApplyScalarProjectionWeights') 00537 use, intrinsic :: iso_c_binding, only: c_int, c_char 00538 integer(c_int), intent(in) :: pid_intersection 00539 character(kind=c_char), intent(in) :: solution_weights_identifier(*) 00540 character(kind=c_char), intent(in) :: source_solution_tag_name(*) 00541 character(kind=c_char), intent(in) :: target_solution_tag_name(*) 00542 end function iMOAB_ApplyScalarProjectionWeights 00543 00544 ! closing endif: MOAB_HAVE_TEMPESTREMAP 00545 #endif 00546 00547 #ifdef MOAB_HAVE_MPI 00548 00549 ! Add some helper MPI converter functions 00550 00551 ! Convert a C-based MPI-Comm handle to fortran 00552 integer function iMOAB_MPI_Comm_c2f(c_handle) bind(C, name="MOAB_MPI_Comm_c2f") 00553 use, intrinsic :: iso_c_binding, only: c_ptr 00554 type(c_ptr), value :: c_handle 00555 end function 00556 00557 ! Convert a Fortran-based MPI-integer handle to MPI-Comm pointer 00558 type(c_ptr) function iMOAB_MPI_Comm_f2c(f_handle) bind(C, name="MOAB_MPI_Comm_f2c") 00559 use, intrinsic :: iso_c_binding, only: c_ptr 00560 integer, intent(in) :: f_handle 00561 end function 00562 00563 ! Convert a C-based MPI-Group handle to fortran 00564 integer function iMOAB_MPI_Group_c2f(c_handle) bind(C, name="MOAB_MPI_Group_c2f") 00565 use, intrinsic :: iso_c_binding, only: c_ptr 00566 type(c_ptr), value :: c_handle 00567 end function 00568 00569 ! Convert a Fortran-based MPI-integer handle to MPI-Group pointer 00570 type(c_ptr) function iMOAB_MPI_Group_f2c(f_handle) bind(C, name="MOAB_MPI_Group_f2c") 00571 use, intrinsic :: iso_c_binding, only: c_ptr 00572 integer, intent(in) :: f_handle 00573 end function 00574 00575 #endif 00576 00577 end interface 00578 00579 end module iMOAB