Appearance
adam_adam_object
ADAM, ADAM class definition.
Source: src/lib/common/adam_adam_object.F90
Dependencies
Contents
- adam_object
- adapt
- amr_update
- blocks_reorder
- check_blocks_number
- compute_blocks_number
- load_restart_files
- initialize
- interpolate_at_point
- make_comm_local_maps_ghost_bc
- mpi_gather_refinement_needed
- mpi_redistribute
- prune
- refine_uniform
- save_restart_files
- save_slice
- save_vtk
- description
Derived Types
adam_object
ADAM class definition.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
tree | type(tree_object) | The tree. | |
maps | type(maps_object) | pointer | The maps (backward-compat alias → global singleton). |
field | type(field_object) | pointer | The field (points to program-scope singleton). |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
adapt | pass(self) | Adapt tree/field accordingly to refine/derefine necessity. |
amr_update | pass(self) | Update AMR status. |
blocks_reorder | pass(self) | Reorder blocks (for asyncrhonous MPI) |
check_blocks_number | pass(self) | Check if blocks number is groving too much. |
compute_blocks_number | pass(self) | Compute maximum blocks number allocatable on memory available. |
description | pass(self) | Return pretty-printed object description. |
initialize | pass(self) | Initialize ADAM. |
interpolate_at_point | pass(self) | Interpolate a scalar variable at a given point. |
load_restart_files | pass(self) | Load restart files. |
make_comm_local_maps_ghost_bc | pass(self) | Make communication/local maps of ghost cells. |
mpi_gather_refinement_needed | pass(self) | Gather refinement needed. |
mpi_redistribute | pass(self) | Redistribute nodes/blocks to processes, load balancing. |
prune | pass(self) | Prune nodes/blocks. |
refine_uniform | pass(self) | Refine all blocks uniformly. |
save_restart_files | pass(self) | Save restart files. |
save_slice | pass(self) | Save slice. |
save_vtk | pass(self) | Save ADAM in VTK format. |
Subroutines
adapt
Adapt tree/field accordingly to refine/derefine necessity.
fortran
subroutine adapt(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | ADAM. | |
q | real(kind=R8P) | inout | Field cell centered variables. |
Call graph
amr_update
Update AMR status.
Note: AMR update can be safely called only after update_ghost has been called for q variables, otherwise refine is not well done. Note: only if the AMR is UNIFORM and GLOBALLY made by tree, i.e. using mark_all_nodes, the mpi_redistribute can be avoided, otherwise mpi_gather_refinement_nedeed is not safe (having wrong nodes number counters).
fortran
subroutine amr_update(self, q, is_marked_by_field, is_marked_by_tree, do_mpi_redistribute, do_blocks_reorder, is_grid_changed)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | ADAM. | |
q | real(kind=R8P) | inout | Field cell centered variables. | |
is_marked_by_field | logical | in | optional | Flag to check if marker is field. |
is_marked_by_tree | logical | in | optional | Flag to check if marker is tree. |
do_mpi_redistribute | logical | in | optional | Flag to activate MPI redistribute. |
do_blocks_reorder | logical | in | optional | Flag to activate blocks reorder. |
is_grid_changed | logical | out | optional | Flag to check if grid is changed. |
Call graph
blocks_reorder
Reorder blocks (for asyncrhonous MPI)
fortran
subroutine blocks_reorder(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | ADAM. | |
q | real(kind=R8P) | inout | Field cell centered variables. |
Call graph
check_blocks_number
Check if blocks number is groving too much.
fortran
subroutine check_blocks_number(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | ADAM. |
Call graph
compute_blocks_number
Compute maximum blocks number allocatable on memory available.
fortran
subroutine compute_blocks_number(self, memory_avail, fields_number, nb, nodes_number)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | in | ADAM. | |
memory_avail | real(kind=R8P) | in | Memory available for single MPI process (GBytes). | |
fields_number | integer(kind=I4P) | in | Fields number. | |
nb | integer(kind=I4P) | out | Maximum blocks number for single MPI process. | |
nodes_number | integer(kind=I8P) | out | Maximum blocks number for all MPI processes (nodes). |
Call graph
load_restart_files
Load restart files.
fortran
subroutine load_restart_files(self, basename, t, time, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | ADAM. | |
basename | character(len=*) | in | Base name of output files. | |
t | integer(kind=I4P) | out | Time iteration. | |
time | real(kind=R8P) | out | Time. | |
q | real(kind=R8P) | inout | Field cell centered variables. |
Call graph
initialize
Initialize ADAM.
fortran
subroutine initialize(self, file_parameters, add_adam, nv, verbose)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | ADAM. | |
file_parameters | type(file_ini) | inout | INI file handler. | |
add_adam | logical | in | optional | Add ADAM node, the ancestor of all nodes. |
nv | integer(kind=I4P) | in | optional | Number of field variables. |
verbose | logical | in | optional | Trigger verbose output. |
Call graph
interpolate_at_point
Interpolate a scalar variable at a given point.
fortran
subroutine interpolate_at_point(self, itype, point, q, qp, is_mine, p, qc, ijk, xyz, code, v)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | ADAM. | |
itype | character(len=*) | in | Type of interpolation. | |
point | real(kind=R8P) | in | Interpolation point xyz coordinates. | |
q | real(kind=R8P) | in | Q variables to be interpolated. | |
qp | real(kind=R8P) | out | Q variables interpolated at given point. | |
is_mine | logical | out | Flag to check if point interpolation belongs to myrank. | |
p | integer(kind=I4P) | in | optional | Power parameter. |
qc | real(kind=R8P) | out | optional | Closest cells q-variable values. |
ijk | integer(kind=I4P) | out | optional | Closest cells indexes. |
xyz | real(kind=R8P) | out | optional | Closest cells center-coordinates. |
code | integer(kind=I8P) | out | optional | Closest block Morton code. |
v | integer(kind=I4P) | out | optional | Closest vertex index. |
Call graph
make_comm_local_maps_ghost_bc
Make communication/local maps of ghost cells and boundary conditions.
fortran
subroutine make_comm_local_maps_ghost_bc(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | ADAM. |
Call graph
mpi_gather_refinement_needed
Gather refinement needed.
fortran
subroutine mpi_gather_refinement_needed(self, is_marked_by_field, is_marked_by_tree)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | ADAM. | |
is_marked_by_field | logical | in | optional | Flag to check if marker is field. |
is_marked_by_tree | logical | in | optional | Flag to check if marker is tree. |
Call graph
mpi_redistribute
Redistribute nodes/blocks to processes, load balancing.
fortran
subroutine mpi_redistribute(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | ADAM. | |
q | real(kind=R8P) | inout | Field cell centered variables. |
Call graph
prune
Prune nodes/blocks.
fortran
subroutine prune(self, q, ijkl_prune, do_blocks_reorder)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | Adam. | |
q | real(kind=R8P) | inout | Field cell centered variables. | |
ijkl_prune | integer(kind=I4P) | inout | Maximum coordinates after which the prune operates. | |
do_blocks_reorder | logical | in | optional | Flag to activate blocks reorder. |
Call graph
refine_uniform
Refine all blocks uniformly.
fortran
subroutine refine_uniform(self, refinement_levels, q, do_mpi_redistribute, do_blocks_reorder)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | Adam. | |
refinement_levels | integer(kind=I4P) | in | Number of refinement to be performed. | |
q | real(kind=R8P) | inout | Field cell centered variables. | |
do_mpi_redistribute | logical | in | optional | Flag to activate MPI redistribute. |
do_blocks_reorder | logical | in | optional | Flag to activate blocks reorder. |
Call graph
save_restart_files
Save restart files.
fortran
subroutine save_restart_files(self, basename, t, time, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | in | ADAM. | |
basename | character(len=*) | in | Base name of output files. | |
t | integer(kind=I4P) | in | Time iteration. | |
time | real(kind=R8P) | in | Time. | |
q | real(kind=R8P) | in | Field cell centered variables. |
Call graph
save_slice
Save slice.
fortran
subroutine save_slice(self, itype, points, basename, q, q_name, phi, t, time)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | ADAM. | |
itype | character(len=*) | in | Type of interpolation. | |
points | real(kind=R8P) | in | Interpolation points coordinates [1:3,1:ni,1:nj,1:nk]. | |
basename | character(len=*) | in | Base name of output files. | |
q | real(kind=R8P) | in | Q variables to be saved. | |
q_name | character(len=*) | in | optional | Variables names. |
phi | real(kind=R8P) | in | optional | Distance function. |
t | integer(kind=I4P) | in | optional | Time iteration. |
time | real(kind=R8P) | in | optional | Time. |
Call graph
save_vtk
Save ADAM in VTK files.
fortran
subroutine save_vtk(self, basename, q, q_aux, q_name, q_aux_name, directory, with_ghost, with_cell_morton, t, time)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | inout | ADAM. | |
basename | character(len=*) | in | Base name of output files. | |
q | real(kind=R8P) | in | Q variables to be saved. | |
q_aux | real(kind=R8P) | in | optional | Q auxiliary variables to be saved. |
q_name | character(len=*) | in | optional | Variables names. |
q_aux_name | character(len=*) | in | optional | Q auxiliary variables names. |
directory | character(len=*) | in | optional | Output directory name. |
with_ghost | logical | in | optional | Flag to save ghost cells. |
with_cell_morton | logical | in | optional | Flag to save Morton code in cells. |
t | integer(kind=I4P) | in | optional | Time iteration. |
time | real(kind=R8P) | in | optional | Time. |
Call graph
Functions
description
Return a pretty-formatted object description.
Attributes: pure
Returns: character(len=:)
fortran
function description(self) result(desc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(adam_object) | in | Adam. |
Call graph