Skip to content

Commit

Permalink
cellDefn -> defn
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Dec 7, 2023
1 parent 0fa98c9 commit 013b0e9
Show file tree
Hide file tree
Showing 10 changed files with 266 additions and 266 deletions.
2 changes: 1 addition & 1 deletion src/Solution/ParticleTracker/Cell.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module CellModule
!> @brief A grid cell. Contains a cell-definition (composition over inheritance)
type, abstract :: CellType
character(len=40), pointer :: type ! tracking domain type
type(CellDefnType), pointer :: cellDefn => null() ! pointer to cell definition, todo rename to defn
type(CellDefnType), pointer :: defn => null() ! cell definition
contains
procedure(destroy), deferred :: destroy ! destructor for the cell
end type CellType
Expand Down
4 changes: 2 additions & 2 deletions src/Solution/ParticleTracker/CellPoly.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ module CellPolyModule
subroutine create_cellPoly(cellPoly)
type(CellPolyType), pointer :: cellPoly
allocate (cellPoly)
allocate (cellPoly%cellDefn)
allocate (cellPoly%defn)
allocate (cellPoly%type)
cellPoly%type = 'CellPoly'
end subroutine create_cellPoly

!> @brief Destroy the polygonal cell
subroutine destroy_cellPoly(this)
class(CellPolyType), intent(inout) :: this
deallocate (this%cellDefn)
deallocate (this%defn)
deallocate (this%type)
end subroutine destroy_cellPoly

Expand Down
4 changes: 2 additions & 2 deletions src/Solution/ParticleTracker/CellRect.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ module CellRectModule
subroutine create_cellRect(cellRect)
type(CellRectType), pointer :: cellRect
allocate (cellRect)
allocate (cellRect%cellDefn)
allocate (cellRect%defn)
allocate (cellRect%type)
cellRect%type = 'CellRect'
end subroutine create_cellRect

!> @brief Destructor for a rectangular cell
subroutine destroy_cellRect(this)
class(CellRectType), intent(inout) :: this
deallocate (this%cellDefn)
deallocate (this%defn)
deallocate (this%type)
end subroutine destroy_cellRect

Expand Down
42 changes: 21 additions & 21 deletions src/Solution/ParticleTracker/CellRectQuad.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module CellRectQuadModule
subroutine create_cellRectQuad(cellRectQuad)
type(CellRectQuadType), pointer :: cellRectQuad
allocate (cellRectQuad)
allocate (cellRectQuad%cellDefn)
allocate (cellRectQuad%defn)
allocate (cellRectQuad%irectvert(5))
allocate (cellRectQuad%ipv4irv(2, 4))
allocate (cellRectQuad%rectflow(2, 4))
Expand All @@ -52,7 +52,7 @@ end subroutine create_cellRectQuad
!> @brief Destroy a rectangular-quad cell
subroutine destroy_cellRectQuad(this)
class(CellRectQuadType), intent(inout) :: this
deallocate (this%cellDefn)
deallocate (this%defn)
deallocate (this%irectvert)
deallocate (this%type)
end subroutine destroy_cellRectQuad
Expand All @@ -64,7 +64,7 @@ subroutine init_from(this, cellDefn)
type(CellDefnType), pointer :: cellDefn

! -- Set pointer to cell definition
this%cellDefn => cellDefn
this%defn => cellDefn

! -- Load the "rectangle vertices" for the cell
call this%load_irectvert()
Expand All @@ -81,21 +81,21 @@ subroutine load_irectvert(this)
! -- local
integer :: npolyverts, n, m

npolyverts = this%cellDefn%get_npolyverts()
npolyverts = this%defn%get_npolyverts()

