Init_Mesh2D Subroutine

public subroutine Init_Mesh2D(this, nGeo, nElem, nSides, nNodes, nBCs)

Arguments

TypeIntentOptionalAttributesName
class(Mesh2D), intent(inout) :: this
integer, intent(in) :: nGeo
integer, intent(in) :: nElem
integer, intent(in) :: nSides
integer, intent(in) :: nNodes
integer, intent(in) :: nBCs

Calls

proc~~init_mesh2d~~CallsGraph proc~init_mesh2d Init_Mesh2D interface~hipmalloc hipMalloc proc~init_mesh2d->interface~hipmalloc proc~gpucheck gpuCheck proc~init_mesh2d->proc~gpucheck

Contents

Source Code


Source Code

  subroutine Init_Mesh2D(this,nGeo,nElem,nSides,nNodes,nBCs)
    implicit none
    class(Mesh2D),intent(inout) :: this
    integer,intent(in) :: nGeo
    integer,intent(in) :: nElem
    integer,intent(in) :: nSides
    integer,intent(in) :: nNodes
    integer,intent(in) :: nBCs
    ! Local
    integer :: i,j,l

    this%nGeo = nGeo
    this%nElem = nElem
    this%nGlobalElem = nElem
    this%nNodes = nNodes
    this%nSides = nSides
    this%nCornerNodes = 0
    this%nUniqueNodes = 0
    this%nUniqueSides = 0
    this%nBCs = nBCs

    allocate(this%elemInfo(1:6,1:nElem))
    allocate(this%sideInfo(1:5,1:4,1:nElem))
    allocate(this%nodeCoords(1:2,1:nGeo+1,1:nGeo+1,1:nElem))
    allocate(this%globalNodeIDs(1:nGeo+1,1:nGeo+1,1:nElem))
    allocate(this%CGNSCornerMap(1:2,1:4))
    allocate(this%CGNSSideMap(1:2,1:4))
    allocate(this%BCType(1:4,1:nBCs))

    allocate(this%BCNames(1:nBCs))

    ! Create lookup tables to assist with connectivity generation
    this%CGNSCornerMap(1:2,1) = (/1,1/)
    this%CGNSCornerMap(1:2,2) = (/nGeo+1,1/)
    this%CGNSCornerMap(1:2,3) = (/nGeo+1,nGeo+1/)
    this%CGNSCornerMap(1:2,4) = (/1,nGeo+1/)

    ! Maps from local corner node id to CGNS side
    this%CGNSSideMap(1:2,1) = (/1,2/)
    this%CGNSSideMap(1:2,2) = (/2,3/)
    this%CGNSSideMap(1:2,3) = (/4,3/)
    this%CGNSSideMap(1:2,4) = (/1,4/)

    call gpuCheck(hipMalloc(this%sideInfo_gpu,sizeof(this%sideInfo)))

  endsubroutine Init_Mesh2D