SELF_DGModel2D Module


Uses

  • module~~self_dgmodel2d~2~~UsesGraph module~self_dgmodel2d~2 SELF_DGModel2D module~self_dgmodel2d_t SELF_DGModel2D_t module~self_dgmodel2d~2->module~self_dgmodel2d_t module~self_gpu SELF_GPU module~self_dgmodel2d~2->module~self_gpu iso_fortran_env iso_fortran_env module~self_dgmodel2d~2->iso_fortran_env module~self_mesh_2d SELF_Mesh_2D module~self_dgmodel2d~2->module~self_mesh_2d module~self_transferplan_2d SELF_TransferPlan_2D module~self_dgmodel2d~2->module~self_transferplan_2d module~self_boundaryconditions SELF_BoundaryConditions module~self_dgmodel2d~2->module~self_boundaryconditions module~self_gpuinterfaces SELF_GPUInterfaces module~self_dgmodel2d~2->module~self_gpuinterfaces module~self_geometry_2d SELF_Geometry_2D module~self_dgmodel2d~2->module~self_geometry_2d module~self_gpu_enums~2 SELF_GPU_enums module~self_dgmodel2d~2->module~self_gpu_enums~2 module~self_dgmodel2d_t->iso_fortran_env module~self_dgmodel2d_t->module~self_mesh_2d module~self_dgmodel2d_t->module~self_transferplan_2d module~self_dgmodel2d_t->module~self_boundaryconditions module~self_dgmodel2d_t->module~self_geometry_2d FEQParse FEQParse module~self_dgmodel2d_t->FEQParse module~self_mappedscalar_2d SELF_MappedScalar_2D module~self_dgmodel2d_t->module~self_mappedscalar_2d module~self_supportroutines SELF_SupportRoutines module~self_dgmodel2d_t->module~self_supportroutines module~self_hdf5 SELF_HDF5 module~self_dgmodel2d_t->module~self_hdf5 module~self_metadata SELF_Metadata module~self_dgmodel2d_t->module~self_metadata module~self_mappedvector_2d~2 SELF_MappedVector_2D module~self_dgmodel2d_t->module~self_mappedvector_2d~2 HDF5 HDF5 module~self_dgmodel2d_t->HDF5 module~self_solutionmigration SELF_SolutionMigration module~self_dgmodel2d_t->module~self_solutionmigration module~self_model SELF_Model module~self_dgmodel2d_t->module~self_model module~self_gpu->module~self_gpu_enums~2 iso_c_binding iso_c_binding module~self_gpu->iso_c_binding module~self_mesh_2d_t SELF_Mesh_2D_t module~self_mesh_2d->module~self_mesh_2d_t module~self_quadtreemesh_2d SELF_QuadTreeMesh_2D module~self_transferplan_2d->module~self_quadtreemesh_2d module~self_lagrange~2 SELF_Lagrange module~self_transferplan_2d->module~self_lagrange~2 module~self_solutiontransfer_2d SELF_SolutionTransfer_2D module~self_transferplan_2d->module~self_solutiontransfer_2d module~self_constants SELF_Constants module~self_transferplan_2d->module~self_constants module~self_boundaryconditions->module~self_supportroutines module~self_boundaryconditions->module~self_metadata module~self_boundaryconditions->iso_c_binding module~self_gpuinterfaces->module~self_gpu module~self_gpuinterfaces->iso_c_binding module~self_geometry_2d->module~self_mesh_2d module~self_scalar_2d~2 SELF_Scalar_2D module~self_geometry_2d->module~self_scalar_2d~2 module~self_geometry_2d->module~self_supportroutines module~self_data SELF_Data module~self_geometry_2d->module~self_data module~self_geometry_2d->module~self_lagrange~2 module~self_vector_2d SELF_Vector_2D module~self_geometry_2d->module~self_vector_2d module~self_geometry_2d->module~self_constants module~self_tensor_2d SELF_Tensor_2D module~self_geometry_2d->module~self_tensor_2d module~self_gpu_enums~2->iso_c_binding module~self_quadtreemesh_2d->module~self_mesh_2d module~self_quadtreemesh_2d->module~self_lagrange~2 module~self_quadtreemesh_2d->module~self_constants module~self_refinementprimitives_2d SELF_RefinementPrimitives_2D module~self_quadtreemesh_2d->module~self_refinementprimitives_2d module~self_scalar_2d~2->iso_c_binding module~self_scalar_2d~2->module~self_constants module~self_scalar_2d_t SELF_Scalar_2D_t module~self_scalar_2d~2->module~self_scalar_2d_t module~self_mappedscalar_2d_t SELF_MappedScalar_2D_t module~self_mappedscalar_2d->module~self_mappedscalar_2d_t module~self_supportroutines->iso_fortran_env module~self_supportroutines->module~self_constants module~self_hdf5->iso_fortran_env module~self_hdf5->HDF5 module~self_hdf5->module~self_constants mpi mpi module~self_hdf5->mpi module~self_metadata->module~self_hdf5 module~self_metadata->HDF5 module~self_mappedvector_2d_t SELF_MappedVector_2D_t module~self_mappedvector_2d~2->module~self_mappedvector_2d_t module~self_data->FEQParse module~self_data->module~self_hdf5 module~self_data->module~self_metadata module~self_data->iso_c_binding module~self_data->module~self_lagrange~2 module~self_data->HDF5 module~self_data->module~self_constants module~self_lagrange~2->iso_fortran_env module~self_lagrange~2->iso_c_binding module~self_lagrange~2->module~self_constants module~self_lagrange_t SELF_Lagrange_t module~self_lagrange~2->module~self_lagrange_t module~self_mesh_2d_t->module~self_supportroutines module~self_mesh_2d_t->module~self_hdf5 module~self_mesh_2d_t->iso_c_binding module~self_mesh_2d_t->module~self_lagrange~2 module~self_mesh_2d_t->HDF5 module~self_mesh_2d_t->module~self_constants module~self_mesh SELF_Mesh module~self_mesh_2d_t->module~self_mesh module~self_domaindecomposition SELF_DomainDecomposition module~self_mesh_2d_t->module~self_domaindecomposition module~self_quadrature SELF_Quadrature module~self_mesh_2d_t->module~self_quadrature module~self_vector_2d_t SELF_Vector_2D_t module~self_vector_2d->module~self_vector_2d_t module~self_solutiontransfer_2d->module~self_lagrange~2 module~self_solutiontransfer_2d->module~self_constants module~self_solutionmigration->iso_fortran_env module~self_solutionmigration->module~self_constants module~self_solutionmigration->mpi module~self_solutionmigration->module~self_domaindecomposition module~self_model->FEQParse module~self_model->module~self_supportroutines module~self_model->module~self_hdf5 module~self_model->module~self_metadata module~self_model->HDF5 module~self_constants->iso_fortran_env module~self_constants->iso_c_binding module~self_tensor_2d_t SELF_Tensor_2D_t module~self_tensor_2d->module~self_tensor_2d_t module~self_refinementprimitives_2d->module~self_lagrange~2 module~self_refinementprimitives_2d->module~self_constants module~self_mappedscalar_2d_t->module~self_mesh_2d module~self_mappedscalar_2d_t->module~self_geometry_2d module~self_mappedscalar_2d_t->module~self_scalar_2d~2 module~self_mappedscalar_2d_t->FEQParse module~self_mappedscalar_2d_t->iso_c_binding module~self_mappedscalar_2d_t->module~self_lagrange~2 module~self_mappedscalar_2d_t->module~self_constants module~self_mappedscalar_2d_t->module~self_tensor_2d module~self_mappedscalar_2d_t->module~self_domaindecomposition module~self_mappedvector_2d_t->module~self_mesh_2d module~self_mappedvector_2d_t->module~self_geometry_2d module~self_mappedvector_2d_t->FEQParse module~self_mappedvector_2d_t->iso_c_binding module~self_mappedvector_2d_t->module~self_lagrange~2 module~self_mappedvector_2d_t->module~self_vector_2d module~self_mappedvector_2d_t->module~self_constants module~self_mappedvector_2d_t->module~self_tensor_2d module~self_mappedvector_2d_t->module~self_domaindecomposition module~self_scalar_2d_t->FEQParse module~self_scalar_2d_t->module~self_hdf5 module~self_scalar_2d_t->module~self_metadata module~self_scalar_2d_t->iso_c_binding module~self_scalar_2d_t->module~self_data module~self_scalar_2d_t->module~self_lagrange~2 module~self_scalar_2d_t->HDF5 module~self_scalar_2d_t->module~self_constants module~self_datapool SELF_DataPool module~self_scalar_2d_t->module~self_datapool module~self_lagrange_t->iso_fortran_env module~self_lagrange_t->module~self_supportroutines module~self_lagrange_t->module~self_hdf5 module~self_lagrange_t->iso_c_binding module~self_lagrange_t->HDF5 module~self_lagrange_t->module~self_constants module~self_lagrange_t->module~self_quadrature module~self_mesh->iso_c_binding module~self_mesh->module~self_constants module~self_mesh->module~self_domaindecomposition module~self_domaindecomposition_t SELF_DomainDecomposition_t module~self_domaindecomposition->module~self_domaindecomposition_t module~self_quadrature->iso_fortran_env module~self_quadrature->module~self_constants module~self_vector_2d_t->FEQParse module~self_vector_2d_t->module~self_hdf5 module~self_vector_2d_t->module~self_metadata module~self_vector_2d_t->iso_c_binding module~self_vector_2d_t->module~self_data module~self_vector_2d_t->module~self_lagrange~2 module~self_vector_2d_t->HDF5 module~self_vector_2d_t->module~self_constants module~self_vector_2d_t->module~self_datapool module~self_tensor_2d_t->FEQParse module~self_tensor_2d_t->module~self_hdf5 module~self_tensor_2d_t->module~self_metadata module~self_tensor_2d_t->iso_c_binding module~self_tensor_2d_t->module~self_data module~self_tensor_2d_t->module~self_lagrange~2 module~self_tensor_2d_t->HDF5 module~self_tensor_2d_t->module~self_constants module~self_tensor_2d_t->module~self_datapool module~self_datapool->module~self_constants module~self_domaindecomposition_t->module~self_supportroutines module~self_domaindecomposition_t->iso_c_binding module~self_domaindecomposition_t->module~self_lagrange~2 module~self_domaindecomposition_t->module~self_constants module~self_domaindecomposition_t->mpi

