Skip to content

adam_field_object

ADAM, field class definition.

A structured block is composed of hexahedron finite volumes with quadrilateral faces using the following internal numeration for nodes and faces:

 /|\Z
  |                            F(4)         _ F(6)
  |                            /|\          /!
  |                        7    |          /    8
  |                         *------------------*
  |                        /|   |        /    /|
  |                       / |   |       /    / |
  |                      /  |   |      /    /  |
  |                     /   |   |     /    /   |
  |                    /    |   |    +    /    |
  |                   /     |   |        /     |
  |                  /      |   +       /      |
  |                 /      3|          /       |4
  |                /        * --------/--------*
  |      F(1)<----/----+   /         /        /
  |              *------------------*    +-------->F(2)
  |             5|       /          |6      /
  |              |      /           |      /
  |              |     /        +   |     /
  |              |    /         |   |    /
  |              |   /      +   |   |   /
  |              |  /      /    |   |  /
  |              | /      /     |   | /
  |              |/      /      |   |/
  |              *------------------*
  |             1      /        |    2
  |                   /        \|/
  |   _ Y           |/_       F(3)
  |   /|         F(5)
  |  /
  | /
  |/                                                    X
  O----------------------------------------------------->

Each hexadron cells is faces-connected to its neighboring, thus the cells build a structured block with implicit connectivity, e.g. in 2D space a FriVolous block could be as the following:

                 _ J
                 /|                          _____
               5+ ...*----*----*----*----*...     |
               /    /    /    /    /    /         |
              /    /    /    /    /    /          |
            4+ ...*----*----*----*----*...        |
            /    /    /    /    /    /            |
           /    /    /    /    /    /             |
         3+ ...*----*----*----*----*...           |  Structured block of 4x4 Finite Volumes
         /    /    / FV /    /    /               |
        /    /    /    /    /    /                |
      2+ ...*----*----*----*----*...              |
      /    /    /    /    /    /                  |
     /    /    /    /    /    /                   |
   1+ ...*----*----*----*----*...                 |
   /     .    .    .    .    .                    |
  /      .    .    .    .    .               _____
 O-------+----+----+----+----+-------------> I
         1    2    3    4    5

Source: src/lib/common/adam_field_object.F90

Dependencies

Contents

Derived Types

field_object

Field class definition.

Components

NameTypeAttributesDescription
mpihtype(mpih_object)MPI handler.
gridtype(grid_object)pointerThe grid.
mapstype(maps_object)pointerThe maps.
nvinteger(kind=I4P)Number of field variables.
nv_picinteger(kind=I4P)Number of PIC (Particle In Cell) variables.
block_weightinteger(kind=I4P)Block weight, cells_number * variables_number.
block_weight_picinteger(kind=I4P)Block weight, particles_number * pic_variables_number.
nbinteger(kind=I4P)Number of all blocks that can be stored.
blocks_numberinteger(kind=I4P)Number of blocks actually stored.
npinteger(kind=I4P)Number of all particles that can be stored for each block.
codeinteger(kind=I8P)allocatableMorton codes [nb].
coordinatesinteger(kind=I4P)allocatableCoordinates IJKL for each block [4,nb].
particles_numberinteger(kind=I4P)allocatableNumber of partcles actually stored in each block [nb].
eminreal(kind=R8P)allocatableCoordinates of minimum abscissa of each block [3,nb].
emaxreal(kind=R8P)allocatableCoordinates of maximum abscissa of each block [3,nb].
dxyzreal(kind=R8P)allocatableSpace steps of each block [3,nb].
x_nodereal(kind=R8P)allocatableX node coordinates [0-ngc:ni+ngc,nb].
y_nodereal(kind=R8P)allocatableY node coordinates [0-ngc:nj+ngc,nb].
z_nodereal(kind=R8P)allocatableZ node coordinates [0-ngc:nk+ngc,nb].
x_cellreal(kind=R8P)allocatableX cell coordinates [1-ngc:ni+ngc,nb].
y_cellreal(kind=R8P)allocatableY cell coordinates [1-ngc:nj+ngc,nb].
z_cellreal(kind=R8P)allocatableZ cell coordinates [1-ngc:nk+ngc,nb].
blocks_numbersinteger(kind=I4P)allocatableNumber of blocks actually stored in all processes.
refinements_neededinteger(kind=I4P)allocatableRefinements needed of my blocks.
refinements_needed_allinteger(kind=I4P)allocatableRefinements needed of all blocks.
disp_countinteger(kind=I4P)allocatableDisplacement of blocks that are received from process.
inner_blocks_numberinteger(kind=I4P)Number of inner blocks where I need fecs.
q_workreal(kind=R8P)allocatableField cell centered variables, working buffer memory.
residualsreal(kind=R8P)allocatableField residuals, normalized.
ngcinteger(kind=I4P)pointerNumber of ghost cells.
niinteger(kind=I4P)pointerNumber of cells in i direction.
njinteger(kind=I4P)pointerNumber of cells in j direction.
nkinteger(kind=I4P)pointerNumber of cells in k direction.

