Appearance
adam_chase_cpu_object
ADAM, CHASE (CFD-HPC enabled-Adaptive mesh-Simulation code for-Euler equations) class definition, CPU backend.
Source: src/app/chase/cpu/adam_chase_cpu_object.F90
Dependencies
Contents
- chase_cpu_object
- assign_omp
- allocate_cpu
- initialize
- amr_update
- compute_phi
- mark_by_geo
- mark_by_grad_var
- move_phi
- refine_uniform
- integrate_eikonal
- load_restart_files
- save_xh5f
- save_residuals
- save_restart_files
- save_simulation_data
- set_boundary_conditions
- set_initial_conditions
- update_ghost
- compute_dt
- compute_q_auxiliary
- compute_residuals
- integrate
- simulate
- assign_omp_R8P_5D
- compute_fluxes_convective
- compute_fluxes_convective_ri
- compute_fluxes_difference
- compute_eigenvectors
- compute_max_eigenvalues
- compute_q_gradient
- compute_roe_average
- decompose_fluxes_convective
Derived Types
chase_cpu_object
Maxwell equations system class definition, CPU backend.
Inheritance
Extends: chase_common_object
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
mpih | type(mpih_object) | MPI handler. | |
adam | type(adam_object) | ADAM. | |
field | type(field_object) | pointer | The field. |
grid | type(grid_object) | pointer | The grid. |
amr | type(amr_object) | AMR marker handler. | |
ib | type(ib_object) | Immersed Boundary (IB) handler. | |
slices | type(slices_object) | Slices handler. | |
rk | type(rk_object) | RK integrator. | |
weno | type(weno_object) | WENO reconstructor. | |
io | type(chase_io_object) | IO handler. | |
physics | type(chase_physics_object) | Fluids physiscs handler. | |
ic | type(chase_ic_object) | Initial Conditions (IC) handler. | |
bc | type(chase_bc_object) | Boundary Conditions (BC) handler. | |
time | type(chase_time_object) | Time handler. | |
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 conservative/primitive variables. |
nv_aux | integer(kind=I4P) | pointer | Number of auxiliary variables. |
q | real(kind=R8P) | allocatable | Cell centered variables. |
q_aux | real(kind=R8P) | allocatable | Auxiliary cell centered variables. |
q_name | character(len=2) | allocatable | Conservative fields names (r,ru,rv,rw,rE). |
dq | real(kind=R8P) | allocatable | Residuals right hand side. |
flx | real(kind=R8P) | allocatable | Fluxes along x. |
fly | real(kind=R8P) | allocatable | Fluxes along y. |
flz | real(kind=R8P) | allocatable | Fluxes along z. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
allocate_common | pass(self) | Allocate common data. |
initialize_common | pass(self) | Initialize the equation common data. |
allocate_cpu | pass(self) | Allocate CPU data. |
initialize | pass(self) | Initialize the equation. |
amr_update | pass(self) | Do AMR update. |
compute_phi | pass(self) | Compute phi, distance from IB solid. |
mark_by_geo | pass(self) | Mark blocks to be refined/derefined by a geometric constrain. |
mark_by_grad_var | pass(self) | Mark blocks to be refined/derefined by a grad(var) value. |
move_phi | pass(self) | Move phi. |
refine_uniform | pass(self) | Refine all blocks uniformly. |
integrate_eikonal | pass(self) | Integrate eikonal equation. |
load_restart_files | pass(self) | Load restart files. |
save_xh5f | pass(self) | Save simulation data in XH5F format. |
save_residuals | pass(self) | Save residuals history. |
save_restart_files | pass(self) | Save restart files. |
save_simulation_data | pass(self) | Save all simulation data. |
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_dt | pass(self) | Compute time step. |
compute_q_auxiliary | pass(self) | Compute auxiliary variables. |
compute_residuals | pass(self) | Compute residuals. |
integrate | pass(self) | Perform one step integration. |
simulate | pass(self) | Perform the simulation. |
Interfaces
assign_omp
Assign array to scalar value with OpenMP threads.
Module procedures: assign_omp_R8P_5D
Subroutines
allocate_cpu
Allocate CPU data.
fortran
subroutine allocate_cpu(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. |
Call graph
initialize
Initialize the equation.
fortran
subroutine initialize(self, filename)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. | |
filename | character(len=*) | in | Input file name. |
Call graph
amr_update
Do AMR update.
fortran
subroutine amr_update(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. |
Call graph
compute_phi
Compute phi, distance from IB solid.
fortran
subroutine compute_phi(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. |
Call graph
mark_by_geo
Mark blocks to be refined/derefined by a geometric constrain.
fortran
subroutine mark_by_geo(self, delta_fine, delta_coarse, threshold, do_init)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. | |
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 |
Call graph
mark_by_grad_var
Mark blocks to be refined/derefined by a grad(var) value.
fortran
subroutine mark_by_grad_var(self, grad_tol, delta_type, delta_fine, delta_coarse, ivar, threshold, do_init)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. | |
grad_tol | real(kind=R8P) | in | Gradiend 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. | |
ivar | integer(kind=I4P) | in | optional | Variable for marking. |
threshold | real(kind=R8P) | in | optional | Threshold for sphere proximity. |
do_init | logical | in | optional | Re-initialize refinements queries. |
Call graph
move_phi
Move phi and the actual tree representation.
fortran
subroutine move_phi(self, velocity, s)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. | |
velocity | real(kind=R8P) | in | Velocity of the movement. | |
s | integer(kind=I4P) | in | Solid index. |
Call graph
refine_uniform
Refine all blocks uniformly.
fortran
subroutine refine_uniform(self, refinement_levels)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. | |
refinement_levels | integer(kind=I4P) | in | Number of refinement to be performed. |
Call graph
integrate_eikonal
Integrate eikonal equation.
fortran
subroutine integrate_eikonal(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. |
Call graph
load_restart_files
Save restart files.
fortran
subroutine load_restart_files(self, t, time)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. | |
t | integer(kind=I4P) | out | Time iteration. | |
time | real(kind=R8P) | out | Time. |
Call graph
save_xh5f
Save simulation data in HDF5 format.
fortran
subroutine save_xh5f(self, output_basename, with_ghost)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. | |
output_basename | character(len=*) | in | optional | Output basename. |
with_ghost | logical | in | optional | Flag to save ghost cells. |
Call graph
save_residuals
Save residuals history.
fortran
subroutine save_residuals(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. |
Call graph
save_restart_files
Save restart files.
fortran
subroutine save_restart_files(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_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(chase_cpu_object) | inout | The equation. |
Call graph
set_boundary_conditions
Set boundary conditions of equation.
fortran
subroutine set_boundary_conditions(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | in | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. |
Call graph
set_initial_conditions
Set initial conditions and coils on field.
fortran
subroutine set_initial_conditions(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. |
Call graph
update_ghost
Update ghost cells. If not specified all steps are perfermod, syncronous computation
fortran
subroutine update_ghost(self, q, step)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_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. |
Call graph
compute_dt
Compute maximum time step accordingly to CFL stabilty criterion.
fortran
subroutine compute_dt(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. |
Call graph
compute_q_auxiliary
Compute auxiliary variables.
fortran
subroutine compute_q_auxiliary(self, q, q_aux)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | in | The equation. | |
q | real(kind=R8P) | in | Conservative variables. | |
q_aux | real(kind=R8P) | out | Auxiliary variables. |
Call graph
compute_residuals
Compute residuals of equation.
fortran
subroutine compute_residuals(self, q, q_aux, dq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. | |
q_aux | real(kind=R8P) | inout | Auxiliary variables. | |
dq | real(kind=R8P) | inout | Residuals. |
Call graph
integrate
Perform one step integration.
fortran
subroutine integrate(self, do_ghost_syncro)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. | |
do_ghost_syncro | logical | in | optional | Flag to do syncrous ghost update. |
Call graph
simulate
Perform the simulation.
fortran
subroutine simulate(self, filename)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(chase_cpu_object) | inout | The equation. | |
filename | character(len=*) | in | Input file name. |
Call graph
assign_omp_R8P_5D
Assign array to scalar value with OpenMP threads (kind R8P, rank 5)
fortran
subroutine assign_omp_R8P_5D(blocks_number, ngc, lhs, rhs)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
blocks_number | integer(kind=I4P) | in | Number of blocks. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
lhs | real(kind=R8P) | inout | Lest hand side. | |
rhs | real(kind=R8P) | in | Right hand side. |
compute_fluxes_convective
Compute convective fluxes along direction dir.
fortran
subroutine compute_fluxes_convective(dir, blocks_number, ni, nj, nk, ngc, nv, g, weno_s, weno_zeps, weno_a, weno_p, weno_d, q_aux, 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 | integer(kind=I4P) | in | Number of conservative varibales. | |
g | real(kind=R8P) | in | Specific heats ratio. | |
weno_s | integer(kind=I4P) | in | Weno stencils number/dimension. | |
weno_zeps | real(kind=R8P) | in | Parameter for avoiding division by zero in computing IS. | |
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. | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
fluxes | real(kind=R8P) | inout | Fluxes. |
Call graph
compute_fluxes_convective_ri
Compute convective fluxes at right interface of b,i,j,k.
fortran
subroutine compute_fluxes_convective_ri(dir, b, i, j, k, ngc, nv, weno_s, weno_zeps, weno_a, weno_p, weno_d, si, sir, g, q_aux, 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 | integer(kind=I4P) | in | Number of conservative varibales. | |
weno_s | integer(kind=I4P) | in | Weno stencils number/dimension. | |
weno_zeps | real(kind=R8P) | in | Parameter to avoid division by zero. | |
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. | |
si | integer(kind=I4P) | in | Stencil increment. | |
sir | real(kind=R8P) | in | Stencil increment, real cast. | |
g | real(kind=R8P) | in | Specific heats ratio. | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
fluxes | real(kind=R8P) | inout | Fluxes. |
Call graph
compute_fluxes_difference
Compute fluxes difference.
fortran
subroutine compute_fluxes_difference(null_xyz, blocks_number, ni, nj, nk, ngc, nv, ib_eps, dx, dy, dz, flx, fly, flz, phi, dq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
null_xyz | logical | in | Nullified directions tags. | |
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 | integer(kind=I4P) | in | Number of conservative varibales. | |
ib_eps | real(kind=R8P) | in | Tolerance IB delta ratio. | |
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. | |
phi | real(kind=R8P) | in | optional | IB distance function. |
dq | real(kind=R8P) | inout | Fluxes differences. |
Call graph
compute_eigenvectors
Attributes: pure
fortran
subroutine compute_eigenvectors(si, sir, b, i, j, k, ngc, nv, g, q_aux, el, er)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
si | integer(kind=I4P) | in | Directional (1=x,2=y,3=z) increment. | |
sir | real(kind=R8P) | in | Directional (1=x,2=y,3=z) increment. | |
b | integer(kind=I4P) | in | Cell indexes. | |
i | integer(kind=I4P) | in | Cell indexes. | |
j | integer(kind=I4P) | in | Cell indexes. | |
k | integer(kind=I4P) | in | Cell indexes. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv | integer(kind=I4P) | in | Number of conservative varibales. | |
g | real(kind=R8P) | in | Specific heats ratio. | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
el | real(kind=R8P) | inout | Left and right eigenvectors. | |
er | real(kind=R8P) | inout | Left and right eigenvectors. |
Call graph
compute_max_eigenvalues
Attributes: pure
fortran
subroutine compute_max_eigenvalues(si, weno_s, b, i, j, k, ngc, nv, q_aux, evmax)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
si | integer(kind=I4P) | in | Directional (1=x,2=y,3=z) increment. | |
weno_s | integer(kind=I4P) | in | Weno stencils number/dimension. | |
b | integer(kind=I4P) | in | Cell indexes. | |
i | integer(kind=I4P) | in | Cell indexes. | |
j | integer(kind=I4P) | in | Cell indexes. | |
k | integer(kind=I4P) | in | Cell indexes. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv | integer(kind=I4P) | in | Number of conservative varibales. | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
evmax | real(kind=R8P) | out | Maximum eigenvalue in the big stencil. |
Call graph
compute_q_gradient
Compute gradient of q(ivar).
fortran
subroutine compute_q_gradient(b, ni, nj, nk, ngc, dx, dy, dz, q, ivar, gradient)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
b | integer(kind=I4P) | in | Block index. | |
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. | |
dx | real(kind=R8P) | in | X space step. | |
dy | real(kind=R8P) | in | Y space step. | |
dz | real(kind=R8P) | in | Z space step. | |
q | real(kind=R8P) | in | Field component to which apply gradient. | |
ivar | integer(kind=I4P) | in | Index of variable for computing the gradient. | |
gradient | real(kind=R8P) | out | Maximum gradient of q. |
Call graph
compute_roe_average
Compute Roe averaged quantities.
Attributes: pure
fortran
subroutine compute_roe_average(ngc, b, i, j, k, ip, jp, kp, g, q_aux, uu, vv, ww, h, qq, c, ci, b1, b2)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ngc | integer(kind=I4P) | in | Number of ghost cells. | |
b | integer(kind=I4P) | in | Left/right cells indexes. | |
i | integer(kind=I4P) | in | Left/right cells indexes. | |
j | integer(kind=I4P) | in | Left/right cells indexes. | |
k | integer(kind=I4P) | in | Left/right cells indexes. | |
ip | integer(kind=I4P) | in | Left/right cells indexes. | |
jp | integer(kind=I4P) | in | Left/right cells indexes. | |
kp | integer(kind=I4P) | in | Left/right cells indexes. | |
g | real(kind=R8P) | in | Specific heats ratio. | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
uu | real(kind=R8P) | out | Roe state average variables. | |
vv | real(kind=R8P) | out | Roe state average variables. | |
ww | real(kind=R8P) | out | Roe state average variables. | |
h | real(kind=R8P) | out | Roe state average variables. | |
qq | real(kind=R8P) | out | Roe state average variables. | |
c | real(kind=R8P) | out | Roe state average variables. | |
ci | real(kind=R8P) | out | Roe state average variables. | |
b1 | real(kind=R8P) | out | Roe state average variables. | |
b2 | real(kind=R8P) | out | Roe state average variables. |
Call graph
decompose_fluxes_convective
Decompose convective fluxes. Flux vector splitting by local-Lax-Friedrics (Rusanov) with projection in pseudo-characteristics space.
Attributes: pure
fortran
subroutine decompose_fluxes_convective(weno_s, b, i, j, k, ngc, nv, si, sir, el, q_aux, fmpc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
weno_s | integer(kind=I4P) | in | Weno stencils number/dimension. | |
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 | integer(kind=I4P) | in | Number of conservative varibales. | |
si | integer(kind=I4P) | in | Stencil increment. | |
sir | real(kind=R8P) | in | Stencil increment, real cast. | |
el | real(kind=R8P) | in | Left eigeinvectors. | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
fmpc | real(kind=R8P) | inout | Fluxes -+ decomposition in characteristics space. |
Call graph