The required source elements for ghost from coarser elements are identified in this routine. Moreover, the weights for each sources based on distance are calculated. \n
The depdendencies for ghostFromCoarser elements initially only include its parent element. Additional dependencies Y for the element x are found which were not included in the construction routine before hand. However, they are defined to be inherently part of the stencil and hence exist locally and can simply be added to the dependencies. Two different ways are implemented. Full interpolation stencil the complete compute stencil is included into the dependency list
Y Y Y
x o
Y O Y
o o
Y Y Y
Note: The view here is according to how the interpolation will be done. The coarse level does the interpolation for the finer level. Thus, we access the information from the levelDesc with the targetLevel and sourceLevel perspective.
Steps of finding sources: 1. loop over all neighbors: iNeigh = 1, QQ 2. get neighbor posInTotal: elemPos = neigh(1)%nghElems 3. if elemPos > 0, add this source into depFromCoarser%elem add this source into sourceFromCoarser save its position in sourceFromCoarser into depFromCoarser%elemBuffer calculate its weight based on relative coordinates in stencil weight is inverse proportional to the distance from source to target weight is normalized at last, so that sum of weights equals 1 4. save its offset on stencil
After finding sources, append target to low or high interpolation list based on if all required sources are found.
suppChild = 1
write(dbgUnit(5),"(A, I0)") ' suppChild: ', suppChild write(dbgUnit(5),"(A, I0)") ' childNum: ', childNum
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_interpolation_type), | intent(inout) | :: | intp | interpolation type |
||
type(tem_levelDesc_type) | :: | levelDesc(minLevel:maxLevel) | Level Descriptor |
|||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | |||
integer, | intent(in) | :: | minLevel | |||
integer, | intent(in) | :: | maxLevel |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | sourceLevel | ||||
integer, | private | :: | targetLevel | ||||
integer, | private | :: | targetElem | ||||
integer, | private | :: | iElem | ||||
integer, | private | :: | iNeigh | ||||
integer, | private | :: | nGhostElems | ||||
integer, | private | :: | nFoundSources | ||||
integer, | private | :: | posInTotal | ||||
integer, | private | :: | parentPosInTotal | ||||
real(kind=rk), | private | :: | targetBary(3) | ||||
integer, | private | :: | mySources(stencil%QQ) | ||||
integer, | private | :: | myNeighDir(stencil%QQ) | ||||
integer, | private | :: | posInMatArray | ||||
integer, | private | :: | intpOrder | ||||
integer, | private | :: | childNum | ||||
integer, | private | :: | iOrder | ||||
logical, | private | :: | success | ||||
integer, | private | :: | sourceElem | ||||
integer, | private | :: | iSourceElem |