subroutine GenerateFromMesh_SEMQuad(myGeom,mesh)
implicit none
class(SEMQuad),intent(inout) :: myGeom
type(Mesh2D),intent(in) :: mesh
! Local
integer :: iel
integer :: i,j
type(Lagrange),target :: meshToModel
type(Vector2D) :: xMesh
call meshToModel%Init(mesh%nGeo, &
mesh%quadrature, &
myGeom%x%interp%N, &
myGeom%x%interp%controlNodeType)
call xMesh%Init(meshToModel,1,mesh%nElem)
! Set the element internal mesh locations
do iel = 1,mesh%nElem
do j = 1,mesh%nGeo+1
do i = 1,mesh%nGeo+1
xMesh%interior(i,j,iel,1,1:2) = mesh%nodeCoords(1:2,i,j,iel)
enddo
enddo
enddo
call xMesh%GridInterp(myGeom%x%interior)
call myGeom%x%UpdateDevice()
call myGeom%x%BoundaryInterp() ! Boundary interp will run on GPU if enabled, hence why we close in update host/device
call myGeom%x%UpdateHost()
call myGeom%CalculateMetricTerms()
call xMesh%Free()
call meshToModel%Free()
endsubroutine GenerateFromMesh_SEMQuad