Contents


Derived Types

type, public, 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.

Components

TypeVisibilityAttributesNameInitial
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 :: nUnmappedBoundaries =0

The first unregistered bcid found, and meaningful only when nUnmappedBoundaries > 0: -1 is itself a legal bcid, so it cannot double as an "absent" marker.

integer, public :: nstepped =0
integer, public :: nvar
type(BoundaryConditionList), public :: parabolicBCs

Mesh boundary edges whose sideInfo(5) boundary condition id matches no registered boundary condition, counted over the whole domain by MapBoundaryConditions and summed across ranks. Nothing writes solution%extBoundary on such an edge, so the Riemann solver reads zeros at t = 0 and stale values afterwards. ReportUnmappedBoundaries warns about them once, from the top of ForwardStep.

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(:,:,:,:)

Migrated old-element window, held between MigrateOldWindow and ApplyTransferPlan on the multi-rank path: the contiguous run of OLD elements this rank's new element range references. Flat, because it is viewed through a rank-remapped pointer whose element lower bound is the window's first GLOBAL old element index - the numbering the transfer plan uses. Persistent and grow-only, so a settled adapting run allocates nothing here. The GPU backend overrides the migration and keeps the window in device memory instead, leaving this unallocated.

logical, public :: unmappedBoundariesReported =.false.

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 :: unmappedBoundaryID =-1
real(kind=prec), public, allocatable:: winStage(:)
integer, public :: winStageFirst =0

