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 Mesh2D 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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(SEMQuad), | intent(inout) | :: | myGeom | |||
| real(kind=prec), | intent(in) | :: | nodeCoords(1:2,1:nGeo+1,1:nGeo+1,1:nElem) | |||
| integer, | intent(in) | :: | nGeo | |||
| integer, | intent(in) | :: | quadrature | |||
| integer, | intent(in) | :: | nElem |
subroutine GenerateFromNodeCoords_SEMQuad(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 Mesh2D 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(SEMQuad),intent(inout) :: myGeom
real(prec),intent(in) :: nodeCoords(1:2,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
if(nElem <= 0) return
call myGeom%EnsureScratch(nGeo,quadrature,nElem)
! Set the element internal mesh locations
do iel = 1,nElem
do j = 1,nGeo+1
do i = 1,nGeo+1
myGeom%xMesh%interior(i,j,iel,1,1:2) = nodeCoords(1:2,i,j,iel)
enddo
enddo
enddo
call myGeom%xMesh%GridInterp(myGeom%x%interior)
endsubroutine GenerateFromNodeCoords_SEMQuad