Skip to content

adam_adam_object

ADAM, ADAM class definition.

Source: src/lib/common/adam_adam_object.F90

Dependencies

Contents

Derived Types

adam_object

ADAM class definition.

Components

NameTypeAttributesDescription
treetype(tree_object)The tree.
mapstype(maps_object)pointerThe maps (backward-compat alias → global singleton).
fieldtype(field_object)pointerThe field (points to program-scope singleton).

Type-Bound Procedures

NameAttributesDescription
adaptpass(self)Adapt tree/field accordingly to refine/derefine necessity.
amr_updatepass(self)Update AMR status.
blocks_reorderpass(self)Reorder blocks (for asyncrhonous MPI)
check_blocks_numberpass(self)Check if blocks number is groving too much.
compute_blocks_numberpass(self)Compute maximum blocks number allocatable on memory available.
descriptionpass(self)Return pretty-printed object description.
initializepass(self)Initialize ADAM.
interpolate_at_pointpass(self)Interpolate a scalar variable at a given point.
load_restart_filespass(self)Load restart files.
make_comm_local_maps_ghost_bcpass(self)Make communication/local maps of ghost cells.
mpi_gather_refinement_neededpass(self)Gather refinement needed.
mpi_redistributepass(self)Redistribute nodes/blocks to processes, load balancing.
prunepass(self)Prune nodes/blocks.
refine_uniformpass(self)Refine all blocks uniformly.
save_restart_filespass(self)Save restart files.
save_slicepass(self)Save slice.
save_vtkpass(self)Save ADAM in VTK format.

Subroutines

adapt

Adapt tree/field accordingly to refine/derefine necessity.

fortran
subroutine adapt(self, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutADAM.
qreal(kind=R8P)inoutField 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

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutADAM.
qreal(kind=R8P)inoutField cell centered variables.
is_marked_by_fieldlogicalinoptionalFlag to check if marker is field.
is_marked_by_treelogicalinoptionalFlag to check if marker is tree.
do_mpi_redistributelogicalinoptionalFlag to activate MPI redistribute.
do_blocks_reorderlogicalinoptionalFlag to activate blocks reorder.
is_grid_changedlogicaloutoptionalFlag to check if grid is changed.

Call graph

blocks_reorder

Reorder blocks (for asyncrhonous MPI)

fortran
subroutine blocks_reorder(self, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutADAM.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

check_blocks_number

Check if blocks number is groving too much.

fortran
subroutine check_blocks_number(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutADAM.

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

NameTypeIntentAttributesDescription
selfclass(adam_object)inADAM.
memory_availreal(kind=R8P)inMemory available for single MPI process (GBytes).
fields_numberinteger(kind=I4P)inFields number.
nbinteger(kind=I4P)outMaximum blocks number for single MPI process.
nodes_numberinteger(kind=I8P)outMaximum 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

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutADAM.
basenamecharacter(len=*)inBase name of output files.
tinteger(kind=I4P)outTime iteration.
timereal(kind=R8P)outTime.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

initialize

Initialize ADAM.

fortran
subroutine initialize(self, file_parameters, add_adam, nv, verbose)

Arguments

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutADAM.
file_parameterstype(file_ini)inoutINI file handler.
add_adamlogicalinoptionalAdd ADAM node, the ancestor of all nodes.
nvinteger(kind=I4P)inoptionalNumber of field variables.
verboselogicalinoptionalTrigger 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

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutADAM.
itypecharacter(len=*)inType of interpolation.
pointreal(kind=R8P)inInterpolation point xyz coordinates.
qreal(kind=R8P)inQ variables to be interpolated.
qpreal(kind=R8P)outQ variables interpolated at given point.
is_minelogicaloutFlag to check if point interpolation belongs to myrank.
pinteger(kind=I4P)inoptionalPower parameter.
qcreal(kind=R8P)outoptionalClosest cells q-variable values.
ijkinteger(kind=I4P)outoptionalClosest cells indexes.
xyzreal(kind=R8P)outoptionalClosest cells center-coordinates.
codeinteger(kind=I8P)outoptionalClosest block Morton code.
vinteger(kind=I4P)outoptionalClosest 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

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutADAM.

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

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutADAM.
is_marked_by_fieldlogicalinoptionalFlag to check if marker is field.
is_marked_by_treelogicalinoptionalFlag to check if marker is tree.

Call graph

mpi_redistribute

Redistribute nodes/blocks to processes, load balancing.

fortran
subroutine mpi_redistribute(self, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutADAM.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

prune

Prune nodes/blocks.

fortran
subroutine prune(self, q, ijkl_prune, do_blocks_reorder)

Arguments

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutAdam.
qreal(kind=R8P)inoutField cell centered variables.
ijkl_pruneinteger(kind=I4P)inoutMaximum coordinates after which the prune operates.
do_blocks_reorderlogicalinoptionalFlag 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

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutAdam.
refinement_levelsinteger(kind=I4P)inNumber of refinement to be performed.
qreal(kind=R8P)inoutField cell centered variables.
do_mpi_redistributelogicalinoptionalFlag to activate MPI redistribute.
do_blocks_reorderlogicalinoptionalFlag to activate blocks reorder.

Call graph

save_restart_files

Save restart files.

fortran
subroutine save_restart_files(self, basename, t, time, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(adam_object)inADAM.
basenamecharacter(len=*)inBase name of output files.
tinteger(kind=I4P)inTime iteration.
timereal(kind=R8P)inTime.
qreal(kind=R8P)inField cell centered variables.

Call graph

save_slice

Save slice.

fortran
subroutine save_slice(self, itype, points, basename, q, q_name, phi, t, time)

Arguments

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutADAM.
itypecharacter(len=*)inType of interpolation.
pointsreal(kind=R8P)inInterpolation points coordinates [1:3,1:ni,1:nj,1:nk].
basenamecharacter(len=*)inBase name of output files.
qreal(kind=R8P)inQ variables to be saved.
q_namecharacter(len=*)inoptionalVariables names.
phireal(kind=R8P)inoptionalDistance function.
tinteger(kind=I4P)inoptionalTime iteration.
timereal(kind=R8P)inoptionalTime.

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

NameTypeIntentAttributesDescription
selfclass(adam_object)inoutADAM.
basenamecharacter(len=*)inBase name of output files.
qreal(kind=R8P)inQ variables to be saved.
q_auxreal(kind=R8P)inoptionalQ auxiliary variables to be saved.
q_namecharacter(len=*)inoptionalVariables names.
q_aux_namecharacter(len=*)inoptionalQ auxiliary variables names.
directorycharacter(len=*)inoptionalOutput directory name.
with_ghostlogicalinoptionalFlag to save ghost cells.
with_cell_mortonlogicalinoptionalFlag to save Morton code in cells.
tinteger(kind=I4P)inoptionalTime iteration.
timereal(kind=R8P)inoptionalTime.

Call graph

Functions

description

Return a pretty-formatted object description.

Attributes: pure

Returns: character(len=:)

fortran
function description(self) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(adam_object)inAdam.

Call graph