Skip to content

adam_flume_cpu_object ​

ADAM, FLUME CPU backend object.

Implements the forest contract on the host (MPI + OpenMP). The dispatch procedure pointers are type components, bound in initialize_flume by exhaustive select case with a fatal case default (issue #35, D-10). Space operator: characteristic (or conservative) WENO flux splitting, face fluxes then flux difference (issue #35, section 3.4); the per-model loops live in adam_flume_cpu_<model>_kernels, selected here by select case on the physical model, never inside a loop (issue #41, section 4).

Source: src/app/flume/cpu/adam_flume_cpu_object.F90

Dependencies

Contents ​

Derived Types ​

equilibrium_seam_face ​

The equilibrium's flux mismatch of one register face, F_coarse - F_fine_sum per skin cell (issue #73, M7-G2b).

Components ​

NameTypeAttributesDescription
dreal(kind=R8P)allocatableMismatch [nv, nface_cells].

flume_cpu_object ​

FLUME CPU backend object.

Inheritance

Extends: flume_common_object

Components ​

NameTypeAttributesDescription
iotype(io_object)IO handler.
amrtype(amr_object)AMR marker handler.
slicestype(slices_object)Slices handler.
blanesmoantype(blanesmoan_object)Blanes-Moan integrator.
cfmtype(cfm_object)Commutator-Free Magnus integrator.
leapfrogtype(leapfrog_object)Leapfrog integrator.
flailtype(flail_object)Linear algebra methods handler.
wenotype(weno_object)WENO reconstructor.
ibtype(ib_object)Immersed boundary.
rktype(rk_object)Runge-Kutta integrator.
adamtype(adam_object)ADAM, grid + tree + field + maps orchestrator.
fdv_schemecharacter(len=:)allocatableFDV scheme, fd/fv.
fdv_orderinteger(kind=I4P)Order of finite difference/volume schemes, general order.
fdv_half_stencilinteger(kind=I4P)Half stencil length of finite difference/volume schemes.
fdv_half_stencilsinteger(kind=I4P)Half stencil length of fdv schemes for each derivative up to 6.
ngcinteger(kind=I4P)pointerNumber of ghost cells.
niinteger(kind=I4P)pointerNumber of cells in i direction.
njinteger(kind=I4P)pointerNumber of cells in j direction.
nkinteger(kind=I4P)pointerNumber of cells in k direction.
nbinteger(kind=I4P)pointerTotal blocks number for MPI.
blocks_numberinteger(kind=I4P)pointerActual blocks number.
nvinteger(kind=I4P)pointerNumber of variables in q vector.
realm_indexinteger(kind=I4P)Inter-realm seam coupling — currently-published stage buffer key.
stage_activeinteger(kind=I4P)A copy of the forest's flux register (its faces and lookup, the accumulators unused), refreshed by the forest each
flux_register_copytype(flux_register_object)Procedure pointer TBPs for FDV operators (set at initialization by backend).
compute_block_total_variationprocedure(compute_block_total_variation_interface)pass(self), pointerCompute TV.
compute_curlprocedure(compute_curl_interface)pass(self), pointerCompute curl.
compute_curl_extendedprocedure(compute_curl_interface)pass(self), pointerCompute curl on extended support.
compute_derivative1procedure(compute_derivative1_interface)pass(self), pointerCompute deriv1.
compute_derivative2procedure(compute_derivative2_interface)pass(self), pointerCompute deriv2.
compute_derivative4procedure(compute_derivative4_interface)pass(self), pointerCompute deriv4.
compute_divergenceprocedure(compute_divergence_interface)pass(self), pointerCompute dive.
compute_gradientprocedure(compute_gradient_interface)pass(self), pointerCompute grad.
compute_gradient_extendedprocedure(compute_gradient_interface)pass(self), pointerCompute gradient on extended support.
compute_laplacianprocedure(compute_laplacian_interface)pass(self), pointerCompute laplac.
amr_locked_logicalRuntime AMR locked after initialization.
save_auxiliary_fieldslogicalSave the auxiliary variables with the fields.
glm_speed_reportedreal(kind=R8P)Largest wave speed above c_h reported so far.
divb_reportedreal(kind=R8P)Largest monitored measure above divb_tol reported so far.
divb_seaminteger(kind=I4P)allocatableSeam faces flags of the div(B) history [nb, 6].
qreal(kind=R8P)allocatableConservative variables [nv, 1-ngc:ni+ngc, ..., nb].
dqreal(kind=R8P)allocatableResiduals [nv, 1-ngc:ni+ngc, ..., nb].
q_auxreal(kind=R8P)allocatableAuxiliary variables [nv_aux, 1-ngc:ni+ngc, ..., nb].
phi_gravreal(kind=R8P)allocatableGravitational potential [1-ngc:ni+ngc, ..., nb] (issue #81);
poissonclass(poisson_fft_object)allocatableSelf-gravity Poisson solver (issue #81; FNL: the cuFFT one).
poisson_mgtype(poisson_mg_object)allocatableSelf-gravity on AMR grids (issue #81, P5b): the multigrid
poisson_wallreal(kind=R8P)Wall time of the last Poisson solve (s).
q_nametype(string)allocatableConservative variables names.
dq_nametype(string)allocatableResiduals names.
q_aux_nametype(string)allocatableAuxiliary variables names.
bctype(flume_bc_object)Boundary conditions.
diagnosticstype(flume_diagnostics_object)Diagnostics.
ictype(flume_ic_object)Initial conditions.
numericstype(flume_numerics_object)Numerics.
physicstype(flume_physics_object)Physics.
unitstype(flume_reference_object)Reference layer (dimensional input, issue #49).
timetype(flume_time_object)Time handler.
flx_freal(kind=R8P)allocatableX-face fluxes [nv, 0:ni, 1:nj, 1:nk, nb], face i = i+1/2.
fly_freal(kind=R8P)allocatableY-face fluxes [nv, 1:ni, 0:nj, 1:nk, nb], face j = j+1/2.
flz_freal(kind=R8P)allocatableZ-face fluxes [nv, 1:ni, 1:nj, 0:nk, nb], face k = k+1/2.
gcorreal(kind=R8P)allocatableFourth-order correction of the gravity energy source (issue #73,
dq_ereal(kind=R8P)allocatableResidual of the hydrostatic equilibrium (issue #73, M7-G2b)
seam_etype(equilibrium_seam_face)allocatableThe equilibrium's 2:1 flux mismatch per register face.
equilibrium_stalelogicaldq_e describes another grid (init, regrid).
equilibrium_computinglogicaldq_e is being computed: no subtraction.
seamtype(flume_seam_sync_object)Per-stage seam flux synchronisation of the limiter (issue #50).
lamreal(kind=R8P)allocatableCell factors of the positivity limiter (component 1, q-shaped for the
compute_residualsprocedure(compute_residuals_interface)pass(self), pointerSpace operator.
integrateprocedure(integrate_interface)pass(self), pointerTime operator.

Type-Bound Procedures ​

NameAttributesDescription
load_fdv_from_filepass(self)Load FDV config from file.
finalize_mpi_forestpass(self)Process-global MPI finalize; forest calls it ONCE after all.
after_topology_build_forestpass(self)Backend hook invoked once after the forest builds the seam maps.
close_block_xh5fnopassClose XH5F file block.
close_file_xh5fnopassClose XH5F file.
open_block_xh5fpass(self)Open block file XH5F.
open_file_xh5fpass(self)Open file XH5F.
save_q_xh5fpass(self)Save in XH5F (XDMF/HDF5) format.
compute_curl_fd_extendedpass(self)Compute curl of vector field, finite difference, even for half gcs.
compute_gradient_fd_extendedpass(self)Compute gradient of scalar field, finite difference, even for half
amr_updatepass(self)Do AMR update (initialization-time only).
runtime_amr_forestpass(self)Whether this realm regrids during the run (issue #74).
mark_by_geometrypass(self)Mark blocks to be refined by a primitive geometric box.
mark_by_gradientpass(self)Mark blocks by the gradient of a conservative or auxiliary variable.
mark_by_solidpass(self)Mark blocks crossed by the surface of an immersed solid.
mark_by_lohnerpass(self)Mark blocks by the Loehner estimator of a variable (issue #74).
mark_runtimepass(self)Combine the markers into the flags of a runtime regrid (issue #74).
check_regridded_statepass(self)Stop on an inadmissible state after a regrid (issue #74).
is_regrid_steppass(self)Whether the step just closed is a runtime regrid step (issue #74).
accumulate_seam_skinpass(self)Route one weighted seam face skin to the forest's flux register.
add_seam_gravity_workpass(self)Add the seam gravity work of self-gravity to a seam skin.
allocate_commonpass(self)Allocate common data.
compute_fields_numberpass(self)Compute the block-sized fields allocated per block.
compute_phipass(self)Compute the immersed solids distance function (host).
destroy_commonpass(self)Free common data.
glm_lambdapass(self)Return the GLM bound of the local dt, c_h max sum_d 1/dx_d.
initializepass(self)Initialize the common data.
log_dt_limitpass(self)Log which limit, hyperbolic or diffusive, sets dt.
log_gravity_regimepass(self)Log the velocity gravity adds in a step (issue #73).
log_self_gravitypass(self)Log the self-gravity regime (issue #81).
poisson_iterationspass(self)FCG iterations of the last multigrid solve.
wall_temperature_boundpass(self)Return the hottest isothermal wall temperature of the dt bound.
null_freezepass(self)Return the variable each null direction freezes.
output_factorspass(self)Return the output factors of written variables.
output_namespass(self)Return the names of every written variable.
report_divbpass(self)Reduce and save the div(B) norms, apply the divb_tol monitor.
report_glm_speedpass(self)Check c_h against the fastest wave (warning or stop).
nonfinite_totalpass(self)Sum the non-finite values count over the ranks.
stop_nonfinitepass(self)Stop on a non-finite state, locating it on every rank.
load_restart_filespass(self)Load restart files.
save_restart_filespass(self)Save restart files.
save_slicespass(self)Save the slices on their cadence.
save_xh5fpass(self)Save fields in XH5F format.
set_divb_seampass(self)Set the seam faces flags of the div(B) history.
set_glm_dampingpass(self)Set the GLM damping once the grid exists.
set_potentialpass(self)Set the gravitational potential of the current grid.
solve_potentialpass(self)Solve the self-gravity potential of a host state.
solve_potential_packedpass(self)Solve the self-gravity potential of a packed density.
coupling_descriptor_forestpass(self)Return the realm coupling descriptor.
accumulate_seam_fluxespass(self)Accumulate the weighted seam face fluxes of one stage.
reflux_stagepass(self)The per-stage reflux (issue #81, P5c).
flag_troubled_seam_cellspass(self)Flag the troubled seam face cells of one stage (#68 E1).
add_dissipative_fluxespass(self)Add the dissipative face fluxes (issue #65).
apply_floorspass(self)Apply the MHD positivity floors of a stage.
allocate_cpupass(self)Allocate CPU data.
check_glm_chpass(self)Check the GLM c_h against the fastest wave.
compute_conservationpass(self)Compute and save the conservation integrals.
compute_divb_historypass(self)Compute and save the div(B) norms (MHD).
compute_dflux_normspass(self)Compute the D_flux norms of the committed state (#68 A2).
compute_q_auxpass(self)Compute the auxiliary variables.
compute_gravity_correctionpass(self)Compute the fourth-order gravity energy correction.
refresh_equilibrium_residualpass(self)Recompute the equilibrium residual if stale.
check_nonfinitepass(self)Stop on a non-finite committed state.
initialize_flumepass(self)Initialize the CPU backend.
limit_positivitypass(self)Apply the positivity limiter to the stage face fluxes.
seam_sync_blendpass(self)Set the seam face fluxes with the seam factors (issue #50).
seam_sync_factorspass(self)Recompute the seam cells' factors (issue #50).
seam_sync_fluxespass(self)Publish the donor states and the fine means (issue #50).
seam_sync_thetapass(self)Compute the seam factors (issue #50).
save_residualspass(self)Save residuals history.
save_simulation_datapass(self)Save fields, restart and diagnostics on their cadence.
set_boundary_conditionspass(self)Set boundary conditions on the crown maps.
set_initial_conditionspass(self)Set initial conditions.
update_ghostpass(self)Update ghost cells: local, MPI, boundary conditions.
advance_one_step_forestpass(self)Advance one full step (fast path).
apply_reflux_to_stage_forestpass(self)Apply the reflux correction.
begin_stage_forestpass(self)Begin an integrator stage (staged path).
close_step_forestpass(self)Close a step (staged path).
compute_local_dt_forestpass(self)Compute the local stability-limited time step.
end_stage_forestpass(self)End an integrator stage (staged path).
fill_seam_from_peer_forestpass(self)Fill inter-realm seam ghosts from a peer.
pack_seam_cells_forestpass(self)Pack own cells of the cross-rank seam send rows.
unpack_seam_cells_forestpass(self)Unpack the cross-rank seam receive rows into own ghosts.
finalize_forestpass(self)Finalize the realm.
initialize_forestpass(self)Initialize the realm.
is_done_forestpass(self)Return true if the realm is done.
open_step_forestpass(self)Open a step (staged path).
post_step_forestpass(self)Post-step IO and diagnostics.
regrid_forestpass(self)Regrid on the [amr] frequency cadence (issue #74).
stages_per_step_forestpass(self)Return the integrator stages per step.

Subroutines ​

accumulate_seam_fluxes ​

Accumulate the seam face fluxes of stage s, weighted by its SSP coefficient, into the forest's flux register.

Every stage contributes (issue #35, P5): the register holds sum_s beta_s F_s, the flux of the committed step. weight replaces the SSP coefficient (the D_flux diagnostic accumulates one evaluation with weight 1, #68 A2).

fortran
subroutine accumulate_seam_fluxes(self, s, flux_register, weight, with_gravity_work)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
sinteger(kind=I4P)inRunge-Kutta stage.
flux_registerclass(flux_register_object)inoutForest's flux register.
weightreal(kind=R8P)inoptionalWeight replacing beta(s).
with_gravity_worklogicalinoptionalAdd the seam gravity work (default:

Call graph

flag_troubled_seam_cells ​

Flag the troubled seam face cells of one stage for the reflux policy troubled (issue #68 E1): on every register face whose coarse side this realm and rank own, a face cell is troubled when the positivity limiter blended it this stage (its seam factor below 1, issue #50: such a face is always refluxed) or when the WENO-5 sensor seam_weno5_sensor of the density, the normal velocity or the pressure across it is below FLUX_CORRECTION_SENSOR_TAU (the stage's auxiliary variables, the coarse skin cell, the two inside it and the three ghosts outside, filled by the restriction). The flags accumulate over the stages of the step (reset with the register): a cell troubled at any stage is refluxed.

fortran
subroutine flag_troubled_seam_cells(self, flux_register)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
flux_registerclass(flux_register_object)inoutForest's flux register.

Call graph

add_dissipative_fluxes ​

Add the dissipative face fluxes of the active directions to the inviscid ones (issue #65), from the auxiliary variables of the stage: the viscous and heat fluxes when a viscosity or a conductivity is on, the Ohmic ones (MHD) when the resistivity is; the kernel of the order is selected here, never inside the loops.

fortran
subroutine add_dissipative_fluxes(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

apply_floors ​

Apply the MHD positivity floors to the interior of a stage state, before its ghost exchange (issue #41, 3.8).

Euler has no floors (return before any work). MHD: the floored cells of the stage are logged by rank 0 when any; a non-positive density or pressure with the floors disabled (both zero) is fatal, reported with the global minimum density and pressure.

fortran
subroutine apply_floors(self, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
qreal(kind=R8P)inoutConservative variables.

Call graph

allocate_cpu ​

Allocate CPU data.

fortran
subroutine allocate_cpu(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

check_glm_ch ​

Check the GLM cleaning speed against the fastest wave of the committed state (issue #41, section 3.5); a no-op without GLM.

fortran
subroutine check_glm_ch(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

check_nonfinite ​

Stop the run when the committed state holds a non-finite (NaN or infinite) value (issue #45): a run could otherwise finish with NaN fields and exit 0. One pass over the interior cells, the model selected outside the loops.

fortran
subroutine check_nonfinite(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

compute_conservation ​

Compute the volume integrals of the conservative variables and save them on the diagnostics cadence.

The cell volume includes the null directions: the tree splits them too, so a refined block's cells are smaller along them, and a volume without them overweights the fine cells (issue #37).

The sum is compensated (Neumaier): a plain running sum of a uniform field adds equal terms to a growing total, so its rounding errors do not cancel and grow with the cells number (M2-P7b: 1.3e-12 relative on the ~2.6e5 cells of a uniform-density AMR run, against a 1e-13 conservation criterion); the FNL twin reduces on the device (a tree).

With self-gravity (issue #81) the row gains W = 1/2 sum rho Phi dV and E + W, Phi solved from the committed state (the stage potentials belong to the stage states).

fortran
subroutine compute_conservation(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

compute_divb_history ​

Compute and save the div(B) norms of the committed state on the diagnostics cadence (issue #41, D-10); a no-op for Euler. The ghost cells are refreshed first and, with sibling realms, the inter-realm seam ghosts are refilled from the peers (update_ghost does not fill them, issue #31): the stencils of the seam-local cells read them.

fortran
subroutine compute_divb_history(self, realm)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
realmclass(realm_object)inouttarget, optionalSibling realms.

Call graph

compute_dflux_norms ​

Compute the D_flux norms of the committed state (issue #68 A2): max|D_flux|, sum |D_flux| dV, the seam-local maximum, max h|D_flux| (h the smallest active spacing of the block) and max|B|.

D_flux is the divergence the cleaning acts on: that of the interface normal field B_n = F_psi / s of the scheme's own psi face fluxes (s = c_h^2 with GLM, c_h with EGLM), not the centred divergence of the cell values. One residual evaluation of the committed state gives the face fluxes: the state is copied into the idle first RK stage buffer (the residual applies the floors and the immersed-boundary extrapolation to its argument) and the residual goes into the second. Its seam face fluxes are accumulated, with weight 1, into the realm's copy of the forest's flux register and completed across the ranks; at the coarse side of an intra-realm 2:1 seam the coarse face flux is then replaced by the fine one, as the reflux does at the end of the step, so the sum of D_flux dV over a composite region is the flux of B_n through its boundary. An inter-realm seam keeps each side's own flux (its fine side belongs to another realm, whose residual is not evaluated here). The caller has refreshed the ghost cells of q.

fortran
subroutine compute_dflux_norms(self, norms)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
normsreal(kind=R8P)outThe five norms of this rank.

Call graph

compute_q_aux ​

Compute the auxiliary variables on every cell, ghost cells included.

fortran
subroutine compute_q_aux(self, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
qreal(kind=R8P)inConservative variables.

Call graph

initialize_flume ​

Initialize the CPU backend: MPI, memory budget, common data, CPU data, dispatch.

fortran
subroutine initialize_flume(self, filename, realms_number)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
filenamecharacter(len=*)inInput file name.
realms_numberinteger(kind=I4P)inoptionalRealm count; divides the per-process budget.

Call graph

limit_positivity ​

Apply the positivity limiter to the face fluxes of the stage (issue #47, D-9): the cell factors of the model's kernel, their ghost exchange (intra-realm copies and MPI only: a ghost the exchange does not fill, at a physical boundary, keeps the factor 1 it was allocated with, so the face takes the interior cell's factor), the blending of the active directions. The limited faces and the cells with an inadmissible backbone are reduced over the ranks and logged. The forward-Euler step of the limiter is the step time%dt (every stage of an SSP scheme is a convex combination of forward-Euler steps of size at most dt).

With 2:1 AMR seams (an intra-realm face in the forest's register) the seam flux is synchronised at this stage (issue #50, D1; adam_flume_seam_sync_object): the fine seam faces take the coarse donor state as backbone outer state, the coarse seam cells' factors use the means of the fine fluxes, and both sides of a seam face blend with theta_s = min(Lambda_C, min Lambda_f), so the coarse flux is the mean of the fine ones and every cell stays in its corner box; the end-of-step reflux then corrects round-off only.

fortran
subroutine limit_positivity(self, q, flux_register)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
qreal(kind=R8P)inConservative variables of the stage.
flux_registerclass(flux_register_object)inoptionalForest's flux register.

Call graph

seam_sync_fluxes ​

Seam synchronisation, first phase (issue #50): publish the coarse donor states of the seam skins, then on every fine seam face compute the backbone with the donor state as outer state, keep it with the face's high-order flux, and accumulate the means of both into the coarse skins (2x2 fine faces per coarse face cell, 2x1 along the unrefined z of a quadtree, issue #46).

fortran
subroutine seam_sync_fluxes(self, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
qreal(kind=R8P)inConservative variables of the stage.

Call graph

seam_sync_factors ​

Seam synchronisation, second phase (issue #50): recompute the factor of every cell beside a seam face with that face's pair overridden, the coarse side by the fine means, the fine side by its donor-state backbone (and its own high-order flux), and add the change of the counts.

fortran
subroutine seam_sync_factors(self, q, dbad, dnonfinite)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
qreal(kind=R8P)inConservative variables of the stage.
dbadinteger(kind=I4P)inoutInadmissible backbones count.
dnonfiniteinteger(kind=I4P)inoutNon-finite cells count.

Call graph

seam_sync_theta ​

Seam synchronisation, third phase (issue #50): the smallest factor of the fine cells under every coarse skin cell, then the seam factor theta_s = min(Lambda_C, min Lambda_f) in [0, 1] written by the coarse owner.

fortran
subroutine seam_sync_theta(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

seam_sync_blend ​

Seam synchronisation, last phase (issue #50): set the seam face fluxes with the seam factor, after the blend of the other faces. Coarse face F_LF + theta_s (F_H - F_LF) of the fine means, fine face the same of its own pair: the coarse flux is the mean of the fine ones (four, two on a quadtree face normal to x or y).

fortran
subroutine seam_sync_blend(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

save_residuals ​

Save residuals history (L2 norm of dq, MPI-reduced, rank 0 writes).

fortran
subroutine save_residuals(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

save_simulation_data ​

Save fields, restart, slices and conservation history, each on its own cadence (one predicate per output).

fortran
subroutine save_simulation_data(self, realm)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
realmclass(realm_object)inouttarget, optionalSibling realms.

Call graph

set_boundary_conditions ​

Set boundary conditions on the crown maps, in three passes: the rows beyond one realm face, then beyond two (realm edges), then beyond three (realm corners).

A row beyond one face applies that face's kind from the cell inward along its normal; the donor is interior or in a lower crown. This covers the face ghosts and the edge and corner ghosts whose other directions lead into another block (their tree boundary is a face). A row beyond several realm faces applies the kind of one physical face among them, inflow first, to the donor mirrored (wall) or clamped (extrapolation) along that face's axis. The donor lies beyond the other faces only, so it is a face ghost (for an edge row) or an edge ghost (for a corner row), already filled by the seams, the exchange or the earlier pass. The realm-edge ghosts then continue the face ghosts, as a cross derivative at a boundary face needs (issue #65 P0: the inward diagonal copy used before was off by O(1) at walls). A row beyond seams only lies outside the forest (a re-entrant corner of an L-shaped forest): it keeps a copy of its inward diagonal, finite, and read by no stencil of a fluid cell.

Periodic faces have no crown rows: their ghosts are filled by the ghost exchange.

fortran
subroutine set_boundary_conditions(self, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
qreal(kind=R8P)inoutConservative variables.

Call graph

set_initial_conditions ​

Set initial conditions.

fortran
subroutine set_initial_conditions(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

update_ghost ​

Update ghost cells: intra-realm local copies, MPI exchange, boundary conditions, then the positivity blend of the inadmissible face ghosts (issue #50, D2: a coarse-to-fine seam interpolant of admissible states may be inadmissible; every other ghost is a copy or a boundary state, admissible, and untouched).

Inter-realm seam ghosts are filled by the forest (fill_seam_from_peer_forest), not here.

fortran
subroutine update_ghost(self, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
qreal(kind=R8P)inoutConservative variables.

Call graph

advance_one_step_forest ​

Advance one full step of size dt (fast path: single realm, no AMR seam faces).

fortran
subroutine advance_one_step_forest(self, dt)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
dtreal(kind=R8P)inTime step from the forest's global reduction.

Call graph

apply_reflux_to_stage_forest ​

Apply the Berger-Colella reflux correction to the committed q (the forest calls it once per step, after close_step_forest, with the final stage).

For every register face whose coarse side this realm and this rank own, the coarse skin cells receive sgn dt / dx_coarse (F_coarse - F_fine_sum): the register holds the step fluxes sum_s beta_s F_s of both sides (accumulate_seam_fluxes), so the coarse flux the step used is replaced by the restricted fine one, and the coarse-fine interface conserves to round-off.

The scale uses the step the update used, time%dt: on the last step of a time-driven run the realm caps it to land on time_max, and the forest's dt argument is the uncapped value (with it the correction was off by the ratio of the two, 1.3e-9 of the mass on sod-amr; issue #37).

fortran
subroutine apply_reflux_to_stage_forest(self, stage, dt, flux_register)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
stageinteger(kind=I4P)inIntegrator stage.
dtreal(kind=R8P)inForest time step (unused: see the scale below).
flux_registerclass(flux_register_object)inForest's flux register.

Call graph

begin_stage_forest ​

Begin integrator stage k (staged path): publish the stage and compute its state.

fortran
subroutine begin_stage_forest(self, k, K_total, dt, realm)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
kinteger(kind=I4P)inStage index (1..K_total).
K_totalinteger(kind=I4P)inForest-wide stage count for this step.
dtreal(kind=R8P)inTime step from the forest.
realmclass(realm_object)inouttarget, optionalSibling realms (contract parity).

Call graph

close_step_forest ​

Close a step (staged path): assemble q, save residuals, advance time, clear the active stage.

fortran
subroutine close_step_forest(self, dt)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
dtreal(kind=R8P)inTime step from the forest (the local capped value is time%dt).

Call graph

compute_local_dt_forest ​

Compute the local stability-limited time step, dt = CFL / max(sum_d (|u_d| + a) / dx_d) (no MPI reduction); with GLM, also dt <= CFL / (c_h max sum_d 1 / dx_d) (glm_lambda, issue #41, section 3.5). With dissipative terms the cell sum gains 2 nu sum_d 1 / dx_d^2, nu = max(4/3 mu / rho, gamma k / (rho cp), eta) (issue #65, D-M4-3), and the first step logs which limit dominates.

The auxiliary variables are recomputed from the committed q (not read from q_aux, which holds the last stage state); null directions do not contribute.

fortran
subroutine compute_local_dt_forest(self, dt_local)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inThe equation.
dt_localreal(kind=R8P)outLocal stability-limited time step.

Call graph

end_stage_forest ​

End integrator stage k (staged path): residuals on the stage state, then stage assignment.

fortran
subroutine end_stage_forest(self, k, K_total, dt, realm, flux_register)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
kinteger(kind=I4P)inStage index (1..K_total).
K_totalinteger(kind=I4P)inForest-wide stage count.
dtreal(kind=R8P)inTime step from the forest.
realmclass(realm_object)inouttarget, optionalSibling realms (parity only).
flux_registerclass(flux_register_object)inoutoptionalForest's flux register.

Call graph

reflux_stage ​

The per-stage reflux ([numerics] reflux_cadence = stage, issue #81 P5c): the seam fluxes of stage s, with the seam gravity work of self-gravity, accumulated with weight 1 into the realm's copy of the forest's flux register, completed across the ranks, and the residual of every coarse seam cell corrected by sgn (F_coarse - F_fine) / H: the stage then advances the coarse cells with the restricted fine fluxes, the conservative composite scheme at every stage, and the end-of-step reflux is skipped (apply_reflux_to_stage_forest). Intra-realm 2:1 faces only (multi-realm runs refuse the stage cadence). The exceptions of the end-of-step reflux apply unchanged: the equilibrium's own mismatch (well-balanced mode), B under EGLM, the flagged cells only under troubled.

fortran
subroutine reflux_stage(self, s, dq)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
sinteger(kind=I4P)inRunge-Kutta stage.
dqreal(kind=R8P)inoutStage residual.

Call graph

fill_seam_from_peer_forest ​

Fill this realm's seam ghosts for peer slot p_idx from the peer's interior, on the active buffers (q when stage_active == 0, else the active stage of q_rk) of both realms.

fortran
subroutine fill_seam_from_peer_forest(self, peer, p_idx)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
peerclass(realm_object)intargetPeer realm.
p_idxinteger(kind=I4P)inPeer slot.

Call graph

pack_seam_cells_forest ​

Pack the ghost values of the cross-rank seam send rows of peer slot p_idx from the active buffer (q when stage_active == 0, else the active stage of q_rk): cell copies, or the 2:1 interpolations and restrictions of a refined seam (issues #40, #52; adam_seam_exchange%pack_seam_rows).

fortran
subroutine pack_seam_cells_forest(self, p_idx, buf)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inThe realm.
p_idxinteger(kind=I4P)inPeer slot (the realm owning the ghosts).
bufreal(kind=R8P)outPacked values.

Call graph

unpack_seam_cells_forest ​

Unpack buf into this realm's seam ghosts of the cross-rank receive rows of peer slot p_idx, on the active buffer (issue #40; adam_seam_exchange%unpack_seam_rows).

fortran
subroutine unpack_seam_cells_forest(self, p_idx, buf)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe realm.
p_idxinteger(kind=I4P)inPeer slot (the realm owning the cells).
bufreal(kind=R8P)inPacked values.

Call graph

finalize_forest ​

Finalize the realm: close the output files and free the data (MPI is finalized once by the forest).

fortran
subroutine finalize_forest(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

initialize_forest ​

Initialize the realm (issue #35, section 6.1): backend init, IC (or restart), initial AMR, ghost update, initial output, output files open, AMR lock.

fortran
subroutine initialize_forest(self, filename, realms_number, memory_avail, nv, verbose)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
filenamecharacter(len=*)inInput file name.
realms_numberinteger(kind=I4P)inoptionalRealm count; divides the per-process budget.
memory_availreal(kind=R8P)inoptionalUnused: the budget comes from the MPI handler.
nvinteger(kind=I4P)inoptionalUnused: nv is decided by the physics.
verboselogicalinoptionalUnused: initialization is always verbose.

Call graph

is_done_forest ​

Return true if the realm has reached its end.

fortran
subroutine is_done_forest(self, done)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inThe equation.
donelogicaloutTrue if the realm is done.

Call graph

open_step_forest ​

Open a step (staged path): time bookkeeping and Runge-Kutta stages initialization.

fortran
subroutine open_step_forest(self, dt)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
dtreal(kind=R8P)inTime step from the forest.

Call graph

post_step_forest ​

Post-step work: the non-finite state check, the GLM c_h check, the div(B) history (MHD), fields, restart and conservation history on their cadence.

fortran
subroutine post_step_forest(self, dt, t, it, do_save_state, do_save_residuals, do_save_restart, do_amr, realm)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
dtreal(kind=R8P)inTime step just advanced.
treal(kind=R8P)inTime after the advance.
itinteger(kind=I4P)inIteration after the advance.
do_save_statelogicalinoptionalUnused: cadence is internal.
do_save_residualslogicalinoptionalUnused: cadence is internal.
do_save_restartlogicalinoptionalUnused: cadence is internal.
do_amrlogicalinoptionalUnused: the forest regrids (regrid_forest).
realmclass(realm_object)inouttarget, optionalSibling realms.

Call graph

regrid_forest ​

Regrid the realm on the cadence of [amr] frequency (issue #74, M5-P2); the forest calls it after every step, before post_step, on the committed state.

On a regrid step, up to [amr] iters sweeps, each: the ghost cells refreshed (the markers and the prolongation read them), the markers combined into one set of flags (mark_runtime), the library regrid (adam_object%amr_update: 2:1 balance, prolongation by [amr] regrid_prolongation, mean restriction, redistribution, maps), and on a changed grid the solids' distance function recomputed (the solid marker of the next sweep and the immersed boundary read it); a sweep that changes nothing ends the regrid. The new state is then checked (check_regridded_state) and its ghosts and auxiliary variables refreshed. regridded tells the forest to rebuild the 2:1 flux register; the grid is replicated, so every rank returns the same value.

fortran
subroutine regrid_forest(self, regridded)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
regriddedlogicaloutTrue if the grid changed.

Call graph

compute_face_mirror_indexes ​

Return the donor indexes mirrored across a boundary face.

fortran
subroutine compute_face_mirror_indexes(face, ni, nj, nk, i_gc, j_gc, k_gc, idelta, jdelta, kdelta, i_d, j_d, k_d)

Arguments

NameTypeIntentAttributesDescription
faceinteger(kind=I4P)inFace index, 1 to 6.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
i_gcinteger(kind=I4P)inGhost cell indexes.
j_gcinteger(kind=I4P)inGhost cell indexes.
k_gcinteger(kind=I4P)inGhost cell indexes.
ideltainteger(kind=I4P)inInward steps.
jdeltainteger(kind=I4P)inInward steps.
kdeltainteger(kind=I4P)inInward steps.
i_dinteger(kind=I4P)outMirrored donor indexes.
j_dinteger(kind=I4P)outMirrored donor indexes.
k_dinteger(kind=I4P)outMirrored donor indexes.

Call graph

compute_flux_difference ​

Compute the residuals from the face fluxes, dq = -sum_d (F_{d,i+1/2} - F_{d,i-1/2}) / dx_d.

A null direction weighs zero, and the residual of the variable it freezes, freeze(d) (0: none), is zero: the normal momentum for Euler (CHASE semantics, issue #35, section 3.4), none for MHD (issue #41, M2-P3). With immersed solids (phi present, its last slot the all-solids summary), the spacing of a fluid cell is cut by the solid surface (ib_cut_spacing, CHASE semantics, D-9).

fortran
subroutine compute_flux_difference(nv, ni, nj, nk, ngc, blocks_number, is_null, freeze, dxyz, flx, fly, flz, dq, phi)

Arguments

NameTypeIntentAttributesDescription
nvinteger(kind=I4P)inConservative variables number.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
is_nulllogicalinNull directions.
freezeinteger(kind=I4P)inVariable frozen by each null direction.
dxyzreal(kind=R8P)inBlocks space steps [3, nb].
flxreal(kind=R8P)inX-face fluxes.
flyreal(kind=R8P)inY-face fluxes.
flzreal(kind=R8P)inZ-face fluxes.
dqreal(kind=R8P)inoutResiduals.
phireal(kind=R8P)inoptionalImmersed solids distance function.

Call graph

add_gravity_sources ​

Add the external gravity sources (issue #73, M7-G1): rho g to the momentum and, from the face mass fluxes the continuity equation used, 1/2 sum_d g_d (F^rho_{d,i+1/2} + F^rho_{d,i-1/2}) to the energy (Mikami et al. 2008, Mullen et al. 2021: with a static potential the total energy E + rho Phi is then conserved exactly, while the cell-centred rho u . g is not), plus its fourth-order correction gc (M7-G2a, compute_gravity_correction). A component of g along a null direction is refused at initialisation.

fortran
subroutine add_gravity_sources(ni, nj, nk, ngc, blocks_number, g, q, flx, fly, flz, gc, dq)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
greal(kind=R8P)inGravity.
qreal(kind=R8P)inConservative variables.
flxreal(kind=R8P)inX-face fluxes.
flyreal(kind=R8P)inY-face fluxes.
flzreal(kind=R8P)inZ-face fluxes.
gcreal(kind=R8P)inFourth-order correction of the energy source.
dqreal(kind=R8P)inoutResiduals.

Call graph

add_potential_sources ​

Add the gravity of the cell potential (issue #81, M8-P1). The face gravity is g_{d,i+1/2} = -(Phi_{i+1} - Phi_i) / dx_d, the cell gravity the mean of the cell's two faces; the momentum gains rho times the cell gravity, the energy 1/2 sum_d (g_{d,i+1/2} F^rho_{d,i+1/2} + g_{d,i-1/2} F^rho_{d,i-1/2}) from the face mass fluxes of the continuity equation: the face form of add_gravity_sources with a gravity per face. Summed over the cells the energy source is sum_i Phi_i (F_{i+1/2} - F_{i-1/2}) / dx, so with a static potential E + rho Phi is conserved exactly, and with a self-gravitating one (a symmetric discrete Laplacian) E + rho Phi / 2 (Mullen et al. 2021). Second order: no fourth-order correction (issue #81, D-81-4).

fortran
subroutine add_potential_sources(ni, nj, nk, ngc, blocks_number, is_null, dxyz, phi, q, flx, fly, flz, dq)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
is_nulllogicalinNull directions.
dxyzreal(kind=R8P)inBlocks space steps [3, nb].
phireal(kind=R8P)inGravitational potential, ghosts filled.
qreal(kind=R8P)inConservative variables.
flxreal(kind=R8P)inX-face fluxes.
flyreal(kind=R8P)inY-face fluxes.
flzreal(kind=R8P)inZ-face fluxes.
dqreal(kind=R8P)inoutResiduals.

Call graph

add_gravity_limited_correction ​

Remove from the gravity energy source of each cell (1 - Lambda) L (issue #73, M7-G1, option B): Lambda and L (lam(1), lam(2)) from the positivity limiter, which gave the backbone the time-centred energy and limited the face-form excess L by Lambda; where Lambda = 1 nothing changes.

fortran
subroutine add_gravity_limited_correction(ni, nj, nk, ngc, blocks_number, lam, dq)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
lamreal(kind=R8P)inCell factors (1) and gravity excess (2).
dqreal(kind=R8P)inoutResiduals.

Call graph

subtract_equilibrium_residual ​

Subtract the residual of the hydrostatic equilibrium from the residual of the stage (issue #73, M7-G2b, the well-balanced mode: the deviation method, Edelmann et al. 2021 section 4.3): at the equilibrium the two are the same operator on the same state, so the residual vanishes to round-off.

fortran
subroutine subtract_equilibrium_residual(nv, ni, nj, nk, ngc, blocks_number, dq_e, dq)

Arguments

NameTypeIntentAttributesDescription
nvinteger(kind=I4P)inVariables number.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
dq_ereal(kind=R8P)inEquilibrium residual.
dqreal(kind=R8P)inoutResiduals.

Call graph

compute_gravity_correction_faces ​

Set the fourth-order correction of the gravity energy source (issue #73, M7-G2a) from the faces the block holds: gc = sum_d g_d (-F_{i-3/2} + F_{i-1/2} + F_{i+1/2} - F_{i+3/2}) / 24 (F the high-order mass flux along d), so that the face form plus gc is sum_d g_d (-F_{i-3/2} + 13 F_{i-1/2} + 13 F_{i+1/2} - F_{i+3/2}) / 24, the cell value of the point values F^rho = rho u_d that the finite-difference fluxes are the primitive function of (fourth order; the face form alone is second order). Each face's weights sum to zero over the cells, so E + rho Phi stays conserved. The faces beyond the block (cells 1 and n_d) are added by add_gravity_edge_correction.

fortran
subroutine compute_gravity_correction_faces(ni, nj, nk, ngc, blocks_number, g, flx, fly, flz, gc)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
greal(kind=R8P)inGravity.
flxreal(kind=R8P)inX-face fluxes.
flyreal(kind=R8P)inY-face fluxes.
flzreal(kind=R8P)inZ-face fluxes.
gcreal(kind=R8P)inoutGravity energy correction [1, ...].

Call graph

poison_ghosts ​

Set every ghost cell to a quiet NaN (verification instrument, [diagnostics] ghost_poison, issue #65).

fortran
subroutine poison_ghosts(ni, nj, nk, ngc, blocks_number, q)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
qreal(kind=R8P)inoutConservative variables.

Call graph

refresh_equilibrium_residual ​

Recompute the residual of the hydrostatic equilibrium when the grid it describes is gone (initialisation, restart, regrid; issue #73, M7-G2b), at the start of a step: the forest's flux register is then the current grid's.

The equilibrium (ic%set_equilibrium) goes into the idle first stage buffer and its residual into dq_e, with the space operator of the run (ghosts, boundary conditions, seam fill, limiter, every source): at the equilibrium every stage residual then vanishes, at AMR 2:1 seams too (the seam ghosts of the two states are the same). The end-of-step reflux replaces the coarse face flux with the fine one, which at the equilibrium would add sgn dt / dx (F_coarse - F_fine): the equilibrium's seam fluxes are accumulated with weight 1 into the realm's copy of the register and their mismatch stored per face (seam_e), and the reflux subtracts it. (Folding it into dq_e instead leaves the coarse seam cells a non-zero stage residual: the stages leave the equilibrium, the fine ghosts prolonged from them follow, and the end-of-step reflux fixes the coarse cells' net change only.) The reflux and the residual each conserve, for the state and for the equilibrium, so the difference does.

fortran
subroutine refresh_equilibrium_residual(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

compute_gravity_correction ​

Compute the fourth-order correction of the gravity energy source into gcor (issue #73, M7-G2a) from the high-order face fluxes of the stage, before any blending: the faces of the block, then the face beyond each end of every direction with gravity, by the edge kernel of the space operator's face (the model's, and with weno-riemann the solver's), selected here outside the loops.

fortran
subroutine compute_gravity_correction(self, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
qreal(kind=R8P)inConservative variables.

Call graph

compute_rk_ssp_residual ​

Compute the residual of a strong stability preserving step, dq = sum_s beta_s dq_s, from the stored stages.

Used with immersed solids only: the library update_q computes the step residual on its unmasked path but not on the masked one. Same summation order as the FNL kernel compute_rk_ssp_residual_dev.

fortran
subroutine compute_rk_ssp_residual(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

compute_residuals_weno ​

Compute the residuals with the WENO space operator: ghost update, auxiliary variables, face fluxes of the active directions, flux difference, and with GLM the psi damping source.

The face fluxes of a null direction are never computed: they keep their zero initialization. On the staged path (AMR seam faces), the seam face fluxes of every stage are accumulated into the forest's flux register. With immersed solids, the eikonal extrapolation fills the solid cells first (n_eikonal Jacobi sweeps, each followed by a ghost exchange, then the wall inversion), and the flux difference uses the spacing cut by the surface.

fortran
subroutine compute_residuals_weno(self, q, dq, s, flux_register)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
qreal(kind=R8P)inoutConservative variables.
dqreal(kind=R8P)inoutResiduals.
sinteger(kind=I4P)inoptionalRunge-Kutta stage.
flux_registerclass(flux_register_object)inoutoptionalForest's flux register for reflux.

Call graph

compute_residuals_riemann ​

Compute the residuals with the weno-riemann space operator (issue #47): as compute_residuals_weno, with the face fluxes of the WENO interpolation, the Riemann solver and the high-order correction.

The host selects the kernel of the (model, solver) pair; a pair without kernels is fatal. The pre-steps (immersed solids, floors, ghosts, auxiliary variables) and the post-steps (seam accumulation, flux difference, GLM damping, EGLM damping and sources) are those of compute_residuals_weno.

fortran
subroutine compute_residuals_riemann(self, q, dq, s, flux_register)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.
qreal(kind=R8P)inoutConservative variables.
dqreal(kind=R8P)inoutResiduals.
sinteger(kind=I4P)inoptionalRunge-Kutta stage.
flux_registerclass(flux_register_object)inoutoptionalForest's flux register for reflux.

Call graph

integrate_rk_ls ​

Integrate one time step with a low-storage Runge-Kutta scheme.

fortran
subroutine integrate_rk_ls(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

integrate_rk_ssp ​

Integrate one time step with a strong stability preserving Runge-Kutta scheme.

fortran
subroutine integrate_rk_ssp(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inoutThe equation.

Call graph

Functions ​

stages_per_step_forest ​

Return the integrator stages per step: only SSP schemes are stage-splittable (staged path).

Returns: integer(kind=I4P)

fortran
function stages_per_step_forest(self) result(K)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_cpu_object)inThe equation.

Call graph