leapBlock Module

Defines structured blocks


Uses

  • module~~leapblock~~UsesGraph module~leapblock leapBlock module~leapkinds leapKinds module~leapblock->module~leapkinds module~leapparallel leapParallel module~leapblock->module~leapparallel mpi_f08 mpi_f08 module~leapblock->mpi_f08 iso_fortran_env iso_fortran_env module~leapkinds->iso_fortran_env module~leapparallel->module~leapkinds module~leapparallel->mpi_f08 module~leapparser leapParser module~leapparallel->module~leapparser module~leapparser->module~leapkinds module~leapcli leapCli module~leapparser->module~leapcli module~leapcli->module~leapkinds

Used by

  • module~~leapblock~~UsedByGraph module~leapblock leapBlock module~cdifs cdifs module~cdifs->module~leapblock module~leapbc leapBC module~cdifs->module~leapbc module~leapdiffop leapDiffOp module~cdifs->module~leapdiffop module~leapeulerian leapEulerian module~cdifs->module~leapeulerian module~leaphypre leapHypre module~cdifs->module~leaphypre module~particles_resolved particles_resolved module~cdifs->module~particles_resolved module~cdifs_cases cdifs_cases module~cdifs->module~cdifs_cases module~immersed_boundaries immersed_boundaries module~cdifs->module~immersed_boundaries module~grans grans module~grans->module~leapblock module~grans->module~leapeulerian module~grans->module~leaphypre module~particles_point particles_point module~grans->module~particles_point module~grans->module~particles_resolved module~grans_cases grans_cases module~grans->module~grans_cases module~grans->module~immersed_boundaries module~immersed_boundaries_markers immersed_boundaries_markers module~immersed_boundaries_markers->module~leapblock module~immersed_boundaries_markers->module~leapdiffop module~immersed_boundaries_markers->module~leapeulerian module~immersed_boundaries_markers->module~leaphypre module~leaplagrangian leapLagrangian module~immersed_boundaries_markers->module~leaplagrangian module~leapio leapIO module~immersed_boundaries_markers->module~leapio module~immersed_boundaries_solids immersed_boundaries_solids module~immersed_boundaries_solids->module~leapblock module~immersed_boundaries_solids->module~immersed_boundaries_markers module~immersed_boundaries_solids->module~leapeulerian module~immersed_boundaries_solids->module~leaplagrangian module~immersed_boundaries_solids->module~leapio module~leapbc->module~leapblock module~leapbc->module~leapeulerian module~leapcases leapCases module~leapcases->module~leapblock module~leapdiffop->module~leapblock module~leapdiffop->module~leapbc module~leapdiffop->module~leapeulerian module~leapeulerian->module~leapblock module~leapio_mpi leapIO_mpi module~leapeulerian->module~leapio_mpi module~leapeulerian->module~leapio module~leaphypre->module~leapblock module~leaphypre->module~leapeulerian module~leapio_mpi->module~leapblock module~leapio_silo leapIO_silo module~leapio_silo->module~leapblock module~leaplagrangian->module~leapblock module~leaplagrangian->module~leapio module~particles_point->module~leapblock module~particles_point->module~leapeulerian module~particles_point->module~leaplagrangian module~particles_point->module~leapio module~particles_resolved->module~leapblock module~particles_resolved->module~leapdiffop module~particles_resolved->module~leapeulerian module~particles_resolved->module~leaplagrangian module~particles_resolved->module~immersed_boundaries module~particles_resolved->module~leapio proc~cdifs_channel_flow_block cdifs_channel_flow_block proc~cdifs_channel_flow_block->module~leapblock proc~cdifs_lid_driven_cavity_block cdifs_lid_driven_cavity_block proc~cdifs_lid_driven_cavity_block->module~leapblock proc~cdifs_vortex_impingement_block cdifs_vortex_impingement_block proc~cdifs_vortex_impingement_block->module~leapblock module~cdifs_advancesolution_smod cdifs_AdvanceSolution_smod module~cdifs_advancesolution_smod->module~cdifs module~cdifs_cases->module~leapcases module~cdifs_cases->module~leapeulerian module~cdifs_monitor_smod cdifs_Monitor_smod module~cdifs_monitor_smod->module~cdifs module~cdifs_preparesolver_smod cdifs_PrepareSolver_smod module~cdifs_preparesolver_smod->module~cdifs module~cdifs_writeoutputdata_smod cdifs_WriteOutputData_smod module~cdifs_writeoutputdata_smod->module~cdifs module~cdifs_writerestartdata_smod cdifs_WriteRestartData_smod module~cdifs_writerestartdata_smod->module~cdifs module~grans_advancesolution_smod grans_AdvanceSolution_smod module~grans_advancesolution_smod->module~grans module~grans_cases->module~leapcases module~grans_cases->module~leapeulerian module~grans_cases->module~particles_point module~grans_cases->module~particles_resolved module~grans_cases->module~immersed_boundaries module~grans_module_smod grans_module_smod module~grans_module_smod->module~grans module~grans_preparesolver_smod grans_PrepareSolver_smod module~grans_preparesolver_smod->module~grans module~grans_writeoutputdata_smod grans_WriteOutputData_smod module~grans_writeoutputdata_smod->module~grans module~grans_writerestartdata_smod grans_WriteRestartData_smod module~grans_writerestartdata_smod->module~grans module~immersed_boundaries->module~immersed_boundaries_markers module~immersed_boundaries->module~immersed_boundaries_solids module~leapio->module~leapio_mpi module~leapio->module~leapio_silo module~nga_smod nga_smod module~nga_smod->module~particles_point proc~add_markers add_markers proc~add_markers->module~particles_resolved proc~add_markers->module~immersed_boundaries proc~add_markers~2 add_markers proc~add_markers~2->module~particles_resolved proc~add_markers~2->module~immersed_boundaries proc~bc_set_buildmask bc_set%bc_set_BuildMask proc~bc_set_buildmask->module~leapeulerian proc~cdifs_channel_flow_bcs cdifs_channel_flow_bcs proc~cdifs_channel_flow_bcs->module~leapbc proc~cdifs_cylinder_bcs cdifs_cylinder_bcs proc~cdifs_cylinder_bcs->module~leapbc proc~cdifs_lamb_oseen_bcs cdifs_lamb_oseen_bcs proc~cdifs_lamb_oseen_bcs->module~leapbc proc~cdifs_lid_driven_cavity_bcs cdifs_lid_driven_cavity_bcs proc~cdifs_lid_driven_cavity_bcs->module~leapbc proc~cdifs_obj_preparesolveroperators cdifs_obj_PrepareSolverOperators proc~cdifs_obj_preparesolveroperators->module~leapbc proc~cdifs_obj_preparesolveroperatorsdiv cdifs_obj_PrepareSolverOperatorsDIV proc~cdifs_obj_preparesolveroperatorsdiv->module~leapbc proc~cdifs_obj_preparesolveroperatorspgrad cdifs_obj_PrepareSolverOperatorsPGRAD proc~cdifs_obj_preparesolveroperatorspgrad->module~leapbc proc~cdifs_obj_preparesolveroperatorsvlap cdifs_obj_PrepareSolverOperatorsVLAP proc~cdifs_obj_preparesolveroperatorsvlap->module~leapbc proc~cdifs_rebound_bcs cdifs_rebound_bcs proc~cdifs_rebound_bcs->module~leapbc proc~cdifs_rebound_respart cdifs_rebound_ResPart proc~cdifs_rebound_respart->module~particles_resolved proc~cdifs_settling_sphere_bcs cdifs_settling_sphere_bcs proc~cdifs_settling_sphere_bcs->module~leapbc proc~cdifs_settling_sphere_respart cdifs_settling_sphere_ResPart proc~cdifs_settling_sphere_respart->module~particles_resolved proc~cdifs_taylor_green_bcs cdifs_taylor_green_bcs proc~cdifs_taylor_green_bcs->module~leapbc proc~cdifs_vortex_dipole_bcs cdifs_vortex_dipole_bcs proc~cdifs_vortex_dipole_bcs->module~leapbc proc~cdifs_vortex_impingement_bcs cdifs_vortex_impingement_bcs proc~cdifs_vortex_impingement_bcs->module~leapbc proc~grans_obj_preparesolver_operators grans_obj_PrepareSolver_operators proc~grans_obj_preparesolver_operators->module~leapdiffop proc~marker_set_computesolidvolfrac marker_set%marker_set_ComputeSolidVolFrac proc~marker_set_computesolidvolfrac->module~leapdiffop proc~op_obj_applylaplaciandc op_obj%op_obj_ApplyLaplacianDC proc~op_obj_applylaplaciandc->module~leapbc program~main main program~main->module~cdifs program~main->module~grans module~cavity_smod cavity_smod module~cavity_smod->module~cdifs_cases module~channel_flow_smod channel_flow_smod module~channel_flow_smod->module~cdifs_cases module~cylinder_smod cylinder_smod module~cylinder_smod->module~cdifs_cases module~headon_collision_smod headon_collision_smod module~headon_collision_smod->module~grans_cases module~homogeneous_cooling_smod homogeneous_cooling_smod module~homogeneous_cooling_smod->module~grans_cases module~lamb_oseen_smod lamb_oseen_smod module~lamb_oseen_smod->module~cdifs_cases module~rebound_smod rebound_smod module~rebound_smod->module~cdifs_cases module~rotating_drum_smod rotating_drum_smod module~rotating_drum_smod->module~grans_cases module~settling_sphere_smod settling_sphere_smod module~settling_sphere_smod->module~cdifs_cases module~taylor_green_smod taylor_green_smod module~taylor_green_smod->module~cdifs_cases module~vortex_dipole_smod vortex_dipole_smod module~vortex_dipole_smod->module~cdifs_cases module~vortex_impingement_smod vortex_impingement_smod module~vortex_impingement_smod->module~cdifs_cases proc~bc_set_read bc_set%bc_set_Read proc~bc_set_read->module~leapio proc~bc_set_write bc_set%bc_set_Write proc~bc_set_write->module~leapio proc~cdifs_cylinder_ib cdifs_cylinder_IB proc~cdifs_cylinder_ib->module~immersed_boundaries proc~cdifs_rebound_ib cdifs_rebound_IB proc~cdifs_rebound_ib->module~immersed_boundaries proc~cdifs_settling_sphere_ib cdifs_settling_sphere_IB proc~cdifs_settling_sphere_ib->module~immersed_boundaries

