Prolong (interpolate) a parent element's nodal solution onto its four children. uChildren(:,:,:,c) is the field on child c (ordering 1=SW,2=SE,3=NE,4=NW). Exact for the parent's degree-N polynomial representation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(Lagrange), | intent(in) | :: | interp | |||
| integer, | intent(in) | :: | nVar | |||
| real(kind=prec), | intent(in) | :: | uParent(1:interp%N+1,1:interp%N+1,1:nVar) | |||
| real(kind=prec), | intent(out) | :: | uChildren(1:interp%N+1,1:interp%N+1,1:nVar,1:4) |
subroutine ProlongToChildren(interp,nVar,uParent,uChildren)
!! Prolong (interpolate) a parent element's nodal solution onto its four children.
!! uChildren(:,:,:,c) is the field on child c (ordering 1=SW,2=SE,3=NE,4=NW). Exact for the
!! parent's degree-N polynomial representation.
implicit none
type(Lagrange),intent(in) :: interp
integer,intent(in) :: nVar
real(prec),intent(in) :: uParent(1:interp%N+1,1:interp%N+1,1:nVar)
real(prec),intent(out) :: uChildren(1:interp%N+1,1:interp%N+1,1:nVar,1:4)
! Local
integer :: c,v,Np
Np = interp%N+1
do concurrent(c=1:4,v=1:nVar)
block
integer :: i,j,ii,jj,kx,ky
real(prec) :: acc
real(prec) :: tmp(1:Np,1:Np) ! tmp(childX, parentY) after the x-direction pass
kx = transferAxc(c)+1
ky = transferAyc(c)+1
! x-direction: tmp(i,jj) = sum_ii mortarR(ii,i,kx) * uParent(ii,jj)
do j = 1,Np
do i = 1,Np
acc = 0.0_prec
do ii = 1,Np
acc = acc+interp%mortarR(ii,i,kx)*uParent(ii,j,v)
enddo
tmp(i,j) = acc
enddo
enddo
! y-direction: uChild(i,j) = sum_jj mortarR(jj,j,ky) * tmp(i,jj)
do j = 1,Np
do i = 1,Np
acc = 0.0_prec
do jj = 1,Np
acc = acc+interp%mortarR(jj,j,ky)*tmp(i,jj)
enddo
uChildren(i,j,v,c) = acc
enddo
enddo
endblock
enddo
endsubroutine ProlongToChildren