Repository of the treelm library. Now found at https://github.com/apes-suite/treelm
修訂 | a605bfb94e422fb9ea3cbe0d0715d04e518a2a9d (tree) |
---|---|
時間 | 2023-05-09 20:49:46 |
作者 | Kannan Masilamani <kannan.masilamani@dlr....> |
Commiter | Kannan Masilamani |
Added a search for neighbor of a requested point in a subTree in
tem_cano_storePntsInSubTree
@@ -845,11 +845,11 @@ | ||
845 | 845 | !> growing array to store tracking points |
846 | 846 | type(tem_grwPoints_type), intent(inout) :: grwPnts |
847 | 847 | ! -------------------------------------------------------------------------- |
848 | - integer :: nElems, nPoints, maxLevel, elemPos | |
849 | - integer :: iCano, iPnt | |
848 | + integer :: nElems, nPoints, maxLevel, elemPos, neighPos, coordOfId(4) | |
849 | + integer :: iCano, iPnt, iQQN | |
850 | 850 | real(kind=rk) :: coord(3), offset_a, offset_b, offset_c |
851 | 851 | real(kind=rk) :: unit_vec_a(3),unit_vec_b(3), unit_vec_c(3) |
852 | - integer(kind=long_k) :: treeID | |
852 | + integer(kind=long_k) :: treeID, tOffset, neighID | |
853 | 853 | integer(kind=long_k), allocatable :: subTreeID(:) |
854 | 854 | ! -------------------------------------------------------------------------- |
855 | 855 | maxLevel = inTree%global%maxLevel |
@@ -887,7 +887,25 @@ | ||
887 | 887 | treeID = tem_IdOfCoord( tem_CoordOfReal(inTree, coord(1:3), maxLevel) ) |
888 | 888 | ! get position of the treeID in subTree |
889 | 889 | elemPos = tem_PosOfId( treeID, subTreeID ) |
890 | - if( elempos > 0 ) then | |
890 | + | |
891 | + neighPos = 0 | |
892 | + if (elemPos <= 0) then | |
893 | + ! Point must be outside fluid domain, its neighbor must be in subTreeID | |
894 | + ! since it was added in tem_cano_initSubTree | |
895 | + coordOfId = tem_CoordOfId( treeID ) | |
896 | + tOffset = tem_FirstIdAtLevel( coordOfId(4) ) | |
897 | + directionLoop: do iQQN = 1, qQQQ | |
898 | + neighID = tem_IdOfCoord( & | |
899 | + & [ coordOfId(1) + qOffset( iQQN, 1 ), & | |
900 | + & coordOfId(2) + qOffset( iQQN, 2 ), & | |
901 | + & coordOfId(3) + qOffset( iQQN, 3 ), & | |
902 | + & coordOfId(4) ], tOffset) | |
903 | + neighPos = tem_PosOfId( neighID, subTreeID) | |
904 | + if (neighPos > 0) exit directionLoop | |
905 | + end do directionLoop | |
906 | + end if | |
907 | + | |
908 | + if( elempos > 0 .or. neighPos > 0 ) then | |
891 | 909 | ! append the physical points to the growing array of points |
892 | 910 | call append( me = grwpnts, & |
893 | 911 | & val = coord ) |