MPI-AMRVAC 3.2
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
Loading...
Searching...
No Matches
mod_advance.t
Go to the documentation of this file.
1!> Module containing all the time stepping schemes
3
4 implicit none
5 private
6
7 !> Whether to conserve fluxes at the current sub-step
8 logical :: fix_conserve_at_step = .true.
9
10 public :: advance
11 public :: process
12 public :: process_advanced
13
14contains
15
16 !> Advance all the grids over one time step, including all sources
17 subroutine advance(iit)
19 use mod_particles, only: handle_particles
21
22 integer, intent(in) :: iit
23
24 integer :: iigrid, igrid, idimsplit
25
26 ! split source addition
27 call add_split_source(prior=.true.)
28
29 if(dimsplit) then
30 if((iit/2)*2==iit .or. typedimsplit=='xy') then
31 ! do the sweeps in order of increasing idim,
32 do idimsplit=1,ndim
33 call advect(idimsplit,idimsplit)
34 end do
35 else
36 ! If the parity of "iit" is odd and typedimsplit=xyyx,
37 ! do sweeps backwards
38 do idimsplit=ndim,1,-1
39 call advect(idimsplit,idimsplit)
40 end do
41 end if
42 else
43 ! Add fluxes from all directions at once
44 call advect(1,ndim)
45 end if
46
47 ! split source addition
48 call add_split_source(prior=.false.)
49
50 if(use_particles) call handle_particles
51
52 end subroutine advance
53
54 !> Advance all grids over one time step, but without taking dimensional
55 !> splitting or split source terms into account
56 subroutine advect(idim^LIM)
60 use mod_comm_lib, only: mpistop
61
62 integer, intent(in) :: idim^lim
63 integer :: iigrid, igrid
64
65 call init_comm_fix_conserve(idim^lim,nwflux)
66 fix_conserve_at_step = time_advance .and. levmax>levmin
67
68 ! copy w instead of wold because of potential use of dimsplit or sourcesplit
69 !$OMP PARALLEL DO PRIVATE(igrid)
70 do iigrid=1,igridstail; igrid=igrids(iigrid);
71 ps1(igrid)%w=ps(igrid)%w
72 if(stagger_grid) ps1(igrid)%ws=ps(igrid)%ws
73 end do
74 !$OMP END PARALLEL DO
75
76 istep = 0
77
78 select case (t_stepper)
79 case (onestep)
80 select case (t_integrator)
81 case (forward_euler)
82 call advect1(flux_method,one,idim^lim,global_time,ps1,global_time,ps)
83
84 case (imex_euler)
85 call advect1(flux_method,one,idim^lim,global_time,ps,global_time,ps1)
86 call global_implicit_update(one,dt,global_time+dt,ps,ps1)
87
88 case (imex_sp)
89 call global_implicit_update(one,dt,global_time,ps,ps1)
90 !$OMP PARALLEL DO PRIVATE(igrid)
91 do iigrid=1,igridstail; igrid=igrids(iigrid);
92 ps1(igrid)%w=ps(igrid)%w
93 if(stagger_grid) ps1(igrid)%ws=ps(igrid)%ws
94 end do
95 !$OMP END PARALLEL DO
96 call advect1(flux_method,one,idim^lim,global_time,ps1,global_time,ps)
97
98 case default
99 call mpistop("unkown onestep time_integrator in advect")
100 end select
101
102 case (twostep)
103 select case (t_integrator)
105 ! PC or explicit midpoint
106 ! predictor step
107 fix_conserve_at_step = .false.
108 call advect1(typepred1,half,idim^lim,global_time,ps,global_time,ps1)
109 ! corrector step
110 fix_conserve_at_step = time_advance .and. levmax>levmin
111 call advect1(flux_method,one,idim^lim,global_time+half*dt,ps1,global_time,ps)
112
113 case (rk2_alf)
114 ! RK2 with alfa parameter, where rk_a21=alfa
115 call advect1(flux_method,rk_a21, idim^lim,global_time,ps,global_time,ps1)
116 !$OMP PARALLEL DO PRIVATE(igrid)
117 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
118 ps(igrid)%w = ps(igrid)%w+rk_b1*(ps1(igrid)%w-ps(igrid)%w)/rk_a21
119 if(stagger_grid) ps(igrid)%ws = ps(igrid)%ws+(one-rk_b2)*(ps1(igrid)%ws-ps(igrid)%ws)/rk_a21
120 end do
121 !$OMP END PARALLEL DO
122 call advect1(flux_method,rk_b2,idim^lim,global_time+rk_a21*dt,ps1,global_time+rk_b1*dt,ps)
123
124 case (ssprk2)
125 ! ssprk2 or Heun's method
126 call advect1(flux_method,one, idim^lim,global_time,ps,global_time,ps1)
127 !$OMP PARALLEL DO PRIVATE(igrid)
128 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
129 ps(igrid)%w = half*ps(igrid)%w+half*ps1(igrid)%w
130 if(stagger_grid) ps(igrid)%ws = half*ps(igrid)%ws+half*ps1(igrid)%ws
131 end do
132 !$OMP END PARALLEL DO
133 call advect1(flux_method,half,idim^lim,global_time+dt,ps1,global_time+half*dt,ps)
134
135 case (imex_midpoint)
136 call advect1(flux_method,half, idim^lim,global_time,ps,global_time,ps1)
137 call global_implicit_update(half,dt,global_time+half*dt,ps2,ps1)
138 !$OMP PARALLEL DO PRIVATE(igrid)
139 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
140 ps(igrid)%w = ps(igrid)%w+2.0d0*(ps2(igrid)%w-ps1(igrid)%w)
141 if(stagger_grid) ps(igrid)%ws = ps(igrid)%ws+2.0d0*(ps2(igrid)%ws-ps1(igrid)%ws)
142 end do
143 !$OMP END PARALLEL DO
144 call advect1(flux_method,one, idim^lim,global_time+half*dt,ps2,global_time,ps)
145
146 case (imex_trapezoidal)
147 call advect1(flux_method,one, idim^lim,global_time,ps,global_time,ps1)
148 !$OMP PARALLEL DO PRIVATE(igrid)
149 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
150 ps2(igrid)%w = half*(ps(igrid)%w+ps1(igrid)%w)
151 if(stagger_grid) ps2(igrid)%ws = half*(ps(igrid)%ws+ps1(igrid)%ws)
152 end do
153 !$OMP END PARALLEL DO
154 call evaluate_implicit(global_time,ps)
155 !$OMP PARALLEL DO PRIVATE(igrid)
156 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
157 ps1(igrid)%w = ps1(igrid)%w+half*dt*ps(igrid)%w
158 if(stagger_grid) ps1(igrid)%ws = ps1(igrid)%ws+half*dt*ps(igrid)%ws
159 end do
160 !$OMP END PARALLEL DO
161 !$OMP PARALLEL DO PRIVATE(igrid)
162 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
163 ps(igrid)%w = ps2(igrid)%w+half*dt*ps(igrid)%w
164 if(stagger_grid) ps(igrid)%ws = ps2(igrid)%ws+half*dt*ps(igrid)%ws
165 end do
166 !$OMP END PARALLEL DO
167 call getbc(global_time+dt,dt,ps1,iwstart,nwgc)
168 call global_implicit_update(half,dt,global_time+dt,ps2,ps1)
169 !$OMP PARALLEL DO PRIVATE(igrid)
170 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
171 ps(igrid)%w = ps(igrid)%w+ps2(igrid)%w-ps1(igrid)%w
172 if(stagger_grid) ps(igrid)%ws = ps(igrid)%ws+ps2(igrid)%ws-ps1(igrid)%ws
173 end do
174 !$OMP END PARALLEL DO
175 call advect1(flux_method,half, idim^lim,global_time+dt,ps2,global_time+half*dt,ps)
176
177 case (imex_222)
178 ! One-parameter family of schemes (parameter is imex222_lambda) from
179 ! Pareschi&Russo 2005, which is L-stable (for default lambda) and
180 ! asymptotically SSP.
181 ! See doi.org/10.1007/s10915-004-4636-4 (table II)
182 ! See doi.org/10.1016/j.apnum.2016.10.018 for interesting values of lambda
183
184 ! Preallocate ps2 as y^n for the implicit update
185 !$OMP PARALLEL DO PRIVATE(igrid)
186 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
187 ps2(igrid)%w = ps(igrid)%w
188 if(stagger_grid) ps2(igrid)%ws = ps(igrid)%ws
189 end do
190 !$OMP END PARALLEL DO
191 ! Solve xi1 = y^n + lambda.dt.F_im(xi1)
192 call global_implicit_update(imex222_lambda, dt, global_time, ps2, ps)
193
194 ! Set ps1 = y^n + dt.F_ex(xi1)
195 call advect1(flux_method, one, idim^lim, global_time, ps2, global_time, ps1)
196 ! Set ps2 = dt.F_im(xi1) (is at t^n)
197 ! Set ps = y^n + dt/2 . F(xi1) (is at t^n+dt/2)
198 ! Set ps1 = y^n + dt.F_ex(xi1) + (1-2.lambda).dt.F_im(xi1) and enforce BC (at t^n+dt)
199 !$OMP PARALLEL DO PRIVATE(igrid)
200 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
201 ps2(igrid)%w = (ps2(igrid)%w - ps(igrid)%w) / imex222_lambda
202 if(stagger_grid) ps2(igrid)%ws = (ps2(igrid)%ws - ps(igrid)%ws) / imex222_lambda
203 end do
204 !$OMP END PARALLEL DO
205 !$OMP PARALLEL DO PRIVATE(igrid)
206 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
207 ps(igrid)%w = half*(ps(igrid)%w + ps1(igrid)%w + ps2(igrid)%w)
208 if(stagger_grid) ps(igrid)%ws = half*(ps(igrid)%ws + ps1(igrid)%ws + ps2(igrid)%ws)
209 end do
210 !$OMP END PARALLEL DO
211 !$OMP PARALLEL DO PRIVATE(igrid)
212 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
213 ps1(igrid)%w = ps1(igrid)%w + (1.0d0 - 2.0d0*imex222_lambda)*ps2(igrid)%w
214 if(stagger_grid) ps1(igrid)%ws = ps1(igrid)%ws + (1.0d0 - 2.0d0*imex222_lambda)*ps2(igrid)%ws
215 end do
216 !$OMP END PARALLEL DO
217 call getbc(global_time+dt,dt,ps1,iwstart,nwgc)
218
219 ! Preallocate ps2 as xi1 for the implicit update (is at t^n)
220 !$OMP PARALLEL DO PRIVATE(igrid)
221 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
222 ps2(igrid)%w = 2.0d0*ps2(igrid)%w - ps1(igrid)%w - imex222_lambda*ps2(igrid)%w
223 if(stagger_grid) ps2(igrid)%ws = 2.0d0*ps2(igrid)%ws - ps1(igrid)%ws - imex222_lambda*ps2(igrid)%ws
224 end do
225 !$OMP END PARALLEL DO
226 ! Solve xi2 = (ps1) + lambda.dt.F_im(xi2)
227 call global_implicit_update(imex222_lambda, dt, global_time, ps2, ps1)
228
229 ! Add dt/2.F_im(xi2) to ps
230 !$OMP PARALLEL DO PRIVATE(igrid)
231 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
232 ps(igrid)%w = ps(igrid)%w + (ps2(igrid)%w - ps1(igrid)%w) / (2.0d0 * imex222_lambda)
233 if(stagger_grid) ps(igrid)%ws = ps(igrid)%ws + (ps2(igrid)%ws - ps1(igrid)%ws) / (2.0d0 * imex222_lambda)
234 end do
235 !$OMP END PARALLEL DO
236 ! Set ps = y^n + dt/2.(F(xi1)+F(xi2)) = y^(n+1)
237 call advect1(flux_method, half, idim^lim, global_time+dt, ps2, global_time+half*dt, ps)
238
239 case default
240 call mpistop("unkown twostep time_integrator in advect")
241 end select
242
243 case (threestep)
244 select case (t_integrator)
245 case (ssprk3)
246 ! this is SSPRK(3,3) Gottlieb-Shu 1998 or SSP(3,2) depending on ssprk_order (3 vs 2)
247 call advect1(flux_method,rk_beta11, idim^lim,global_time,ps,global_time,ps1)
248 !$OMP PARALLEL DO PRIVATE(igrid)
249 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
250 ps2(igrid)%w=rk_alfa21*ps(igrid)%w+rk_alfa22*ps1(igrid)%w
251 if(stagger_grid) ps2(igrid)%ws=rk_alfa21*ps(igrid)%ws+rk_alfa22*ps1(igrid)%ws
252 end do
253 !$OMP END PARALLEL DO
254 call advect1(flux_method,rk_beta22, idim^lim,global_time+rk_c2*dt,ps1,global_time+rk_alfa22*rk_c2*dt,ps2)
255 !$OMP PARALLEL DO PRIVATE(igrid)
256 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
257 ps(igrid)%w=rk_alfa31*ps(igrid)%w+rk_alfa33*ps2(igrid)%w
258 if(stagger_grid) ps(igrid)%ws=rk_alfa31*ps(igrid)%ws+rk_alfa33*ps2(igrid)%ws
259 end do
260 !$OMP END PARALLEL DO
261 call advect1(flux_method,rk_beta33, idim^lim,global_time+rk_c3*dt,ps2,global_time+(1.0d0-rk_beta33)*dt,ps)
262
263 case (rk3_bt)
264 ! this is a general threestep RK according to its Butcher Table
265 call advect1(flux_method,rk3_a21, idim^lim,global_time,ps,global_time,ps1)
266 !$OMP PARALLEL DO PRIVATE(igrid)
267 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
268 ps3(igrid)%w=(ps1(igrid)%w-ps(igrid)%w)/rk3_a21
269 if(stagger_grid) ps3(igrid)%ws=(ps1(igrid)%ws-ps(igrid)%ws)/rk3_a21
270 end do
271 !$OMP END PARALLEL DO
272 !$OMP PARALLEL DO PRIVATE(igrid)
273 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
274 ps2(igrid)%w=ps(igrid)%w+rk3_a31*ps3(igrid)%w
275 if(stagger_grid) ps2(igrid)%ws=ps(igrid)%ws+rk3_a31*ps3(igrid)%ws
276 end do
277 !$OMP END PARALLEL DO
278 call advect1(flux_method,rk3_a32, idim^lim,global_time+rk3_c2*dt,ps1,global_time+rk3_a31*dt,ps2)
279 !$OMP PARALLEL DO PRIVATE(igrid)
280 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
281 ps(igrid)%w=ps(igrid)%w+rk3_b1*ps3(igrid)%w &
282 +rk3_b2*(ps2(igrid)%w-(ps(igrid)%w+rk3_a31*ps3(igrid)%w))/rk3_a32
283 if(stagger_grid)then
284 ps(igrid)%ws=ps(igrid)%ws+rk3_b1*ps3(igrid)%ws &
285 +rk3_b2*(ps2(igrid)%ws-(ps(igrid)%ws+rk3_a31*ps3(igrid)%ws))/rk3_a32
286 endif
287 end do
288 !$OMP END PARALLEL DO
289 call advect1(flux_method,rk3_b3, idim^lim,global_time+rk3_c3*dt,ps2,global_time+(1.0d0-rk3_b3)*dt,ps)
290
291 case (imex_ars3)
292 ! this is IMEX scheme ARS3
293 call advect1(flux_method,ars_gamma, idim^lim,global_time,ps,global_time,ps1)
294 !$OMP PARALLEL DO PRIVATE(igrid)
295 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
296 ps4(igrid)%w=(ps1(igrid)%w-ps(igrid)%w)/ars_gamma
297 if(stagger_grid) ps4(igrid)%ws=(ps1(igrid)%ws-ps(igrid)%ws)/ars_gamma
298 end do
299 !$OMP END PARALLEL DO
300 call global_implicit_update(ars_gamma,dt,global_time+ars_gamma*dt,ps2,ps1)
301 !$OMP PARALLEL DO PRIVATE(igrid)
302 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
303 ps1(igrid)%w=(ps2(igrid)%w-ps1(igrid)%w)/ars_gamma
304 if(stagger_grid) ps1(igrid)%ws=(ps2(igrid)%ws-ps1(igrid)%ws)/ars_gamma
305 end do
306 !$OMP END PARALLEL DO
307 !$OMP PARALLEL DO PRIVATE(igrid)
308 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
309 ps3(igrid)%w=ps(igrid)%w+(ars_gamma-1.0d0)*ps4(igrid)%w+(1.0d0-2.0d0*ars_gamma)*ps1(igrid)%w
310 if(stagger_grid) then
311 ps3(igrid)%ws=ps(igrid)%ws+(ars_gamma-1.0d0)*ps4(igrid)%ws+(1.0d0-2.0d0*ars_gamma)*ps1(igrid)%ws
312 endif
313 end do
314 !$OMP END PARALLEL DO
315 call advect1(flux_method,2.0d0*(1.0d0-ars_gamma), idim^lim,global_time+ars_gamma*dt,ps2,global_time+(ars_gamma-1.0d0)*dt,ps3)
316 !$OMP PARALLEL DO PRIVATE(igrid)
317 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
318 ps2(igrid)%w=ps1(igrid)%w+(ps3(igrid)%w-(ps(igrid)%w+ &
319 (ars_gamma-1.0d0)*ps4(igrid)%w+(1.0d0-2.0d0*ars_gamma)*ps1(igrid)%w))/(2.0d0*(1.0d0-ars_gamma))
320 if(stagger_grid) then
321 ps2(igrid)%ws=ps1(igrid)%ws+(ps3(igrid)%ws-(ps(igrid)%ws+ &
322 (ars_gamma-1.0d0)*ps4(igrid)%ws+(1.0d0-2.0d0*ars_gamma)*ps1(igrid)%ws))/(2.0d0*(1.0d0-ars_gamma))
323 endif
324 end do
325 !$OMP END PARALLEL DO
326 call global_implicit_update(ars_gamma,dt,global_time+(1.0d0-ars_gamma)*dt,ps4,ps3)
327 !$OMP PARALLEL DO PRIVATE(igrid)
328 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
329 ps(igrid)%w=ps(igrid)%w+half*ps2(igrid)%w &
330 +half*(ps4(igrid)%w-ps3(igrid)%w)/ars_gamma
331 if(stagger_grid) then
332 ps(igrid)%ws=ps(igrid)%ws+half*ps2(igrid)%ws &
333 +half*(ps4(igrid)%ws-ps3(igrid)%ws)/ars_gamma
334 endif
335 end do
336 !$OMP END PARALLEL DO
337 call advect1(flux_method,half, idim^lim,global_time+(1.0d0-ars_gamma)*dt,ps4,global_time+half*dt,ps)
338
339 case (imex_232)
340 ! this is IMEX_ARK(2,3,2) or IMEX_SSP(2,3,2)
341 call advect1(flux_method,imex_a21, idim^lim,global_time,ps,global_time,ps1)
342 !$OMP PARALLEL DO PRIVATE(igrid)
343 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
344 ps4(igrid)%w=(ps1(igrid)%w-ps(igrid)%w)/imex_a21
345 ps3(igrid)%w=ps(igrid)%w
346 if(stagger_grid) then
347 ps4(igrid)%ws=(ps1(igrid)%ws-ps(igrid)%ws)/imex_a21
348 ps3(igrid)%ws=ps(igrid)%ws
349 endif
350 end do
351 !$OMP END PARALLEL DO
352 call evaluate_implicit(global_time,ps3)
353 !$OMP PARALLEL DO PRIVATE(igrid)
354 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
355 ps1(igrid)%w=ps1(igrid)%w+imex_ha21*dt*ps3(igrid)%w
356 if(stagger_grid) ps1(igrid)%ws=ps1(igrid)%ws+imex_ha21*dt*ps3(igrid)%ws
357 end do
358 !$OMP END PARALLEL DO
359 call getbc(global_time+imex_a21*dt,dt,ps1,iwstart,nwgc)
360 call global_implicit_update(imex_ha22,dt,global_time+imex_c2*dt,ps2,ps1)
361 !$OMP PARALLEL DO PRIVATE(igrid)
362 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
363 ps(igrid)%w=ps(igrid)%w+imex_a31*ps4(igrid)%w &
364 +imex_b1*dt*ps3(igrid)%w+imex_b2*(ps2(igrid)%w-ps1(igrid)%w)/imex_ha22
365 if(stagger_grid) then
366 ps(igrid)%ws=ps(igrid)%ws+imex_a31*ps4(igrid)%ws &
367 +imex_b1*dt*ps3(igrid)%ws+imex_b2*(ps2(igrid)%ws-ps1(igrid)%ws)/imex_ha22
368 endif
369 end do
370 !$OMP END PARALLEL DO
371 !$OMP PARALLEL DO PRIVATE(igrid)
372 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
373 ps3(igrid)%w=ps1(igrid)%w-imex_a21*ps4(igrid)%w &
374 -imex_ha21*dt*ps3(igrid)%w+imex_b1*dt*ps3(igrid)%w
375 if(stagger_grid) then
376 ps3(igrid)%ws=ps1(igrid)%ws-imex_a21*ps4(igrid)%ws &
377 -imex_ha21*dt*ps3(igrid)%ws+imex_b1*dt*ps3(igrid)%ws
378 endif
379 end do
380 !$OMP END PARALLEL DO
381 call advect1(flux_method,imex_a32, idim^lim,global_time+imex_c2*dt,ps2,global_time+imex_a31*dt,ps)
382 !$OMP PARALLEL DO PRIVATE(igrid)
383 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
384 ps2(igrid)%w=(ps(igrid)%w-ps3(igrid)%w-imex_a31*ps4(igrid)%w)/imex_a32 &
385 +(1.0d0-imex_b2/imex_a32)*(ps2(igrid)%w-ps1(igrid)%w)/imex_ha22
386 if(stagger_grid) then
387 ps2(igrid)%ws=(ps(igrid)%ws-ps3(igrid)%ws-imex_a31*ps4(igrid)%ws)/imex_a32 &
388 +(1.0d0-imex_b2/imex_a32)*(ps2(igrid)%ws-ps1(igrid)%ws)/imex_ha22
389 endif
390 end do
391 !$OMP END PARALLEL DO
392 !$OMP PARALLEL DO PRIVATE(igrid)
393 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
394 ps1(igrid)%w=ps3(igrid)%w+imex_b1*ps4(igrid)%w+imex_b2*ps2(igrid)%w
395 if(stagger_grid) then
396 ps1(igrid)%ws=ps3(igrid)%ws+imex_b1*ps4(igrid)%ws+imex_b2*ps2(igrid)%ws
397 endif
398 end do
399 !$OMP END PARALLEL DO
400 call global_implicit_update(imex_b3,dt,global_time+imex_c3*dt,ps2,ps)
401 !$OMP PARALLEL DO PRIVATE(igrid)
402 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
403 ps(igrid)%w=ps1(igrid)%w+ps2(igrid)%w-ps(igrid)%w
404 if(stagger_grid) then
405 ps(igrid)%ws=ps1(igrid)%ws+ps2(igrid)%ws-ps(igrid)%ws
406 endif
407 end do
408 !$OMP END PARALLEL DO
409 call advect1(flux_method,imex_b3, idim^lim,global_time+imex_c3*dt,ps2,global_time+(1.0d0-imex_b3)*dt,ps)
410
411 case (imex_cb3a)
412 ! Third order IMEX scheme with low-storage implementation (4 registers).
413 ! From Cavaglieri&Bewley 2015, see doi.org/10.1016/j.jcp.2015.01.031
414 ! (scheme called "IMEXRKCB3a" there). Uses 3 explicit and 2 implicit stages.
415 ! Parameters are in imex_bj, imex_cj (same for implicit/explicit),
416 ! imex_aij (implicit tableau) and imex_haij (explicit tableau).
417 call advect1(flux_method, imex_ha21, idim^lim, global_time, ps, global_time, ps1)
418 call global_implicit_update(imex_a22, dt, global_time+imex_c2*dt, ps2, ps1)
419 !$OMP PARALLEL DO PRIVATE(igrid)
420 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
421 ps3(igrid)%w = ps(igrid)%w + imex_a32/imex_a22 * (ps2(igrid)%w - ps1(igrid)%w)
422 ps(igrid)%w = ps(igrid)%w + imex_b2 /imex_a22 * (ps2(igrid)%w - ps1(igrid)%w)
423 ps1(igrid)%w = ps3(igrid)%w
424 if(stagger_grid) ps3(igrid)%ws = ps(igrid)%ws + imex_a32/imex_a22 * (ps2(igrid)%ws - ps1(igrid)%ws)
425 if(stagger_grid) ps(igrid)%ws = ps(igrid)%ws + imex_b2 /imex_a22 * (ps2(igrid)%ws - ps1(igrid)%ws)
426 if(stagger_grid) ps1(igrid)%ws = ps3(igrid)%ws
427 end do
428 !$OMP END PARALLEL DO
429 call advect1(flux_method, imex_ha32, idim^lim, global_time+imex_c2*dt, ps2, global_time, ps3)
430 !$OMP PARALLEL DO PRIVATE(igrid)
431 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
432 ps(igrid)%w = ps(igrid)%w + imex_b2 /imex_ha32 * (ps3(igrid)%w - ps1(igrid)%w)
433 if(stagger_grid) ps(igrid)%ws = ps(igrid)%ws + imex_b2 /imex_ha32 * (ps3(igrid)%ws - ps1(igrid)%ws)
434 end do
435 call global_implicit_update(imex_a33, dt, global_time+imex_c3*dt, ps1, ps3)
436 !$OMP PARALLEL DO PRIVATE(igrid)
437 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
438 ps(igrid)%w = ps(igrid)%w + imex_b3 /imex_a33 * (ps1(igrid)%w - ps3(igrid)%w)
439 if(stagger_grid) ps(igrid)%ws = ps(igrid)%ws + imex_b3 /imex_a33 * (ps1(igrid)%ws - ps3(igrid)%ws)
440 end do
441 !$OMP END PARALLEL DO
442 call advect1(flux_method, imex_b3, idim^lim, global_time+imex_c3*dt, ps1, global_time+imex_b2*dt, ps)
443
444 case default
445 call mpistop("unkown threestep time_integrator in advect")
446 end select
447
448 case (fourstep)
449 select case (t_integrator)
450 case (ssprk4)
451 ! SSPRK(4,3) or SSP(4,2) depending on ssprk_order (3 vs 2)
452 ! ssprk43: Strong stability preserving 4 stage RK 3rd order by Ruuth and Spiteri
453 ! Ruuth & Spiteri J. S C, 17 (2002) p. 211 - 220
454 ! supposed to be stable up to CFL=2.
455 ! ssp42: stable up to CFL=3
456 call advect1(flux_method,rk_beta11, idim^lim,global_time,ps,global_time,ps1)
457 !$OMP PARALLEL DO PRIVATE(igrid)
458 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
459 ps2(igrid)%w=rk_alfa21*ps(igrid)%w+rk_alfa22*ps1(igrid)%w
460 if(stagger_grid) ps2(igrid)%ws=rk_alfa21*ps(igrid)%ws+rk_alfa22*ps1(igrid)%ws
461 end do
462 !$OMP END PARALLEL DO
463 call advect1(flux_method,rk_beta22, idim^lim,global_time+rk_c2*dt,ps1,global_time+rk_alfa22*rk_c2*dt,ps2)
464 !$OMP PARALLEL DO PRIVATE(igrid)
465 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
466 ps1(igrid)%w=rk_alfa31*ps(igrid)%w+rk_alfa33*ps2(igrid)%w
467 if(stagger_grid) ps1(igrid)%ws=rk_alfa31*ps(igrid)%ws+rk_alfa33*ps2(igrid)%ws
468 end do
469 !$OMP END PARALLEL DO
470 call advect1(flux_method,rk_beta33, idim^lim,global_time+rk_c3*dt,ps2,global_time+rk_alfa33*rk_c3*dt,ps1)
471 !$OMP PARALLEL DO PRIVATE(igrid)
472 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
473 ps(igrid)%w=rk_alfa41*ps(igrid)%w+rk_alfa44*ps1(igrid)%w
474 if(stagger_grid) ps(igrid)%ws=rk_alfa41*ps(igrid)%ws+rk_alfa44*ps1(igrid)%ws
475 end do
476 !$OMP END PARALLEL DO
477 call advect1(flux_method,rk_beta44, idim^lim,global_time+rk_c4*dt,ps1,global_time+(1.0d0-rk_beta44)*dt,ps)
478
479 case (rk4)
480 ! the standard RK(4,4) method
481 !$OMP PARALLEL DO PRIVATE(igrid)
482 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
483 ps2(igrid)%w=ps(igrid)%w
484 ps3(igrid)%w=ps(igrid)%w
485 if(stagger_grid) then
486 ps2(igrid)%ws=ps(igrid)%ws
487 ps3(igrid)%ws=ps(igrid)%ws
488 endif
489 end do
490 !$OMP END PARALLEL DO
491 call advect1(flux_method,half, idim^lim,global_time,ps,global_time,ps1)
492 call advect1(flux_method,half, idim^lim,global_time+half*dt,ps1,global_time,ps2)
493 call advect1(flux_method,1.0d0, idim^lim,global_time+half*dt,ps2,global_time,ps3)
494 !$OMP PARALLEL DO PRIVATE(igrid)
495 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
496 ps(igrid)%w=(1.0d0/3.0d0)*(-ps(igrid)%w+ps1(igrid)%w+2.0d0*ps2(igrid)%w+ps3(igrid)%w)
497 if(stagger_grid) ps(igrid)%ws=(1.0d0/3.0d0) &
498 *(-ps(igrid)%ws+ps1(igrid)%ws+2.0d0*ps2(igrid)%ws+ps3(igrid)%ws)
499 end do
500 !$OMP END PARALLEL DO
501 call advect1(flux_method,1.0d0/6.0d0, idim^lim,global_time+dt,ps3,global_time+dt*5.0d0/6.0d0,ps)
502
503 case default
504 call mpistop("unkown fourstep time_integrator in advect")
505 end select
506
507 case (fivestep)
508 select case (t_integrator)
509 case (ssprk5)
510 ! SSPRK(5,4) by Ruuth and Spiteri
511 !bcexch = .false.
512 call advect1(flux_method,rk_beta11, idim^lim,global_time,ps,global_time,ps1)
513 !$OMP PARALLEL DO PRIVATE(igrid)
514 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
515 ps2(igrid)%w=rk_alfa21*ps(igrid)%w+rk_alfa22*ps1(igrid)%w
516 if(stagger_grid) ps2(igrid)%ws=rk_alfa21*ps(igrid)%ws+rk_alfa22*ps1(igrid)%ws
517 end do
518 !$OMP END PARALLEL DO
519 call advect1(flux_method,rk_beta22, idim^lim,global_time+rk_c2*dt,ps1,global_time+rk_alfa22*rk_c2*dt,ps2)
520 !$OMP PARALLEL DO PRIVATE(igrid)
521 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
522 ps1(igrid)%w=rk_alfa31*ps(igrid)%w+rk_alfa33*ps2(igrid)%w
523 if(stagger_grid) ps1(igrid)%ws=rk_alfa31*ps(igrid)%ws+rk_alfa33*ps2(igrid)%ws
524 end do
525 !$OMP END PARALLEL DO
526 call advect1(flux_method,rk_beta33, idim^lim,global_time+rk_c3*dt,ps2,global_time+rk_alfa33*rk_c3*dt,ps1)
527 !$OMP PARALLEL DO PRIVATE(igrid)
528 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
529 ps3(igrid)%w=rk_alfa53*ps2(igrid)%w+rk_alfa54*ps1(igrid)%w
530 if(stagger_grid) ps3(igrid)%ws=rk_alfa53*ps2(igrid)%ws+rk_alfa54*ps1(igrid)%ws
531 end do
532 !$OMP END PARALLEL DO
533 !$OMP PARALLEL DO PRIVATE(igrid)
534 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
535 ps2(igrid)%w=rk_alfa41*ps(igrid)%w+rk_alfa44*ps1(igrid)%w
536 if(stagger_grid) ps2(igrid)%ws=rk_alfa41*ps(igrid)%ws+rk_alfa44*ps1(igrid)%ws
537 end do
538 !$OMP END PARALLEL DO
539 call advect1(flux_method,rk_beta44, idim^lim,global_time+rk_c4*dt,ps1,global_time+rk_alfa44*rk_c4*dt,ps2)
540 !$OMP PARALLEL DO PRIVATE(igrid)
541 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
542 ps(igrid)%w=ps3(igrid)%w+rk_alfa55*ps2(igrid)%w &
543 +(rk_beta54/rk_beta44)*(ps2(igrid)%w-(rk_alfa41*ps(igrid)%w+rk_alfa44*ps1(igrid)%w))
544 if(stagger_grid) then
545 ps(igrid)%ws=ps3(igrid)%ws+rk_alfa55*ps2(igrid)%ws &
546 +(rk_beta54/rk_beta44)*(ps2(igrid)%ws-(rk_alfa41*ps(igrid)%ws+rk_alfa44*ps1(igrid)%ws))
547 endif
548 end do
549 !$OMP END PARALLEL DO
550 !bcexch = .true.
551 call advect1(flux_method,rk_beta55, idim^lim,global_time+rk_c5*dt,ps2,global_time+(1.0d0-rk_beta55)*dt,ps)
552
553 case default
554 call mpistop("unkown fivestep time_integrator in advect")
555 end select
556
557 case default
558 call mpistop("unkown time_stepper in advect")
559 end select
560
561 end subroutine advect
562
563 !> Implicit global update step within IMEX schemes, advance psa=psb+dtfactor*qdt*F_im(psa)
564 subroutine global_implicit_update(dtfactor,qdt,qtC,psa,psb)
568
569 type(state), target :: psa(max_blocks) !< Compute implicit part from this state and update it
570 type(state), target :: psb(max_blocks) !< Will be unchanged, as on entry
571 double precision, intent(in) :: qdt !< overall time step dt
572 double precision, intent(in) :: qtc !< Both states psa and psb at this time level
573 double precision, intent(in) :: dtfactor !< Advance psa=psb+dtfactor*qdt*F_im(psa)
574
575 integer :: iigrid, igrid
576
577 !> First copy all variables from a to b, this is necessary to account for
578 ! quantities in w with no implicit sourceterm
579 do iigrid=1,igridstail; igrid=igrids(iigrid);
580 psa(igrid)%w = psb(igrid)%w
581 if(stagger_grid) psa(igrid)%ws = psb(igrid)%ws
582 end do
583
584 if (associated(phys_implicit_update)) then
585 call phys_implicit_update(dtfactor,qdt,qtc,psa,psb)
586 end if
587
588 ! enforce boundary conditions for psa
589 call getbc(qtc,0.d0,psa,iwstart,nwgc)
590
591 end subroutine global_implicit_update
592
593 !> Evaluate Implicit part in place, i.e. psa==>F_im(psa)
594 subroutine evaluate_implicit(qtC,psa)
597 type(state), target :: psa(max_blocks) !< Compute implicit part from this state and update it
598 double precision, intent(in) :: qtc !< psa at this time level
599
600 if (associated(phys_evaluate_implicit)) then
601 call phys_evaluate_implicit(qtc,psa)
602 end if
603 end subroutine evaluate_implicit
604
605 !> Integrate all grids by one partial step
606 subroutine advect1(method,dtfactor,idim^LIM,qtC,psa,qt,psb)
610 use mod_physics
611
612 integer, intent(in) :: idim^lim
613 type(state), target :: psa(max_blocks) !< Compute fluxes based on this state
614 type(state), target :: psb(max_blocks) !< Update solution on this state
615 double precision, intent(in) :: dtfactor !< Advance over dtfactor * dt
616 double precision, intent(in) :: qtc
617 double precision, intent(in) :: qt
618 integer, intent(in) :: method(nlevelshi)
619
620 double precision :: qdt
621 integer :: iigrid, igrid
622
623 istep = istep+1
624
625 if(associated(phys_special_advance)) then
626 call phys_special_advance(qtc,psa)
627 end if
628
629 qdt=dtfactor*dt
630 ! opedit: Just advance the active grids:
631 !$OMP PARALLEL DO PRIVATE(igrid)
632 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
633 block=>ps(igrid)
634 ^d&dxlevel(^d)=rnode(rpdx^d_,igrid);
635 call advect1_grid(igrid,method(block%level),qdt,dtfactor,ixg^ll,idim^lim,&
636 qtc,psa(igrid),qt,psb(igrid),rnode(rpdx1_:rnodehi,igrid),ps(igrid)%x)
637 end do
638 !$OMP END PARALLEL DO
639
640 ! opedit: Send flux for all grids, expects sends for all
641 ! nsend_fc(^D), set in connectivity.t.
642
643 if (fix_conserve_global .and. fix_conserve_at_step) then
644 call recvflux(idim^lim)
645 call sendflux(idim^lim)
646 call fix_conserve(psb,idim^lim,1,nwflux)
647 if(stagger_grid) then
648 call fix_edges(psb,idim^lim)
649 ! fill the cell-center values from the updated staggered variables
650 !$OMP PARALLEL DO PRIVATE(igrid)
651 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
652 call phys_face_to_center(ixm^ll,psb(igrid))
653 end do
654 !$OMP END PARALLEL DO
655 end if
656 end if
657
658 ! For all grids: fill ghost cells
659 call getbc(qt+qdt,qdt,psb,iwstart,nwgc)
660
661 end subroutine advect1
662
663 !> Advance a single grid over one partial time step
664 subroutine advect1_grid(igrid,method,qdt,dtfactor,ixI^L,idim^LIM,qtC,sCT,qt,s,dxs,x)
665
666 ! integrate one grid by one partial step
669 use mod_tvd
670 use mod_source, only: addsource2
673 use mod_comm_lib, only: mpistop
675
676 integer, intent(in) :: igrid,method
677 integer, intent(in) :: ixi^l, idim^lim
678 double precision, intent(in) :: qdt, dtfactor, qtc, qt, dxs(ndim), x(ixi^s,1:ndim)
679 type(state), target :: sct, s
680
681 ! cell face flux
682 double precision :: fc(ixi^s,1:nwflux,1:ndim)
683 ! cell edge flux
684 double precision :: fe(ixi^s,sdim:3)
685 double precision :: wprim(ixi^s,1:nw)
686 integer :: ixo^l
687
688 ! for mf module
689 if(iwstart>1) fc=0.d0
690
691 ixo^l=ixi^l^lsubnghostcells;
692 select case (method)
694 call finite_volume(method,qdt,dtfactor,ixi^l,ixo^l,idim^lim,qtc,sct,qt,s,fc,fe,dxs,x)
695 case (fs_cd,fs_cd4)
696 call centdiff(method,qdt,dtfactor,ixi^l,ixo^l,idim^lim,qtc,sct,qt,s,fc,fe,dxs,x)
697 case (fs_hancock)
698 call hancock(qdt,dtfactor,ixi^l,ixo^l,idim^lim,qtc,sct,qt,s,dxs,x)
699 case (fs_fd)
700 call fd(qdt,dtfactor,ixi^l,ixo^l,idim^lim,qtc,sct,qt,s,fc,fe,dxs,x)
701 case (fs_tvd)
702 call centdiff(fs_cd,qdt,dtfactor,ixi^l,ixo^l,idim^lim,qtc,sct,qt,s,fc,fe,dxs,x)
703 call tvdlimit(method,qdt,ixi^l,ixo^l,idim^lim,sct,qt+qdt,s,fc,dxs,x)
704 case (fs_source)
705 fc=0.d0
706 fe=0.d0
707 wprim=sct%w
708 call phys_to_primitive(ixi^l,ixi^l,wprim,x)
709 call addsource2(qdt*dble(idimmax-idimmin+1)/dble(ndim),&
710 dtfactor*dble(idimmax-idimmin+1)/dble(ndim),&
711 ixi^l,ixo^l,1,nw,qtc,sct%w,wprim,qt,s%w,x,.false.)
712 case (fs_nul)
713 ! There is nothing to do
714 case default
715 call mpistop("unknown flux scheme in advect1_grid")
716 end select
717
718 ! opedit: Obviously, flux is stored only for active grids.
719 ! but we know in fix_conserve wether there is a passive neighbor
720 ! but we know in conserve_fix wether there is a passive neighbor
721 ! via neighbor_active(i^D,igrid) thus we skip the correction for those.
722 ! This violates strict conservation when the active/passive interface
723 ! coincides with a coarse/fine interface.
724 if (fix_conserve_global .and. fix_conserve_at_step) then
725 call store_flux(igrid,fc,idim^lim,nwflux)
726 if(stagger_grid) call store_edge(igrid,ixg^ll,fe,idim^lim)
727 end if
728
729 end subroutine advect1_grid
730
731 !> process is a user entry in time loop, before output and advance
732 !> allows to modify solution, add extra variables, etc.
733 !> Warning: CFL dt already determined (and is not recomputed)!
734 subroutine process(iit,qt)
738 ! .. scalars ..
739 integer,intent(in) :: iit
740 double precision, intent(in):: qt
741
742 integer:: iigrid, igrid
743
744 if (associated(usr_process_global)) then
745 call usr_process_global(iit,qt)
746 end if
747
748 if (associated(usr_process_grid)) then
749 !$OMP PARALLEL DO PRIVATE(igrid)
750 do iigrid=1,igridstail; igrid=igrids(iigrid);
751 ! next few lines ensure correct usage of routines like divvector etc
752 ^d&dxlevel(^d)=rnode(rpdx^d_,igrid);
753 block=>ps(igrid)
754 call usr_process_grid(igrid,node(plevel_,igrid),ixg^ll,ixm^ll, &
755 qt,ps(igrid)%w,ps(igrid)%x)
756 end do
757 !$OMP END PARALLEL DO
758 call getbc(qt,dt,ps,iwstart,nwgc)
759 end if
760 end subroutine process
761
762 !> process_advanced is user entry in time loop, just after advance
763 !> allows to modify solution, add extra variables, etc.
764 !> added for handling two-way coupled PIC-MHD
765 !> Warning: w is now at global_time^(n+1), global time and iteration at global_time^n, it^n
766 subroutine process_advanced(iit,qt)
771 ! .. scalars ..
772 integer,intent(in) :: iit
773 double precision, intent(in):: qt
774
775 integer:: iigrid, igrid
776
777 if (associated(usr_process_adv_global)) then
778 call usr_process_adv_global(iit,qt)
779 end if
780
781 if (associated(usr_process_adv_grid)) then
782 !$OMP PARALLEL DO PRIVATE(igrid)
783 do iigrid=1,igridstail; igrid=igrids(iigrid);
784 ! next few lines ensure correct usage of routines like divvector etc
785 ^d&dxlevel(^d)=rnode(rpdx^d_,igrid);
786 block=>ps(igrid)
787
788 call usr_process_adv_grid(igrid,node(plevel_,igrid),ixg^ll,ixm^ll, &
789 qt,ps(igrid)%w,ps(igrid)%x)
790 end do
791 !$OMP END PARALLEL DO
792 call getbc(qt,dt,ps,iwstart,nwgc)
793 end if
794 end subroutine process_advanced
795
796end module mod_advance
Module containing all the time stepping schemes.
Definition mod_advance.t:2
subroutine, public process_advanced(iit, qt)
process_advanced is user entry in time loop, just after advance allows to modify solution,...
subroutine, public advance(iit)
Advance all the grids over one time step, including all sources.
Definition mod_advance.t:18
subroutine, public process(iit, qt)
process is a user entry in time loop, before output and advance allows to modify solution,...
subroutine, public mpistop(message)
Exit MPI-AMRVAC with an error message.
Module with finite difference methods for fluxes.
subroutine, public fd(qdt, dtfactor, ixil, ixol, idimslim, qtc, sct, qt, snew, fc, fe, dxs, x)
subroutine, public centdiff(method, qdt, dtfactor, ixil, ixol, idimslim, qtc, sct, qt, s, fc, fe, dxs, x)
Module with finite volume methods for fluxes.
subroutine, public finite_volume(method, qdt, dtfactor, ixil, ixol, idimslim, qtc, sct, qt, snew, fc, fe, dxs, x)
finite volume method
subroutine, public hancock(qdt, dtfactor, ixil, ixol, idimslim, qtc, sct, qt, snew, dxs, x)
The non-conservative Hancock predictor for TVDLF.
Module for flux conservation near refinement boundaries.
subroutine, public init_comm_fix_conserve(idimlim, nwfluxin)
subroutine, public fix_edges(psuse, idimlim)
subroutine, public recvflux(idimlim)
subroutine, public sendflux(idimlim)
subroutine, public store_flux(igrid, fc, idimlim, nwfluxin)
subroutine, public store_edge(igrid, ixil, fe, idimlim)
subroutine, public fix_conserve(psb, idimlim, nw0, nwfluxin)
update ghost cells of all blocks including physical boundaries
subroutine getbc(time, qdt, psb, nwstart, nwbc)
do update ghost cells of all blocks including physical boundaries
This module contains definitions of global parameters and variables and some generic functions/subrou...
type(state), pointer block
Block pointer for using one block and its previous state.
integer, dimension(:), allocatable typepred1
The spatial discretization for the predictor step when using a two step PC method.
integer, parameter imex_euler
double precision global_time
The global simulation time.
integer istep
Index of the sub-step in a multi-step time integrator.
double precision ars_gamma
IMEX_ARS3 parameter ars_gamma.
integer, parameter ndim
Number of spatial dimensions for grid variables.
integer, parameter nlevelshi
The maximum number of levels in the grid refinement.
logical stagger_grid
True for using stagger grid.
logical use_particles
Use particles module or not.
integer, parameter imex_trapezoidal
double precision, dimension(:), allocatable, parameter d
double precision dt
global time step
double precision imex222_lambda
IMEX-222(lambda) one-parameter family of schemes.
integer, dimension(:), allocatable flux_method
Which flux scheme of spatial discretization to use (per grid level)
integer, parameter fs_hll
flux schemes
logical time_advance
do time evolving
double precision, dimension(:,:), allocatable rnode
Corner coordinates.
double precision rk_a21
RK2(alfa) method parameters from Butcher tableau.
integer, parameter predictor_corrector
integer, parameter sdim
starting dimension for electric field
integer, parameter forward_euler
logical fix_conserve_global
Whether to apply flux conservation at refinement boundaries.
character(len=std_len) typedimsplit
double precision, dimension(^nd) dxlevel
store unstretched cell size of current level
integer t_stepper
time stepper type
integer, parameter rnodehi
grid location info (corner coordinates and grid spacing)
integer max_blocks
The maximum number of grid blocks in a processor.
double precision imex_a22
IMEX_CB3a extra parameters.
integer t_integrator
time integrator method
integer, parameter fs_hancock
integer, dimension(:,:), allocatable node
integer, parameter imex_midpoint
Module containing all the particle routines.
This module defines the procedures of a physics module. It contains function pointers for the various...
Definition mod_physics.t:4
procedure(sub_convert), pointer phys_to_primitive
Definition mod_physics.t:54
procedure(sub_evaluate_implicit), pointer phys_evaluate_implicit
Definition mod_physics.t:81
procedure(sub_implicit_update), pointer phys_implicit_update
Definition mod_physics.t:80
procedure(sub_face_to_center), pointer phys_face_to_center
Definition mod_physics.t:79
procedure(sub_special_advance), pointer phys_special_advance
Definition mod_physics.t:68
Module for handling split source terms (split from the fluxes)
Definition mod_source.t:2
subroutine, public addsource2(qdt, dtfactor, ixil, ixol, iwlim, qtc, wct, wctprim, qt, w, x, qsourcesplit, src_active)
Add source within ixO for iws: w=w+qdt*S[wCT].
Definition mod_source.t:132
subroutine, public add_split_source(prior)
Definition mod_source.t:20
Subroutines for TVD-MUSCL schemes.
Definition mod_tvd.t:2
subroutine, public tvdlimit(method, qdt, ixil, ixol, idimlim, s, qt, snew, fc, dxs, x)
Definition mod_tvd.t:14
Module with all the methods that users can customize in AMRVAC.
procedure(process_grid), pointer usr_process_grid
procedure(process_adv_grid), pointer usr_process_adv_grid
procedure(process_global), pointer usr_process_global
procedure(process_adv_global), pointer usr_process_adv_global