Type-Bound Procedures

NameAttributesDescription
adaptpass(self)Adapt field accordingly to refine/derefine necessity.
blocks_reorderpass(self)Reorder blocks indexes in field.
compute_metricspass(self)Compute metrics of each block.
compute_normL2_residualspass(self)Compute L2 norm of residuals.
descriptionpass(self)Return pretty-printed object description.
do_caxis_intersectpass(self)Return true if a block is intersected by coordinate-axis.
do_cplane_intersectpass(self)Return true if a block is intersected by coordinate-plane.
do_ray_intersectpass(self)Return true if a block is intersected by ray.
initializepass(self)Initialize the field.
load_blockspass(self)Load blocks data, used for restarting.
load_from_ini_filepass(self)Load object data from INI file.
mark_all_blockspass(self)Mark all blocks to be refined, derefined, ecc.
mark_spherepass(self)Mark blocks to be refined/derefined by sphere distance.
mpi_gather_refinements_neededpass(self)Gather blocks refinement needed status between MPI processes.
mpi_redistributepass(self)Redistribute blocks to processes.
save_blockspass(self)Save blocks data, used for restarting.
update_ghost_localpass(self)Update ghosts locally.
update_ghost_mpipass(self)Update ghosts MPI.
derefine1Dpass(self)Derefine blocks, 1D.
derefine2Dpass(self)Derefine blocks, 2D.
derefine3Dpass(self)Derefine blocks, 3D.
refine1Dpass(self)Refine blocks, 1D.
refine2Dpass(self)Refine blocks, 2D.
refine3Dpass(self)Refine blocks, 3D.

Subroutines

adapt

Adapt field accordingly to refine/derefine necessity.

