|
MFC
Exascale flow solver
|
Contains module m_amr_stage. More...
Go to the source code of this file.
Modules | |
| module | m_amr_stage |
| The AMR hooks of the SSP-RK stage loop (m_time_steppers): the stage-top coarse halo, the fine-level stage, and the end-of-step fold of the fine solution into the level-0 covered cells. | |
Functions/Subroutines | |
| impure subroutine, public | m_amr_stage::s_amr_stage_begin (q_cons) |
| Stage top: hoist the cons halo (the AMR fill needs it) so the RHS converts over the buffered domain instead of exchanging a prim halo on the same faces (pointwise, so byte-identical). Only where the cons halo carries everything the prim halo did (no q_T_sf, no igr). | |
| impure subroutine, public | m_amr_stage::s_amr_stage_fine (s, t_step, coefs, q_cons, q_t_sf, bc_type, rhs_vf, pb_in, rhs_pb, mv_in, rhs_mv) |
| The fine-level stage, with q_cons still the coarse stage-entry state: (1) fill every block's ghosts top-down as per-level waves after one coarse cons halo, (2) overwrite fine-fine seam ghosts with neighbours' stage-entry interiors (posted before the fills, drained after), (3) advance all owned blocks in batches, (4) reflux level-1 blocks into the coarse rhs (one face wave plus one batched apply, order-free). A level>=2 block's coarse side is its parent, refluxed in s_amr_step_fold. | |
| impure subroutine, public | m_amr_stage::s_amr_subcycle_fine (q_new, q_old, coefs, q_t_sf, bc_type, pb_in, rhs_pb, mv_in, rhs_mv, t_step) |
| Subcycled fine advance (amr_subcycle): after level 0's step (q_old = step-start state, q_new = end state, coarse registers holding its dt-weighted flux integral) the fine levels substep recursively (s_amr_subcycle_level), accumulating their registers. The registers then correct the coarse state (Berger-Colella) and the caller's fold restricts. | |
| recursive subroutine | m_amr_stage::s_amr_subcycle_level (lev, th0, dth, dtl, q_new, coefs, q_t_sf, bc_type, pb_in, rhs_pb, mv_in, rhs_mv, t_step) |
| Level lev's two substeps of dtl across the fraction [th0, th0 + dth] of the coarse step. Level 1 fills its ghosts from the patch cache at that coarse time; a deeper level fills from its parents blended between their substep-start backup and end state (amr_par_theta). After each substep the next level substeps across it: this level's ghosts are first refilled at the substep end (the children's parent patches can reach them), and the children are then synced back into this level. | |
| impure subroutine | m_amr_stage::s_amr_fill_sub (lev, q_new, th, th0, dth) |
| Ghost fill of level lev at the fraction th of its parent's current substep, which spans [th0, th0 + dth] of the coarse step. | |
| impure subroutine | m_amr_stage::s_amr_fill_levels (q_cons, lev_lo, lev_hi, theta) |
| Ghost fill of levels lev_lo..lev_hi: the level-1 wave from the coarse q_cons (or, with theta, the patch cache at that coarse time fraction), then the parent waves. The fine-fine seam reads stage-entry interiors only, so it is posted before the fills and drained after. | |
| impure subroutine | m_amr_stage::s_amr_pc_gather (q, t) |
| Gather every owned level-1 block's coarse patch ring from q into the pooled amr_cg and keep it as time level t (0: step start, 1: step end), once per coarse step; stages then blend in time with no wave or halo. | |
| impure subroutine | m_amr_stage::s_amr_pc_fill (theta) |
| Level-1 ghost fill at coarse time fraction theta: blend the cached time levels into the pool, then the batched fill. | |
| impure subroutine | m_amr_stage::s_amr_pc_copy (t, theta) |
| The used pool (amr_cg_nuse patches) against the cache amr_pc: t >= 0 stores it as time level t (t = 0 sizes the cache); t < 0 writes the pool = (1 - theta) * level 0 + theta * level 1. | |
| impure subroutine, public | m_amr_stage::s_amr_step_fold (q_cons) |
| End of step: fold the fine solution into the level-0 covered cells (the only deliberate level-0 write) and Berger-Colella state-reflux each level>=2 block into its parent. Bottom-up (per-level waves), so covered cells hold the finest data. | |
| impure subroutine, public | m_amr_stage::s_amr_relax_fine (q_cons) |
| End-of-step phase-change relaxation on the fine blocks (the coarse grid's is in m_start_up), then a restrict so the covered cells hold the average of the relaxed fine cells. The relaxation is cell-local, so block order is free. | |
| impure subroutine, public | m_amr_stage::s_amr_apply_ic_patches (q_cons) |
| Fresh start: set every owned fine block to the initial condition patches evaluated at its own cell centers, replacing the data interpolated from level 0, then restrict. Skipped when the patches alone do not reproduce the level-0 data. | |
| impure subroutine | m_amr_stage::s_amr_check_ic_patches (q_cons) |
| Compare the patches evaluated on level 0 with the loaded initial data. They differ when pre_process perturbed or smoothed the patches or started from old data; hard-coded and STL patches are not evaluated in the simulation. | |
| impure subroutine | m_amr_stage::s_amr_ic_on_frame (q_cons) |
| Evaluate the initial condition patches on the installed grid frame into the interior of q_cons, on the host. | |
Variables | |
| logical | m_amr_stage::ic_checked = .false. |
| Whether patch_icpp was compared with the level-0 initial data, and reproduces it. | |
| logical | m_amr_stage::ic_from_patches = .false. |
Contains module m_amr_stage.
Definition in file m_amr_stage.fpp.f90.