Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed denominator typos #77

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/modules/gridData.F90
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ module gridData
integer(kind=intTYpe) :: initializationSet = 0

real(kind=realType), dimension(:), allocatable :: d2wall
real(kind=realType), dimension(:), allocatable :: denomenator, denomenator0
real(kind=realType), dimension(:), allocatable :: denominator, denominator0
real(kind=realType), dimension(:, :), allocatable :: numerator

! Symmetry Information
6 changes: 3 additions & 3 deletions src/modules/kd_tree.F90
Original file line number Diff line number Diff line change
@@ -663,7 +663,7 @@ end subroutine evalNode

subroutine evalNodeExact(tp, np, r, num, den)
! Loop over the owned nodes and evaluate the exact numerator and
! denomenator at the requesed r. Note that this rouine *may* be
! denominator at the requesed r. Note that this rouine *may* be
! called on *any* node including the root node. When called on the
! root node this is actually the exact scheme.
implicit none
@@ -750,7 +750,7 @@ end subroutine writeTreeTecplot

recursive subroutine getWiEstimate(tp, np, r, den)
! This routine needs to be only called once. Essentialy what we are
! dong is computing just the denomenator (Wi) computation. This is
! dong is computing just the denominator (Wi) computation. This is
! used as a reference value for the 'real' mesh warp, to be used for
! checking against the errors. A hard coded R-limit of 5.0 is used
! here. This should be sufficient to get an good estimate of Wi.
@@ -831,7 +831,7 @@ end subroutine dryRun

recursive subroutine computeErrors(tp, np)
! This routine computes an estimate of the error to be induced in
! the denomenator at each tree node. Then, when we are evaluating
! the denominator at each tree node. Then, when we are evaluating
! the displacment we can determine if the errors induced by the
! approximation are acceptable or not.

2 changes: 1 addition & 1 deletion src/utils/releaseMemory.F90
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ subroutine releaseMemory
call EChk(ierr, __FILE__, __LINE__)

! Deallocate the num/den data
deallocate (numerator, denomenator, denomenator0)
deallocate (numerator, denominator, denominator0)

