mus_construction_module Module

\ref mus_construct "Creation of the data structures"


Uses

Used by

  • module~~mus_construction_module~~UsedByGraph module~mus_construction_module mus_construction_module module~mus_dynloadbal_module mus_dynLoadBal_module module~mus_dynloadbal_module->module~mus_construction_module module~mus_hvs_construction_module mus_hvs_construction_module module~mus_hvs_construction_module->module~mus_construction_module program~mus_harvesting mus_harvesting program~mus_harvesting->module~mus_construction_module program~mus_harvesting->module~mus_hvs_construction_module module~mus_program_module mus_program_module module~mus_program_module->module~mus_construction_module module~mus_program_module->module~mus_dynloadbal_module program~musubi musubi program~musubi->module~mus_program_module

Contents


Derived Types

type, private :: halo_commBitmask_type

Contains bitmask to reduce halo elements communciation links. This type is used only in init_levelBuffers

Components

TypeVisibilityAttributesNameInitial
logical, private, allocatable:: bitmask(:,:)

Bitmask of which direction to send, only directions of fluid neighbor need to be update Size: nDofs, nElems

type, private :: logical_array_type

Components

TypeVisibilityAttributesNameInitial
logical, private, allocatable:: val(:)

Subroutines

public subroutine mus_construct(scheme, geometry, params)

Initialize Musubi data strucutres based on data provided by Treelm

Read more…

Arguments

TypeIntentOptionalAttributesName
type(mus_scheme_type), intent(inout) :: scheme

scheme information including fluid, boundary and flow information

type(mus_geom_type), intent(inout) :: geometry

geometric information

type(mus_param_type), intent(in) :: params

run-time Parameters

public subroutine communicate_property(send, recv, property, flag, proc, pattern)

Initialize the communication buffers for a single level

Arguments

TypeIntentOptionalAttributesName
type(tem_communication_type), intent(inout) :: send

Communication structure to send and receive property

type(tem_communication_type), intent(inout) :: recv

Communication structure to send and receive property

integer(kind=long_k), intent(inout) :: property(:)

property to communicate

integer, intent(in) :: flag

communication flag

type(tem_comm_env_type), intent(in) :: proc

Process description to use.

type(tem_commPattern_type), intent(in) :: pattern

public subroutine calculate_nElems(levelDesc, proc, minLevel, maxLevel)

Calculate global and sum of levels numbers of elements

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_levelDesc_type), intent(in) :: levelDesc(minLevel:maxLevel)
type(tem_comm_env_type), intent(in) :: proc

mpi communication enviroment with mpi communicator

integer, intent(in) :: minLevel

Level range

integer, intent(in) :: maxLevel

public subroutine set_sendHaloBits(property, sendBuffer)

set the sendHalo bit for all fluid elements which are send to remote procs

Arguments

TypeIntentOptionalAttributesName
integer(kind=long_k), intent(inout) :: property(:)
type(tem_communication_type), intent(in) :: sendBuffer

private subroutine init_levelBuffers(send, recv, pdf, pattern, offset, requireAll, scheme, stat, comm, haloRequired)

Initialize the communication buffers for a single level

Arguments

TypeIntentOptionalAttributesName
type(tem_communication_type) :: send

Communication structure to initialize

type(tem_communication_type) :: recv

Communication structure to initialize

type(pdf_data_type), intent(in) :: pdf

iLevel pdf info with neigh array

type(tem_commPattern_type), intent(in) :: pattern

communication pattern

integer, intent(in) :: offset(2,eT_minRelevant:eT_maxRelevant)
logical, intent(in) :: requireAll

different place to take values from for interpolation

type(mus_scheme_type), intent(in) :: scheme

fluid, bnd and flow info

type(mus_statistics_type), intent(inout) :: stat

Statistics

integer, intent(in) :: comm

mpi communication enviroment with mpi communicator

logical, intent(in) :: haloRequired(:)

private subroutine set_halo_commLinks(scheme, minLevel, maxLevel, nBCs, comm_reduced, haloRequired)

Select the halo elements which require all links

Read more…

Arguments

TypeIntentOptionalAttributesName
type(mus_scheme_type), intent(in) :: scheme

scheme information including fluid, boundary and flow information

integer, intent(in) :: minLevel

Global information

integer, intent(in) :: maxLevel

Global information

integer, intent(in) :: nBCs

Global information

logical, intent(in) :: comm_reduced

reduced communication

type(logical_array_type), intent(inout), allocatable:: haloRequired(:)

private subroutine init_recvBuffers(me, myHalos, pattern, requireAll, haloRequired, halo_offset, scheme, stat, neigh, nSize)

Create the communication buffers

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_communication_type), intent(inout) :: me

receive communication buffer

type(halo_commBitmask_type), intent(inout) :: myHalos(:)

contains bitmask of my halos with array size of recv%nProcs

