GenerateFromNodeCoords_SEMHex Subroutine

public subroutine GenerateFromNodeCoords_SEMHex(myGeom, nodeCoords, nGeo, quadrature, nElem)

Generate geometry for nElem elements directly from their mesh node coordinates (AMR Stage 6c). GenerateFromMesh is a thin wrapper over this.

Taking the coordinates rather than a Mesh3D is what allows the adaptive loop to generate a COMPACTED set of elements - just the ones an epoch actually changed - without teaching the shared data classes about element subsets. The generation loops still run over every element they are given; the saving comes from being given fewer.

Arguments

TypeIntentOptionalAttributesName
class(SEMHex), intent(inout) :: myGeom
real(kind=prec), intent(in) :: nodeCoords(1:3,1:nGeo+1,1:nGeo+1,1:nGeo+1,1:nElem)
integer, intent(in) :: nGeo
integer, intent(in) :: quadrature
integer, intent(in) :: nElem

Contents


Source Code

  subroutine GenerateFromNodeCoords_SEMHex(myGeom,nodeCoords,nGeo,quadrature,nElem)
    !! Generate geometry for nElem elements directly from their mesh node coordinates (AMR Stage
    !! 6c). GenerateFromMesh is a thin wrapper over this.
    !!
    !! Taking the coordinates rather than a Mesh3D is what allows the adaptive loop to generate a
    !! COMPACTED set of elements - just the ones an epoch actually changed - without teaching the
    !! shared data classes about element subsets. The generation loops still run over every element
    !! they are given; the saving comes from being given fewer.
    implicit none
    class(SEMHex),intent(inout) :: myGeom
    real(prec),intent(in) :: nodeCoords(1:3,1:nGeo+1,1:nGeo+1,1:nGeo+1,1:nElem)
    integer,intent(in) :: nGeo
    integer,intent(in) :: quadrature
    integer,intent(in) :: nElem
    ! Local
    integer :: iel,i,j,k

    if(nElem <= 0) return

    call myGeom%EnsureScratch(nGeo,quadrature,nElem)

    ! Set the element internal mesh locations
    do iel = 1,nElem
      do k = 1,nGeo+1
        do j = 1,nGeo+1
          do i = 1,nGeo+1
            myGeom%xMesh%interior(i,j,k,iel,1,1:3) = nodeCoords(1:3,i,j,k,iel)
          enddo
        enddo
      enddo
    enddo

    call myGeom%xMesh%GridInterp(myGeom%x%interior)

  endsubroutine GenerateFromNodeCoords_SEMHex