78 INTEGER,
PARAMETER,
PUBLIC :: HASHTABLE_ENTRYSTATUS_OLD = 0, &
79 HASHTABLE_ENTRYSTATUS_NEW = 1
81 INTEGER,
PUBLIC :: hashTableCollisions,hashTableSize
82 INTEGER,
ALLOCATABLE,
DIMENSION(:),
PUBLIC :: hashTable
88 INTEGER,
PARAMETER,
PRIVATE :: HASHTABLE_INIT = 0
89 INTEGER,
PARAMETER,
PRIVATE :: NPRIMES = 48
91 INTEGER,
PRIVATE :: primeNumbers(NPRIMES) = &
92 (/ 1, 251, 379, 509, &
93 761, 1021, 1531, 2039, &
94 3067, 4093, 6143, 8191, &
95 12289, 16381, 24571, 32749, &
96 49139, 65521, 98297, 131071, &
97 196613, 262139, 393209, 524287, &
98 786431, 1048573, 1572853, 2097143, &
99 3145721, 4194301, 6291449, 8388593, &
100 12582917, 16777213, 25165807, 33554393, &
101 50331599, 67108859, 100663261, 134217689, &
102 201326549, 268435399, 402653171, 536870909, &
103 805306349, 1073741789, 1610612711, 2147483647 /)
143 INTEGER,
INTENT(IN) ::
size
150 INTEGER :: errorflag,ih
157 'RFLU_ModHashTable.F90')
169 ALLOCATE(hashtable(hashtablesize),stat=errorflag)
170 global%error = errorflag
171 IF ( global%error /= err_none )
THEN
172 CALL
errorstop(global,err_allocate,__line__,
'hashTable')
175 DO ih = 1,hashtablesize
176 hashtable(ih) = hashtable_init
179 hashtablecollisions = 0
235 'RFLU_ModHashTable.F90')
241 DEALLOCATE(hashtable,stat=errorflag)
242 global%error = errorflag
243 IF ( global%error /= err_none )
THEN
244 CALL
errorstop(global,err_deallocate,__line__,
'hashTable')
291 INTEGER,
INTENT(IN) ::
size
292 INTEGER,
INTENT(OUT) :: primesize
305 IF (
size >= primenumbers(
i) .AND.
size < primenumbers(
i+1) )
THEN
306 primesize = primenumbers(
i+1)
351 INTEGER,
INTENT(IN) :: asize
352 INTEGER,
INTENT(IN) ::
a(1:asize)
353 INTEGER,
INTENT(OUT) ::
key
360 INTEGER,
PARAMETER :: a_rand = 31415, b_rand = 27183
377 term = mod(
term*b_rand,hashtablesize)
428 INTEGER,
INTENT(IN) ::
a
429 INTEGER,
INTENT(OUT) ::
key
486 INTEGER,
INTENT(IN) ::
key
487 INTEGER,
INTENT(IN) ::
v(1:2)
488 INTEGER,
INTENT(OUT) :: edgetype
489 TYPE(t_grid),
POINTER :: pgrid
496 INTEGER ::
addr,collcntr,incr
503 'RFLU_ModHashTable.F90')
518 IF ( hashtable(
addr) == hashtable_init )
THEN
519 IF ( pgrid%nEdgesTot == pgrid%nEdgesEst )
THEN
520 CALL
errorstop(global,err_nedges_estimate,__line__)
523 edgetype = edge_type_new
525 pgrid%nEdgesTot = pgrid%nEdgesTot + 1
526 hashtable(
addr) = pgrid%nEdgesTot
528 pgrid%e2v(1,pgrid%nEdgesTot) =
v(1)
529 pgrid%e2v(2,pgrid%nEdgesTot) =
v(2)
533 IF (
v(1) == pgrid%e2v(1,hashtable(
addr)) .AND. &
534 v(2) == pgrid%e2v(2,hashtable(
addr)) )
THEN
535 edgetype = edge_type_old
539 hashtablecollisions = hashtablecollisions + 1
541 IF ( collcntr == 0 )
THEN
545 collcntr = collcntr + 1
546 addr = mod(
addr + incr,hashtablesize)
548 IF (
addr == 0 )
THEN
603 INTEGER,
INTENT(IN) :: icg,ifl,
key,
nvert
604 INTEGER,
INTENT(IN) :: fv(1:3)
605 INTEGER,
INTENT(OUT) :: facetype
606 TYPE(t_grid),
POINTER :: pgrid
613 INTEGER ::
addr,collcntr,incr
620 'RFLU_ModHashTable.F90')
640 IF ( hashtable(
addr) == hashtable_init )
THEN
641 IF ( pgrid%nFacesTot == pgrid%nFacesEst )
THEN
642 CALL
errorstop(global,err_nfaces_estimate,__line__)
645 facetype = face_type_new
647 pgrid%nFacesTot = pgrid%nFacesTot + 1
648 hashtable(
addr) = pgrid%nFacesTot
650 pgrid%f2c(1 ,pgrid%nFacesTot) = icg
651 pgrid%f2c(3 ,pgrid%nFacesTot) = ifl
652 pgrid%f2c(4 ,pgrid%nFacesTot) =
nvert
653 pgrid%f2v(1:3,pgrid%nFacesTot) = fv(1:3)
667 IF ( fv(1) == pgrid%f2v(1,hashtable(
addr)) .AND. &
668 fv(2) == pgrid%f2v(2,hashtable(
addr)) .AND. &
669 fv(3) == pgrid%f2v(3,hashtable(
addr)) )
THEN
670 facetype = face_type_old
672 pgrid%f2c(2,hashtable(
addr)) = icg
674 IF ( pgrid%f2c(4,hashtable(
addr)) /=
nvert )
THEN
675 CALL
errorstop(global,err_face_nvert_invalid,__line__)
685 hashtablecollisions = hashtablecollisions + 1
687 IF ( collcntr == 0 )
THEN
691 collcntr = collcntr + 1
692 addr = mod(
addr + incr,hashtablesize)
694 IF (
addr == 0 )
THEN
744 INTEGER,
INTENT(IN) ::
key
745 INTEGER,
INTENT(OUT) ::
addr
752 addr = 1 + mod(
key,hashtablesize)
794 INTEGER,
INTENT(IN) ::
key
795 INTEGER,
INTENT(OUT) ::
addr
802 addr = 1 + mod(
key,hashtablesize-2)
850 INTEGER,
INTENT(IN) :: ivg,
key
851 INTEGER,
INTENT(INOUT) ::
nvert
852 INTEGER,
INTENT(OUT),
OPTIONAL :: errorflag
853 INTEGER,
DIMENSION(:),
INTENT(INOUT) :: vert
854 TYPE(t_patch),
POINTER :: ppatch
861 INTEGER ::
addr,collcntr,incr
868 'RFLU_ModHashTable.F90')
870 IF ( present(errorflag) )
THEN
887 IF ( hashtable(
addr) == hashtable_init )
THEN
888 IF (
nvert ==
SIZE(vert,1) )
THEN
889 IF ( .NOT. present(errorflag) )
THEN
890 CALL
errorstop(global,err_nvert_estimate,__line__)
892 errorflag = err_none + 1
897 hashtable(
addr) = ivg
904 IF ( hashtable(
addr) == ivg )
THEN
907 hashtablecollisions = hashtablecollisions + 1
909 IF ( collcntr == 0 )
THEN
913 collcntr = collcntr + 1
914 addr = mod(
addr + incr,hashtablesize)
916 IF (
addr == 0 )
THEN
975 INTEGER,
INTENT(IN) :: ivg,
key
976 INTEGER,
INTENT(INOUT) ::
nvert
977 INTEGER,
INTENT(OUT) :: ivgindx,ivgstat
978 INTEGER,
DIMENSION(:),
INTENT(INOUT) :: indx,vert
979 TYPE(t_patch),
POINTER :: ppatch
986 INTEGER ::
addr,collcntr,incr
993 'RFLU_ModHashTable.F90')
1008 IF ( hashtable(
addr) == hashtable_init )
THEN
1009 IF (
nvert ==
SIZE(vert,1) )
THEN
1010 CALL
errorstop(global,err_nvert_estimate,__line__)
1013 hashtable(
addr) = ivg
1020 ivgstat = hashtable_entrystatus_new
1021 ivgindx = crazy_value_int
1025 IF ( hashtable(
addr) == ivg )
THEN
1026 ivgstat = hashtable_entrystatus_old
1027 ivgindx = indx(
addr)
1031 hashtablecollisions = hashtablecollisions + 1
1033 IF ( collcntr == 0 )
THEN
1037 collcntr = collcntr + 1
1038 addr = mod(
addr + incr,hashtablesize)
1040 IF (
addr == 0 )
THEN
1096 INTEGER,
INTENT(IN) :: bctype,
key,
nvert
1097 INTEGER,
INTENT(IN) :: fv(1:3)
1098 INTEGER,
INTENT(OUT) :: icg,ifg
1099 TYPE(t_grid),
POINTER :: pgrid
1106 INTEGER ::
addr,collcntr,fvsize,incr
1113 'RFLU_ModHashTable.F90')
1128 ifg = hashtable(
addr)
1134 IF ( ifg == hashtable_init )
THEN
1135 CALL
errorstop(global,err_hashtable,__line__)
1147 IF ( fv(1) == pgrid%f2v(1,ifg) .AND. &
1148 fv(2) == pgrid%f2v(2,ifg) .AND. &
1149 fv(3) == pgrid%f2v(3,ifg) )
THEN
1150 icg = pgrid%f2c(1,ifg)
1156 IF ( pgrid%f2c(2,ifg) /= cell_type_ext )
THEN
1157 IF ( bctype /= bc_symmetry .AND. bctype /= bc_periodic )
THEN
1158 CALL
errorstop(global,err_hashtable,__line__)
1191 IF ( bctype /= bc_symmetry .AND. bctype /= bc_periodic )
THEN
1192 pgrid%f2c(2,ifg) = cell_type_bnd
1194 IF ( icg <= pgrid%nCells )
THEN
1195 pgrid%f2c(2,ifg) = cell_type_bnd
1200 IF ( pgrid%f2c(4,ifg) /=
nvert )
THEN
1201 CALL
errorstop(global,err_face_nvert_invalid,__line__)
1211 IF ( collcntr == 0 )
THEN
1215 collcntr = collcntr + 1
1216 addr = mod(
addr + incr,hashtablesize)
1218 IF (
addr == 0 )
THEN
subroutine, private rflu_hashfuncprimary(key, addr)
subroutine, public rflu_createhashtable(global, size)
subroutine, public rflu_hashedge(global, key, pGrid, v, edgeType)
subroutine, public rflu_destroyhashtable(global)
subroutine rflu_hashbuildkey1(a, key)
subroutine registerfunction(global, funName, fileName)
subroutine, public rflu_hashbuildkey(a, aSize, key)
subroutine, public rflu_unhashbface(global, key, pGrid, fv, nVert, bcType, icg, ifg)
subroutine, private rflu_hashfuncsecondary(key, addr)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
subroutine, public rflu_hashvertexfancy(global, key, ivg, nVert, vert, indx, ivgStat, ivgIndx)
subroutine, private rflu_findnearestprime(size, primeSize)
const void * addr(const COM::Attribute *attr) const
Obtain the address of an attribute associated with the node.
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
subroutine, public rflu_hashface(global, key, pGrid, icg, ifl, fv, nVert, faceType)
subroutine, public rflu_hashvertex(global, key, ivg, nVert, vert, errorFlag)