fortran
subroutine adapt(self, ratio, block_to_refine, block_refined, block_to_derefine, block_derefined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
ratiointeger(kind=I4P)inRefinement ratio.
block_to_refineinteger(kind=I8P)inallocatableList of field blocks to be refined.
block_refinedinteger(kind=I8P)inallocatableList of field refined blocks with Morton code.
block_to_derefineinteger(kind=I8P)inallocatableList of field blocks to be derefined.
block_derefinedinteger(kind=I8P)inallocatableList of field derefined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

blocks_reorder

Reorder blocks indexes in field.

fortran
subroutine blocks_reorder(self, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

compute_metrics

Compute metrics of each block.

fortran
subroutine compute_metrics(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.

Call graph

compute_normL2_residuals

Compute L2 norm of residuals.

fortran
subroutine compute_normL2_residuals(self, dq, norm)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inThe field.
dqreal(kind=R8P)inResiduals.
normreal(kind=R8P)inoutResiduals norm.

Call graph

initialize

Initialize field.

fortran
subroutine initialize(self, grid, maps, file_parameters, nv, nv_pic, nb, np, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)intargetThe grid.
mapstype(maps_object)intargetThe maps.
file_parameterstype(file_ini)inoutoptionalINI file handler.
nvinteger(kind=I4P)inoptionalNumber of field variables.
nv_picinteger(kind=I4P)inoptionalNumber of PIC variables.
nbinteger(kind=I4P)inoptionalNumber of all blocks that can be stored.
npinteger(kind=I4P)inoptionalNumber of all particles that can be stored in each block.
qreal(kind=R8P)inoutallocatable, optionalField cell centered variables.

Call graph

load_blocks

Load blocks data, used for restarting.

Note: blocks memory must be already initialized with enough memory (proper nv,ni,nj,nk,ngc and nb>=blocks number).

fortran
subroutine load_blocks(self, basename, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
basenamecharacter(len=*)inOutput base name.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

load_from_ini_file

Load object data from INI file.

fortran
subroutine load_from_ini_file(self, file_parameters)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
file_parameterstype(file_ini)inoutINI file handler.

Call graph

mark_sphere

Mark blocks to be refined/derefined by sphere distance.

fortran
subroutine mark_sphere(self, center, radius, threshold)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
centerreal(kind=R8P)inSphere center coordinates [x,y,z].
radiusreal(kind=R8P)inSphere radius.
thresholdreal(kind=R8P)inoptionalThreshold for sphere proximity.

Call graph

mark_all_blocks

Mark all blocks to be refined, derefined, ecc.

fortran
subroutine mark_all_blocks(self, mark)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe tree.
markinteger(kind=I4P)inMark to be imposed [TO_BE_REFINED,...].

mpi_gather_refinements_needed

Gather blocks refinement needed status between MPI processes.

fortran
subroutine mpi_gather_refinements_needed(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.

Call graph

mpi_redistribute

Redistribute blocks to processes. @TODO: Morton codes are not yet redistributed, must be fixed.

fortran
subroutine mpi_redistribute(self, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

save_blocks

Save blocks data, used for restarting.

fortran
subroutine save_blocks(self, basename, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inThe field.
basenamecharacter(len=*)inOutput base name.
qreal(kind=R8P)inField cell centered variables.

Call graph

update_ghost_local

Update (local) ghost cells.

fortran
subroutine update_ghost_local(self, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inThe base backend.
qreal(kind=R8P)inoutField component to be updated.

Call graph

update_ghost_mpi

Update ghost cells within other processes.

fortran
subroutine update_ghost_mpi(self, q, step)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe base backend.
qreal(kind=R8P)inoutField component to be updated.
stepinteger(kind=I4P)inoptionalStep to be perfordmed in asyncronous comp.

Call graph

derefine1D

Derefine blocks.

Note: blocks number is not updated: mpi redistribute does it. This is dangerous...

fortran
subroutine derefine1D(self, ratio, block_to_derefine, block_derefined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
ratiointeger(kind=I4P)inRefinement ratio.
block_to_derefineinteger(kind=I8P)inallocatableList of blocks to be derefined.
block_derefinedinteger(kind=I8P)inallocatableList of derefined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

derefine2D

Derefine blocks.

Note: blocks number is not updated: mpi redistribute does it. This is dangerous...

fortran
subroutine derefine2D(self, ratio, block_to_derefine, block_derefined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
ratiointeger(kind=I4P)inRefinement ratio.
block_to_derefineinteger(kind=I8P)inallocatableList of blocks to be derefined.
block_derefinedinteger(kind=I8P)inallocatableList of derefined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

derefine3D

Derefine blocks.

Note: blocks number is not updated: mpi redistribute does it. This is dangerous...

fortran
subroutine derefine3D(self, ratio, block_to_derefine, block_derefined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
ratiointeger(kind=I4P)inRefinement ratio.
block_to_derefineinteger(kind=I8P)inallocatableList of blocks to be derefined.
block_derefinedinteger(kind=I8P)inallocatableList of derefined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

refine1D

Refine blocks.

Note: blocks number is not updated: mpi redistribute does it. This is dangerous...

fortran
subroutine refine1D(self, ratio, block_to_refine, block_refined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
ratiointeger(kind=I4P)inRefinement ratio.
block_to_refineinteger(kind=I8P)inallocatableList of blocks to be refined.
block_refinedinteger(kind=I8P)inallocatableList of refined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

refine2D

Refine blocks.

Note: blocks number is not updated: mpi redistribute does it. This is dangerous...

fortran
subroutine refine2D(self, ratio, block_to_refine, block_refined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
ratiointeger(kind=I4P)inRefinement ratio.
block_to_refineinteger(kind=I8P)inallocatableList of blocks to be refined.
block_refinedinteger(kind=I8P)inallocatableList of refined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

refine3D

Refine blocks.

Note: blocks number is not updated: mpi redistribute does it. This is dangerous...

fortran
subroutine refine3D(self, ratio, block_to_refine, block_refined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
ratiointeger(kind=I4P)inRefinement ratio.
block_to_refineinteger(kind=I8P)inallocatableList of blocks to be refined.
block_refinedinteger(kind=I8P)inallocatableList of refined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

Functions

description

Return a pretty-formatted object description.

Attributes: pure

Returns: character(len=:)

fortran
function description(self) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inThe field.

Call graph

do_caxis_intersect

Return true if a block is intersected by coordinate-axis.

Returns: logical

fortran
function do_caxis_intersect(self, b, caxis_origin, caxis_direction, caxis_block_indexes) result(do_intersect)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
binteger(kind=I4P)inBlock index.
caxis_originreal(kind=R8P)inCoordinate-axis origin.
caxis_directionreal(kind=R8P)inCoordinate-axis direction.
caxis_block_indexesinteger(kind=I4P)outoptionalBlock-local indexes of caxis intersection.

do_cplane_intersect

Return true if a block is intersected by coordinate-plane.

Returns: logical

fortran
function do_cplane_intersect(self, b, cplane_origin, cplane_normal, cplane_block_indexes) result(do_intersect)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
binteger(kind=I4P)inBlock index.
cplane_originreal(kind=R8P)inCoordinate-plane origin.
cplane_normalreal(kind=R8P)inCoordinate-plane normal.
cplane_block_indexesinteger(kind=I4P)outoptionalBlock-local indexes of cplane intersection.

Call graph

do_ray_intersect

Return true if a block is intersected by ray from ray_origin and oriented as ray_direction vector.

Returns: logical

fortran
function do_ray_intersect(self, b, ray_origin, ray_direction) result(do_intersect)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
binteger(kind=I4P)inBlock index.
ray_originreal(kind=R8P)inRay origin.
ray_directionreal(kind=R8P)inRay direction.

Call graph