Appearance
adam_prism_cpu_object
ADAM, PRISM (Plasma Research usIng Simulation Methods) equations system class definition, CPU backend.
Source: src/app/prism/cpu/adam_prism_cpu_object.F90
Dependencies
Contents
- prism_cpu_object
- compute_residuals_interface
- integrate_interface
- mark_by_j_vec_total_variation
- allocate_cpu
- initialize_prism
- save_residuals
- save_simulation_data
- compute_coils_current
- apply_fWL_correction
- set_boundary_conditions
- compute_face_mirror_indexes
- enforce_silver_muller_normal_bc_cpu
- solve_silver_muller_normal_line_cpu
- silver_muller_face_metadata_cpu
- solve_silver_muller_normal_field_cpu
- interior_cell_from_face_cpu
- ghost_cell_from_face_cpu
- set_initial_conditions
- update_ghost
- initialize_forest
- compute_local_dt_forest
- advance_one_step_forest
- open_step_forest
- begin_stage_forest
- end_stage_forest
- close_step_forest
- fill_seam_from_peer_forest
- pack_seam_cells_forest
- unpack_seam_cells_forest
- apply_reflux_to_stage_forest
- post_step_forest
- is_done_forest
- finalize_forest
- compute_dt
- compute_energy
- compute_energy_error
- compute_grms
- compute_magnetic_field_at_center_domain
- compute_max_divergence_outside_absorbing_layers
- exclude_stencil_contaminated_face
- impose_div_free
- print_elliptic_progress
- simulate
- compute_residuals_fd_centered
- apply_pml_fd_centered_ade
- apply_direct_damping
- select_pml_field_scales
- apply_x_face_field_correction
- apply_y_face_field_correction
- apply_z_face_field_correction
- compute_x_face_pml_rhs
- compute_y_face_pml_rhs
- compute_z_face_pml_rhs
- compute_pml_coefficients
- compute_residuals_fv_centered
- accumulate_seam_fluxes_fv
- compute_residuals_weno
- integrate_blanesmoan
- integrate_cfm
- integrate_leapfrog
- integrate_leapfrog_pic
- integrate_rk_ls
- integrate_rk_ssp
- integrate_rk_ssp_pic
- integrate_rk_ssp_pic_charge_conserving
- compute_pic_charge_displacement_decomposition
- compute_pic_esirkepov_displacement
- compute_esirkepov_gaussian_shape_1d
- esirkepov_shape_weight_1d
- deposit_pic_charge_density
- initialize_charge_conservation_diagnostic
- accumulate_charge_conservation_current
- finalize_charge_conservation_diagnostic
- save_charge_conservation_diagnostic
- solve_pic_charge_conserving_current_dispatch
- ensure_esirkepov_current_solver_cache
- solve_pic_charge_conserving_current_esirkepov
- modified_kernels
- filter_modified_axis
- deposit_pic_modified_charge
- initialize_pic_conserving_current_time_zero
- check_conserving_single_block
- modified_current_line
- solve_pic_charge_conserving_current_modified
- solve_modified_current_with_cleanup
- cleanup_modified_particle_current
- report_particle_tail_error
- build_esirkepov_face_line
- update_esirkepov_face_residual
- ensure_direct_current_solver_cache
- solve_pic_charge_conserving_current
- find_pic_position_cell
- particle_weighting_radius
- particle_shape_weight_1d
- build_centered_reconstruction_matrix
- build_centered_derivative_matrix
- factorize_matrix_pivot
- solve_factored_matrix_pivot
- update_current_line_solver_residual
- odd_mirror_index
- impose_zero_current_ghosts
- impose_odd_current_ghosts
- integrate_rk_yoshida
- compute_dxyz_min
- compute_fluxes_convective_weno
- compute_fluxes_convective_ri_weno
- compute_fluxes_difference
- decompose_fluxes_convective
- compute_field_mean_value
- is_face_line_seed_cpu
- face_normal_direction_cpu
- silver_muller_unknown_coefficient_cpu
- tangential_divergence_at_cell_cpu
- normal_known_contribution_cpu
- normal_depth_from_cell_cpu
- component_along_direction_cpu
- stages_per_step_forest
- compute_pml_kappa
- modified_filter_radius
- modified_position_shift
- dotproduct
- crossproduct
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
compute_fluxes_maxwell | procedure(compute_convective_fluxes_interface) | pointer | Compute convective fluxes. |
PML_FACE_X_M | integer(kind=I4P) | parameter | |
PML_FACE_X_P | integer(kind=I4P) | parameter | |
PML_FACE_Y_M | integer(kind=I4P) | parameter | |
PML_FACE_Y_P | integer(kind=I4P) | parameter | |
PML_FACE_Z_M | integer(kind=I4P) | parameter | |
PML_FACE_Z_P | integer(kind=I4P) | parameter | |
GRMS_3DB_RATIO | real(kind=R8P) | parameter |
Derived Types
prism_cpu_object
Maxwell equations system class definition, CPU backend.
Inheritance
Extends: prism_common_object
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
io | type(io_object) | IO handler. | |
amr | type(amr_object) | AMR marker handler. | |
slices | type(slices_object) | Slices handler. | |
blanesmoan | type(blanesmoan_object) | Blanes-Moan integrator. | |
cfm | type(cfm_object) | Commutator-Free Magnus integrator. | |
leapfrog | type(leapfrog_object) | Leapfrog integrator. | |
flail | type(flail_object) | Linear algebra methods handler. | |
weno | type(weno_object) | WENO reconstructor. | |
ib | type(ib_object) | Immersed boundary. | |
rk | type(rk_object) | Runge-Kutta integrator. | |
adam | type(adam_object) | ADAM, grid + tree + field + maps orchestrator. | |
fdv_scheme | character(len=:) | allocatable | FDV scheme, fd/fv. |
fdv_order | integer(kind=I4P) | Order of finite difference/volume schemes, general order. | |
fdv_half_stencil | integer(kind=I4P) | Half stencil length of finite difference/volume schemes. | |
fdv_half_stencils | integer(kind=I4P) | Half stencil length of fdv schemes for each derivative up to 6. | |
ngc | integer(kind=I4P) | pointer | Number of ghost cells. |
ni | integer(kind=I4P) | pointer | Number of cells in i direction. |
nj | integer(kind=I4P) | pointer | Number of cells in j direction. |
nk | integer(kind=I4P) | pointer | Number of cells in k direction. |
nb | integer(kind=I4P) | pointer | Total blocks number for MPI. |
blocks_number | integer(kind=I4P) | pointer | Actual blocks number. |
nv | integer(kind=I4P) | pointer | Number of variables in q vector. |
realm_index | integer(kind=I4P) | Inter-realm seam coupling — currently-published stage buffer key. | |
stage_active | integer(kind=I4P) | A copy of the forest's flux register (its faces and lookup, the accumulators unused), refreshed by the forest each | |
flux_register_copy | type(flux_register_object) | Procedure pointer TBPs for FDV operators (set at initialization by backend). | |
compute_block_total_variation | procedure(compute_block_total_variation_interface) | pass(self), pointer | Compute TV. |
compute_curl | procedure(compute_curl_interface) | pass(self), pointer | Compute curl. |
compute_curl_extended | procedure(compute_curl_interface) | pass(self), pointer | Compute curl on extended support. |
compute_derivative1 | procedure(compute_derivative1_interface) | pass(self), pointer | Compute deriv1. |
compute_derivative2 | procedure(compute_derivative2_interface) | pass(self), pointer | Compute deriv2. |
compute_derivative4 | procedure(compute_derivative4_interface) | pass(self), pointer | Compute deriv4. |
compute_divergence | procedure(compute_divergence_interface) | pass(self), pointer | Compute dive. |
compute_gradient | procedure(compute_gradient_interface) | pass(self), pointer | Compute grad. |
compute_gradient_extended | procedure(compute_gradient_interface) | pass(self), pointer | Compute gradient on extended support. |
compute_laplacian | procedure(compute_laplacian_interface) | pass(self), pointer | Compute laplac. |
save_em_only | logical | [IO] save_fields = em: the XH5F output holds D and B only. | |
amr_locked_ | logical | AMR regrid lock (issue #22 GA6): set .true. by backends whose device/topology | |
nv_c | integer(kind=I4P) | pointer | Number of conservative variables in q vector. |
nv_s | integer(kind=I4P) | pointer | Number of source variables in q vector. |
nv_cl | integer(kind=I4P) | pointer | Number of divergence cleaning variables in q vector. |
q | real(kind=R8P) | allocatable | Conservative cell centered variables. |
dq | real(kind=R8P) | allocatable | Residuals right hand side. |
q_pic | real(kind=R8P) | allocatable | PIC variables. |
pic_fields | real(kind=R8P) | allocatable | Fields value at particle locations. |
curl | real(kind=R8P) | allocatable | Curl fields. |
divergence | real(kind=R8P) | allocatable | Divergence fields. |
q_name | type(string) | allocatable | Fields names [1:nv]. |
dq_name | type(string) | allocatable | Residuals names [1:nv]. |
q_pic_name | type(string) | allocatable | PIC Fields names. |
curl_name | type(string) | allocatable | Curl fields names. |
div_name | type(string) | allocatable | Divergence fields names. |
energy_D | real(kind=R8P) | allocatable | Energy of field D, time history. |
energy_B | real(kind=R8P) | allocatable | Energy of field B, time history. |
coil_power | real(kind=R8P) | allocatable | Power of coils, time history. |
Poynting_flux | real(kind=R8P) | allocatable | Total Poynting flux from boundary, time history. |
rms_energy_error_D | real(kind=R8P) | RMS energy error of D field. | |
rms_energy_error_B | real(kind=R8P) | RMS energy error of B field. | |
max_divergence_D | real(kind=R8P) | Maximum of divergence of D field. | |
max_divergence_B | real(kind=R8P) | Maximum of divergence of B field. | |
max_divergence_J | real(kind=R8P) | Maximum of divergence of J field. | |
single_particle_output_last_time | real(kind=R8P) | Last time written to single-particle history. | |
single_particle_output_written | logical | Single-particle history write sentinel. | |
bc | type(prism_bc_object) | Boundary conditions. | |
coil | type(prism_coil_object) | Coil source term. | |
external_fields | type(prism_external_fields_object) | External fields. | |
fWLayer | type(prism_fWLayer_object) | Far-field weighted layer. | |
grms | type(prism_grms_object) | Grms diagnostic. | |
ic | type(prism_ic_object) | Initial conditions. | |
leapfrog_pic | type(prism_leapfrog_pic_object) | Leapfrog PIC integrator. | |
magnetic_field_at_center_domain | type(prism_magnetic_field_at_center_domain_object) | Domain-center B diagnostic. | |
numerics | type(prism_numerics_object) | Numerics configuration. | |
particle_injection | type(prism_particle_injection_object) | Particle injection. | |
physics | type(prism_physics_object) | Physics configuration. | |
pic | type(prism_pic_object) | PIC state. | |
pml | type(prism_pml_object) | Perfectly matched layer. | |
rk_pic | type(prism_rk_pic_object) | Runge-Kutta PIC handler. | |
rk_pml | type(prism_rk_pml_object) | Runge-Kutta PML auxiliary handler. | |
time | type(prism_time_object) | Time integration state. | |
flxyz_c | real(kind=R8P) | allocatable | Fluxes at cell center with +/- decomposition for all directions. |
flx_f | real(kind=R8P) | allocatable | Fluxes along x at cell face. |
fly_f | real(kind=R8P) | allocatable | Fluxes along y at cell face. |
flz_f | real(kind=R8P) | allocatable | Fluxes along z at cell face. |
charge_conservation_acc | real(kind=R8P) | allocatable | Accumulator for rho/dt + weighted div(J) diagnostic. |
charge_conservation_divj | real(kind=R8P) | allocatable | Workspace for stage div(J) diagnostic. |
direct_current_matrix_x | real(kind=R8P) | allocatable | Cached factored x-line matrices for direct PIC current. |
direct_current_matrix_y | real(kind=R8P) | allocatable | Cached factored y-line matrices for direct PIC current. |
direct_current_matrix_z | real(kind=R8P) | allocatable | Cached factored z-line matrices for direct PIC current. |
direct_current_dxyz | real(kind=R8P) | allocatable | Grid spacings used to build direct current matrices. |
direct_current_pivot_x | integer(kind=I4P) | allocatable | Cached x-line pivots for direct PIC current. |
direct_current_pivot_y | integer(kind=I4P) | allocatable | Cached y-line pivots for direct PIC current. |
direct_current_pivot_z | integer(kind=I4P) | allocatable | Cached z-line pivots for direct PIC current. |
direct_current_cache_ni | integer(kind=I4P) | Cached x-line size. | |
direct_current_cache_nj | integer(kind=I4P) | Cached y-line size. | |
direct_current_cache_nk | integer(kind=I4P) | Cached z-line size. | |
direct_current_cache_nb | integer(kind=I4P) | Cached block count. | |
direct_current_cache_hs | integer(kind=I4P) | Cached half-stencil. | |
direct_current_cache_esirkepov | logical | ||
fv_add_phi_damping | logical | Apply phi damping in FV residuals. | |
fv_add_psi_damping | logical | Apply psi damping in FV residuals. | |
fv_ivar_phi | integer(kind=I4P) | Phi slot index in FV residuals. | |
fv_ivar_psi | integer(kind=I4P) | Psi slot index in FV residuals. | |
charge_conservation_error_max | real(kind=R8P) | Max continuity-equation residual over one PIC step. | |
current_solver_residual_max | real(kind=R8P) | Max residual of the direct current line solves. | |
charge_conservation_ready | logical | True when the current PIC step has a finalized diagnostic. | |
compute_residuals | procedure(compute_residuals_interface) | pass(self), pointer | Compute residuals, space operator. |
integrate | procedure(integrate_interface) | pass(self), pointer | Integrate, time operator. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
load_fdv_from_file | pass(self) | Load FDV config from file. |
runtime_amr_forest | pass(self) | Whether this realm regrids during the run (#74). |
regrid_forest | pass(self) | Invoked by forest%regrid per realm per timestep (#74). |
finalize_mpi_forest | pass(self) | Process-global MPI finalize; forest calls it ONCE after all. |
after_topology_build_forest | pass(self) | Backend hook invoked once after the forest builds the seam maps. |
close_block_xh5f | nopass | Close XH5F file block. |
close_file_xh5f | nopass | Close XH5F file. |
open_block_xh5f | pass(self) | Open block file XH5F. |
open_file_xh5f | pass(self) | Open file XH5F. |
save_q_xh5f | pass(self) | Save in XH5F (XDMF/HDF5) format. |
compute_curl_fd_extended | pass(self) | Compute curl of vector field, finite difference, even for half gcs. |
compute_gradient_fd_extended | pass(self) | Compute gradient of scalar field, finite difference, even for half |
amr_update | pass(self) | Do AMR update (init-time only where amr_locked_). |
mark_by_geometry | pass(self) | Mark blocks to be refined by a primitive geometric box. |
allocate_common | pass(self) | Allocate common data. |
compute_auxiliary_fields | pass(self) | Compute auxiliary fields. |
compute_fields_number | pass(self) | Compute the block-sized fields allocated per block. |
initialize | pass(self) | Initialize the equation common data. |
fold_deposited_ghosts | pass(self) | Fold PIC deposits spilled into ghosts, locally and across ranks. |
initialize_pic_time_zero | pass(self) | Host-side PIC particle injection plus charge/current deposition at t=0. |
verify_no_pic_deposition_on_coils | pass(self) | Guard against PIC deposition on coil cells. |
weight_pic_fields_time_zero | pass(self) | Host-side PIC field interpolation at t=0. |
save_pic_self_force_diagnostic_time_zero | pass(self) | Temporary PIC self-force diagnostic at t=0. |
load_restart_files | pass(self) | Load restart files. |
save_energy_error | pass(self) | Save energy error history. |
save_energy_history | pass(self) | Save energy history. |
save_coils_current_diagnostics | pass(self) | Save instantaneous coil-current diagnostics. |
save_divergence_history | pass(self) | Save divergence history. |
save_grms_history | pass(self) | Save Grms history. |
save_magnetic_field_at_center_domain_history | pass(self) | Save domain-center B history. |
save_restart_files | pass(self) | Save restart files. |
save_slices | pass(self) | Save the slices on their cadence. |
save_xh5f | pass(self) | Save simulation data in XH5F format. |
initialize_coils | pass(self) | Initialize coils. |
compute_coils_current_time_zero | pass(self) | Host-side coil current initialization at t=0. |
impose_ct_correction | pass(self) | Host-side constrained-transport projection on q(ivar:ivar+2). |
impose_pic_fields_time_zero | pass(self) | Host-side elliptic initialization for PIC/current-driven fields. |
set_rectangular_coil_x | pass(self) | Subroutine to set a rectangular coil source with +-x normal |
set_rectangular_coil_y | pass(self) | Subroutine to set a rectangular coil source with +-y normal |
set_rectangular_coil_z | pass(self) | Subroutine to set a rectangular coil source with +-z normal |
set_circular_coil_x | pass(self) | Subroutine to set a circular coil source with +-x normal |
set_circular_coil_y | pass(self) | Subroutine to set a circular coil source with +-y normal |
set_circular_coil_z | pass(self) | Subroutine to set a circular coil source with +-z normal |
set_solenoid_x | pass(self) | Subroutine to set a solenoid source with +-x normal |
set_solenoid_y | pass(self) | Subroutine to set a solenoid source with +-y normal |
set_solenoid_z | pass(self) | Subroutine to set a solenoid source with +-z normal |
set_helicon_coil | pass(self) | Subroutine to set a helicon coil source. |
compute_rectangular_current_flux_sides | pass(self) | Precompute rectangular side-current fluxes. |
compute_helicon_current_flux_segments | pass(self) | Precompute helicon segment-current fluxes. |
coupling_descriptor_forest | pass(self) | Report (scheme_time, rk_scheme, nv) for β admissibility. |
mark_by_j_vec_total_variation | pass(self) | |
allocate_cpu | pass(self) | Allocate CPU data. |
initialize_prism | pass(self) | Initialize PRSIM equation. |
save_residuals | pass(self) | Save residuals history. |
save_simulation_data | pass(self) | Save all simulation data. |
apply_fWL_correction | pass(self) | Apply fWLayer correction (if present) |
compute_coils_current | pass(self) | Compute current coils sources. |
set_boundary_conditions | pass(self) | Set boundary conditions of equation. |
set_initial_conditions | pass(self) | Set initial conditions (and coils) of equation. |
update_ghost | pass(self) | Update ghost cells and set boundary conditions. |
compute_field_mean_value | pass(self) | Compute field mean value. |
initialize_forest | pass(self) | Invoked by forest%initialize per realm at startup. |
compute_local_dt_forest | pass(self) | Invoked by forest%compute_global_dt during the min reduction. |
advance_one_step_forest | pass(self) | Invoked by forest%evolve_one_step per realm per timestep. |
stages_per_step_forest | pass(self) | Number of integrator stages this realm exposes per step. |
open_step_forest | pass(self) | Per-step prologue (multi-realm path). |
begin_stage_forest | pass(self) | Begin one integrator stage on this realm (multi-realm path). |
end_stage_forest | pass(self) | End the stage: residuals + assignment (multi-realm path). |
close_step_forest | pass(self) | Per-step epilogue (multi-realm path). |
post_step_forest | pass(self) | Invoked by forest%post_step per realm per timestep. |
is_done_forest | pass(self) | Invoked by forest%is_done during the termination reduction. |
finalize_forest | pass(self) | Invoked by forest%finalize per realm at shutdown. |
fill_seam_from_peer_forest | pass(self) | Copy peer's interior into self's ghosts for peer slot p_idx. |
pack_seam_cells_forest | pass(self) | Pack own cells of the cross-rank seam send rows. |
unpack_seam_cells_forest | pass(self) | Unpack the cross-rank seam receive rows into own ghosts. |
apply_reflux_to_stage_forest | pass(self) | Apply end-of-step Berger-Colella reflux to self's committed q. |
initialize_charge_conservation_diagnostic | pass(self) | Initialize PIC continuity-equation diagnostic. |
accumulate_charge_conservation_current | pass(self) | Accumulate weighted stage div(J). |
finalize_charge_conservation_diagnostic | pass(self) | Finalize PIC continuity-equation diagnostic. |
save_charge_conservation_diagnostic | pass(self) | Save PIC charge-conservation diagnostic history. |
compute_dt | pass(self) | Compute time step. |
compute_energy | pass(self) | Compute energy. |
compute_energy_error | pass(self) | Compute energy error. |
compute_grms | pass(self) | Compute Grms of the rotating magnetic-field amplitude. |
compute_magnetic_field_at_center_domain | pass(self) | Compute B at the domain center. |
impose_div_free | pass(self) | Impose divergence-free property. |
simulate | pass(self) | Perform the simulation. |
Interfaces
compute_residuals_interface
integrate_interface
Subroutines
mark_by_j_vec_total_variation
Mark blocks to be refined/derefined by the value of total variation of j_vec.
fortran
subroutine mark_by_j_vec_total_variation(self, tv_tol, delta_type, delta_fine, delta_coarse, threshold, do_init)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. | |
tv_tol | real(kind=R8P) | in | Total variation tolerance value. | |
delta_type | character(len=*) | in | Delta criterion type. | |
delta_fine | real(kind=R8P) | in | Maximum cell delta in fine grids. | |
delta_coarse | real(kind=R8P) | in | Minimum cell delta in coarse grids. | |
threshold | real(kind=R8P) | in | optional | Threshold for sphere proximity. |
do_init | logical | in | optional | Re-initialize refinements queries. |
Call graph
allocate_cpu
Allocate CPU data.
fortran
subroutine allocate_cpu(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
initialize_prism
Initialize PRSIM equation.
fortran
subroutine initialize_prism(self, filename, realms_number)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. | |
filename | character(len=*) | in | Input file name. | |
realms_number | integer(kind=I4P) | in | optional | Forest realm count; divides the per-process budget (default 1). |
Call graph
save_residuals
Save residuals history.
fortran
subroutine save_residuals(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
save_simulation_data
Save all simulation data.
fortran
subroutine save_simulation_data(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
compute_coils_current
Compute current coils sources (DC/AC with smooth envelope).
fortran
subroutine compute_coils_current(self, q, gamma)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
q | real(kind=R8P) | inout | ||
gamma | real(kind=R8P) | in | optional |
Call graph
apply_fWL_correction
Apply correction if a fWL is present
fortran
subroutine apply_fWL_correction(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. |
Call graph
set_boundary_conditions
Set boundary conditions of equation.
fortran
subroutine set_boundary_conditions(self, q, s)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. | |
s | integer(kind=I4P) | in | optional | Stage counter. |
Call graph
compute_face_mirror_indexes
Return the donor indexes mirrored across the selected 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
face | integer(kind=I4P) | in | Face index in 1:6 numbering. | |
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
nk | integer(kind=I4P) | in | Grid dimensions. | |
i_gc | integer(kind=I4P) | in | Ghost-cell indexes. | |
j_gc | integer(kind=I4P) | in | Ghost-cell indexes. | |
k_gc | integer(kind=I4P) | in | Ghost-cell indexes. | |
idelta | integer(kind=I4P) | in | One-step inward deltas. | |
jdelta | integer(kind=I4P) | in | One-step inward deltas. | |
kdelta | integer(kind=I4P) | in | One-step inward deltas. | |
i_d | integer(kind=I4P) | out | Mirrored donor indexes. | |
j_d | integer(kind=I4P) | out | Mirrored donor indexes. | |
k_d | integer(kind=I4P) | out | Mirrored donor indexes. |
Call graph
enforce_silver_muller_normal_bc_cpu
fortran
subroutine enforce_silver_muller_normal_bc_cpu(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q | real(kind=R8P) | inout |
Call graph
solve_silver_muller_normal_line_cpu
fortran
subroutine solve_silver_muller_normal_line_cpu(q, ngc, ni, nj, nk, b, face, i_seed, j_seed, k_seed, hs, dxyz, has_rho, var_rho)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
q | real(kind=R8P) | inout | ||
ngc | integer(kind=I4P) | in | ||
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
b | integer(kind=I4P) | in | ||
face | integer(kind=I4P) | in | ||
i_seed | integer(kind=I4P) | in | ||
j_seed | integer(kind=I4P) | in | ||
k_seed | integer(kind=I4P) | in | ||
hs | integer(kind=I4P) | in | ||
dxyz | real(kind=R8P) | in | ||
has_rho | logical | in | ||
var_rho | integer(kind=I4P) | in |
Call graph
silver_muller_face_metadata_cpu
fortran
subroutine silver_muller_face_metadata_cpu(face, dir_t1, dir_t2, var_d_t1, var_d_t2, var_d_n, var_b_t1, var_b_t2, var_b_n)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
face | integer(kind=I4P) | in | ||
dir_t1 | integer(kind=I4P) | out | ||
dir_t2 | integer(kind=I4P) | out | ||
var_d_t1 | integer(kind=I4P) | out | ||
var_d_t2 | integer(kind=I4P) | out | ||
var_d_n | integer(kind=I4P) | out | ||
var_b_t1 | integer(kind=I4P) | out | ||
var_b_t2 | integer(kind=I4P) | out | ||
var_b_n | integer(kind=I4P) | out |
Call graph
solve_silver_muller_normal_field_cpu
fortran
subroutine solve_silver_muller_normal_field_cpu(q, ngc, ni, nj, nk, b, face, i_seed, j_seed, k_seed, hs, dxyz, dir_t1, dir_t2, var_t1, var_t2, var_n, use_target_var, target_var)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
q | real(kind=R8P) | inout | ||
ngc | integer(kind=I4P) | in | ||
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
b | integer(kind=I4P) | in | ||
face | integer(kind=I4P) | in | ||
i_seed | integer(kind=I4P) | in | ||
j_seed | integer(kind=I4P) | in | ||
k_seed | integer(kind=I4P) | in | ||
hs | integer(kind=I4P) | in | ||
dxyz | real(kind=R8P) | in | ||
dir_t1 | integer(kind=I4P) | in | ||
dir_t2 | integer(kind=I4P) | in | ||
var_t1 | integer(kind=I4P) | in | ||
var_t2 | integer(kind=I4P) | in | ||
var_n | integer(kind=I4P) | in | ||
use_target_var | logical | in | ||
target_var | integer(kind=I4P) | in |
Call graph
interior_cell_from_face_cpu
fortran
subroutine interior_cell_from_face_cpu(face, eq, ni, nj, nk, i_seed, j_seed, k_seed, ic, jc, kc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
face | integer(kind=I4P) | in | ||
eq | integer(kind=I4P) | in | ||
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
i_seed | integer(kind=I4P) | in | ||
j_seed | integer(kind=I4P) | in | ||
k_seed | integer(kind=I4P) | in | ||
ic | integer(kind=I4P) | out | ||
jc | integer(kind=I4P) | out | ||
kc | integer(kind=I4P) | out |
Call graph
ghost_cell_from_face_cpu
fortran
subroutine ghost_cell_from_face_cpu(face, ghost_layer, ni, nj, nk, i_seed, j_seed, k_seed, ic, jc, kc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
face | integer(kind=I4P) | in | ||
ghost_layer | integer(kind=I4P) | in | ||
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
i_seed | integer(kind=I4P) | in | ||
j_seed | integer(kind=I4P) | in | ||
k_seed | integer(kind=I4P) | in | ||
ic | integer(kind=I4P) | out | ||
jc | integer(kind=I4P) | out | ||
kc | integer(kind=I4P) | out |
Call graph
set_initial_conditions
Set initial conditions and coils on field.
fortran
subroutine set_initial_conditions(self, is_restart)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. | |
is_restart | logical | in | Branching sentinel for restart/non restart path. |
Call graph
update_ghost
Update ghost cells (intra-realm only). If not specified all steps are performed, synchronous computation.
Inter-realm seam ghost cells are NO LONGER filled here: the forest's Phase 2 seam fill (between begin_stage and end_stage) populates them via the fill_seam_from_peer_forest TBP operating on the realm's currently-active buffer (selected internally via stage_active). The realm(:) optional dummy that used to thread through this signature has been retired.
fortran
subroutine update_ghost(self, q, step, s)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. | |
step | integer(kind=I4P) | in | optional | Step to be perfordmed in asyncronous comp. |
s | integer(kind=I4P) | in | optional | Stage counter. |
Call graph
initialize_forest
Initialize this realm from scratch: PRISM init, IC injection (or restart load), initial ghost update, initial diagnostics dump, IO files open, plus PIC/leapfrog priming if those schemes are active.
Invoked by forest%initialize. The forest writes self%realm_index = is BEFORE calling this routine, so the body can already read the 1-based forest position from self%realm_index if needed. Pic residual computation
Integration of equations
fortran
subroutine initialize_forest(self, filename, realms_number, memory_avail, nv, verbose)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The realm. | |
filename | character(len=*) | in | Input parameters file name. | |
realms_number | integer(kind=I4P) | in | optional | Realm count; divides the per-process budget. |
memory_avail | real(kind=R8P) | in | optional | Per-process memory budget override. |
nv | integer(kind=I4P) | in | optional | Number of field variables override. |
verbose | logical | in | optional | Trigger verbose output. |
Call graph
compute_local_dt_forest
Compute this realm's local stability-limited dt (no MPI reduction).
Invoked by forest%compute_global_dt during the min reduction across all realms in the forest. The reduction itself is the orchestrator's job; this method computes only the value local to self.
fortran
subroutine compute_local_dt_forest(self, dt_local)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | The realm. | |
dt_local | real(kind=R8P) | out | Local stability-limited dt. |
Call graph
advance_one_step_forest
Advance this realm by one full timestep of size dt.
Invoked by forest%evolve_one_step once per realm per timestep. Owns the integration itself, i.e. everything that turns q at time t into q at time t + dt.
fortran
subroutine advance_one_step_forest(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The realm. | |
dt | real(kind=R8P) | in | Timestep size from the forest's global reduction. |
Call graph
open_step_forest
Per-step prologue on the multi-realm path: set dt, init RK stages.
Mirrors the head of integrate_rk_ssp: external-field prelude (if active), rk%initialize_stages(q=self%q), and the per-step time bookkeeping advance_one_step_forest does inline (it increment, dt cap for time_max, self%time%dt update). Time advance and progress print run in close_step_forest, mirroring the legacy ordering.
fortran
subroutine open_step_forest(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The realm. | |
dt | real(kind=R8P) | in | Timestep size from the forest. |
Call graph
begin_stage_forest
Begin integrator stage k on the multi-realm path.
Mirrors the FIRST line of integrate_rk_ssp's substage body: rk%compute_stage(s=k, dt=self%time%dt [, phi=ib%phi]). This populates rk%q_rk(:,:,:,:,:,k) from previously computed substages and from self%q, and publishes the stage buffer to peers by setting self%stage_active = k. No ghost reads, no peer-realm access — peer realms may not yet have opened their stage-k buffer when this fires.
fortran
subroutine begin_stage_forest(self, k, K_total, dt, realm)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The realm. | |
k | integer(kind=I4P) | in | Stage index (1..K_total). | |
K_total | integer(kind=I4P) | in | Forest-wide stage count for this step. | |
dt | real(kind=R8P) | in | Timestep size from the forest. | |
realm | class(realm_object) | inout | target, optional | Sibling realms (contract parity). |
Call graph
end_stage_forest
Close integrator stage k: residuals + stage assignment in one sweep.
fortran
subroutine end_stage_forest(self, k, K_total, dt, realm, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The realm. | |
k | integer(kind=I4P) | in | Stage index (1..K_total). | |
K_total | integer(kind=I4P) | in | Forest-wide stage count for this step. | |
dt | real(kind=R8P) | in | Timestep size from the forest. | |
realm | class(realm_object) | inout | target, optional | Sibling realms (FNL parity only). |
flux_register | class(flux_register_object) | inout | optional | Forest's flux register for FV reflux. |
Call graph
close_step_forest
Per-step epilogue on the multi-realm path: q assembly, BC, div-clean, residual save, coil source refresh, time advance, progress print.
Mirrors the post-substage tail of integrate_rk_ssp: rk%update_q + update_q_BC + save_residuals + compute_coils_current + impose_div_free + external_fields add, plus the post-loop time advance + progress print that advance_one_step_forest does inline.
fortran
subroutine close_step_forest(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The realm. | |
dt | real(kind=R8P) | in | Timestep size from the forest. |
Call graph
fill_seam_from_peer_forest
Fill THIS realm's seam ghost cells for peer slot p_idx from peer's interior cells. Single-TBP roundtrip: walks the receiver's sorted seam-map slice for the peer, and for each row copies peer's INTERIOR(b_send, i_send, j_send, k_send, v) → self's GHOST (b_recv, i_recv, j_recv, k_recv, v) on the active conservative buffer (q when stage_active == 0, or rk%q_rk(:,...,stage_active) when active). The PEER's stage_active controls its read source; SELF's stage_active controls its write target.
select type(peer) is confined here — the only place that needs to know the peer's concrete backend type. Cross-backend mixing (CPU realm reading from FNL peer) is not supported and triggers error_stop.
fortran
subroutine fill_seam_from_peer_forest(self, peer, p_idx)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
peer | class(realm_object) | in | target | |
p_idx | integer(kind=I4P) | in |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | The realm. | |
p_idx | integer(kind=I4P) | in | Peer slot (the realm owning the ghosts). | |
buf | real(kind=R8P) | out | Packed 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The realm. | |
p_idx | integer(kind=I4P) | in | Peer slot (the realm owning the cells). | |
buf | real(kind=R8P) | in | Packed values. |
Call graph
apply_reflux_to_stage_forest
PRISM-CPU override of the Berger-Colella reflux correction TBP.
α.r1 cadence: end-of-step barrier. The body fires exactly once per realm per step, at stage == self%rk%nrk (the realm's own final RK substage). Earlier stages return immediately as a no-op. The accumulators F_coarse(:,:,1) / F_fine_sum(:,:,1) hold the step flux sum_s beta_s F_s of each side (accumulate_seam_fluxes_fv fires at every stage, weighted by beta_s), i.e. the flux each side's committed update used, so the correction restores conservation to round-off; same-K and asymmetric-K realms alike, each side summing its own beta. This is the AMReX non-subcycled Reflux cadence.
For each face in flux_register where face%coarse_realm == self%realm_index, writes the per-cell correction q_rk(:, seam_cell, b_coarse, stage) += ark(stage) * sign * (dt / dx_coarse) * (F_coarse(:,:,1) - F_fine_sum(:,:,1)) on the matching one-cell-thick seam slice (i ∈ {1, ni} for x-normal faces, etc.). The third-axis index is hardcoded to 1 under α.r1 (register collapsed by M2); the stage parameter is retained on the signature for API stability and used only for the cadence gate and as the write target into self%rk%q_rk(:, ..., stage).
Empty-register / out-of-range guards short-circuit to a no-op, so a realm with no seam faces returns cleanly.
fortran
subroutine apply_reflux_to_stage_forest(self, stage, dt, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The realm. | |
stage | integer(kind=I4P) | in | Integrator stage 1..K_total. | |
dt | real(kind=R8P) | in | Time step. | |
flux_register | class(flux_register_object) | in | Forest's flux register. |
Call graph
post_step_forest
Run PRISM-CPU's per-timestep post-step work: state IO, energy diagnostics, divergence diagnostics.
Invoked by forest%post_step. v1 implementation is the verbatim post- step block formerly inline in simulate — every action runs every step, since today's cadence is enforced inside the save_* routines themselves (e.g. save_simulation_data honours io%it_save). The do_* flags are signature-only for now: when the forest takes over cadence the flags will gate the individual calls. For now they are accepted but unused, preserving present-day behavior bit-for-bit.
dt, t, it are not consumed by the current body; they are on the contract so the forest can supply them once it owns time-state (today they are still read from the time module singleton).
realm is accepted on contract parity with FNL; unused on CPU.
fortran
subroutine post_step_forest(self, dt, t, it, do_save_state, do_save_residuals, do_save_restart, do_amr, realm)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The realm. | |
dt | real(kind=R8P) | in | Timestep size just advanced. | |
t | real(kind=R8P) | in | Simulation time after the advance. | |
it | integer(kind=I4P) | in | Iteration index after the advance. | |
do_save_state | logical | in | optional | Save state output this step. |
do_save_residuals | logical | in | optional | Save residuals output this step. |
do_save_restart | logical | in | optional | Save restart dump this step. |
do_amr | logical | in | optional | Run AMR update this step. |
realm | class(realm_object) | inout | target, optional | Sibling realms. |
Call graph
is_done_forest
Decide whether this realm has reached its local termination criterion.
Invoked by forest%is_done. PRISM-CPU override: matches the legacy condition inline in simulate — terminate when either the simulated time has reached self%time%time_max (time-driven mode, it_max <= 0) or the iteration count has reached self%time%it_max (iteration-driven mode). Today the test reads time-state from the time module singleton, so self is unused; once the forest takes over time bookkeeping the body will consume self%time%* instead.
fortran
subroutine is_done_forest(self, done)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | The realm. | |
done | logical | out | True if this realm is done evolving. |
Call graph
finalize_forest
Shut this realm down: final state dump, close residuals/energy/ divergence history files, post-loop divergence diagnostics, finalize MPI handler.
Invoked by forest%finalize. v1 implementation is the verbatim post- loop block formerly inline in simulate. Behavior unchanged.
fortran
subroutine finalize_forest(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The realm. |
Call graph
compute_dt
Compute the global stability-limited dt and store it on self%time%dt.
Body delegates the local computation to compute_local_dt_forest (orchestrator contract method), then performs the legacy MPI_ALLREDUCE on MPI_COMM_WORLD for backward compatibility with simulate. The forest's compute_global_dt will perform its own reduction, possibly on a per-realm sub-comm; the redundancy disappears once the legacy compute_dt is retired.
fortran
subroutine compute_dt(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
compute_energy
Compute energy.
fortran
subroutine compute_energy(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
compute_energy_error
Compute energy error.
fortran
subroutine compute_energy_error(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
compute_grms
Compute the RMS gradient of the rotating magnetic-field amplitude over the selected domain and over its -3 dB subset.
fortran
subroutine compute_grms(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout |
Call graph
compute_magnetic_field_at_center_domain
Compute the magnetic field interpolated at the geometrical domain center.
fortran
subroutine compute_magnetic_field_at_center_domain(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout |
Call graph
compute_max_divergence_outside_absorbing_layers
Compute divergence maxima excluding absorbing layers and any cell whose centered-divergence stencil intersects them.
fortran
subroutine compute_max_divergence_outside_absorbing_layers(self, hs, max_div_D, max_div_B, max_div_J)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
hs | integer(kind=I4P) | in | ||
max_div_D | real(kind=R8P) | out | ||
max_div_B | real(kind=R8P) | out | ||
max_div_J | real(kind=R8P) | out |
Call graph
exclude_stencil_contaminated_face
Shrink a 1D diagnostic window so that no retained cell uses a centered divergence stencil intersecting the selected absorbing layer face.
Attributes: pure
fortran
subroutine exclude_stencil_contaminated_face(lo, hi, face_first, face_last, is_minus, hs)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
lo | integer(kind=I4P) | inout | ||
hi | integer(kind=I4P) | inout | ||
face_first | integer(kind=I4P) | in | ||
face_last | integer(kind=I4P) | in | ||
is_minus | logical | in | ||
hs | integer(kind=I4P) | in |
Call graph
impose_div_free
Impose divergence-free property.
fortran
subroutine impose_div_free(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
print_elliptic_progress
fortran
subroutine print_elliptic_progress(label, progress_done, progress_total, last_percent, converged)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
label | character(len=*) | in | Progress label. | |
progress_done | integer(kind=I4P) | in | Completed smoothing sweeps. | |
progress_total | integer(kind=I4P) | in | Planned smoothing sweeps. | |
last_percent | integer(kind=I4P) | inout | Last printed percent. | |
converged | logical | in | optional | Force progress to 100% when converged. |
Call graph
simulate
Perform the simulation: legacy single-realm entry point.
fortran
subroutine simulate(self, filename)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. | |
filename | character(len=*) | in | Input file name. |
Call graph
compute_residuals_fd_centered
Compute residuals of equation, space operator, centered finite difference schemes.
fortran
subroutine compute_residuals_fd_centered(self, q, dq, s, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. | |
dq | real(kind=R8P) | inout | Residuals. | |
s | integer(kind=I4P) | in | optional | Stage counter. |
flux_register | class(flux_register_object) | inout | optional | Flux register. |
Call graph
apply_pml_fd_centered_ade
Add ADE-PML source terms to the FD-centered Maxwell residuals and build the 12 auxiliary RHSs.
fortran
subroutine apply_pml_fd_centered_ade(self, q, dq, s)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
q | real(kind=R8P) | in | ||
dq | real(kind=R8P) | inout | ||
s | integer(kind=I4P) | in | optional |
Call graph
apply_direct_damping
Apply diagnostic direct damping on components transverse to the selected PML normal.
fortran
subroutine apply_direct_damping(self, q, dq, block_ids, face)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q | real(kind=R8P) | in | ||
dq | real(kind=R8P) | inout | ||
block_ids | integer(kind=I4P) | in | ||
face | integer(kind=I4P) | in |
Call graph
select_pml_field_scales
Convert D/B derivatives into E/H derivatives for the current physical scaling.
fortran
subroutine select_pml_field_scales(self, inv_eps_scale, inv_mu_scale)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
inv_eps_scale | real(kind=R8P) | out | ||
inv_mu_scale | real(kind=R8P) | out |
Call graph
apply_x_face_field_correction
fortran
subroutine apply_x_face_field_correction(self, q, q_face, dq, block_ids, face, inv_eps_scale, inv_mu_scale)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q | real(kind=R8P) | in | ||
q_face | real(kind=R8P) | in | ||
dq | real(kind=R8P) | inout | ||
block_ids | integer(kind=I4P) | in | ||
face | integer(kind=I4P) | in | ||
inv_eps_scale | real(kind=R8P) | in | ||
inv_mu_scale | real(kind=R8P) | in |
Call graph
apply_y_face_field_correction
fortran
subroutine apply_y_face_field_correction(self, q, q_face, dq, block_ids, face, inv_eps_scale, inv_mu_scale)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q | real(kind=R8P) | in | ||
q_face | real(kind=R8P) | in | ||
dq | real(kind=R8P) | inout | ||
block_ids | integer(kind=I4P) | in | ||
face | integer(kind=I4P) | in | ||
inv_eps_scale | real(kind=R8P) | in | ||
inv_mu_scale | real(kind=R8P) | in |
Call graph
apply_z_face_field_correction
fortran
subroutine apply_z_face_field_correction(self, q, q_face, dq, block_ids, face, inv_eps_scale, inv_mu_scale)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q | real(kind=R8P) | in | ||
q_face | real(kind=R8P) | in | ||
dq | real(kind=R8P) | inout | ||
block_ids | integer(kind=I4P) | in | ||
face | integer(kind=I4P) | in | ||
inv_eps_scale | real(kind=R8P) | in | ||
inv_mu_scale | real(kind=R8P) | in |
Call graph
compute_x_face_pml_rhs
fortran
subroutine compute_x_face_pml_rhs(self, q, q_face, dq_face, block_ids, face, inv_eps_scale, inv_mu_scale)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q | real(kind=R8P) | in | ||
q_face | real(kind=R8P) | in | ||
dq_face | real(kind=R8P) | inout | ||
block_ids | integer(kind=I4P) | in | ||
face | integer(kind=I4P) | in | ||
inv_eps_scale | real(kind=R8P) | in | ||
inv_mu_scale | real(kind=R8P) | in |
Call graph
compute_y_face_pml_rhs
fortran
subroutine compute_y_face_pml_rhs(self, q, q_face, dq_face, block_ids, face, inv_eps_scale, inv_mu_scale)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q | real(kind=R8P) | in | ||
q_face | real(kind=R8P) | in | ||
dq_face | real(kind=R8P) | inout | ||
block_ids | integer(kind=I4P) | in | ||
face | integer(kind=I4P) | in | ||
inv_eps_scale | real(kind=R8P) | in | ||
inv_mu_scale | real(kind=R8P) | in |
Call graph
compute_z_face_pml_rhs
fortran
subroutine compute_z_face_pml_rhs(self, q, q_face, dq_face, block_ids, face, inv_eps_scale, inv_mu_scale)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q | real(kind=R8P) | in | ||
q_face | real(kind=R8P) | in | ||
dq_face | real(kind=R8P) | inout | ||
block_ids | integer(kind=I4P) | in | ||
face | integer(kind=I4P) | in | ||
inv_eps_scale | real(kind=R8P) | in | ||
inv_mu_scale | real(kind=R8P) | in |
Call graph
compute_pml_coefficients
Return the face-local ADE-PML coefficients for the supported variants.
Attributes: pure
fortran
subroutine compute_pml_coefficients(self, center_distance, span, gamma, alpha, kappa)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
center_distance | real(kind=R8P) | in | ||
span | real(kind=R8P) | in | ||
gamma | real(kind=R8P) | out | ||
alpha | real(kind=R8P) | out | ||
kappa | real(kind=R8P) | out |
Call graph
compute_residuals_fv_centered
Compute residuals of equation, space operator, centered finite volume schemes.
fortran
subroutine compute_residuals_fv_centered(self, q, dq, s, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. | |
dq | real(kind=R8P) | inout | Residuals. | |
s | integer(kind=I4P) | in | optional | Stage counter. |
flux_register | class(flux_register_object) | inout | optional | Forest's flux register; FV reflux. |
Call graph
accumulate_seam_fluxes_fv
Accumulate the face fluxes of one RK stage, weighted by the stage's SSP coefficient weight = beta_s, on the seam faces of the FV-centered scheme.
Walks every (block, fec) pair and, for non-zero entries in self%adam%maps%inter_realm_face_register_index(b, fec), packs the appropriate flx_f/fly_f/flz_f face skin into a (nv, nface_cells) slab and routes it to the right register accumulator: positive index → coarse side → accumulate_coarse_flux, negative index → fine side → accumulate_fine_flux. The call site fires at every stage, so the register sums the stage fluxes into the step flux sum_s beta_s F_s of both sides.
The register accumulators are sized (nv, nface_cells, 1) under α.r1 (M2 reshape) with the full state-vector width nv (set at register_face time from realm%adam%field%nv). The FV scheme only fills the conservative slice 1:nv_c of the flux arrays; the remaining rows are left at zero in flux_slab so the register's F_coarse - F_fine_sum correction is identically zero outside the conservative variables. The third-axis index passed to accumulate_*_flux is hardcoded to 1 (collapsed register).
For a same-resolution mirror seam (rmf-2realm), each coarse and fine side carries an identical end-of-step flux; F_coarse - F_fine_sum is round-off zero in expectation and the downstream q-correction is a no-op. For a true 2:1 intra-realm AMR jump (#13 §7.5 M3) the coarse and fine sides differ:
- Coarse side (
sgn_idx > 0): packs its fullnface_cells-cell face skin directly — the linear indexcruns (inner axis fastest, outer axis slowest) over the coarse cells, exactly as before. - Fine side (
sgn_idx < 0): each of theratio/2(4 in 3D) fine blocks covers ONE quadrant of the coarse face. Itsnj*nkfine-face cells are 2:1-restricted (2x2 conservative average) onto the(nj/2)*(nk/2)coarse cells of that quadrant, written into the coarse-skin-shaped slab at the quadrant offset (zero elsewhere), then accumulated. The quadrant offset is read frommaps%amr_seam_quadrant, precomputed at registration from the two blocks' Morton codes (issue #28 D2 — the coarse partner may live on another rank, so its geometry is not readable here). The fine blocks'accumulate_fine_fluxcalls sum into disjoint quadrants, soF_fine_sumends up holding the area-averaged fine flux over the WHOLE coarse face, matchingF_coarse's shape for the Berger-Colella delta.
Conservative 2:1 averaging (arithmetic mean of the 2x2 fine sub-faces) is the correct restriction for a face FLUX (Berger-Colella 1989 §4; Olivares 2019 Eq. 26-27): the coarse-face flux equals the average of the fine-face fluxes covering it, so the telescoping ∮F·n across the seam cancels to round-off.
The FD-centered case does not reach this routine (different residual target).
fortran
subroutine accumulate_seam_fluxes_fv(self, ni, nj, nk, nv_c, blocks_number, weight, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The realm. | |
ni | integer(kind=I4P) | in | Interior cell counts. | |
nj | integer(kind=I4P) | in | Interior cell counts. | |
nk | integer(kind=I4P) | in | Interior cell counts. | |
nv_c | integer(kind=I4P) | in | Number of conservative variables. | |
blocks_number | integer(kind=I4P) | in | Number of local blocks. | |
weight | real(kind=R8P) | in | Stage weight, the SSP coefficient beta_s. | |
flux_register | class(flux_register_object) | inout | Forest's flux register. |
Call graph
compute_residuals_weno
Compute residuals of equation, space operator, WENO schemes.
fortran
subroutine compute_residuals_weno(self, q, dq, s, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. | |
dq | real(kind=R8P) | inout | Residuals. | |
s | integer(kind=I4P) | in | optional | Stage counter. |
flux_register | class(flux_register_object) | inout | optional | Flux register. |
Call graph
integrate_blanesmoan
Integrate equation, time operator, Yoshida RK scheme.
fortran
subroutine integrate_blanesmoan(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
integrate_cfm
Integrate equation, time operator, Commutator-Free Magnus integrator.
fortran
subroutine integrate_cfm(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
integrate_leapfrog
Integrate equation, time operator, leapfrog scheme.
fortran
subroutine integrate_leapfrog(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
integrate_leapfrog_pic
Integrate equation, time operator, leapfrog scheme for particle in cell Maxwell residuals computation Pic residual computation Integration of equations
fortran
subroutine integrate_leapfrog_pic(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
integrate_rk_ls
Integrate equation, time operator, RK classical low storage schemes. Low storage RK working on q_rk(:,:,:,:,:,1)/q as stages, update q in place.
fortran
subroutine integrate_rk_ls(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
integrate_rk_ssp
Integrate equation, time operator, SSP RK schemes. SSP RK working on q_rk as stages.
fortran
subroutine integrate_rk_ssp(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
integrate_rk_ssp_pic
Integrate equation, time operator, SSP RK schemes. SSP RK working on q_rk as stages.
fortran
subroutine integrate_rk_ssp_pic(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
integrate_rk_ssp_pic_charge_conserving
Integrate PIC equations with SSP RK and charge-conserving current reconstruction.
fortran
subroutine integrate_rk_ssp_pic_charge_conserving(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout |
Call graph
compute_pic_charge_displacement_decomposition
Directional telescopic decomposition of rho(q_to)-rho(q_ref), using the configured particle shape.
fortran
subroutine compute_pic_charge_displacement_decomposition(self, q_ref, q_to, q_work, h_dir)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
q_ref | real(kind=R8P) | in | ||
q_to | real(kind=R8P) | in | ||
q_work | real(kind=R8P) | inout | ||
h_dir | real(kind=R8P) | inout |
Call graph
compute_pic_esirkepov_displacement
Symmetric Esirkepov density decomposition for the same separable shape used by rho.
fortran
subroutine compute_pic_esirkepov_displacement(self, q_ref, q_to, h_dir, particle)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q_ref | real(kind=R8P) | in | ||
q_to | real(kind=R8P) | in | ||
h_dir | real(kind=R8P) | inout | ||
particle | integer(kind=I4P) | in | optional |
Call graph
compute_esirkepov_gaussian_shape_1d
Normalize the filtered Gaussian on the endpoint's own deposition stencil. Its tensor product equals Gaussian_charge_weighting's 3D normalization up to roundoff.
fortran
subroutine compute_esirkepov_gaussian_shape_1d(self, x, x_cell, dx, ip, radius, lo, hi, w)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
x | real(kind=R8P) | in | ||
x_cell | real(kind=R8P) | in | ||
dx | real(kind=R8P) | in | ||
ip | integer(kind=I4P) | in | ||
radius | integer(kind=I4P) | in | ||
lo | integer(kind=I4P) | in | ||
hi | integer(kind=I4P) | in | ||
w | real(kind=R8P) | out |
Call graph
esirkepov_shape_weight_1d
Apply the optional binomial filter to the B-spline before computing particle fluxes.
fortran
subroutine esirkepov_shape_weight_1d(self, x, xc, dx, w)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
x | real(kind=R8P) | in | ||
xc | real(kind=R8P) | in | ||
dx | real(kind=R8P) | in | ||
w | real(kind=R8P) | out |
Call graph
deposit_pic_charge_density
Deposit charge density for an arbitrary PIC position array.
fortran
subroutine deposit_pic_charge_density(self, q_pic_pos, q_work)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
q_pic_pos | real(kind=R8P) | in | ||
q_work | real(kind=R8P) | inout |
Call graph
initialize_charge_conservation_diagnostic
Initialize rho_n/dt + sum_s beta_s div(J_s) diagnostic accumulator.
fortran
subroutine initialize_charge_conservation_diagnostic(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout |
Call graph
accumulate_charge_conservation_current
Accumulate beta_s div(J_s) for the current PIC RK stage.
fortran
subroutine accumulate_charge_conservation_current(self, q, weight)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
q | real(kind=R8P) | inout | ||
weight | real(kind=R8P) | in |
Call graph
finalize_charge_conservation_diagnostic
Finalize max |(rho_np1-rho_n)/dt + sum_s beta_s div(J_s)|.
fortran
subroutine finalize_charge_conservation_diagnostic(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout |
Call graph
save_charge_conservation_diagnostic
Save the 12-column PIC charge-conservation diagnostic for the current completed step.
fortran
subroutine save_charge_conservation_diagnostic(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout |
Call graph
solve_pic_charge_conserving_current_dispatch
Select the configured charge-conserving current reconstruction.
fortran
subroutine solve_pic_charge_conserving_current_dispatch(self, q, hq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
q | real(kind=R8P) | inout | ||
hq | real(kind=R8P) | in |
Call graph
ensure_esirkepov_current_solver_cache
Factor the interior face map plus one checkerboard constraint per line.
fortran
subroutine ensure_esirkepov_current_solver_cache(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout |
Call graph
solve_pic_charge_conserving_current_esirkepov
Integrate Esirkepov's directional charge changes to faces and invert D=G A.
fortran
subroutine solve_pic_charge_conserving_current_esirkepov(self, q, hq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
q | real(kind=R8P) | inout | ||
hq | real(kind=R8P) | in |
Call graph
modified_kernels
P = A Q maps the base-shape nodes to centers, Q maps the face prefix sums to centers (A2 = [1,1]/2 for FD2, A6 = [1,-8,37,37,-8,1]/60 for FD6, so that D J = P H). Even Q: base on centers, P odd and centered, Q from faces. Odd Q: base on the dual nodes (node m at x_m+dx/2, see modified_position_shift), P even with taps m=i-N/2-2..i+N/2+2, Q centered on the prefix sums at centers (flux index f = center-1). radius bounds the taps of P (plus one if odd).
fortran
subroutine modified_kernels(self, p, qw, radius, qfirst, nq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
p | real(kind=R8P) | out | ||
qw | real(kind=R8P) | out | ||
radius | integer(kind=I4P) | out | ||
qfirst | integer(kind=I4P) | out | ||
nq | integer(kind=I4P) | out |
Call graph
filter_modified_axis
Zero extension is used only outside the block; supported particles stay in the bulk.
fortran
subroutine filter_modified_axis(input, output, axis, p, radius)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
input | real(kind=R8P) | in | ||
output | real(kind=R8P) | out | ||
axis | integer(kind=I4P) | in | ||
p | real(kind=R8P) | in | ||
radius | integer(kind=I4P) | in |
Call graph
deposit_pic_modified_charge
Deposit the unfiltered particle shape, then apply P_c=Q A in all directions.
fortran
subroutine deposit_pic_modified_charge(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
q | real(kind=R8P) | inout |
Call graph
initialize_pic_conserving_current_time_zero
Deposit the current at t=0 using the same trajectory operator as the PIC evolution.
fortran
subroutine initialize_pic_conserving_current_time_zero(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout |
Call graph
check_conserving_single_block
The CPU charge-conserving current is single-block by design (line solves and P/Q filters per block); the multi-block version is FNL-only (prism_fnl_pic_conserving_object, virtual-block solves).
fortran
subroutine check_conserving_single_block(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in |
Call graph
modified_current_line
F^E is the face prefix sum of the directional Esirkepov charge change.
fortran
subroutine modified_current_line(self, source, dir, b, n, qw, qfirst, nq, sol)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
source | real(kind=R8P) | in | ||
dir | integer(kind=I4P) | in | ||
b | integer(kind=I4P) | in | ||
n | integer(kind=I4P) | in | ||
qw | real(kind=R8P) | in | ||
qfirst | integer(kind=I4P) | in | ||
nq | integer(kind=I4P) | in | ||
sol | real(kind=R8P) | out |
Call graph
solve_pic_charge_conserving_current_modified
J_d=Q_d P_transverse F_d^E; no inverse reconstruction or line solve.
fortran
subroutine solve_pic_charge_conserving_current_modified(self, q, hq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
q | real(kind=R8P) | inout | ||
hq | real(kind=R8P) | in |
Call graph
solve_modified_current_with_cleanup
Reconstruct one particle's SSP source at a time, clean its matched current, then accumulate.
fortran
subroutine solve_modified_current_with_cleanup(self, q, q_ref, q_to_history, active_stage, mixed_source)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
q | real(kind=R8P) | inout | ||
q_ref | real(kind=R8P) | in | ||
q_to_history | real(kind=R8P) | in | ||
active_stage | integer(kind=I4P) | in | ||
mixed_source | real(kind=R8P) | in | optional |
Call graph
cleanup_modified_particle_current
Zero only sub-threshold leakage outside the exact P/Q-expanded source support.
fortran
subroutine cleanup_modified_particle_current(self, q_particle, particle, block, shape_lo, shape_hi)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q_particle | real(kind=R8P) | inout | ||
particle | integer(kind=I4P) | in | ||
block | integer(kind=I4P) | in | ||
shape_lo | integer(kind=I4P) | in | ||
shape_hi | integer(kind=I4P) | in |
Call graph
report_particle_tail_error
fortran
subroutine report_particle_tail_error(particle, component, block, i, j, k, value, j_ref, ratio, lo, hi)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
particle | integer(kind=I4P) | in | ||
component | integer(kind=I4P) | in | ||
block | integer(kind=I4P) | in | ||
i | integer(kind=I4P) | in | ||
j | integer(kind=I4P) | in | ||
k | integer(kind=I4P) | in | ||
value | real(kind=R8P) | in | ||
j_ref | real(kind=R8P) | in | ||
ratio | real(kind=R8P) | in | ||
lo | integer(kind=I4P) | in | ||
hi | integer(kind=I4P) | in |
Call graph
build_esirkepov_face_line
fortran
subroutine build_esirkepov_face_line(self, source, dir, b, n, flux)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
source | real(kind=R8P) | in | ||
dir | integer(kind=I4P) | in | ||
b | integer(kind=I4P) | in | ||
n | integer(kind=I4P) | in | ||
flux | real(kind=R8P) | out |
Call graph
update_esirkepov_face_residual
Check the reconstructed flux on both boundary faces and every interior face.
fortran
subroutine update_esirkepov_face_residual(self, n, sol, flux)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
n | integer(kind=I4P) | in | ||
sol | real(kind=R8P) | in | ||
flux | real(kind=R8P) | in |
Call graph
ensure_direct_current_solver_cache
Build cached factored line matrices for the direct conserving-current solver.
fortran
subroutine ensure_direct_current_solver_cache(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout |
Call graph
solve_pic_charge_conserving_current
Reconstruct J from D_alpha J_alpha = -H_alpha(Q)/dt with homogeneous ghost-cell values.
fortran
subroutine solve_pic_charge_conserving_current(self, q, hq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
q | real(kind=R8P) | inout | ||
hq | real(kind=R8P) | in |
Call graph
find_pic_position_cell
Locate one PIC position on the local Cartesian block grid.
fortran
subroutine find_pic_position_cell(self, q_pos, b, i, j, k)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q_pos | real(kind=R8P) | in | ||
b | integer(kind=I4P) | out | ||
i | integer(kind=I4P) | out | ||
j | integer(kind=I4P) | out | ||
k | integer(kind=I4P) | out |
Call graph
particle_weighting_radius
Integer support radius for the configured particle shape.
fortran
subroutine particle_weighting_radius(self, b, rx, ry, rz)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
b | integer(kind=I4P) | in | ||
rx | integer(kind=I4P) | out | ||
ry | integer(kind=I4P) | out | ||
rz | integer(kind=I4P) | out |
Call graph
particle_shape_weight_1d
One-dimensional particle shape used by the PIC charge deposition.
fortran
subroutine particle_shape_weight_1d(self, model, x, xc, dx, w, cutoff_limit)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
model | character(len=*) | in | ||
x | real(kind=R8P) | in | ||
xc | real(kind=R8P) | in | ||
dx | real(kind=R8P) | in | ||
w | real(kind=R8P) | out | ||
cutoff_limit | real(kind=R8P) | in | optional |
Call graph
build_centered_reconstruction_matrix
Build face-reconstruction matrix R such that FD1_CC J = (R_{i+1/2}-R_{i-1/2})/dx.
fortran
subroutine build_centered_reconstruction_matrix(self, n, a)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
n | integer(kind=I4P) | in | ||
a | real(kind=R8P) | inout |
Call graph
build_centered_derivative_matrix
fortran
subroutine build_centered_derivative_matrix(self, dir, b, n, a)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
dir | integer(kind=I4P) | in | ||
b | integer(kind=I4P) | in | ||
n | integer(kind=I4P) | in | ||
a | real(kind=R8P) | inout |
Call graph
factorize_matrix_pivot
fortran
subroutine factorize_matrix_pivot(a, pivot, n)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
a | real(kind=R8P) | inout | ||
pivot | integer(kind=I4P) | out | ||
n | integer(kind=I4P) | in |
Call graph
solve_factored_matrix_pivot
fortran
subroutine solve_factored_matrix_pivot(a, pivot, rhs, sol, n)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
a | real(kind=R8P) | in | ||
pivot | integer(kind=I4P) | in | ||
rhs | real(kind=R8P) | in | ||
sol | real(kind=R8P) | out | ||
n | integer(kind=I4P) | in |
Call graph
update_current_line_solver_residual
Update max residual |D_alpha sol - target| for one direct current line solve.
fortran
subroutine update_current_line_solver_residual(self, dir, b, n, sol, target)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | ||
dir | integer(kind=I4P) | in | ||
b | integer(kind=I4P) | in | ||
n | integer(kind=I4P) | in | ||
sol | real(kind=R8P) | in | ||
target | real(kind=R8P) | in |
Call graph
odd_mirror_index
fortran
subroutine odd_mirror_index(idx, n, col, sgn)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
idx | integer(kind=I4P) | in | ||
n | integer(kind=I4P) | in | ||
col | integer(kind=I4P) | out | ||
sgn | real(kind=R8P) | out |
Call graph
impose_zero_current_ghosts
fortran
subroutine impose_zero_current_ghosts(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q | real(kind=R8P) | inout |
Call graph
impose_odd_current_ghosts
Zero normal face flux: J outside the face is the odd mirror of J inside.
fortran
subroutine impose_odd_current_ghosts(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
q | real(kind=R8P) | inout |
Call graph
integrate_rk_yoshida
Integrate equation, time operator, Yoshida RK scheme.
fortran
subroutine integrate_rk_yoshida(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | inout | The equation. |
Call graph
compute_dxyz_min
Compute minimum dxyz space step.
fortran
subroutine compute_dxyz_min(blocks_number, dxyz, dxyz_min)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
blocks_number | integer(kind=I4P) | in | Number of blocks. | |
dxyz | real(kind=R8P) | in | XYZ space steps. | |
dxyz_min | real(kind=R8P) | out | Minimum space step. |
Call graph
compute_fluxes_convective_weno
Compute convective fluxes along direction dir, WENO scheme for space operator.
fortran
subroutine compute_fluxes_convective_weno(dir, blocks_number, ni, nj, nk, ngc, nv_c, weno_s, weno_a, weno_p, weno_d, weno_c, weno_zeps, weno_sigma, evmax, erw, elw, chi, q, fluxes)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
dir | integer(kind=I4P) | in | Direction, 1=X, 2=Y, 3=Z. | |
blocks_number | integer(kind=I4P) | in | Number of blocks. | |
ni | integer(kind=I4P) | in | Grid cells number in I direction. | |
nj | integer(kind=I4P) | in | Grid cells number in J direction. | |
nk | integer(kind=I4P) | in | Grid cells number in K direction. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv_c | integer(kind=I4P) | in | Number of conservative varibales. | |
weno_s | integer(kind=I4P) | in | Weno stencils number/dimension. | |
weno_a | real(kind=R8P) | in | Optimal weights. | |
weno_p | real(kind=R8P) | in | Polinomials coefficients. | |
weno_d | real(kind=R8P) | in | Smoothness indicators coefficients. | |
weno_c | real(kind=R8P) | in | Centered polinomials coefficients. | |
weno_zeps | real(kind=R8P) | in | Parameter for avoiding division by zero in computing IS. | |
weno_sigma | real(kind=R8P) | in | WENO descaler switch (0 Jiang-Shu, 1 scale-invariant). | |
evmax | real(kind=R8P) | in | Maximum waves speed estimation. | |
erw | real(kind=R8P) | in | Right eigenvectors for WENO reconstruction. | |
elw | real(kind=R8P) | in | Left eigenvectors for WENO reconstruction. | |
chi | real(kind=R8P) | in | Speed parameter for divergence cleaning. | |
q | real(kind=R8P) | in | Field variables. | |
fluxes | real(kind=R8P) | inout | Fluxes. |
Call graph
compute_fluxes_convective_ri_weno
Compute convective fluxes at right interface of b,i,j,k.
fortran
subroutine compute_fluxes_convective_ri_weno(dir, b, i, j, k, ngc, nv_c, weno_s, weno_zeps, weno_sigma, weno_a, weno_p, weno_d, weno_c, evmax, erw, elw, chi, si, sir, q, fluxes)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
dir | integer(kind=I4P) | in | Direction, 1=X, 2=Y, 3=Z. | |
b | integer(kind=I4P) | in | Counter. | |
i | integer(kind=I4P) | in | Counter. | |
j | integer(kind=I4P) | in | Counter. | |
k | integer(kind=I4P) | in | Counter. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv_c | integer(kind=I4P) | in | Number of conservative varibales in q vector. | |
weno_s | integer(kind=I4P) | in | Weno stencils number/dimension. | |
weno_zeps | real(kind=R8P) | in | Parameter to avoid division by zero. | |
weno_sigma | real(kind=R8P) | in | WENO descaler switch (0 Jiang-Shu, 1 SI). | |
weno_a | real(kind=R8P) | in | Optimal weights. | |
weno_p | real(kind=R8P) | in | Polinomials coefficients. | |
weno_d | real(kind=R8P) | in | Smoothness indicators coefficients. | |
weno_c | real(kind=R8P) | in | Centered polinomials coefficients. | |
evmax | real(kind=R8P) | in | Maximum waves speed estimation. | |
erw | real(kind=R8P) | in | Right eigenvectors for WENO reconstruction. | |
elw | real(kind=R8P) | in | Left eigenvectors for WENO reconstruction. | |
chi | real(kind=R8P) | in | Speed parameter for divergence cleaning. | |
si | integer(kind=I4P) | in | Stencil increment. | |
sir | real(kind=R8P) | in | Stencil increment, real cast. | |
q | real(kind=R8P) | in | Fields variables. | |
fluxes | real(kind=R8P) | inout | Fluxes. |
Call graph
compute_fluxes_difference
Compute fluxes difference.
fortran
subroutine compute_fluxes_difference(blocks_number, ni, nj, nk, ngc, nv_c, var_Jx, var_Jy, var_Jz, phi_ivar, psi_ivar, rho_ivar, use_rho, chi_wave2, alpha, dx, dy, dz, flx, fly, flz, q, dq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
blocks_number | integer(kind=I4P) | in | Number of blocks. | |
ni | integer(kind=I4P) | in | Grid cells number in I direction. | |
nj | integer(kind=I4P) | in | Grid cells number in J direction. | |
nk | integer(kind=I4P) | in | Grid cells number in K direction. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv_c | integer(kind=I4P) | in | Number of conservative varibales in q. | |
var_Jx | integer(kind=I4P) | in | Current variable indices. | |
var_Jy | integer(kind=I4P) | in | Current variable indices. | |
var_Jz | integer(kind=I4P) | in | Current variable indices. | |
phi_ivar | integer(kind=I4P) | in | ||
psi_ivar | integer(kind=I4P) | in | ||
rho_ivar | integer(kind=I4P) | in | ||
use_rho | logical | in | ||
chi_wave2 | real(kind=R8P) | in | ||
alpha | real(kind=R8P) | in | ||
dx | real(kind=R8P) | in | Space steps. | |
dy | real(kind=R8P) | in | Space steps. | |
dz | real(kind=R8P) | in | Space steps. | |
flx | real(kind=R8P) | in | X direction fluxes. | |
fly | real(kind=R8P) | in | Y direction fluxes. | |
flz | real(kind=R8P) | in | Z direction fluxes. | |
q | real(kind=R8P) | in | Fields. | |
dq | real(kind=R8P) | inout | Fluxes differences. |
Call graph
decompose_fluxes_convective
Decompose convective fluxes.
fortran
subroutine decompose_fluxes_convective(dir, si, sir, b, i, j, k, ngc, nv_c, weno_s, evmax, elw, q, chi, fmpc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
dir | integer(kind=I4P) | in | Direction, 1=X, 2=Y, 3=Z. | |
si | integer(kind=I4P) | in | Stencil increment. | |
sir | real(kind=R8P) | in | Stencil increment, real cast. | |
b | integer(kind=I4P) | in | Counter. | |
i | integer(kind=I4P) | in | Counter. | |
j | integer(kind=I4P) | in | Counter. | |
k | integer(kind=I4P) | in | Counter. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv_c | integer(kind=I4P) | in | Number of conservative varibales in q vector. | |
weno_s | integer(kind=I4P) | in | Weno stencils number/dimension. | |
evmax | real(kind=R8P) | in | Maximum eigenvalue. | |
elw | real(kind=R8P) | in | Left eigenvectors for WENO reconstruction. | |
q | real(kind=R8P) | in | Auxiliary variables. | |
chi | real(kind=R8P) | in | Speed coefficient for D & B div-cleaning. | |
fmpc | real(kind=R8P) | inout | Fluxes -+ decomposition in characteristics space. |
Call graph
compute_field_mean_value
Compute mean value of the field in a certain region of the domain.
fortran
subroutine compute_field_mean_value(self, q, n_x, n_y, n_z, n_b, mean_value)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | The object | |
q | real(kind=R8P) | in | Field variables. | |
n_x | integer(kind=I4P) | in | Number of cells in each direction and number | |
n_y | integer(kind=I4P) | in | Number of cells in each direction and number | |
n_z | integer(kind=I4P) | in | Number of cells in each direction and number | |
n_b | integer(kind=I4P) | in | Number of cells in each direction and number | |
mean_value | real(kind=R8P) | out | Mean value of the field out of the fWLayer |
Functions
is_face_line_seed_cpu
Attributes: pure
Returns: logical
fortran
function is_face_line_seed_cpu(face, i, j, k, ni, nj, nk) result(is_seed)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
face | integer(kind=I4P) | in | ||
i | integer(kind=I4P) | in | ||
j | integer(kind=I4P) | in | ||
k | integer(kind=I4P) | in | ||
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in |
Call graph
face_normal_direction_cpu
Attributes: pure
Returns: integer(kind=i4p)
fortran
function face_normal_direction_cpu(face) result(dir_n)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
face | integer(kind=I4P) | in |
Call graph
silver_muller_unknown_coefficient_cpu
Attributes: pure
Returns: real(kind=r8p)
fortran
function silver_muller_unknown_coefficient_cpu(face, m, hs, ds) result(coeff)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
face | integer(kind=I4P) | in | ||
m | integer(kind=I4P) | in | ||
hs | integer(kind=I4P) | in | ||
ds | real(kind=R8P) | in |
Call graph
tangential_divergence_at_cell_cpu
Attributes: pure
Returns: real(kind=r8p)
fortran
function tangential_divergence_at_cell_cpu(q, ngc, b, i, j, k, hs, dxyz, dir_t1, dir_t2, var_t1, var_t2) result(div_t)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
q | real(kind=R8P) | in | ||
ngc | integer(kind=I4P) | in | ||
b | integer(kind=I4P) | in | ||
i | integer(kind=I4P) | in | ||
j | integer(kind=I4P) | in | ||
k | integer(kind=I4P) | in | ||
hs | integer(kind=I4P) | in | ||
dxyz | real(kind=R8P) | in | ||
dir_t1 | integer(kind=I4P) | in | ||
dir_t2 | integer(kind=I4P) | in | ||
var_t1 | integer(kind=I4P) | in | ||
var_t2 | integer(kind=I4P) | in |
Call graph
normal_known_contribution_cpu
Attributes: pure
Returns: real(kind=r8p)
fortran
function normal_known_contribution_cpu(q, ngc, ni, nj, nk, b, face, i, j, k, hs, dxyz, var_n) result(div_n_known)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
q | real(kind=R8P) | in | ||
ngc | integer(kind=I4P) | in | ||
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
b | integer(kind=I4P) | in | ||
face | integer(kind=I4P) | in | ||
i | integer(kind=I4P) | in | ||
j | integer(kind=I4P) | in | ||
k | integer(kind=I4P) | in | ||
hs | integer(kind=I4P) | in | ||
dxyz | real(kind=R8P) | in | ||
var_n | integer(kind=I4P) | in |
Call graph
normal_depth_from_cell_cpu
Attributes: pure
Returns: integer(kind=i4p)
fortran
function normal_depth_from_cell_cpu(face, i, j, k, ni, nj, nk) result(depth)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
face | integer(kind=I4P) | in | ||
i | integer(kind=I4P) | in | ||
j | integer(kind=I4P) | in | ||
k | integer(kind=I4P) | in | ||
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in |
Call graph
component_along_direction_cpu
Attributes: pure
Returns: real(kind=r8p)
fortran
function component_along_direction_cpu(q, ngc, b, var, dir, i, j, k, offset) result(value_)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
q | real(kind=R8P) | in | ||
ngc | integer(kind=I4P) | in | ||
b | integer(kind=I4P) | in | ||
var | integer(kind=I4P) | in | ||
dir | integer(kind=I4P) | in | ||
i | integer(kind=I4P) | in | ||
j | integer(kind=I4P) | in | ||
k | integer(kind=I4P) | in | ||
offset | integer(kind=I4P) | in |
Call graph
stages_per_step_forest
Number of integrator stages this realm exposes per step.
For the multi-realm path the forest drives the stage loop, so it needs to know K up front. ONLY runge-kutta-ssp-* is split into per-stage TBPs (begin_stage_forest / end_stage_forest): the staged protocol reads gamm(k) per stage and applies beta(:) in close_step_forest — coefficients the low-storage schemes do not even allocate (issue #25: LS schemes used to pass this gate silently and crash/corrupt far downstream on both backends). The forest queries this TBP only on the STAGED branch, so refusing here leaves the fused N=1/no-seam fast path — where LS schemes legitimately run — untouched. Other integrators (Yoshida, Leapfrog, Blanes-Moan, CFM) must error-stop here as well when they become selectable.
Returns: integer(kind=I4P)
fortran
function stages_per_step_forest(self) result(K)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | The realm. |
Call graph
compute_pml_kappa
Attributes: pure
Returns: real(kind=r8p)
fortran
function compute_pml_kappa(self, center_distance, span) result(kappa)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in | ||
center_distance | real(kind=R8P) | in | ||
span | real(kind=R8P) | in |
Call graph
modified_filter_radius
Cells reached by the P filter, plus one for the half-cell shift of the odd filters (boundary margin).
Returns: integer(kind=i4p)
fortran
function modified_filter_radius(self) result(radius)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in |
Call graph
modified_position_shift
Odd esirkepov_Q<N> deposit the base shape on the dual nodes x_c+dx/2 (P has an even number of taps, dual nodes to centers): this equals the regular deposit of the particle at x-dx/2. Zero for the even filters and the other solvers.
Returns: real(kind=R8P)
fortran
function modified_position_shift(self) result(shift)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_cpu_object) | in |
Call graph
dotproduct
Compute the scalar (dot) product.
Returns: real(kind=R8P)
fortran
function dotproduct(a, b) result(dot)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
a | real(kind=R8P) | in | Left hand side. | |
b | real(kind=R8P) | in | Left hand side. |
Call graph
crossproduct
Returns: real(kind=R8P)
fortran
function crossproduct(a, b) result(cross)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
a | real(kind=R8P) | in | Left hand side. | |
b | real(kind=R8P) | in | Left hand side. |
Call graph