n = 0
do m = 1, npolyverts
if (.not. this%cellDefn%get_ispv180(m)) then
if (.not. this%defn%get_ispv180(m)) then
n = n + 1
this%irectvert(n) = m
this%ipv4irv(1, n) = m
this%rectflow(1, n) = this%cellDefn%get_faceflow(m)
this%rectflow(1, n) = this%defn%get_faceflow(m)
this%ipv4irv(2, n) = 0
this%rectflow(2, n) = 0d0
else
if (n .ne. 0) then
this%ipv4irv(2, n) = m
this%rectflow(2, n) = this%cellDefn%get_faceflow(m)
this%rectflow(2, n) = this%defn%get_faceflow(m)
end if
end if
end do
Expand Down Expand Up @@ -130,19 +130,19 @@ function get_irectvertSW(this) result(irv1)
irv1 = irvnxt(irv4)
ipv4 = this%irectvert(irv4)
ipv1 = this%irectvert(irv1)
x4 = this%cellDefn%polyvert(1, ipv4)
y4 = this%cellDefn%polyvert(2, ipv4)
x1 = this%cellDefn%polyvert(1, ipv1)
y1 = this%cellDefn%polyvert(2, ipv1)
x4 = this%defn%polyvert(1, ipv4)
y4 = this%defn%polyvert(2, ipv4)
x1 = this%defn%polyvert(1, ipv1)
y1 = this%defn%polyvert(2, ipv1)
if (x1 .lt. x4) then
irv2 = irvnxt(irv1)
ipv2 = this%irectvert(irv2)
x2 = this%cellDefn%polyvert(1, ipv2)
x2 = this%defn%polyvert(1, ipv2)
if (x2 .le. x1) return
else if (y1 .ge. y4) then
irv2 = irvnxt(irv1)
ipv2 = this%irectvert(irv2)
y2 = this%cellDefn%polyvert(2, ipv2)
y2 = this%defn%polyvert(2, ipv2)
if (y2 .gt. y1) return
end if
end do
Expand Down Expand Up @@ -171,26 +171,26 @@ subroutine get_rectDimensionsRotation(this, irv1, xOrigin, yOrigin, zOrigin, &

! -- Get model coordinates at irv1, irv2, and irv4
ipv1 = this%irectvert(irv1)
x1 = this%cellDefn%polyvert(1, ipv1)
y1 = this%cellDefn%polyvert(2, ipv1)
x1 = this%defn%polyvert(1, ipv1)
y1 = this%defn%polyvert(2, ipv1)
ipv2 = this%irectvert(irv2)
x2 = this%cellDefn%polyvert(1, ipv2)
y2 = this%cellDefn%polyvert(2, ipv2)
x2 = this%defn%polyvert(1, ipv2)
y2 = this%defn%polyvert(2, ipv2)
ipv4 = this%irectvert(irv4)
x4 = this%cellDefn%polyvert(1, ipv4)
y4 = this%cellDefn%polyvert(2, ipv4)
x4 = this%defn%polyvert(1, ipv4)
y4 = this%defn%polyvert(2, ipv4)

! -- Compute rectangle dimensions
xOrigin = x1
yOrigin = y1
zOrigin = this%cellDefn%bot
zOrigin = this%defn%bot
dx2 = x2 - xOrigin
dy2 = y2 - yOrigin
dx4 = x4 - xOrigin
dy4 = y4 - yOrigin
dx = dsqrt(dx4 * dx4 + dy4 * dy4)
dy = dsqrt(dx2 * dx2 + dy2 * dy2)
dz = this%cellDefn%top - zOrigin ! kluge note: need to account for partial saturation
dz = this%defn%top - zOrigin ! kluge note: need to account for partial saturation

! -- Compute sine and cosine of rotation angle (angle between "southern"
! -- rectangle side irv1-irv4 and the model x axis)
Expand Down
12 changes: 6 additions & 6 deletions src/Solution/ParticleTracker/CellUtil.f90
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ subroutine CellPolyToCellRect(cellPoly, cellRect, istatus)
double precision :: factor, term

call create_cellRect(cellRect)
cellDefn => cellPoly%cellDefn
cellDefn => cellPoly%defn
! -- kluge note: no check whether conversion is possible; assumes it is

! -- Translate and rotate the rectangular cell into local coordinates
Expand Down Expand Up @@ -85,7 +85,7 @@ subroutine CellPolyToCellRect(cellPoly, cellRect, istatus)
dz = cellDefn%top - zOrigin ! todo: need to account for partial saturation
sinrot = dy4 / dx
cosrot = dx4 / dx
cellRect%cellDefn = cellPoly%cellDefn
cellRect%defn = cellPoly%defn
cellRect%dx = dx
cellRect%dy = dy
cellRect%dz = dz
Expand Down Expand Up @@ -129,7 +129,7 @@ subroutine CellPolyToCellRectQuad(cellPoly, cellRectQuad, istatus)
double precision :: qhalf, qdisttopbot, q1, q2, q4

call create_cellRectQuad(cellRectQuad)
call cellRectQuad%init_from(cellPoly%cellDefn)
call cellRectQuad%init_from(cellPoly%defn)
! kluge note: no check whether conversion is possible; assumes it is
! -- Translate and rotate the rect-quad cell into local coordinates with
! -- x varying from 0 to dx and y varying from 0 to dy. Choose the "south-
Expand Down Expand Up @@ -159,9 +159,9 @@ subroutine CellPolyToCellRectQuad(cellPoly, cellRectQuad, istatus)
cellRectQuad%qextl1(isc) = cellRectQuad%get_rectflow(2, irv)
end if
end do
qdisttopbot = 2.5d-1 * (cellRectQuad%cellDefn%get_distflow() &
+ cellRectQuad%cellDefn%get_botflow() &
+ cellRectQuad%cellDefn%get_topflow())
qdisttopbot = 2.5d-1 * (cellRectQuad%defn%get_distflow() &
+ cellRectQuad%defn%get_botflow() &
+ cellRectQuad%defn%get_topflow())
q1 = qdisttopbot + cellRectQuad%qextl1(1) + cellRectQuad%qextl2(1)
q2 = qdisttopbot + cellRectQuad%qextl1(2) + cellRectQuad%qextl2(2)
q4 = qdisttopbot + cellRectQuad%qextl1(4) + cellRectQuad%qextl2(4)
Expand Down
6 changes: 3 additions & 3 deletions src/Solution/ParticleTracker/MethodCellPollock.f90
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ subroutine apply_mCP(this, particle, tmax)

! -- Update particle state, checking whether any reporting or
! -- termination conditions apply
call this%update(particle, this%cellRect%cellDefn)
call this%update(particle, this%cellRect%defn)

! -- Return early if particle is done advancing
if (.not. particle%advancing) return
Expand All @@ -146,8 +146,8 @@ subroutine apply_mCP(this, particle, tmax)
! -- represent a water table above the cell bottom), pass the particle
! -- vertically and instantaneously to the cell top elevation and save
! -- the particle state to output file(s).
if (particle%z > this%cellRect%cellDefn%top) then
particle%z = this%cellRect%cellDefn%top
if (particle%z > this%cellRect%defn%top) then
particle%z = this%cellRect%defn%top
call this%trackctl%save(particle, kper=kper, &
kstp=kstp, reason=1) ! reason=1: cell transition
end if
Expand Down
22 changes: 11 additions & 11 deletions src/Solution/ParticleTracker/MethodCellPollockQuad.f90
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ subroutine pass_mCPQ(this, particle)