global old index of winStage's first element

integer, public :: winStageN =0

window element count; 0 means no window is migrated

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) Migrated old-element window, device-resident: the contiguous run of OLD elements this rank's new element range references, assembled by MigrateOldWindow and consumed by ApplyTransferPlan. Its own capacity and lifecycle, separate from xferOld_gpu, because the two have different lifetimes and different sizes - a window is the hull of a rank's new range in the OLD numbering and can be larger than the local old field - and because keeping them apart is what lets an unpaired stage/migrate be caught rather than silently served.

integer, public :: xferNWin =0

window element count (its device stride); 0 means no window

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

integer(kind=c_size_t), public :: xferWinBytes =0

current capacity, grown but never shrunk

integer, public :: xferWinFirst =0

global old index of the window's first element

type(c_ptr), public :: xferWin_gpu =c_null_ptr

Type-Bound Procedures

procedure, public :: AdditionalFree => AdditionalFree_Model
procedure, public :: AdditionalInit => AdditionalInit_Model
procedure, public :: AdditionalOutput => AdditionalOutput_Model
procedure, public :: ApplyTransferPlan => ApplyTransferPlan_DGModel2D
procedure, public :: BoundaryFlux => BoundaryFlux_DGModel2D
procedure, public :: CalculateEntropy => CalculateEntropy_DGModel2D
procedure, public :: CalculateSolutionGradient => CalculateSolutionGradient_DGModel2D
procedure, public :: CalculateTendency => CalculateTendency_DGModel2D
procedure, public :: DownloadOldWindow => DownloadOldWindow_DGModel2D
procedure, public :: Euler_timeIntegrator
procedure, public :: FluxMethod => fluxmethod_DGModel2D
procedure, public :: ForwardStep => ForwardStep_Model
procedure, public :: Free => Free_DGModel2D
procedure, public :: GetSimulationTime
procedure, public :: IncrementIOCounter
procedure, public :: Init => Init_DGModel2D
procedure, public :: LowStorageRK2_timeIntegrator
procedure, public :: LowStorageRK3_timeIntegrator
procedure, public :: LowStorageRK4_timeIntegrator
procedure, public :: MapBoundaryConditions => MapBoundaryConditions_DGModel2D_t
procedure, public :: MigrateOldWindow => MigrateOldWindow_DGModel2D
procedure, public :: PostStepHook => PostStepHook_Model
procedure, public :: PreStepHook => PreStepHook_Model
procedure, public :: PreTendencyHook => PreTendencyHook_Model
procedure, public :: PrintType => PrintType_Model
procedure, public :: ReadModel => Read_DGModel2D_t
procedure, public :: Regrid => Regrid_DGModel2D
procedure, public :: ReportEntropy => ReportEntropy_Model
procedure, public :: ReportMetrics => ReportMetrics_DGModel2D_t
procedure, public :: ReportUnmappedBoundaries => ReportUnmappedBoundaries_DGModel2D_t
procedure, public :: ReportUserMetrics => ReportUserMetrics_Model
procedure, public :: SetBoundaryCondition => setboundarycondition_DGModel2D_t
procedure, public :: SetGradientBoundaryCondition => setgradientboundarycondition_DGModel2D_t
procedure, public :: SetMetadata => SetMetadata_DGModel2D_t
procedure, public :: SetNumberOfVariables => SetNumberOfVariables_Model
procedure, public :: SetSimulationTime
generic, public :: SetSolution => SetSolutionFromChar_DGModel2D_t, SetSolutionFromEqn_DGModel2D_t
generic, public :: SetTimeIntegrator => SetTimeIntegrator_withChar
procedure, public :: SourceMethod => sourcemethod_DGModel2D
procedure, public :: StageSolutionForTransfer => StageSolutionForTransfer_DGModel2D
procedure, public :: UpdateGRK2 => UpdateGRK2_DGModel2D
procedure, public :: UpdateGRK3 => UpdateGRK3_DGModel2D
procedure, public :: UpdateGRK4 => UpdateGRK4_DGModel2D
procedure, public :: UpdateSolution => UpdateSolution_DGModel2D
procedure, public :: WriteModel => Write_DGModel2D_t
procedure, public :: WriteTecplot => WriteTecplot_DGModel2D_t
procedure, public :: entropy_func => entropy_func_Model
procedure, public :: flux1D => flux1d_Model
procedure, public :: flux2D => flux2d_Model
procedure, public :: flux3D => flux3d_Model
procedure, public :: riemannflux1d => riemannflux1d_Model
procedure, public :: riemannflux2d => riemannflux2d_Model
procedure, public :: riemannflux3d => riemannflux3d_Model
procedure, public :: source1d => source1d_Model
procedure, public :: source2d => source2d_Model
procedure, public :: source3d => source3d_Model