Derived Types

type, public ::  block_obj

A block object

Components

Type Visibility Attributes Name Initial
type(axis_obj), public :: axis(3)

Axes in x1, x2, and x3 directions

type(axis_obj), public :: axis_partition(3)

Axes of the main partition, (spacing equal to 1 sub-block)

real(kind=wp), public :: dx(3)

Minimum mesh spacing in each direction

real(kind=wp), public, pointer, contiguous :: dxm(:) => null()

Convenience pointer to x-cell spacings

real(kind=wp), public, pointer, contiguous :: dym(:) => null()

Convenience pointer to y-cell spacings

real(kind=wp), public, pointer, contiguous :: dzm(:) => null()

Convenience pointer to z-cell spacings

type(MPI_Datatype), public :: gc_slab_i(3) = MPI_DATATYPE_NULL

MPI derived type for integer gc

type(MPI_Datatype), public :: gc_slab_r(3) = MPI_DATATYPE_NULL

MPI derived type for wp real gc

integer, public :: hi(3)

Array upper bound

logical, public :: is_partitioned = .false.

Flag for parallel partitioning

integer, public :: lo(3)

Array lower bound

integer, public :: ngc = 2

Number of ghostcells

type(parallel_obj), public, pointer :: parallel => null()

Associated parallel structure