exitFace = particle%iTrackingDomainBoundary(3)
isc = particle%iTrackingDomain(3)
npolyverts = this%cellRectQuad%cellDefn%npolyverts
npolyverts = this%cellRectQuad%defn%npolyverts

select case (exitFace) ! kluge note: exitFace uses Dave's iface convention
case (0)
Expand Down Expand Up @@ -221,7 +221,7 @@ subroutine apply_mCPQ(this, particle, tmax)

! -- Update particle state, checking whether any reporting or
! -- termination conditions apply
call this%update(particle, this%cellRectQuad%cellDefn)
call this%update(particle, this%cellRectQuad%defn)

! -- Return early if particle is done advancing
if (.not. particle%advancing) return
Expand All @@ -230,8 +230,8 @@ subroutine apply_mCPQ(this, particle, tmax)
! -- represent a water table above the cell bottom), pass the particle
! -- vertically and instantaneously to the cell top elevation and save
! -- the particle state to output file(s).
if (particle%z > this%cellRectQuad%cellDefn%top) then
particle%z = this%cellRectQuad%cellDefn%top
if (particle%z > this%cellRectQuad%defn%top) then
particle%z = this%cellRectQuad%defn%top
call this%trackctl%save(particle, kper=kper, &
kstp=kstp, reason=1) ! reason=1: cell transition
end if
Expand Down Expand Up @@ -274,9 +274,9 @@ subroutine load_subcell(this, particle, levelNext, subcellRect)
double precision :: qextl1, qextl2, qintl1, qintl2
double precision :: factor, term

