67 class(MethodSubcellTernaryType),
intent(inout) :: this
68 class(SubcellTriType),
intent(in) :: subcell
69 type(ParticleType),
pointer,
intent(inout) :: particle
70 real(DP),
intent(in) :: tmax
72 integer(I4B) :: exitFace
122 integer(I4B) :: izstatus
123 integer(I4B) :: itopbotexit
124 integer(I4B) :: ntmax
125 integer(I4B) :: isolv
126 integer(I4B) :: itrifaceenter
127 integer(I4B) :: itrifaceexit
132 integer(I4B) :: reason
136 if (particle%iexmeth == 0)
then
139 isolv = particle%iexmeth
165 vzbot = subcell%vzbot
166 vztop = subcell%vztop
178 call canonical(x0, y0, x1, y1, x2, y2, &
179 v0x, v0y, v1x, v1y, v2x, v2y, &
181 rxx, rxy, ryx, ryy, &
183 alp0, bet0, alp1, bet1, alp2, bet2, alpi, beti)
187 call clamp_bary(alpi, beti, gami, pad=dsame * dep3)
191 zirel = (zi - zbot) / dz
192 call calculate_dt(vzbot, vztop, dz, zirel, vzi, &
193 az, dtexitz, izstatus, &
198 itrifaceenter = particle%iboundary(3) - 1
199 if (itrifaceenter == -1) itrifaceenter = 999
200 call traverse_triangle(isolv, tol, &
201 dtexitxy, alpexit, betexit, &
202 itrifaceenter, itrifaceexit, &
203 alp1, bet1, alp2, bet2, alpi, beti)
207 if (itopbotexit == 0 .and. itrifaceexit == 0)
then
209 particle%advancing = .false.
210 call this%save(particle, reason=3)
218 if (itrifaceexit /= 0)
then
220 exitface = itrifaceexit
222 else if (dtexitz < dtexitxy)
then
224 if (itopbotexit == -1)
then
231 texit = particle%ttrack + dtexit
238 call this%tracktimes%advance()
239 if (this%tracktimes%any())
then
240 do i = this%tracktimes%selection(1), this%tracktimes%selection(2)
241 t = this%tracktimes%times(i)
242 if (t < particle%ttrack) cycle
243 if (t >= texit .or. t >= tmax)
exit
245 call calculate_xyz_position(dt, rxx, rxy, ryx, ryy, sxx, sxy, syy, &
246 izstatus, x0, y0, az, vzi, vzbot, &
247 ztop, zbot, zi, x, y, z)
253 call this%save(particle, reason=5)
260 if (texit .gt. tmax)
then
267 particle%advancing = .false.
276 call calculate_xyz_position(dt, rxx, rxy, ryx, ryy, sxx, sxy, syy, &
277 izstatus, x0, y0, az, vzi, vzbot, &
278 ztop, zbot, zi, x, y, z, exitface)
283 particle%iboundary(3) = exitface
284 call this%save(particle, reason=reason)