subroutine SideExchange_MappedScalar1D(this,mesh)
implicit none
class(MappedScalar1D),intent(inout) :: this
type(Mesh1D),intent(inout) :: mesh
! Local
integer :: e1,e2,s1,s2
integer :: ivar
call gpuCheck(hipMemcpy(c_loc(this%boundary),this%boundary_gpu,sizeof(this%boundary),hipMemcpyDeviceToHost))
do ivar = 1,this%nvar
do e1 = 1,mesh%nElem
if(e1 == 1) then
s1 = 2
e2 = e1+1
s2 = 1
this%extBoundary(s1,e1,ivar) = this%boundary(s2,e2,ivar)
elseif(e1 == mesh%nElem) then
s1 = 1
e2 = e1-1
s2 = 2
this%extBoundary(s1,e1,ivar) = this%boundary(s2,e2,ivar)
else
s1 = 1
e2 = e1-1
s2 = 2
this%extBoundary(s1,e1,ivar) = this%boundary(s2,e2,ivar)
s1 = 2
e2 = e1+1
s2 = 1
this%extBoundary(s1,e1,ivar) = this%boundary(s2,e2,ivar)
endif
enddo
enddo
call gpuCheck(hipMemcpy(this%extboundary_gpu,c_loc(this%extboundary),sizeof(this%extboundary),hipMemcpyHostToDevice))
endsubroutine SideExchange_MappedScalar1D