initializationSet = 0
end if
50 changes: 25 additions & 25 deletions src/warp/initializeWarping.F90
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ subroutine initializeWarping(pts, uniquePts, link, faceSizes, faceConn, &
integer(kind=intType) :: i, j, ii, kk
real(kind=realType), dimension(:), allocatable :: costs, procEndCosts, cumNodesProc
integer(kind=intType), dimension(:), allocatable :: procSplits, procSplitsLocal
real(kind=realType), dimension(:), allocatable :: denomenator0Copy
real(kind=realType), dimension(:), allocatable :: denominator0Copy
real(kind=realtype) :: costOffset, totalCost, averageCost, c, tmp, r(3)
integer(kind=intType) :: nVol, curBin, newBin, newDOFProc, totalDOF
integer(kind=intType) :: stat
@@ -78,11 +78,11 @@ subroutine initializeWarping(pts, uniquePts, link, faceSizes, faceConn, &
call VecGetArrayF90(commonGridVec, Xv0Ptr, ierr)
call EChk(ierr, __FILE__, __LINE__)

! Allocate the denomenator estimate and costs. These may be loaded
! Allocate the denominator estimate and costs. These may be loaded
! from the restart file.
nVol = size(Xv0Ptr) / 3
allocate (denomenator0(nVol), costs(nVol))
denomenator0 = zero
allocate (denominator0(nVol), costs(nVol))
denominator0 = zero
costs = zero

! Get the ownership ranges for common grid vector, we need that to
@@ -169,7 +169,7 @@ subroutine initializeWarping(pts, uniquePts, link, faceSizes, faceConn, &
call mpi_file_seek(fileHandle, offset, MPI_SEEK_SET, ierr)
call EChk(ierr, __FILE__, __LINE__)

call MPI_file_read(fileHandle, denomenator0, size(denomenator0), &
call MPI_file_read(fileHandle, denominator0, size(denominator0), &
MPI_REAL8, status, ierr)
call EChk(ierr, __FILE__, __LINE__)

@@ -203,9 +203,9 @@ subroutine initializeWarping(pts, uniquePts, link, faceSizes, faceConn, &
call getWiEstimate(mytrees(1)%tp, mytrees(1)%tp%root, r, tmp)
end do
! Do a relative check:
if (1 - tmp / denomenator0(j) > eps) then
if (1 - tmp / denominator0(j) > eps) then
localBadFile = .True.
print *, myid, j, tmp, denomenator0(j), eps
print *, myid, j, tmp, denominator0(j), eps
exit wiLoop_check
end if
end do wiLoop_check
@@ -234,15 +234,15 @@ subroutine initializeWarping(pts, uniquePts, link, faceSizes, faceConn, &

if (recompute) then
if (myid == 0) then
print *, 'Computing Denomenator Estimate...'
print *, 'Computing Denominator Estimate...'
end if

! Compute the (approx) denomenator. This needs to be done only once.
! Compute the (approx) denominator. This needs to be done only once.
do kk = 1, nLoop
wiLoop: do j = 1, nVol
call getMirrorPt(Xv0Ptr(3 * j - 2:3 * j), r, kk)
call getWiEstimate(mytrees(1)%tp, mytrees(1)%tp%root, r, &
denomenator0(j))
denominator0(j))
end do wiLoop
end do

@@ -259,7 +259,7 @@ subroutine initializeWarping(pts, uniquePts, link, faceSizes, faceConn, &
dryRunLoop: do j = 1, nVol
c = zero
call getMirrorPt(Xv0Ptr(3 * j - 2:3 * j), r, kk)
call dryRun(mytrees(1)%tp, mytrees(1)%tp%root, r, denomenator0(j), c)
call dryRun(mytrees(1)%tp, mytrees(1)%tp%root, r, denominator0(j), c)
costs(j) = costs(j) + c / mytrees(1)%tp%n
end do dryRunLoop
end do
@@ -294,7 +294,7 @@ subroutine initializeWarping(pts, uniquePts, link, faceSizes, faceConn, &
call mpi_file_seek(fileHandle, offset, MPI_SEEK_SET, ierr)
call EChk(ierr, __FILE__, __LINE__)

call MPI_file_write(fileHandle, denomenator0, size(denomenator0), &
call MPI_file_write(fileHandle, denominator0, size(denominator0), &
MPI_REAL8, MPI_STATUS_IGNORE, ierr)
call EChk(ierr, __FILE__, __LINE__)

@@ -450,25 +450,25 @@ subroutine initializeWarping(pts, uniquePts, link, faceSizes, faceConn, &
call VecCopy(Xv, Xv0, ierr)
call EChk(ierr, __FILE__, __LINE__)

! We also want to scatter denomenator0 since that was kinda costly
! We also want to scatter denominator0 since that was kinda costly
! to compute. So we vecPlace it into commonGridVec and take it out
! of Xv. However, denomenator is only a third of the size of the
! of Xv. However, denominator is only a third of the size of the
! gridVec. So we dump it into a temporary vector, which *is* the
! right size and the copy after

! We can now also allocate the final space for the denomenator
! We can now also allocate the final space for the denominator
allocate (numerator(3, newDOFProc / 3))
allocate (denomenator(newDOFProc / 3))
allocate (denomenator0Copy(nVol * 3))
allocate (denominator(newDOFProc / 3))
allocate (denominator0Copy(nVol * 3))
do i = 1, nVol
denomenator0Copy(3 * i - 2) = denomenator0(i)
denominator0Copy(3 * i - 2) = denominator0(i)
end do

! Clear the current denomenator0 and make the right size.
deallocate (denomenator0)
allocate (denomenator0(newDOFProc / 3))
! Clear the current denominator0 and make the right size.
deallocate (denominator0)
allocate (denominator0(newDOFProc / 3))

call VecPlaceArray(commonGridVec, denomenator0Copy, ierr)
call VecPlaceArray(commonGridVec, denominator0Copy, ierr)
call EChk(ierr, __FILE__, __LINE__)

call VecPlaceArray(Xv, numerator, ierr)
@@ -490,16 +490,16 @@ subroutine initializeWarping(pts, uniquePts, link, faceSizes, faceConn, &
call VecResetArray(Xv, ierr)
call EChk(ierr, __FILE__, __LINE__)

! Copy denomenator0 out of 'numerator'
! Copy denominator0 out of 'numerator'
do i = 1, newDOFProc / 3
denomenator0(i) = numerator(1, i)
denominator0(i) = numerator(1, i)
end do
warpMeshDOF = newDOFProc
commonMeshDOF = nVol * 3

! Deallocate the memory from this subroutine
deallocate (cumNodesProc)
deallocate (costs, procEndCosts, procSplits, procSplitsLocal, denomenator0Copy)
deallocate (costs, procEndCosts, procSplits, procSplitsLocal, denominator0Copy)

if (myid == 0) then
print *, 'Finished Mesh Initialization.'
4 changes: 2 additions & 2 deletions src/warp/warpDeriv.F90
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ subroutine warpDeriv(dXv_f, ndof_warp)
call getMirrorPt(Xv0Ptr(3 * j - 2:3 * j), r, kk)

! Numerator derivative
oden = one / denomenator(j)
oden = one / denominator(j)

numb = xvptrb(3 * j - 2:3 * j) * oden
call getMirrorNumerator_b(numb, kk)
@@ -82,7 +82,7 @@ subroutine warpDeriv(dXv_f, ndof_warp)
call evalNodeExact_b(mytrees(1)%tp, mytrees(1)%tp%root, r, numb, Bib, Mib)
else
call evalNode_b(mytrees(1)%tp, mytrees(1)%tp%root, r, numb, &
denomenator0(j), Bib, Mib)
denominator0(j), Bib, Mib)
end if
end do
end do
4 changes: 2 additions & 2 deletions src/warp/warpDerivFwd.F90
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ subroutine warpDerivFwd(Xsdot, cDof, Xvdot, meshDOF)
call evalNodeExact_d(mytrees(1)%tp, mytrees(1)%tp%root, r, numd)
else
call evalNode_d(mytrees(1)%tp, mytrees(1)%tp%root, r, numd, &
denomenator0(j))
denominator0(j))
end if

call getMirrorNumerator_d(numd, kk)
@@ -92,7 +92,7 @@ subroutine warpDerivFwd(Xsdot, cDof, Xvdot, meshDOF)
call deallocDerivValues(mytrees(1)%tp)

updateLoop: do j = 1, nVol
oden = one / denomenator(j)
oden = one / denominator(j)
Xvdot(3 * j - 2) = numerator(1, j) * oden
Xvdot(3 * j - 1) = numerator(2, j) * oden
Xvdot(3 * j) = numerator(3, j) * oden
8 changes: 4 additions & 4 deletions src/warp/warpMesh.F90
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ subroutine warpMesh()
mytrees(1)%tp%errTol = errTol
call setData(mytrees(1)%tp, mytrees(1)%tp%root)

denomenator = zero
denominator = zero
numerator = zero
do kk = 1, nLoop
volLoop: do j = 1, nVol
@@ -51,19 +51,19 @@ subroutine warpMesh()
if (evalMode == EVAL_EXACT) then
call evalNodeExact(mytrees(1)%tp, mytrees(1)%tp%root, r, num, den)
else
call evalNode(mytrees(1)%tp, mytrees(1)%tp%root, r, num, den, denomenator0(j))
call evalNode(mytrees(1)%tp, mytrees(1)%tp%root, r, num, den, denominator0(j))
end if

call getMirrorNumerator(num, kk)
numerator(1, j) = numerator(1, j) + num(1)
numerator(2, j) = numerator(2, j) + num(2)
numerator(3, j) = numerator(3, j) + num(3)
denomenator(j) = denomenator(j) + den
denominator(j) = denominator(j) + den
end do volLoop
end do

updateLoop: do j = 1, nVol
oden = one / denomenator(j)
oden = one / denominator(j)
XvPtr(3 * j - 2) = Xv0Ptr(3 * j - 2) + numerator(1, j) * oden
XvPtr(3 * j - 1) = Xv0Ptr(3 * j - 1) + numerator(2, j) * oden
XvPtr(3 * j) = Xv0Ptr(3 * j) + numerator(3, j) * oden