Subroutines

public subroutine ApplyTransferPlan_DGModel2D(this, plan, interp, eFirst, eLast, uGlobal, oldFirst)

Apply the transfer plan on the device, writing solution%interior_gpu directly and moving no solution data across the PCIe/xGMI link - on any number of ranks.

Read more…

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout), target:: 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 contiguous:: uGlobal(:,:,:,:)
integer, intent(in), optional :: oldFirst

public subroutine BoundaryFlux_DGModel2D(this)

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this

public subroutine CalculateEntropy_DGModel2D(this)

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this

public subroutine CalculateSolutionGradient_DGModel2D(this)

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this

public subroutine CalculateTendency_DGModel2D(this)

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this

public subroutine DownloadOldWindow_DGModel2D(this, wFirst, wLast, uWin)

Copy the device-resident migrated window to the host, for the SELF_AMR_MIGRATE_VERIFY diagnostic only. This is exactly the host traffic the device path exists to avoid, so it must never appear on the default path.

Read more…

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(in) :: this
integer, intent(in) :: wFirst
integer, intent(in) :: wLast
real(kind=prec), intent(out), target, contiguous:: uWin(:,:,:,:)

public subroutine Free_DGModel2D(this)

Free the 2D DG model, including GPU BC arrays.

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this

public subroutine Init_DGModel2D(this, mesh, geometry)

