66 class(MethodSubcellTernaryType),
intent(inout) :: this
67 class(SubcellTriType),
intent(in) :: subcell
68 type(ParticleType),
pointer,
intent(inout) :: particle
69 real(DP),
intent(in) :: tmax
71 integer(I4B) :: exitFace
121 integer(I4B) :: izstatus
122 integer(I4B) :: itopbotexit
123 integer(I4B) :: ntmax
124 integer(I4B) :: isolv
125 integer(I4B) :: itrifaceenter
126 integer(I4B) :: itrifaceexit
131 integer(I4B) :: reason
135 if (particle%iexmeth == 0)
then
138 isolv = particle%iexmeth
164 vzbot = subcell%vzbot
165 vztop = subcell%vztop
177 call canonical(x0, y0, x1, y1, x2, y2, &
178 v0x, v0y, v1x, v1y, v2x, v2y, &
180 rxx, rxy, ryx, ryy, &
182 alp0, bet0, alp1, bet1, alp2, bet2, alpi, beti)
186 call clamp_bary(alpi, beti, gami, pad=dsame * dep3)
190 zirel = (zi - zbot) / dz
191 call calculate_dt(vzbot, vztop, dz, zirel, vzi, &
192 az, dtexitz, izstatus, &
197 itrifaceenter = particle%iboundary(3) - 1
198 if (itrifaceenter == -1) itrifaceenter = 999
199 call traverse_triangle(isolv, tol, &
200 dtexitxy, alpexit, betexit, &
201 itrifaceenter, itrifaceexit, &
202 alp1, bet1, alp2, bet2, alpi, beti)
206 if (itopbotexit == 0 .and. itrifaceexit == 0)
then
208 particle%advancing = .false.
209 call this%save(particle, reason=3)
217 if (itrifaceexit /= 0)
then
219 exitface = itrifaceexit
221 else if (dtexitz < dtexitxy)
then
223 if (itopbotexit == -1)
then
230 texit = particle%ttrack + dtexit
237 call this%tracktimes%advance()
238 if (this%tracktimes%any())
then
239 do i = this%tracktimes%selection(1), this%tracktimes%selection(2)
240 t = this%tracktimes%times(i)
241 if (t < particle%ttrack) cycle
242 if (t >= texit .or. t >= tmax)
exit
244 call calculate_xyz_position(dt, rxx, rxy, ryx, ryy, sxx, sxy, syy, &
245 izstatus, x0, y0, az, vzi, vzbot, &
246 ztop, zbot, zi, x, y, z)
252 call this%save(particle, reason=5)
259 if (texit .gt. tmax)
then
266 particle%advancing = .false.
275 call calculate_xyz_position(dt, rxx, rxy, ryx, ryy, sxx, sxy, syy, &
276 izstatus, x0, y0, az, vzi, vzbot, &
277 ztop, zbot, zi, x, y, z, exitface)
282 particle%iboundary(3) = exitface
283 call this%save(particle, reason=reason)