| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Vector2D), | intent(out) | :: | this | |||
| type(Lagrange), | intent(in), | target | :: | interp | ||
| integer, | intent(in) | :: | nVar | |||
| integer, | intent(in) | :: | nElem |
subroutine Init_Vector2D(this,interp,nVar,nElem)
implicit none
class(Vector2D),intent(out) :: this
type(Lagrange),target,intent(in) :: interp
integer,intent(in) :: nVar
integer,intent(in) :: nElem
! local
integer :: i
this%interp => interp
this%nVar = nVar
this%nElem = nElem
this%N = interp%N
this%M = interp%M
call this%MapArrays(interp%N+1,nVar,nElem)
allocate(this%meta(1:nVar))
allocate(this%eqn(1:2*nVar))
! Initialize equation parser
! This is done to prevent segmentation faults that arise
! when building with amdflang that are traced back to
! feqparse_functions.f90 : finalize routine
! When the equation parser is not initialized, the
! functions are not allocated, which I think are the
! source of the segfault - joe@fluidnumerics.com
do i = 1,2*nvar
this%eqn(i) = EquationParser('f=0',(/'x','y','z','t'/))
enddo
this%interior = 0.0_prec
this%boundary = 0.0_prec
this%boundarynormal = 0.0_prec
this%extBoundary = 0.0_prec
this%avgBoundary = 0.0_prec
call EnsureDeviceBuffers_Vector2D(this)
call this%UpdateDevice()
endsubroutine Init_Vector2D