logical, public :: periods(3) = .false.

Periodicity in each direction

real(kind=wp), public :: pmax(3)

Min and max locations across all blocks

real(kind=wp), public :: pmin(3)

Min and max locations across all blocks

real(kind=wp), public, pointer, contiguous :: x(:) => null()

Convenience pointer to x-nodal points

real(kind=wp), public :: xhi(3)

Coordinate of the top right corner

real(kind=wp), public :: xlo(3)

Coordinate of the bottom left corner

real(kind=wp), public, pointer, contiguous :: xm(:) => null()

Convenience pointer to x-mid points

real(kind=wp), public :: xmax

Min and max locations across all blocks

real(kind=wp), public :: xmin

Min and max locations across all blocks

real(kind=wp), public, pointer, contiguous :: y(:) => null()

Convenience pointer to y-nodal points

real(kind=wp), public, pointer, contiguous :: ym(:) => null()

Convenience pointer to y-mid points

real(kind=wp), public :: ymax

Min and max locations across all blocks

real(kind=wp), public :: ymin

Min and max locations across all blocks

real(kind=wp), public, pointer, contiguous :: z(:) => null()

Convenience pointer to z-nodal points

real(kind=wp), public, pointer, contiguous :: zm(:) => null()

Convenience pointer to z-mid points

