This module creates the required treeID lists, from which then the state vector and the neighbor information can be constructed.
Also, the structures for the ghost and halo elements are created. For the ghost cells, this means establishing the dependencies. The source element positions for each ghost is stored. For the halo elements, the information from where to get the element information is stored in the mpi buffers. See the example for stencil construction in the Documentation.
Calculate nearest neighbors. if its fluid then identify its treeID from tem_IdOfCoord If neighbor is boundary then identify the boundary ID from boundary_ID list
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private, | save | :: | nestingLimit | limit for searching neighbors * For acoustic scaling (2 coarser elements required) set to 1 * For diffusive scaling (4 coarser elements required) set to 3 |
||
integer(kind=long_k), | private, | allocatable, save | :: | hash(:) | Hash to quickly identify if an element was reconstructed before. If so, it is part of the hash this array contains treeIDs of recently accessed elements allocated and used in tem_init_elemLevels also used in identify_elements this array contains positions in element_type of recently accessed elements |
||
integer, | private, | allocatable, save | :: | hash_elemPos(:) | |||
integer(kind=long_k), | private | :: | nHashes | Entries in the hash |
identification parameters for different lists includes the direct neighbors of each tree ID
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private, | allocatable | :: | nghElems(:,:) | array of the neighbors in the resulting totalList. Use this one in the solver! size: stencil%QQN, nElems(to treat with stencil) |
Type to specify the dependencies of ghost and halo cells. E.g.: used to specify which cells have to be known to be able to interpolate a ghost/halo cell
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | dependencyLevel | = | -1 | the source level, from where the current ghost element gets the source elements for the interpolation |
|
type(grw_intarray_type), | private | :: | elem | position of the source elements in the totalList |
|||
type(grw_intarray_type), | private | :: | elemBuffer | position of the source elements in the all source elements list i.e. levelDesc( targetLevel )%sourceFromCoarser |
|||
real(kind=rk), | private, | allocatable | :: | weight(:) | Interpolation weight for each source element specified above |
||
real(kind=rk), | private | :: | coord(3) | ||||
integer, | private | :: | childNum | ||||
integer, | private | :: | posInIntpMatLSF | Pointer to array of interpolation matrix calculated from available sources |
detailed information of a complete level of elements including all treeIDs, properties and neighbors as well as informations about ghost/halo cells and its dependencies for interpolation/reconstruction
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(tem_element_type), | private | :: | elem | ||||
type(dyn_longarray_type), | private | :: | require | This list includes treeIDs for which additionally neighbors have to be identified constructed in tem_init_elemLevels used in routine: identify_additionalNeigh |
|||
type(tem_haloList_type), | private | :: | haloList | ||||
integer(kind=long_k), | private, | allocatable | :: | total(:) | list of treeIDs for this level. Consists of ordered treeIDs of first fluid, then ghost, then halo elements. total: Array size: nElems ( = nElems_fluid+nElems_ghostFromCoarser + nElems_ghostFromFiner+nElems_halo ) |
||
real(kind=rk), | private, | allocatable | :: | baryOfTotal(:,:) | Barycenter for all treeID in total list size: nElems in total, 3 |
||
integer, | private, | allocatable | :: | totalPnt(:) | pointer to elem%tID list set in routine: identify_lists used in tem_build_listHorizontalDep, assemble_lists Array size: nElems |
||
integer(kind=long_k), | private, | allocatable | :: | property(:) | list of property bits for this level. the same order as total list array size: nElems |
||
integer, | private, | allocatable | :: | pntTID(:) | pointer from the levelDescriptor to the original treeID list ( only for fluids ) array size: nElems_fluid |
||
type(tem_levelNeighbor_type), | private, | allocatable | :: | neigh(:) | neighbor relations for all fluid elements. Dimension: number of stencils We store the positions of the neighbor elements inside the total-list. If a fluid element does not have a neighbor in a direction (e.g. because of a boundary in that direction), we store the boundary ID as negative to indicate, that it is not a regular neighbor. |
||
type(depSource_type), | private, | allocatable | :: | depFromFiner(:) | Dependencies for ghost elements To reconstruct all the data you should iterate over this list and reconstruct the ghost elements with source element information from these data types data. Up = to coarser, down = to finer array size: nElems_ghostFromFiner |
||
type(depSource_type), | private, | allocatable | :: | depFromCoarser(:) | In treelm, only the parent is stored. If more sources are needed, it has to be extend in the solver. array size: nElems_ghostFromCoarser |
||
type(dyn_intarray_type), | private | :: | sourceFromFiner | Store all the source elements for the ghostFromFiner Their positions in total list on source level |
|||
type(dyn_intarray_type), | private | :: | sourceFromCoarser | Store all the source elements that needed for all ghostFromCoarser |
|||
real(kind=rk), | private, | allocatable | :: | intpBufFromFiner(:,:) | Buffer storing intermediate values of the source elements for the interpolation |
||
real(kind=rk), | private, | allocatable | :: | intpBufFromCoarser(:,:) | |||
type(grw_intarray_type), | private, | allocatable | :: | intpFromCoarser(:) | List to store interpolation from coarser ghost elements How to use: do indElem = 1, intpFromCoarser%nVals posInDepFromCoarser = intpFromCoarser%val( indElem ) posInTotal = depFromCoarser%elem%val( posInDepFromCoarser ) end do Size of intpFromCoarser depends on interpolation order which intern depends on available number of source elements |
||
type(grw_intarray_type), | private | :: | intpFromFiner | List to store interpolation from finer ghost elements |
|||
type(dyn_intarray_type), | private | :: | bc_elemBuffer | pointing to the position of boundary elements in the levelDescriptor total list |
|||
integer, | private | :: | offset(2,eT_minRelevant:eT_maxRelevant) | = | 0 | Offsets in the assembled lists for fluid (1), ghostFromCoarser(2), ghostFromFiner(3) and halo(4) elements for the assembled lists, i.e the totalList, invSorted, ... gets the values (0, nElems_fluid, nElems_fluid+nElems_ghostCoarser, nElems_fluid+nElems_ghostCoarser+nELems_ghostFiner) |
|
type(tem_communication_type), | private | :: | sendBuffer | Local Fluids required by remote processes |
|||
type(tem_communication_type), | private | :: | sendBufferFromCoarser | Local ghostFromCoarser required by remote processes |
|||
type(tem_communication_type), | private | :: | sendBufferFromFiner | Local ghostFromFiner required by remote processes |
|||
type(tem_communication_type), | private | :: | recvBuffer | My halos which are fluids on remote processes |
|||
type(tem_communication_type), | private | :: | recvBufferFromCoarser | My halos which are ghostFromCoarser on remote processes |
|||
type(tem_communication_type), | private | :: | recvBufferFromFiner | My halos which are ghostFromFiner on remote processes |
|||
integer, | private | :: | nElems | total number of elements |
Returns the absolute position in the total list of a given treeID opposed to PosOfId, where the relative position in one of the separate lists is returned. Herefore, total list has to be created beforehand.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | tID | the element you are looking for |
||
type(tem_levelDesc_type), | intent(in) | :: | levelDesc | the descriptor you use for searching |
||
integer, | intent(in), | optional | :: | eType | element type |
return position of tID in levelDesc%total list
Convert a non-zero stencil direction {-1,1} to child coordinate {0,1}
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | stencilCoord |
Convert a child coordinate {0,1} to non-zero stencil direction {-1,1}
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | childCoord |
call this routine from your geometry initialization routine in the solver create all the necessary level-wise objects, such as element lists, dependencies
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(inout) | :: | tree | the global tree |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(tree%global%minLevel:) | the level descriptor to be filled |
||
integer, | intent(out), | allocatable | :: | levelPointer(:) | Pointer from treeIDlist entry to level-wise fluid part of total list |
|
type(tem_stencilHeader_type) | :: | computeStencil(:) | array of all stencils used in the simulation |
|||
type(tem_commPattern_type), | intent(in) | :: | commPattern | the communication pattern used |
||
logical, | intent(in), | optional | :: | cleanup | cleanup arrays afterwards? |
|
integer, | intent(in), | optional | :: | reqNesting | nesting level |
|
type(tem_comm_env_type), | intent(in) | :: | proc | Process description to use. |
subroutine to find neighbours of cells
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(out), | allocatable | :: | me(:) | neighbor list containing all the neighbours for the cells given in treeidsubset. Result of this routine |
|
type(tem_BC_prop_type), | intent(in) | :: | boundary | boundaries for the elements with bnd property set |
||
type(treelmesh_type), | intent(in) | :: | tree | subset of tree ids for which the neighbours will be specified |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencils(:) | the given stencil |
Find the partitions holding data on a given path
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(out) | :: | depProc | List of partitions |
||
integer, | intent(out) | :: | nDepProcs | Number of partitions |
||
type(treelmesh_type), | intent(in) | :: | tree | tree information |
||
type(tem_path_type), | intent(in) | :: | elemPath | Element to look up |
||
type(tem_path_type), | intent(in) | :: | PathFirst(:) | Left partition bounds |
||
type(tem_path_type), | intent(in) | :: | PathLast(:) | Right partition bounds |
Find the remote partitions holding data on a given path
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(out) | :: | depProc | List of partitions |
||
integer, | intent(out) | :: | nDepProcs | Number of partitions |
||
type(tem_path_type), | intent(in) | :: | elemPath | Element to look up |
||
integer, | intent(in) | :: | p_lb | Left interval bound to search in |
||
integer, | intent(in) | :: | p_ub | Right interval bound to search in |
||
type(tem_path_type), | intent(in) | :: | PathFirst(:) | Left partition bounds |
||
type(tem_path_type), | intent(in) | :: | PathLast(:) | Right partition bounds |
Invoke the identify_elements for each neighbor of the stencil and store the positions of the encountered elements
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iElem | element position in levelDesc to identify |
||
integer, | intent(in) | :: | iLevel | element level |
||
integer, | intent(in) | :: | iStencil | stencil within the element to act on |
||
type(treelmesh_type), | intent(in) | :: | tree | tree information |
||
type(tem_path_type), | intent(in) | :: | pathFirst(:) | first treeID path in every process |
||
type(tem_path_type), | intent(in) | :: | pathLast(:) | last treeID path in every process |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(tree%global%minLevel:) | the level descriptor to be filled |
||
type(tem_comm_env_type), | intent(in) | :: | proc | process |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | current stencil definition |
||
integer, | intent(in) | :: | nesting | nesting level |
deallocate all dispensable dynamic data structures and arrays
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(:) | the level descriptor |
deallocate the stencil treeID neighbor arrays for each element This routine can only be called after build_horizontalDependencies
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(:) | the level descriptor |
Build the vertical dependencies of ghost elements
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(minlevel:maxLevel) | the level descriptor |
||
integer, | intent(in) | :: | minlevel | Level range |
||
integer, | intent(in) | :: | maxLevel | Level range |
Building neighor array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iStencil | Index of your neighbor list?? |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(tree%global%minLevel:) | Level descriptor for each level of your mesh (starting from minimum level). |
||
type(treelmesh_type), | intent(in) | :: | tree | Tree representation of your mesh. |
||
type(tem_stencilHeader_type), | intent(in) | :: | computeStencil | The stencil you build the horizontal dependencies for. |
Building neighor array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iStencil | Index of your neighbor list. |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(tree%global%minLevel:) | Level descriptor for each level of your mesh (starting from min level). |
||
type(treelmesh_type), | intent(in) | :: | tree | Tree representation of your mesh. |
||
type(tem_stencilHeader_type) | :: | computeStencil | The stencil you build the horizontal dependencies for. |
write out the complete list of elements of a given level
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_element_type), | intent(in) | :: | me | |||
integer, | intent(in) | :: | nUnit | |||
character(len=*), | intent(in) | :: | string | |||
logical, | intent(in), | optional | :: | stencil | ||
logical, | intent(in), | optional | :: | compact |
output all level-wise treeIDs in a clean way
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | minlevel | minimum level of the global tree |
||
integer, | intent(in) | :: | maxLevel | minimum level of the global tree |
||
type(tem_levelDesc_type), | intent(in) | :: | LD(minlevel:maxLevel) | level descriptor |
This routine updates the property bits in the tree with those of the level descriptor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(in) | :: | levelDesc | level descriptor |
||
type(treelmesh_type), | intent(inout) | :: | tree | global tree |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(depSource_type) | :: | me | ||||
type(dyn_intarray_type) | :: | sourceList | ||||
integer, | intent(in) | :: | mySources(n) | |||
integer, | intent(in) | :: | n |
Assemble the fluid list and identify neighbor relations start with building up the ghost and halo element collection as well
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(tree%global%minLevel:) | the level descriptor to be filled |
||
type(treelmesh_type), | intent(in) | :: | tree | the global tree |
||
type(tem_comm_env_type), | intent(in) | :: | proc | Process description to use. |
||
type(tem_stencilHeader_type) | :: | stencil | array of all stencils used in the simulation |
|||
type(tem_path_type), | intent(in) | :: | pathFirst(:) | first and last treeID path in every process |
||
type(tem_path_type), | intent(in) | :: | pathLast(:) | first and last treeID path in every process |
Check, on which partition a given element is located add required elements to corresponding lists: if remote, add to halo if ghost, add to resp. ghost list
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | treeID | treeID to identify |
||
type(treelmesh_type), | intent(in) | :: | tree | tree information |
||
type(tem_path_type), | intent(in) | :: | pathFirst(:) | first treeID path in every process |
||
type(tem_path_type), | intent(in) | :: | pathLast(:) | last treeID path in every process |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(tree%global%minLevel:) | the level descriptor to be filled |
||
integer, | intent(out) | :: | elemPos | nTreeID element position in the levelDesc % elem list |
||
type(tem_comm_env_type), | intent(in) | :: | proc | Process description to use. |
||
type(tem_stencilHeader_type), | intent(in) | :: | Stencil | current stencil definition |
||
integer, | intent(in) | :: | nesting | nesting level |
||
logical, | intent(in), | optional | :: | skip_add_additionalGhost | logical, optional, if true no ghosts are added |
create all the neighbors of an element's parent
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | targetID | requested element position (child element) in LevelDesc elem list |
||
integer, | intent(in) | :: | level | requested element level |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | current stencil definition |
||
type(treelmesh_type), | intent(in) | :: | tree | tree information |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(tree%global%minLevel:) | the level descriptor to be filled |
||
type(tem_path_type), | intent(in) | :: | pathFirst(:) | first treeID path in every process |
||
type(tem_path_type), | intent(in) | :: | pathLast(:) | last treeID path in every process |
||
type(tem_comm_env_type), | intent(in) | :: | proc | process |
Determine the location (which process) of a requested element, which was identified to be located on one single process (can be local or remote) If it is located on a remote process: add to halo list local process: identify if ghost or fluid
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | targetID | neighboring treeID |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(minLevel:) | the level descriptor to be filled |
||
type(treelmesh_type), | intent(in) | :: | tree | tree information |
||
type(tem_comm_env_type), | intent(in) | :: | proc | Process description to use. |
||
integer, | intent(in) | :: | iProc | Process on which targetID is located |
||
integer, | intent(in) | :: | minLevel | minimum level fluid element in the tree |
||
integer, | intent(out) | :: | elemPos | targetID element position in the levelDesc % elem list |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | current stencil definition |
||
integer, | intent(in) | :: | nesting | nesting level |
||
logical, | intent(out) | :: | updated | was the element updated in this call? |
||
logical, | intent(in), | optional | :: | skip_add_additionalGhost | logical, optional, if true no ghosts are added |
Determine if the target element (local) targetID is fluid or ghost in the local process If fluid: do nothing, as it will be added later on anyway (or already is) ghostFromFiner (coarser than requested): add all virtual children, i.e. all levels between requested treeID and found one. ghostFromCoarser (finer than requested): not existing( localPos=0): add to halo
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | targetID | neighboring treeID |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(minLevel:) | the level descriptor to be filled |
||
type(treelmesh_type), | intent(in) | :: | tree | tree information |
||
integer, | intent(in) | :: | minLevel | minimum level fluid element in the tree |
||
integer, | intent(out) | :: | elemPos | targetID element position in the levelDesc % elem list |
||
integer, | intent(in) | :: | nesting | nesting level |
||
logical, | intent(out) | :: | updated | was the element updated in this call? |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | current stencil definition |
||
logical, | intent(in), | optional | :: | skip_add_additionalGhost | logical, optional, if true no ghosts are added |
Find all the virtual children of the sourceID down to the targetLevel and add to the level-wise ghostFromCoarser list in the level descriptor
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | sourceID | source treeID (existing founded ID in tree%treeID list or children ID from recursion) |
||
integer(kind=long_k), | intent(in) | :: | sourceProperty | property of source element |
||
integer, | intent(in) | :: | foundPos | position of this sourceID in elem%tID list |
||
type(tem_path_type), | intent(in) | :: | elemPath | element path |
||
integer, | intent(in) | :: | targetLevel | level upto which virtual children must be created |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(minLevel:) | the level descriptor to be filled |
||
integer, | intent(in) | :: | minLevel | minimum level in the tree |
||
type(treelmesh_type), | intent(in) | :: | tree | tree information |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | current stencil definition |
||
integer, | intent(in) | :: | nesting | nesting level |
||
logical, | intent(out) | :: | updated | was the element updated in this call? |
Inherit the neighborhood from the sourceELem to the targetElem
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | dir | |||
integer, | intent(in) | :: | childCoord(4) | coordinate of virtual(ghost) child |
||
integer, | intent(in) | :: | sourceLevel | coarse element level |
||
integer, | intent(in) | :: | sourcePos | position of coarser element in original treeID list |
||
integer(kind=long_k), | intent(inout) | :: | neighID(:) | neighbor treeIDs of child element |
||
type(tem_stencilHeader_type), | intent(in) | :: | computeStencil | current stencil definition |
||
type(tem_levelDesc_type), | intent(in) | :: | levelDesc(minLevel:) | the level descriptor to be filled |
||
integer, | intent(in) | :: | minLevel | minimum level in the tree |
Add parentID as GhostFromFiner. Then set its BC from its children. If any children do NOT exist, recursively call this routine to add them as GhostFromFiner.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | elemID | requested treeID |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(minLevel:) | the level descriptor to be filled |
||
integer, | intent(in) | :: | minLevel | minimum level fluid element in the tree |
||
type(treelmesh_type), | intent(in) | :: | tree | tree information |
||
logical, | intent(out) | :: | updated | was the current element updated in this call? |
||
integer, | intent(out) | :: | foundPos | |||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | current stencil definition |
Inherit the neighborhood from the sourceELem to the targetElem Note that targetElem is inout, as it might have already values assigned.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | childPos(8) | position of all childs in the levelDesc elem tID list |
||
integer, | intent(in) | :: | sourceLevel | level of child |
||
integer, | intent(in) | :: | targetLevel | level of parent |
||
integer, | intent(in) | :: | targetPos | added position of parent in the levelDesc elem tID list |
||
type(tem_levelDesc_type) | :: | levelDesc(minLevel:) | the level descriptor to be filled |
|||
integer, | intent(in) | :: | minLevel | minimum level in the tree |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | current stencil definition |
create the intermediate, static list totalPnt, which holds pointers to the elem%TID list, but in an ordered fashion. The order is the same as it will be in the total list later on, i.e.: fluid, ghostFC, ghostFF, halo. this four sub-lists are within sorted by their treeID. Additionally, the process-wise collections of halo elements are collected into haloList by grouping the treeIDs according to their belonging process
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(inout) | :: | me | the level descriptor to be filled |
Set the offsets for accessing totallist, invsorted etc. arrays for fluids, ghosts and halos
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(out) | :: | me(2,eT_minRelevant:eT_maxRelevant) | element type offsets |
||
integer, | intent(in) | :: | nFluids | |||
integer, | intent(in) | :: | nGhostFC | |||
integer, | intent(in) | :: | nGhostFF | |||
integer, | intent(in) | :: | nHalos |
Create the level-wise total lists.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(inout) | :: | me(minlevel:maxLevel) | Level descriptor to fill |
||
integer, | intent(in) | :: | minlevel | Minimal level in the mesh |
||
integer, | intent(in) | :: | maxLevel | Minimal level in the mesh |
||
type(treelmesh_type), | intent(in) | :: | tree | tree information |
identify additionally required neighbor elements run over the 'require' list of elements, which was accumulated before in init_elemLevels. The list includes neighbor elements of stencil neighbors, for stencils with the requireNeighNeigh attribute set. This is needed for example for LBM boundary stencil elements, which in turn require their compute stencil neighborhood to allow PULL operations from there
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree | the global tree |
||
type(tem_comm_env_type), | intent(in) | :: | proc | Process description to use. |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(tree%global%minlevel:) | the level descriptor to be filled |
||
type(tem_path_type), | intent(in) | :: | pathFirst(:) | first treeID path in every process |
||
type(tem_path_type), | intent(in) | :: | pathLast(:) | last treeID path in every process |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | the compute stencil, for which the additional neighbors are reconstructed |
exchange the requested treeIDs between all MPI processs
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree | the global tree |
||
type(tem_comm_env_type), | intent(in) | :: | proc | Process description to use. |
||
type(tem_levelDesc_type), | intent(inout) | :: | me(tree%global%minlevel:) | the level descriptor to be filled |
||
type(tem_commPattern_type), | intent(in) | :: | commPattern | the communication pattern used |
||
type(tem_path_type), | intent(in) | :: | pathFirst(:) | first and last treeID path in every process |
||
type(tem_path_type), | intent(in) | :: | pathLast(:) | first and last treeID path in every process |
||
type(tem_stencilHeader_type), | intent(in) | :: | computeStencil(:) | stencil definition |
Map requested halo to a position in my local fluid list or add recursively ghosts until I reach valid fluid elements return type of added element in levelPos(2) Also, non-existing elements are reported as such (levelPos(2))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | haloTreeID | neighboring treeID |
||
integer, | intent(out) | :: | elemPos | type and position in list of found treeID |
||
integer, | intent(out) | :: | haloLevel | |||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(minlevel:) | |||
type(treelmesh_type), | intent(in) | :: | tree | |||
logical, | intent(out) | :: | updated | |||
integer, | intent(in) | :: | nesting | |||
integer, | intent(in) | :: | minLevel | |||
type(tem_stencilHeader_type), | intent(in) | :: | stencil |
Update the neighor arrays depending on what is given in the element stencil
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iStencil | Index of your neighbor list. |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc | Level descriptor for each level of your mesh (starting from min level). |
||
type(tem_stencilHeader_type), | intent(in) | :: | computeStencil | The stencil you build the horizontal dependencies for. |
||
integer, | intent(in) | :: | list(:) | stencil elemLvl points to sorted original treeID list |
||
integer, | intent(in) | :: | nElems | number of elements |
||
type(treelmesh_type), | intent(in) | :: | tree | tree information |
Update the neighor arrays depending on what is given in the element stencil
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iStencil | Index of your neighbor list. |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc | Level descriptor for each level of your mesh (starting from min level). |
||
integer, | intent(in) | :: | posInSortElem(:) | Positions in sorted elem%tID list |
||
integer, | intent(in) | :: | nElems | number of elements |
||
integer, | intent(inout) | :: | iIndex |
Communicate with all existing process the number of requested halo elements
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(inout) | :: | me(minlevel:maxLevel) | the level descriptor to be filled |
||
type(tem_comm_env_type), | intent(in) | :: | proc | Process description to use. |
||
integer, | intent(in) | :: | minLevel | level range |
||
integer, | intent(in) | :: | maxLevel | level range |
Inverse Communication: Communicate, which elements each process needs from me.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(tree%global%minlevel:) | the level descriptor to be filled |
||
type(tem_comm_env_type), | intent(in) | :: | proc | Process description to use. |
||
type(treelmesh_type), | intent(in) | :: | tree | the global tree |
||
integer, | intent(in) | :: | iLevel | current level |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | stencil definition |
||
type(tem_path_type), | intent(in) | :: | pathFirst(:) | first and last treeID path in every process |
||
type(tem_path_type), | intent(in) | :: | pathLast(:) | first and last treeID path in every process |
Report the actually existing elements, which were requested as halos from remote
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_communication_type), | intent(in) | :: | sendbuffer | send buffer |
||
type(tem_communication_type), | intent(inout) | :: | recvbuffer | recv buffer |
||
integer, | intent(in) | :: | comm | MPI communicator |
Check if additional communications have to be performed
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(in) | :: | levelDesc(minlevel:) | level descriptor |
||
type(tem_comm_env_type), | intent(in) | :: | proc | Process description to use. |
||
logical, | intent(out) | :: | doAdditional | do addtional steps to identify neighbors of elems in require list |
||
integer, | intent(in) | :: | minlevel | minlevel in tree |
Report the actually existing elements, which were requested as halos from remote
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc | the level descriptor of specific level |
||
type(tem_communication_type), | intent(inout) | :: | sendbuffer | send and receive communication buffer type |
||
type(tem_communication_type), | intent(inout) | :: | recvbuffer | send and receive communication buffer type |
||
type(tem_comm_env_type), | intent(in) | :: | proc | Process description to use. |
||
type(tem_commPattern_type) | :: | commPattern | communication pattern |
|||
type(tem_stencilHeader_type) | :: | computeStencil(:) | array of all stencils used in the simulation |
Communicate the complete stencil
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_communication_type), | intent(inout) | :: | send | send and recv communication buffers |
||
type(tem_communication_type), | intent(inout) | :: | recv | send and recv communication buffers |
||
type(tem_element_type), | intent(inout) | :: | elem | levelDesc element list |
||
type(tem_stencilHeader_type), | intent(in) | :: | computeStencil | array of all stencils used in the simulation |
||
type(tem_comm_env_type), | intent(in) | :: | proc | Process description to use. |
||
type(tem_commPattern_type), | intent(in) | :: | commPattern | communication pattern |
||
integer, | intent(in) | :: | iStencil | amount of values to communicate |
Update the found dependencies, which were built for non-ordered lists Out of fluid, ghost and halo lists, the totalList is constructed in an ordered fashion. The element order as in the TotalList is later passed on to the solver.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(tree%global%minlevel:) | the level descriptor to be filled |
||
integer, | intent(in) | :: | levelPointer(:) | Pointer from original treeID list to level wise fluid list |
||
type(treelmesh_type), | intent(in) | :: | tree | the global tree |
||
type(tem_stencilHeader_type), | intent(inout) | :: | computeStencil(:) | array of all stencils used in the simulation |
Update the position of the elements inside the buffers from the original tID list to the later totalList
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_communication_type), | intent(inout) | :: | buffer | communication buffer |
||
type(tem_levelDesc_type), | intent(in) | :: | levelDesc | levelDesc to be used |
||
integer, | intent(out) | :: | iError | return encountered error |
add here the dependency for interpolation between the levels For each target cell, there are one or more source cells. The source cell can be of type fluid, ghost or halo. We save the type to update the correct element position later on, when the lists have been assembled.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | sourcePos | position of the source cell in total list |
||
integer, | intent(in) | :: | sourceLevel | level of the source ghost cell |
||
type(depSource_type), | intent(inout) | :: | tgtDep | dependent source elements for this target |
Update the link into a given direction, based on the childs neighbor relations. Define here the trumping rule to decide, which of the neighbors or boundarie is taken for the ghostFromFiner element
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(inout) | :: | neighID | neighID for coarser |
||
integer, | intent(in) | :: | childCoord(4) | child coordinates |
||
integer, | intent(in) | :: | childPos(8) | position of childIds in levelDesc elem tID list |
||
integer, | intent(in) | :: | iStencilElem | current stencil direction |
||
type(tem_element_type), | intent(in) | :: | elem | |||
integer, | intent(in) | :: | iStencil |
write out the complete list of elements of a given level
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dyn_longarray_type), | intent(in) | :: | me | |||
integer, | intent(in) | :: | nUnit | |||
character(len=*), | intent(in) | :: | string |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | posInBCID | |||
integer(kind=long_k), | intent(in) | :: | boundary_ID(:,:) | |||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | |||
integer, | intent(in) | :: | x(4) | |||
integer(kind=long_k), | intent(out) | :: | neighIDs(stencil%QQN) |
Allocate level descriptor and initilize its variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(out), | allocatable | :: | me(:) | ||
integer, | intent(in) | :: | minLevel | |||
integer, | intent(in) | :: | maxLevel | |||
integer, | intent(in) | :: | initlen | |||
integer, | intent(in) | :: | nStencils |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(out), | allocatable | :: | levelPointer(:) | Pointer from original treeID list to level wise fluid list |
|
type(treelmesh_type), | intent(in) | :: | tree | the global tree |
||
type(tem_levelDesc_type), | intent(in) | :: | levelDesc(tree%global%minlevel:) | the level descriptor to be filled |