Device-resident staging for the AMR solution transfer (Stage 6a). These buffers persist across adaptation epochs and grow monotonically, so a settled run performs no allocation here at all; xferAllocBytes / planAllocElem record the current capacity.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(MappedScalar2D), | public | :: | dSdt | ||||
| real(kind=prec), | public | :: | dt | ||||
| real(kind=prec), | public | :: | entropy | ||||
| type(MappedVector2D), | public | :: | flux | ||||
| type(MappedScalar2D), | public | :: | fluxDivergence | ||||
| type(SEMQuad), | public, | pointer | :: | geometry | => | null() | |
| logical, | public | :: | gradient_enabled | = | .false. | ||
| type(BoundaryConditionList), | public | :: | hyperbolicBCs | ||||
| integer, | public | :: | ioIterate | = | 0 | ||
| type(Mesh2D), | public, | pointer | :: | mesh | => | null() | |
| integer, | public | :: | nstepped | = | 0 | ||
| integer, | public | :: | nvar | ||||
| type(BoundaryConditionList), | public | :: | parabolicBCs | Pre-regrid copy of the solution, held between StageSolutionForTransfer and ApplyTransferPlan so that Regrid is free to release the storage it was read from. The base implementation stages on the host; the GPU backend overrides both procedures and stages device-side instead, leaving this unallocated. |
|||
| integer, | public | :: | planAllocElem | = | 0 | new-element count the plan buffers are sized for |
|
| integer, | public | :: | planAllocStride | = | 0 | plan%path leading dimension they are sized for |
|
| logical, | public | :: | prescribed_bcs_enabled | = | .true. | ||
| type(MappedScalar2D), | public | :: | solution | ||||
| type(MappedVector2D), | public | :: | solutionGradient | ||||
| type(MappedScalar2D), | public | :: | source | ||||
| real(kind=prec), | public | :: | t | ||||
| logical, | public | :: | tecplot_enabled | = | .true. | ||
| procedure(SELF_timeIntegrator), | public, | pointer | :: | timeIntegrator | => | Euler_timeIntegrator | |
| real(kind=prec), | public, | allocatable | :: | transferStage(:,:,:,:) | |||
| type(MappedScalar2D), | public | :: | workSol | ||||
| integer(kind=c_size_t), | public | :: | xferAllocBytes | = | 0 | ||
| type(c_ptr), | public | :: | xferDepth_gpu | = | c_null_ptr | plan%depth |
|
| type(c_ptr), | public | :: | xferElem_gpu | = | c_null_ptr | plan%sourceElem |
|
| type(c_ptr), | public | :: | xferFamily_gpu | = | c_null_ptr | plan%family |
|
| type(c_ptr), | public | :: | xferKind_gpu | = | c_null_ptr | plan%sourceKind |
|
| integer, | public | :: | xferNOld | = | 0 | element count of the staged field (its device stride) |
|
| type(c_ptr), | public | :: | xferOld_gpu | = | c_null_ptr | pre-regrid solution, staged device-side |
|
| type(c_ptr), | public | :: | xferPath_gpu | = | c_null_ptr | plan%path |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| integer(kind=HID_T), | intent(in) | :: | fileid |
Apply the transfer plan on the device (Stage 6a), writing solution%interior_gpu directly and moving no solution data across the PCIe/xGMI link.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this | |||
| type(TransferPlan2D), | intent(in), | target | :: | plan | ||
| type(Lagrange), | intent(in) | :: | interp | |||
| integer, | intent(in) | :: | eFirst | |||
| integer, | intent(in) | :: | eLast | |||
| real(kind=prec), | intent(in), | optional | :: | uGlobal(:,:,:,:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | tn |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this |
Forward steps the model using the associated tendency procedure and time integrator
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | tn | |||
| real(kind=prec), | intent(in) | :: | dt | |||
| real(kind=prec), | intent(in) | :: | ioInterval |
Free the 2D DG model, including GPU BC arrays.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this |
Returns the current simulation time stored in the model % t attribute
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(out) | :: | t |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this |
Initialize the 2D DG model, then upload BC element/side arrays to GPU.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(out) | :: | this | |||
| type(Mesh2D), | intent(in), | target | :: | mesh | ||
| type(SEMQuad), | intent(in), | target | :: | geometry |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | tn |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | tn |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | tn |
Scan the mesh sideInfo and populate the elements/sides arrays for each registered boundary condition.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D_t), | intent(inout) | :: | this |
PostStepHook is a template routine invoked by the time integrators once immediately after each completed time step (after this%t has advanced by this%dt). The default implementation is a no-op.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this |
PreStepHook is a template routine invoked by the time integrators once immediately before each time step is taken (before any Runge-Kutta stages of that step). The default implementation is a no-op.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this |
PreTendencyHook is a template routine that is used to house any additional calculations that you want to execute at the beginning of the tendency calculation routine. This default PreTendencyHook simply returns back to the caller without executing any instructions
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D_t), | intent(inout) | :: | this | |||
| character, | intent(in) | :: | fileName |
GPU regrid: release the device copies of the old boundary-condition element/side arrays, rebuild the model storage and BC maps on the new mesh (base Regrid), then upload the new BC arrays to the device - the same device bookkeeping Init/Free do around the base Init/Free.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this | |||
| type(Mesh2D), | intent(in), | target | :: | mesh | ||
| type(SEMQuad), | intent(in), | target | :: | geometry |
Base method for reporting the entropy of a model to stdout. Only override this procedure if additional reporting is needed. Alternatively, if you think additional reporting would be valuable for all models, open a pull request with modifications to this base method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this |
Base method for reporting the entropy of a model to stdout. Only override this procedure if additional reporting is needed. Alternatively, if you think additional reporting would be valuable for all models, open a pull request with modifications to this base method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D_t), | intent(inout) | :: | this |
Method that can be overridden by users to report their own custom metrics after file io
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this |
Apply registered boundary conditions for the solution. Each boundary condition method loops over its own boundary faces.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D_t), | intent(inout) | :: | this |
Apply registered boundary conditions for the solution gradient. Each boundary condition method loops over its own boundary faces.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this |
Sets the model % t attribute with the provided simulation time
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | t |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D_t), | intent(inout) | :: | this | |||
| character, | intent(in) | :: | eqnChar(1:this%solution%nVar) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D_t), | intent(inout) | :: | this | |||
| type(EquationParser), | intent(in) | :: | eqn(1:this%solution%nVar) |
Sets the time integrator method, using a character input
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| character, | intent(in) | :: | integrator |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this |
Stage the pre-regrid solution on the DEVICE (Stage 6a), replacing the base implementation's device-to-host copy of the whole field. Regrid subsequently releases solution%interior_gpu, so the field is copied device-to-device into a buffer this model owns; ApplyTransferPlan then reads it from there.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | m |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | m |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | m |
Computes a solution update as , where dt is either provided through the interface or taken as the Model's stored time step size (model % dt)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in), | optional | :: | dt |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D_t), | intent(inout) | :: | this | |||
| character, | intent(in), | optional | :: | fileName |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel2D_t), | intent(inout) | :: | this | |||
| character, | intent(in), | optional | :: | filename |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar,1:2) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar,1:3) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | sL(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | sR(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | nhat |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | sL(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | sR(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar,1:2) | |||
| real(kind=prec), | intent(in) | :: | nhat(1:2) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | sL(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | sR(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar,1:3) | |||
| real(kind=prec), | intent(in) | :: | nhat(1:3) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar,1:2) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar,1:3) |
type,extends(DGModel2D_t) :: DGModel2D
!! Device-resident staging for the AMR solution transfer (Stage 6a). These buffers persist
!! across adaptation epochs and grow monotonically, so a settled run performs no allocation
!! here at all; xferAllocBytes / planAllocElem record the current capacity.
type(c_ptr) :: xferOld_gpu = c_null_ptr !! pre-regrid solution, staged device-side
integer(c_size_t) :: xferAllocBytes = 0
type(c_ptr) :: xferKind_gpu = c_null_ptr !! plan%sourceKind
type(c_ptr) :: xferElem_gpu = c_null_ptr !! plan%sourceElem
type(c_ptr) :: xferFamily_gpu = c_null_ptr !! plan%family
type(c_ptr) :: xferDepth_gpu = c_null_ptr !! plan%depth
type(c_ptr) :: xferPath_gpu = c_null_ptr !! plan%path
integer :: planAllocElem = 0 !! new-element count the plan buffers are sized for
integer :: planAllocStride = 0 !! plan%path leading dimension they are sized for
integer :: xferNOld = 0 !! element count of the staged field (its device stride)
contains
procedure :: Init => Init_DGModel2D
procedure :: Free => Free_DGModel2D
procedure :: Regrid => Regrid_DGModel2D
procedure :: StageSolutionForTransfer => StageSolutionForTransfer_DGModel2D
procedure :: ApplyTransferPlan => ApplyTransferPlan_DGModel2D
procedure :: UpdateSolution => UpdateSolution_DGModel2D
procedure :: CalculateEntropy => CalculateEntropy_DGModel2D
procedure :: BoundaryFlux => BoundaryFlux_DGModel2D
procedure :: FluxMethod => fluxmethod_DGModel2D
procedure :: SourceMethod => sourcemethod_DGModel2D
procedure :: UpdateGRK2 => UpdateGRK2_DGModel2D
procedure :: UpdateGRK3 => UpdateGRK3_DGModel2D
procedure :: UpdateGRK4 => UpdateGRK4_DGModel2D
procedure :: CalculateSolutionGradient => CalculateSolutionGradient_DGModel2D
procedure :: CalculateTendency => CalculateTendency_DGModel2D
endtype DGModel2D