Initialize the 3D DG model, then upload BC element/side arrays to GPU.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D), | intent(out) | :: | this | |||
| type(Mesh3D), | intent(in), | target | :: | mesh | ||
| type(SEMHex), | intent(in), | target | :: | geometry |
subroutine Init_DGModel3D(this,mesh,geometry)
!! Initialize the 3D DG model, then upload BC element/side arrays to GPU.
implicit none
class(DGModel3D),intent(out) :: this
type(Mesh3D),intent(in),target :: mesh
type(SEMHex),intent(in),target :: geometry
! Local
type(BoundaryCondition),pointer :: bc
call Init_DGModel3D_t(this,mesh,geometry)
! Upload hyperbolic BC element/side arrays to device
bc => this%hyperbolicBCs%head
do while(associated(bc))
if(bc%nBoundaries > 0) then
call gpuCheck(hipMalloc(bc%elements_gpu,sizeof(bc%elements)))
call gpuCheck(hipMemcpy(bc%elements_gpu,c_loc(bc%elements), &
sizeof(bc%elements),hipMemcpyHostToDevice))
call gpuCheck(hipMalloc(bc%sides_gpu,sizeof(bc%sides)))
call gpuCheck(hipMemcpy(bc%sides_gpu,c_loc(bc%sides), &
sizeof(bc%sides),hipMemcpyHostToDevice))
endif
bc => bc%next
enddo
! Upload parabolic BC element/side arrays to device
bc => this%parabolicBCs%head
do while(associated(bc))
if(bc%nBoundaries > 0) then
call gpuCheck(hipMalloc(bc%elements_gpu,sizeof(bc%elements)))
call gpuCheck(hipMemcpy(bc%elements_gpu,c_loc(bc%elements), &
sizeof(bc%elements),hipMemcpyHostToDevice))
call gpuCheck(hipMalloc(bc%sides_gpu,sizeof(bc%sides)))
call gpuCheck(hipMemcpy(bc%sides_gpu,c_loc(bc%sides), &
sizeof(bc%sides),hipMemcpyHostToDevice))
endif
bc => bc%next
enddo
endsubroutine Init_DGModel3D