70 class(MethodSubcellTernaryType),
intent(inout) :: this
71 class(SubcellTriType),
intent(in) :: subcell
72 type(ParticleType),
pointer,
intent(inout) :: particle
73 real(DP),
intent(in) :: tmax
75 integer(I4B) :: exitFace
125 integer(I4B) :: izstatus
126 integer(I4B) :: itopbotexit
127 integer(I4B) :: ntmax
128 integer(I4B) :: isolv
129 integer(I4B) :: itrifaceenter
130 integer(I4B) :: itrifaceexit
135 integer(I4B) :: event_code
139 if (particle%iexmeth == 0)
then
142 isolv = particle%iexmeth
168 vzbot = subcell%vzbot
169 vztop = subcell%vztop
181 call canonical(x0, y0, x1, y1, x2, y2, &
182 v0x, v0y, v1x, v1y, v2x, v2y, &
184 rxx, rxy, ryx, ryy, &
186 alp0, bet0, alp1, bet1, alp2, bet2, alpi, beti)
190 call clamp_bary(alpi, beti, gami, pad=dsame * dep3)
195 zirel = (zi - zbot) / dz
196 if (zirel > done)
then
198 else if (zirel < dzero)
then
201 call calculate_dt(vzbot, vztop, dz, zirel, vzi, &
202 az, dtexitz, izstatus, &
207 itrifaceenter = particle%iboundary(level_subfeature) - 1
208 if (itrifaceenter == -1) itrifaceenter = 999
209 call traverse_triangle(isolv, tol, &
210 dtexitxy, alpexit, betexit, &
211 itrifaceenter, itrifaceexit, &
212 alp1, bet1, alp2, bet2, alpi, beti)
216 if (itopbotexit == 0 .and. itrifaceexit == 0)
then
217 call this%terminate(particle, &
223 if (itopbotexit == 0)
then
225 exitface = itrifaceexit
227 else if (itrifaceexit == 0 .or. dtexitz < dtexitxy)
then
233 exitface = itrifaceexit
236 if (exitface == 45)
then
237 if (itopbotexit == -1)
then
245 if (dtexit < dzero)
then
246 call this%terminate(particle, &
251 texit = particle%ttrack + dtexit
258 call this%tracktimes%advance()
259 if (this%tracktimes%any())
then
260 do i = this%tracktimes%selection(1), this%tracktimes%selection(2)
261 t = this%tracktimes%times(i)
262 if (t < particle%ttrack) cycle
263 if (t >= texit .or. t >= tmax)
exit
265 call calculate_xyz_position(dt, rxx, rxy, ryx, ryy, sxx, sxy, syy, &
266 izstatus, x0, y0, az, vzi, vzbot, &
267 ztop, zbot, zi, x, y, z)
273 call this%usertime(particle)
280 if (texit .gt. tmax)
then
287 particle%advancing = .false.
296 call calculate_xyz_position(dt, rxx, rxy, ryx, ryy, sxx, sxy, syy, &
297 izstatus, x0, y0, az, vzi, vzbot, &
298 ztop, zbot, zi, x, y, z, exitface)
303 particle%iboundary(level_subfeature) = exitface
306 call this%timestep(particle)
307 else if (event_code ==
featexit)
then
308 call this%subcellexit(particle)
@, public featexit
particle exited a grid feature
@, public usertime
user-specified tracking time
@, public terminate
particle terminated
@, public timestep
time step ended
@ term_no_exits_sub
terminated in a subcell with no exit face