factor = DONE / this%cellRectQuad%cellDefn%retfactor
factor = factor / this%cellRectQuad%cellDefn%porosity
npolyverts = this%cellRectQuad%cellDefn%npolyverts
factor = DONE / this%cellRectQuad%defn%retfactor
factor = factor / this%cellRectQuad%defn%porosity
npolyverts = this%cellRectQuad%defn%npolyverts

isc = particle%iTrackingDomain(3)
! -- Subcells 1, 2, 3, and 4 are Pollock's subcells A, B, C, and D,
Expand Down Expand Up @@ -324,8 +324,8 @@ subroutine load_subcell(this, particle, levelNext, subcellRect)
end if
dx = 5d-1 * dx
dy = 5d-1 * dy
dz = this%cellRectQuad%cellDefn%top - &
this%cellRectQuad%cellDefn%bot ! kluge note: need to account for partial saturation
dz = this%cellRectQuad%defn%top - &
this%cellRectQuad%defn%bot ! kluge note: need to account for partial saturation
areax = dy * dz
areay = dx * dz
areaz = dx * dy
Expand Down Expand Up @@ -382,8 +382,8 @@ subroutine load_subcell(this, particle, levelNext, subcellRect)
m1 = npolyverts + 2
m2 = m1 + 1
term = factor / areaz
subcellRect%vz1 = 2.5d-1 * this%cellRectQuad%cellDefn%faceflow(m1) * term
subcellRect%vz2 = -2.5d-1 * this%cellRectQuad%cellDefn%faceflow(m2) * term
subcellRect%vz1 = 2.5d-1 * this%cellRectQuad%defn%faceflow(m1) * term
subcellRect%vz2 = -2.5d-1 * this%cellRectQuad%defn%faceflow(m2) * term

end subroutine load_subcell

Expand Down
44 changes: 22 additions & 22 deletions src/Solution/ParticleTracker/MethodCellTernary.f90
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ subroutine pass_mCT(this, particle)

exitFace = particle%iTrackingDomainBoundary(3)
isc = particle%iTrackingDomain(3)
npolyverts = this%cellPoly%cellDefn%npolyverts
npolyverts = this%cellPoly%defn%npolyverts

select case (exitFace)
case (0)
Expand Down Expand Up @@ -150,7 +150,7 @@ subroutine apply_mCT(this, particle, tmax)

! -- Update particle state, checking whether any reporting or
! -- termination conditions apply
call this%update(particle, this%cellPoly%cellDefn)
call this%update(particle, this%cellPoly%defn)

! -- Return early if particle is done advancing
if (.not. particle%advancing) return
Expand All @@ -159,36 +159,36 @@ subroutine apply_mCT(this, particle, tmax)
! -- represent a water table above the cell bottom), pass the particle
! -- vertically and instantaneously to the cell top elevation and save
! -- the particle state to output file(s).
if (particle%z > this%cellPoly%cellDefn%top) then
particle%z = this%cellPoly%cellDefn%top
if (particle%z > this%cellPoly%defn%top) then
particle%z = this%cellPoly%defn%top
call this%trackctl%save(particle, kper=kper, &
kstp=kstp, reason=1) ! reason=1: cell transition
end if

npolyverts = this%cellPoly%cellDefn%npolyverts
npolyverts = this%cellPoly%defn%npolyverts

