GenerateFromMesh_Geometry1D Subroutine

public subroutine GenerateFromMesh_Geometry1D(myGeom, mesh)

Arguments

TypeIntentOptionalAttributesName
class(Geometry1D), intent(inout) :: myGeom
type(Mesh1D), intent(in) :: mesh

Contents


Source Code

  subroutine GenerateFromMesh_Geometry1D(myGeom,mesh)
    ! Generates the geometry for a 1-D mesh ( set of line segments )
    ! Assumes that mesh is using Gauss-Lobatto quadrature and the degree is given by mesh % nGeo
    implicit none
    class(Geometry1D),intent(inout) :: myGeom
    type(Mesh1D),intent(in) :: mesh
    ! Local
    integer :: iel,i,nid
    type(Lagrange),target :: meshToModel
    type(Scalar1D) :: 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
    nid = 1
    do iel = 1,mesh%nElem
      do i = 1,mesh%nGeo+1
        xMesh%interior(i,iel,1) = mesh%nodeCoords(nid)
        nid = nid+1
      enddo
    enddo

    ! Interpolate from the mesh hopr_nodeCoords to the geometry (Possibly not gauss_lobatto quadrature)
    call xMesh%GridInterp(myGeom%x%interior)
    call myGeom%x%UpdateDevice()
    call myGeom%x%BoundaryInterp()

    call myGeom%CalculateMetricTerms()

    call xMesh%Free()

    call meshToModel%Free()

  endsubroutine GenerateFromMesh_Geometry1D