93 class(MethodSubcellTernaryType),
intent(inout) :: this
94 class(SubcellTriType),
intent(in) :: subcell
95 type(ParticleType),
pointer,
intent(inout) :: particle
96 real(DP),
intent(in) :: tmax
98 real(DP) :: dt, dtexit, texit
99 real(DP) :: t0, t, x, y, z0, z
100 integer(I4B) :: exit_face, exit_soln, event_code, i, isolv
101 type(BarycentricExitSolutionType) :: exit_solutions(2)
102 type(BarycentricExitSolutionType) :: exit_z, exit_lateral
105 if (particle%iexmeth == 0)
then
108 isolv = particle%iexmeth
114 call find_exits(particle, subcell, exit_solutions)
116 exit_z = exit_solutions(1)
117 exit_lateral = exit_solutions(2)
121 if (exit_z%itopbotexit == 0 .and. &
122 exit_lateral%itrifaceexit == 0)
then
128 exit_soln = pick_exit(exit_solutions)
129 exit_face = exit_solutions(exit_soln)%iboundary
130 dtexit = exit_solutions(exit_soln)%dt
131 if (dtexit < dzero)
then
141 call this%tracktimes%advance()
142 if (this%tracktimes%any())
then
143 do i = this%tracktimes%selection(1), this%tracktimes%selection(2)
144 t = this%tracktimes%times(i)
146 if (t > texit .or. t > tmax)
exit
148 call calculate_xyz_position(dt, &
149 exit_lateral%rxx, exit_lateral%rxy, &
150 exit_lateral%ryx, exit_lateral%ryy, &
151 exit_lateral%sxx, exit_lateral%sxy, &
152 exit_lateral%syy, exit_z%status, &
153 subcell%x0, subcell%y0, &
154 exit_z%dvdx, exit_z%v, &
155 subcell%vzbot, subcell%ztop, subcell%zbot, &
162 call this%usertime(particle)
169 if (texit .gt. tmax)
then
176 particle%advancing = .false.
185 call calculate_xyz_position(dt, &
186 exit_lateral%rxx, exit_lateral%rxy, &
187 exit_lateral%ryx, exit_lateral%ryy, &
188 exit_lateral%sxx, exit_lateral%sxy, &
189 exit_lateral%syy, exit_z%status, &
190 subcell%x0, subcell%y0, &
191 exit_z%dvdx, exit_z%v, &
192 subcell%vzbot, subcell%ztop, subcell%zbot, &
193 z0, x, y, z, exit_face)
198 particle%iboundary(level_subfeature) = exit_face
201 call this%timestep(particle)
202 else if (event_code ==
featexit)
then
203 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