21 integer(I4B) :: irvorigin
26 real(dp) :: qextl1(4), qextl2(4), qintl(5)
27 integer(I4B),
allocatable :: irectvert(:)
28 integer(I4B),
allocatable :: ipv4irv(:, :)
29 real(dp),
allocatable :: rectflow(:, :)
48 allocate (cell%irectvert(5))
49 allocate (cell%ipv4irv(2, 4))
50 allocate (cell%rectflow(2, 4))
52 cell%type =
'rectquad'
58 deallocate (this%defn)
59 deallocate (this%irectvert)
60 deallocate (this%type)
68 call this%load_rect_verts_flows()
82 logical(LGP) :: istart180
86 do m = 1, this%defn%npolyverts
87 if (.not. this%defn%get_ispv180(m))
then
90 this%ipv4irv(1, n) = m
91 this%rectflow(1, n) = this%defn%get_faceflow(m)
92 this%ipv4irv(2, n) = 0
93 this%rectflow(2, n) =
dzero
96 this%ipv4irv(2, n) = m
97 this%rectflow(2, n) = this%defn%get_faceflow(m)
104 this%ipv4irv(2, 4) = 1
105 this%rectflow(2, 4) = this%defn%get_faceflow(1)
109 this%irectvert(5) = this%irectvert(1)
122 integer(I4B) :: irv, irv2, irv4, ipv1, ipv2, ipv4
123 integer(I4B),
dimension(4) :: irvnxt = (/2, 3, 4, 1/)
124 real(dp) :: x1, y1, x2, y2, x4, y4
136 ipv4 = this%irectvert(irv4)
137 ipv1 = this%irectvert(irv1)
138 x4 = this%defn%polyvert(1, ipv4)
139 y4 = this%defn%polyvert(2, ipv4)
140 x1 = this%defn%polyvert(1, ipv1)
141 y1 = this%defn%polyvert(2, ipv1)
144 ipv2 = this%irectvert(irv2)
145 x2 = this%defn%polyvert(1, ipv2)
146 if (x2 .le. x1)
return
147 else if (y1 .ge. y4)
then
149 ipv2 = this%irectvert(irv2)
150 y2 = this%defn%polyvert(2, ipv2)
151 if (y2 .gt. y1)
return
166 integer(I4B) :: irv2, irv4, ipv1, ipv2, ipv4
167 integer(I4B),
dimension(4) :: irvnxt = (/2, 3, 4, 1/)
168 real(DP) :: x1, y1, x2, y2, x4, y4, dx2, dy2, dx4, dy4
171 irv2 = irvnxt(this%irvOrigin)
172 irv4 = irvnxt(irvnxt(irv2))
175 ipv1 = this%irectvert(this%irvOrigin)
176 x1 = this%defn%polyvert(1, ipv1)
177 y1 = this%defn%polyvert(2, ipv1)
178 ipv2 = this%irectvert(irv2)
179 x2 = this%defn%polyvert(1, ipv2)
180 y2 = this%defn%polyvert(2, ipv2)
181 ipv4 = this%irectvert(irv4)
182 x4 = this%defn%polyvert(1, ipv4)
183 y4 = this%defn%polyvert(2, ipv4)
188 this%zOrigin = this%defn%bot
189 dx2 = x2 - this%xOrigin
190 dy2 = y2 - this%yOrigin
191 dx4 = x4 - this%xOrigin
192 dy4 = y4 - this%yOrigin
193 this%dx = dsqrt(dx4 * dx4 + dy4 * dy4)
194 this%dy = dsqrt(dx2 * dx2 + dy2 * dy2)
195 this%dz = this%defn%top - this%zOrigin
199 this%sinrot = dy4 / this%dx
200 this%cosrot = dx4 / this%dx
206 integer(I4B) :: iq, irv
208 rectflow = this%rectflow(iq, irv)
216 logical(LGP) :: is_refined
218 if (this%ipv4irv(2, i) .ne. 0)
then
subroutine, public create_defn(cellDefn)
Create a new cell definition object.
subroutine, public create_cell_rect_quad(cell)
Create a new rectangular-quad cell.
subroutine init_from(this, defn)
Initialize a rectangular-quad cell from cell definition.
subroutine get_rect_dim_rot(this)
Get rectangular cell dimensions and rotation.
subroutine destroy_cell_rect_quad(this)
Destroy the rectangular-quad cell.
real(dp) function get_rect_flow(this, iq, irv)
Return a rectangle face flow.
subroutine load_rect_verts_flows(this)
Load local polygon vertex indices and rectangular face flows.
logical(lgp) function face_is_refined(this, i)
Return whether a rectangle face is refined.
integer(i4b) function get_rect_ivert_sw(this)
Get index of SW rectangle vertex.
This module contains simulation constants.
real(dp), parameter dzero
real constant zero
This module defines variable data types.
Base grid cell definition.
Base type for grid cells of a concrete type. Contains a cell-definition which is information shared b...