Initialize the 2D DG model, then upload BC element/side arrays to GPU.

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(out) :: this
type(Mesh2D), intent(in), target:: mesh
type(SEMQuad), intent(in), target:: geometry

public subroutine MigrateOldWindow_DGModel2D(this, winFirst, winLast, wFirst, wLast, nBytesRecv, nBytesSent, nElemRemote)

Assemble this rank's window of the pre-regrid old field IN DEVICE MEMORY, replacing the base implementation's host-memory migration. The rank's own run is copied device-to-device and the peers' runs are received directly into device memory, so no solution data crosses the host link and the windowed ApplyTransferPlan that follows runs as a device kernel.

Read more…

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this
integer, intent(in) :: winFirst(:)
integer, intent(in) :: winLast(:)
integer, intent(in) :: wFirst
integer, intent(in) :: wLast
integer(kind=int64), intent(inout) :: nBytesRecv
integer(kind=int64), intent(inout) :: nBytesSent
integer(kind=int64), intent(inout) :: nElemRemote

public subroutine Regrid_DGModel2D(this, mesh, geometry)

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.

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this
type(Mesh2D), intent(in), target:: mesh
type(SEMQuad), intent(in), target:: geometry

public subroutine StageSolutionForTransfer_DGModel2D(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.

Read more…

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this

public subroutine UpdateGRK2_DGModel2D(this, m)

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this
integer, intent(in) :: m

public subroutine UpdateGRK3_DGModel2D(this, m)

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this
integer, intent(in) :: m

public subroutine UpdateGRK4_DGModel2D(this, m)

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this
integer, intent(in) :: m

public subroutine UpdateSolution_DGModel2D(this, dt)

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)

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this
real(kind=prec), intent(in), optional :: dt

public subroutine fluxmethod_DGModel2D(this)

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this

public subroutine sourcemethod_DGModel2D(this)

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D), intent(inout) :: this