type(tem_commPattern_type), intent(in) :: pattern

communication pattern

logical, intent(in) :: requireAll

requires complete element information or only required links?

logical, intent(in) :: haloRequired(:)
integer, intent(in) :: halo_offset

Level descriptor

type(mus_scheme_type), intent(in) :: scheme

Scheme information on fluid, boundary and flow properties

type(mus_statistics_type), intent(inout) :: stat

Statistics

integer, intent(in) :: neigh(:)

PDF neighbor array

integer, intent(in) :: nSize

number of Elements in neigh array

private subroutine init_sendBuffers(send, remoteHalos, neigh, pattern, scheme, nSize)

Create the communication buffers

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_communication_type), intent(inout) :: send

send communication buffer

type(halo_commBitmask_type), intent(in) :: remoteHalos(:)

contains bitmask of remote halos with array size send%nProcs

integer, intent(in) :: neigh(:)

neighbor array for state array

type(tem_commPattern_type), intent(in) :: pattern

communication pattern

type(mus_scheme_type), intent(in) :: scheme

fluid, boundary and flow information

integer, intent(in) :: nSize

private subroutine update_BClists(scheme, minLevel, maxLevel, nBCs, LP, remove_solid)

Update the neighbor stencil positions for the Boundaries

Read more…

Arguments

TypeIntentOptionalAttributesName
type(mus_scheme_type), intent(inout) :: scheme

scheme information including fluid, boundary and flow information

integer, intent(in) :: minLevel
integer, intent(in) :: maxLevel
integer, intent(in) :: nBCs
integer, intent(in) :: LP(:)

Level Pointer

logical, intent(in) :: remove_solid

private subroutine finalize_BClist(scheme, proc, minLevel, maxLevel, nBCs)

Arguments

TypeIntentOptionalAttributesName
type(mus_scheme_type), intent(inout) :: scheme

scheme information including fluid, boundary and flow information

type(tem_comm_env_type), intent(in) :: proc

mpi communication enviroment with mpi communicator

integer, intent(in) :: minLevel
integer, intent(in) :: maxLevel
integer, intent(in) :: nBCs

private subroutine build_bcLevelPointer(bcLevelPointer, posInBndID, minBCID, levelPointer, bc_prop, tree, globBC)

Arguments

TypeIntentOptionalAttributesName
integer, intent(inout), allocatable:: bcLevelPointer(:)

levelPointer from posInBndID to globBC%elemLVl(:)%elem

integer, intent(in) :: posInBndID(:)

tree element position in boundaryID

integer, intent(in) :: minBCID(:)

minBCID for each element

integer, intent(in) :: levelPointer(:)

tree element position in levelDesc total list

type(tem_BC_prop_type), intent(in) :: bc_prop

boundary information from mesh

type(treelmesh_type), intent(in) :: tree

fluid tree from mesh

type(glob_boundary_type), intent(in) :: globBC(bc_prop%nBCtypes)

global boundary information

private subroutine setFieldBCNeigh(fieldBC, globBC, levelDesc, minLevel, maxLevel)

This routine sets field BC neigh array with position of neighbor element in the inward normal direction of boundary in the levelwise list. if valid 1st neighbor does not exist return current element position. if valid higher order neighbor does not exist return last valid neighbor

Arguments

TypeIntentOptionalAttributesName
type(boundary_type), intent(inout) :: fieldBC

field boundary with boundary neighbor info

type(glob_boundary_type), intent(in) :: globBC

boundaries for the elements with bnd property set

type(tem_levelDesc_type), intent(in) :: levelDesc(minLevel:maxLevel)

Level descriptor

integer, intent(in) :: minLevel

Level range

integer, intent(in) :: maxLevel

private subroutine build_BClists(globBC, tree, bc_prop, minLevel, maxLevel, layout, field, comm)

Assemble the level-wise list of elements which adhere to the boundary conditions.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(glob_boundary_type), intent(out), allocatable:: globBC(:)

boundaries for the elements with bnd property set

type(treelmesh_type), intent(in) :: tree

fluid tree from mesh

type(tem_BC_prop_type), intent(in) :: bc_prop

boundary information from mesh

integer, intent(in) :: minLevel

contains pdf global information

integer, intent(in) :: maxLevel

contains pdf global information

type(mus_scheme_layout_type), intent(in) :: layout

scheme layout

type(mus_field_type), intent(in) :: field(:)

field type

integer, intent(in) :: comm

mpi communication enviroment with mpi communicator

private subroutine countnBnds(globBC, boundaryID, tree, stencil, nBCs, comm)

Identify the number of boundary condition elements of each BC type and number of elements with multiple BC types. This is 1st step in Build_BClists

Arguments

TypeIntentOptionalAttributesName
type(glob_boundary_type), intent(inout) :: globBC(nBCs)

boundaries for the elements with bnd property set