real(kind=wp), public :: zmax

Min and max locations across all blocks

real(kind=wp), public :: zmin

Min and max locations across all blocks

Type-Bound Procedures

procedure, public :: Finalize => block_obj_Final
procedure, public :: Info => block_obj_Info
generic, public :: Initialize => block_obj_Init, block_obj_Init2
procedure, public :: Locate => block_obj_Locate
procedure, public :: Partition => block_obj_Partition
procedure, public :: Read => block_obj_Read
procedure, public :: SetConveniencePointers => block_obj_SetConveniencePointers
procedure, public :: SetPeriodicity => block_obj_SetPeriodicity
procedure, public :: SetupMPITypes => block_obj_SetupMPITypes
procedure, public :: SetupUniformGrid => block_obj_SetupUniformGrid
procedure, public, nopass :: SubDivideBlock => block_obj_SubDivideBlock
procedure, public :: UpdateExtents => block_obj_UpdateExtents
generic, public :: UpdateGridGhostCells => block_obj_UpdateGridGhostCells, block_obj_UpdateGridGhostCells2
procedure, public :: UpdateMidPoints => block_obj_UpdateMidPoints
procedure, public :: UpdateSpacing => block_obj_UpdateSpacing
procedure, public :: Write => block_obj_Write
procedure, private :: block_obj_Init
procedure, private :: block_obj_Init2
procedure, private :: block_obj_UpdateGridGhostCells
procedure, private :: block_obj_UpdateGridGhostCells2

type, private ::  axis_obj

Defines a 1D axis xm(lo) xm(hi) | | |-----|-----|------|------| | <-dxm-> | x(lo) x(hi+1)

Components

Type Visibility Attributes Name Initial
real(kind=wp), public, pointer, contiguous :: dxm(:) => null()

Cell spacings

integer, public :: hi

Higher bound

integer, public :: lo

Lower bound

integer, public :: ngc

Number of ghostcells

real(kind=wp), public, pointer, contiguous :: x(:) => null()

Nodal points

real(kind=wp), public, pointer, contiguous :: xm(:) => null()

Mid points

Type-Bound Procedures

procedure, public :: Finalize => axis_obj_Final
procedure, public :: Initialize => axis_obj_Init

Functions

private impure function block_obj_Locate(this, p) result(rank)

Return block ID and rank of the block where the point is located using a binary search alogirthm. Note that this function assumes that the point is within the domain, i.e., (pmin <= p <= pmax) and that any treatment for periodicity has been previously applied.

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(in) :: this

A block object

real(kind=wp), intent(in) :: p(3)

Position to locate

Return Value integer

MPI rank


Subroutines

private pure subroutine axis_obj_Final(this)

Arguments

Type IntentOptional Attributes Name
class(axis_obj), intent(inout) :: this

A axis object

private pure subroutine axis_obj_Init(this, lo, hi, ngc)

Initialize axis

Arguments

Type IntentOptional Attributes Name
class(axis_obj), intent(inout) :: this

A axis object

integer, intent(in) :: lo

Array lower bound

integer, intent(in) :: hi

Array higher bound

integer, intent(in) :: ngc

Number of ghost cells

