69 class(MethodSubcellTernaryType),
intent(inout) :: this
70 class(SubcellTriType),
intent(in) :: subcell
71 type(ParticleType),
pointer,
intent(inout) :: particle
72 real(DP),
intent(in) :: tmax
74 integer(I4B) :: exitFace
124 integer(I4B) :: izstatus
125 integer(I4B) :: itopbotexit
126 integer(I4B) :: ntmax
127 integer(I4B) :: isolv
128 integer(I4B) :: itrifaceenter
129 integer(I4B) :: itrifaceexit
134 integer(I4B) :: event_code
138 if (particle%iexmeth == 0)
then
141 isolv = particle%iexmeth
167 vzbot = subcell%vzbot
168 vztop = subcell%vztop
180 call canonical(x0, y0, x1, y1, x2, y2, &
181 v0x, v0y, v1x, v1y, v2x, v2y, &
183 rxx, rxy, ryx, ryy, &
185 alp0, bet0, alp1, bet1, alp2, bet2, alpi, beti)
189 call clamp_bary(alpi, beti, gami, pad=dsame * dep3)
194 zirel = (zi - zbot) / dz
195 if (zirel > done)
then
197 else if (zirel < dzero)
then
200 call calculate_dt(vzbot, vztop, dz, zirel, vzi, &
201 az, dtexitz, izstatus, &
206 itrifaceenter = particle%iboundary(3) - 1
207 if (itrifaceenter == -1) itrifaceenter = 999
208 call traverse_triangle(isolv, tol, &
209 dtexitxy, alpexit, betexit, &
210 itrifaceenter, itrifaceexit, &
211 alp1, bet1, alp2, bet2, alpi, beti)
215 if (itopbotexit == 0 .and. itrifaceexit == 0)
then
216 call this%events%terminate(particle, &
222 if (itopbotexit == 0)
then
224 exitface = itrifaceexit
226 else if (itrifaceexit == 0 .or. dtexitz < dtexitxy)
then
232 exitface = itrifaceexit
235 if (exitface == 45)
then
236 if (itopbotexit == -1)
then
244 if (dtexit < dzero)
then
245 call this%events%terminate(particle, &
250 texit = particle%ttrack + dtexit
257 call this%tracktimes%advance()
258 if (this%tracktimes%any())
then
259 do i = this%tracktimes%selection(1), this%tracktimes%selection(2)
260 t = this%tracktimes%times(i)
261 if (t < particle%ttrack) cycle
262 if (t >= texit .or. t >= tmax)
exit
264 call calculate_xyz_position(dt, rxx, rxy, ryx, ryy, sxx, sxy, syy, &
265 izstatus, x0, y0, az, vzi, vzbot, &
266 ztop, zbot, zi, x, y, z)
272 call this%events%usertime(particle)
279 if (texit .gt. tmax)
then
286 particle%advancing = .false.
295 call calculate_xyz_position(dt, rxx, rxy, ryx, ryy, sxx, sxy, syy, &
296 izstatus, x0, y0, az, vzi, vzbot, &
297 ztop, zbot, zi, x, y, z, exitface)
302 particle%iboundary(3) = exitface
304 call this%dispatch(particle, event_code=event_code)
@, public usertime
user-specified tracking time
@, public cellexit
particle exited a cell
@, public terminate
particle terminated
@, public timestep
time step ended
@ term_no_exits_sub
terminated in a subcell with no exit face