xsum = DZERO
ysum = DZERO
vxsum = DZERO
vysum = DZERO
area = DZERO
this%ztop = this%cellPoly%cellDefn%top
this%zbot = this%cellPoly%cellDefn%bot
this%ztop = this%cellPoly%defn%top
this%zbot = this%cellPoly%defn%bot
this%dz = this%ztop - this%zbot
do iv = 1, npolyverts
ivp1 = iv + 1
if (ivp1 .gt. npolyverts) ivp1 = 1
ivm1 = iv - 1
if (ivm1 .lt. 1) ivm1 = npolyverts
x0 = this%cellPoly%cellDefn%polyvert(1, iv)
y0 = this%cellPoly%cellDefn%polyvert(2, iv)
x2 = this%cellPoly%cellDefn%polyvert(1, ivp1)
y2 = this%cellPoly%cellDefn%polyvert(2, ivp1)
x1 = this%cellPoly%cellDefn%polyvert(1, ivm1)
y1 = this%cellPoly%cellDefn%polyvert(2, ivm1)
term = DONE / (this%cellPoly%cellDefn%porosity * this%dz)
flow0 = this%cellPoly%cellDefn%faceflow(iv) * term
flow1 = this%cellPoly%cellDefn%faceflow(ivm1) * term
x0 = this%cellPoly%defn%polyvert(1, iv)
y0 = this%cellPoly%defn%polyvert(2, iv)
x2 = this%cellPoly%defn%polyvert(1, ivp1)
y2 = this%cellPoly%defn%polyvert(2, ivp1)
x1 = this%cellPoly%defn%polyvert(1, ivm1)
y1 = this%cellPoly%defn%polyvert(2, ivm1)
term = DONE / (this%cellPoly%defn%porosity * this%dz)
flow0 = this%cellPoly%defn%faceflow(iv) * term
flow1 = this%cellPoly%defn%faceflow(ivm1) * term
d01x = x1 - x0 ! kluge note: do this more efficiently, not recomputing things so much???
d01y = y1 - y0
d02x = x2 - x0
Expand All @@ -200,7 +200,7 @@ subroutine apply_mCT(this, particle, tmax)
! v0x = -velmult*oodet*(d02x*flow1 + d01x*flow0)
! v0y = -velmult*oodet*(d02y*flow1 + d01y*flow0) !
det = d01y * d02x - d02y * d01x
retfactor = this%cellPoly%cellDefn%retfactor
retfactor = this%cellPoly%defn%retfactor
! kluge note: can det ever be zero, like maybe for a 180-deg vertex???
! term = velfactor/det
! kluge note: can det ever be zero, like maybe for a 180-deg vertex???
Expand All @@ -220,9 +220,9 @@ subroutine apply_mCT(this, particle, tmax)
area = area + x0 * y1 - x1 * y0
end do
area = area * DHALF
term = DONE / (retfactor * this%cellPoly%cellDefn%porosity * area)
this%vzbot = this%cellPoly%cellDefn%faceflow(npolyverts + 2) * term
this%vztop = -this%cellPoly%cellDefn%faceflow(npolyverts + 3) * term
term = DONE / (retfactor * this%cellPoly%defn%porosity * area)
this%vzbot = this%cellPoly%defn%faceflow(npolyverts + 2) * term
this%vztop = -this%cellPoly%defn%faceflow(npolyverts + 3) * term
this%xctr = xsum / dble(npolyverts)
this%yctr = ysum / dble(npolyverts)
this%vxctr = vxsum / dble(npolyverts)
Expand All @@ -249,10 +249,10 @@ subroutine load_subcell(this, particle, levelNext, subcellTri)
double precision :: di2, d02, d12, di1, d01, alphai, betai
double precision :: betatol

ic = this%cellPoly%cellDefn%icell
ic = this%cellPoly%defn%icell
subcellTri%icell = ic
isc = particle%iTrackingDomain(3)
npolyverts = this%cellPoly%cellDefn%npolyverts
npolyverts = this%cellPoly%defn%npolyverts

! -- Find subcell if not known ! kluge note: from "find_init_triangle"
if (isc .le. 0) then
Expand Down
Loading

0 comments on commit 013b0e9

Please sign in to comment.