private impure subroutine block_obj_Final(this)

Finalize the block object

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

private impure subroutine block_obj_Info(this)

Print to stdout information about this block

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(in) :: this

A block object

private impure subroutine block_obj_Init(this, ngc, parallel)

Initialize block object

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

integer, intent(in) :: ngc

Number of ghostcells

type(parallel_obj), intent(in), target :: parallel

parallel structure from main program

private impure subroutine block_obj_Init2(this, xlo, xhi, lo, hi, ngc, parallel)

[DEPRECATED] Initialize block object

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

real(kind=wp), intent(in) :: xlo(3)

Coordinates of the bottom left corner

real(kind=wp), intent(in) :: xhi(3)

Coordinates of the top right corner

integer, intent(in) :: lo(3)

Array lower bound

integer, intent(in) :: hi(3)

Array upper bound

integer, intent(in) :: ngc

Number of ghostcells

type(parallel_obj), intent(in), target :: parallel

parallel structure from main program

private impure subroutine block_obj_Partition(this, Nb)

Partition a parent block into sub-blocks based on a given decomposition Nb(3) for parallel simulations. This will also define the partition axes, and update local bounds/extents, and global bounds/extents.

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

integer, intent(in) :: Nb(3)

Number of blocks in each direction

private impure subroutine block_obj_Read(this, name)

Read block data using HDF5

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

character(len=*), intent(in) :: name

Name of file to write

private pure subroutine block_obj_SetConveniencePointers(this)

Associate the convenience pointers

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

private pure subroutine block_obj_SetPeriodicity(this, periods)

Set block periodicity in each direction

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

logical, intent(in) :: periods(3)

Periodicity

private impure subroutine block_obj_SetupMPITypes(this)

Define MPI derived type for communicating ghostcells

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

private impure subroutine block_obj_SetupUniformGrid(this, xlo, xhi, lo, hi)

Initialize a uniform grid on this block

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

real(kind=wp), intent(in) :: xlo(3)

Coordinates of the bottom left corner

real(kind=wp), intent(in) :: xhi(3)

Coordinates of the top right corner

integer, intent(in) :: lo(3)

Array lower bound

integer, intent(in) :: hi(3)

Array upper bound

private pure subroutine block_obj_SubDivideBlock(coord, Nb, minlo, maxhi, sublo, subhi)

Computes the bounds of the sub-block form the bounds of the parent block. Each sub-block gets about the same number of grid points in each direction.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: coord(3)

Coordinates of MPI rank on MPI grid

integer, intent(in) :: Nb(3)

Number of blocks in each direction

integer, intent(in) :: minlo(3)

Global lo bounds

integer, intent(in) :: maxhi(3)

Global hi bounds

integer, intent(out) :: sublo(3)

lo bounds of sub-block

integer, intent(out) :: subhi(3)

hi bounds of sub-block

private impure subroutine block_obj_UpdateExtents(this)

Updates the dimensional extents of the block

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

private impure subroutine block_obj_UpdateGridGhostCells(this)

Updates the ghostcell values of local grid owned by the current MPI rank. Note that each MPI rank stores only its portion of the grid, thus needs to have proper ghostcell values.

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

private subroutine block_obj_UpdateGridGhostCells2(this, axis, idir)

[DEPRECATED] Updates the ghostcell values of local grid owned by the current MPI rank. Note that each MPI rank stores only its portion of the grid, thus needs to have proper ghostcell values. Although SetupUniformGrid fills the ghostcells of x/y/z, it does it assuming fixed grid spacing, which may not be the correct if a non-uniform grid is used.

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

real(kind=wp), intent(inout) :: axis(:)
integer, intent(in) :: idir

private pure subroutine block_obj_UpdateMidPoints(this)

Update mid points

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

private impure subroutine block_obj_UpdateSpacing(this)

Update grid spacing arrays

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(inout) :: this

A block object

private impure subroutine block_obj_Write(this, name)

Write block data using HDF5

Arguments

Type IntentOptional Attributes Name
class(block_obj), intent(in) :: this

A block object

character(len=*), intent(in) :: name

Name of file to write