Skip to content

Commit

Permalink
Making NodeToElements faster
Browse files Browse the repository at this point in the history
  • Loading branch information
vickysharma0812 committed Feb 1, 2024
1 parent 6ed414c commit a96f92a
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
MODULE PROCEDURE obj_InitiateNodeToElements
CHARACTER(*), PARAMETER :: myName = "obj_InitiateNodeToElements()"
INTEGER(I4B) :: ii, jj, globalElemNum, nn, localNodeNum, &
& globalNodeNum
& globalNodeNum, nodewise_size(obj%tNodes)
TYPE(CPUTime_) :: TypeCPUTime
INTEGER(I4B), PARAMETER :: chunk_size = 32

#ifdef DEBUG_VER
CALL e%RaiseInformation(modName//'::'//myName//' - '// &
Expand All @@ -47,6 +48,8 @@

obj%isNodeToElementsInitiated = .TRUE.

nodewise_size = 0

DO ii = 1, obj%tElements
globalElemNum = obj%elementData(ii)%globalElemNum

Expand All @@ -56,13 +59,19 @@
globalNodeNum = obj%elementData(ii)%globalNodes(jj)
localNodeNum = obj%local_nptrs(globalNodeNum)

CALL Append(obj%nodeData(localNodeNum)%globalElements, &
& globalElemNum)

CALL Expand(vec=obj%nodeData(localNodeNum)%globalElements, &
& n=nodewise_size(localNodeNum), chunk_size=chunk_size, &
& val=globalElemNum)
END DO

END DO

! Now we have to fix the size of `nodeData%globalElements`
DO ii = 1, obj%tNodes
CALL Expand(vec=obj%nodeData(ii)%globalElements, &
& n=nodewise_size(ii), chunk_size=chunk_size, finished=.TRUE.)
END DO

IF (obj%showTime) THEN
CALL TypeCPUTime%SetEndTime()
CALL Display(modName//" : "//myName// &
Expand Down

0 comments on commit a96f92a

Please sign in to comment.