integer(kind=long_k), intent(in) :: boundaryID(:,:)

boundary information from mesh

type(treelmesh_type), intent(in) :: tree

fluid tree from mesh

type(tem_stencilHeader_type), intent(in) :: stencil

stencil

integer, intent(in) :: nBCs

contains pdf global information

integer, intent(in) :: comm

mpi communication enviroment with mpi communicator

private subroutine allocateBCList(globBC, nBCs, minLevel, maxLevel, QQN)

Allocate BC lists, 2nd step in Build_BClists

Arguments

TypeIntentOptionalAttributesName
type(glob_boundary_type), intent(inout) :: globBC(nBCs)

boundaries for the elements with bnd property set

integer, intent(in) :: nBCs
integer, intent(in) :: minLevel
integer, intent(in) :: maxLevel
integer, intent(in) :: QQN

private subroutine assignBCList(tree, bc_prop, stencil, globBC)

This routine assigns the BC lists Run over all the elements with the property boundary and check each direction. Assign all common boundaries to the level-wise representation 3rd step in build_BCLists

Arguments

TypeIntentOptionalAttributesName
type(treelmesh_type), intent(in) :: tree

fluid tree from mesh

type(tem_BC_prop_type), intent(in) :: bc_prop

boundary information from mesh

type(tem_stencilHeader_type), intent(in) :: stencil

stencil

type(glob_boundary_type), intent(inout) :: globBC(:)

boundaries for the elements with bnd property set

private subroutine normalizeBC(nBCs, minLevel, maxLevel, globBC, layout, field, comm)

This routine normalizes the normal vectors of boundary elements including the corner elements as well as assigns the corresponding prevailing direction from the stencil

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: nBCs

number of boundaries

integer, intent(in) :: minLevel

number of boundaries

integer, intent(in) :: maxLevel

number of boundaries

type(glob_boundary_type), intent(inout) :: globBC(:)

boundaries for the elements with bnd property set

type(mus_scheme_layout_type), intent(in) :: layout

scheme layout

type(mus_field_type), intent(in) :: field(:)

field type

integer, intent(in) :: comm

mpi communication enviroment with mpi communicator

private subroutine mus_build_BCStencils(globBC, bc, prevailDir, prefix, minLevel, maxLevel, stencil_labels, grwStencil)

subroutine to find neighbours of element with individual (for each element) stencil definitions. Unique stencil label for boundary stencils are created with boundary label and stencil%cxDir therefore each stencil is limited to one boundary type

Arguments

TypeIntentOptionalAttributesName
type(glob_boundary_type), intent(in) :: globBC

boundaries for the elements with bnd property set

type(boundary_type), intent(inout) :: bc

field boundary with boundary neighbor info

real(kind=rk), intent(in) :: prevailDir(:,:)

scheme layout

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

field label

integer, intent(in) :: minLevel

min and max level

integer, intent(in) :: maxLevel

min and max level

type(dyn_labelarray_type), intent(inout) :: stencil_labels

dynamic array of stencil labels

type(grw_stencilheaderarray_type), intent(inout) :: grwStencil

growing array of stencils

private subroutine mus_build_IBMStencils(globIBM, layout, grwStencil)

This routine build and append IBM stencils to scheme stencil array

Arguments

TypeIntentOptionalAttributesName
type(mus_IBM_globType), intent(inout) :: globIBM

datatype to store the surface information

type(mus_scheme_layout_type), intent(inout) :: layout

scheme stencil layout

type(grw_stencilheaderarray_type), intent(inout) :: grwStencil

contains array of stencils

private subroutine mus_update_BcghostElem(minLevel, maxLevel, levelDesc, layout, bc_prop, globBC)

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: minLevel

Min and max level

integer, intent(in) :: maxLevel

Min and max level

type(tem_levelDesc_type), intent(inout) :: levelDesc(minLevel:maxLevel)

Level Descriptor

type(mus_scheme_layout_type), intent(in) :: layout

scheme layout

type(tem_BC_prop_type), intent(in) :: bc_prop

boundary information from mesh

type(glob_boundary_type), intent(inout) :: globBC(:)

boundaries for the elements with bnd property set

private subroutine mus_add_BcghostElem(levelDesc, stencil, bc_prop, globBC, nGhosts, offset, weight, iLevel)

Arguments

TypeIntentOptionalAttributesName
type(tem_levelDesc_type), intent(inout) :: levelDesc

Level Descriptor for iLevel

type(tem_stencilHeader_type), intent(in) :: stencil

stencil

type(tem_BC_prop_type), intent(in) :: bc_prop

boundary information from mesh

type(glob_boundary_type), intent(inout) :: globBC(:)

boundaries for the elements with bnd property set

integer :: nGhosts
integer, intent(in) :: offset
integer, intent(in) :: weight(stencil%QQN)
integer, intent(in) :: iLevel