subroutine GenerateFromMesh_SEMHex(myGeom,mesh)
implicit none
class(SEMHex),intent(inout) :: myGeom
type(Mesh3D),intent(in) :: mesh
! Local
integer :: iel
integer :: i,j,k
type(Lagrange),target :: meshToModel
type(Vector3D) :: 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 k = 1,mesh%nGeo+1
do j = 1,mesh%nGeo+1
do i = 1,mesh%nGeo+1
xMesh%interior(i,j,k,iel,1,1:3) = mesh%nodeCoords(1:3,i,j,k,iel)
enddo
enddo
enddo
enddo
call xMesh%GridInterp(myGeom%x%interior)
call myGeom%x%UpdateDevice()
call myGeom%x%BoundaryInterp()
call myGeom%x%UpdateHost()
call myGeom%CalculateMetricTerms()
call xMesh%Free()
call meshToModel%Free()
endsubroutine GenerateFromMesh_SEMHex