atl_modg_kernel_module Module

Module for routines and datatypes of MOdal Discontinuous Galerkin (MODG) scheme. This scheme is a spectral scheme for linear, purley hyperbolic partial differential equation systems.

Todo

HK: Split this module into three: a common one, a Q part and a P part.


Uses

Used by

  • module~~atl_modg_kernel_module~~UsedByGraph module~atl_modg_kernel_module atl_modg_kernel_module module~atl_compute_local_module atl_compute_local_module module~atl_compute_local_module->module~atl_modg_kernel_module module~atl_container_module atl_container_module module~atl_container_module->module~atl_modg_kernel_module module~atl_global_time_integration_module atl_global_time_integration_module module~atl_container_module->module~atl_global_time_integration_module proc~compute_rhs_cubes_modg compute_rhs_cubes_modg proc~compute_rhs_cubes_modg->module~atl_modg_kernel_module proc~postprocess_rhs_cubes postprocess_rhs_cubes proc~postprocess_rhs_cubes->module~atl_modg_kernel_module proc~preprocess_rhs_cubes preprocess_rhs_cubes proc~preprocess_rhs_cubes->module~atl_modg_kernel_module module~atl_initialize_module atl_initialize_module module~atl_initialize_module->module~atl_container_module module~atl_predcor_cerk4_module atl_predcor_cerk4_module module~atl_predcor_cerk4_module->module~atl_compute_local_module module~atl_program_module atl_program_module module~atl_program_module->module~atl_container_module module~atl_program_module->module~atl_initialize_module module~atl_program_module->module~atl_global_time_integration_module program~ateles ateles program~ateles->module~atl_container_module program~ateles->module~atl_program_module program~atl_harvesting atl_harvesting program~atl_harvesting->module~atl_container_module program~atl_harvesting->module~atl_initialize_module program~atl_harvesting->module~atl_program_module module~atl_global_time_integration_module->module~atl_predcor_cerk4_module

Subroutines

public subroutine atl_init_modg_kernel(kerneldata_list, statedata_list, statedata_stab_list, mesh_list, scheme_list, boundary_list, boundary_stab_list, equation, tree, time, commPattern, need_deviation)

Initiate the MODG kernel for cubic elements on all levels.

Arguments

Type IntentOptional Attributes Name
type(atl_kerneldata_type), allocatable :: kerneldata_list(:)

Array of kerneldata_types, one for each level. They will be initialized.

type(atl_statedata_type), allocatable :: statedata_list(:)

Array of statedata_types, one for each level.

type(atl_statedata_type), allocatable :: statedata_stab_list(:,:)
type(atl_cube_elem_type), allocatable :: mesh_list(:)

List of cubic meshes. One entry per level.

type(atl_scheme_type), allocatable :: scheme_list(:)

List of schemes on the levels.

type(atl_level_boundary_type), allocatable :: boundary_list(:)

The boundary description for the faces on the current level.

type(atl_level_boundary_type), allocatable :: boundary_stab_list(:)

The boundary description for the faces on the current level.

type(atl_Equations_type) :: equation

The equation type.

type(treelmesh_type), intent(in) :: tree

The tree of the simulation domain

type(tem_time_type), intent(in) :: time

current time

type(tem_commPattern_type), intent(in) :: commPattern

mpi communication pattern type

logical, intent(in) :: need_deviation

Flag to indicate whether maximal polynomial deviations should be computed for the state.

public subroutine atl_preprocess_modg_kernel(equation, statedata, mesh, scheme, poly_proj_material, boundary, material, proc, commPattern)

Subroutine to execute the preprocessing for the MODG kernels. Currently this includes: Convert external source terms to modal representation.

Arguments

Type IntentOptional Attributes Name
type(atl_Equations_type), intent(inout) :: equation
type(atl_statedata_type), intent(inout) :: statedata
type(atl_cube_elem_type), intent(inout) :: mesh
type(atl_scheme_type), intent(inout) :: scheme
type(ply_poly_project_type), intent(inout) :: poly_proj_material
type(atl_level_boundary_type), intent(in) :: boundary

Global description of the boundary conditions.

type(atl_material_type), intent(inout) :: material
type(tem_comm_env_type) :: proc

mpi communication environment with mpi communicator

type(tem_commPattern_type) :: commPattern

mpi communication pattern type

public subroutine atl_modg_project_NumFlux(mesh, equation, kerneldata, facedata, scheme, poly_proj, dl_prod, dl_prodDiff, dirVec, penalizationdata, usePenalization)

Subroutine to project modal representations of physical flux, numerical flux and source terms onto test functions.

Read more…

Arguments

Type IntentOptional Attributes Name
type(atl_cube_elem_type), intent(in) :: mesh

Descritption of the cubical elements in the mesh

type(atl_Equations_type), intent(in) :: equation

The equation description.

type(atl_kerneldata_type), intent(inout) :: kerneldata

The data of the kernel. Holds the physical fluxes.

type(atl_facedata_type), intent(inout) :: facedata

The representation on the face + representation of the flux.

type(atl_modg_scheme_type), intent(in) :: scheme

The parameters of the MODG scheme

type(ply_poly_project_type), intent(inout) :: poly_proj

Projection for the current level

real(kind=rk), intent(in) :: dl_prod(2,scheme%maxPolyDegree+1)

stored scalar products of the testfunction and anstaz function

real(kind=rk), intent(in) :: dl_prodDiff(2,scheme%maxPolyDegree+1)
integer, intent(in) :: dirVec(3,3)

vector for direction indicators

type(atl_penalizationData_type), intent(in) :: penalizationdata

Volumetric data for the penalization

logical, intent(in) :: usePenalization

Flag to indicate, whether we need to take care of the penalization terms here or not.

public subroutine atl_modg_project_source(nScalars, sourcedata, scheme, mesh, kerneldata, currentLevel)

Projection of the source terms (in modal representation) to the test functions.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nScalars

The number scalar variables in the equation system.

type(atl_source_type), intent(in) :: sourcedata

The modal representation of the source

type(atl_modg_scheme_type), intent(in) :: scheme

The parameters of the MODG scheme

type(atl_cube_elem_type), intent(in) :: mesh

The cubical elements.

type(atl_kerneldata_type), intent(inout) :: kerneldata

The data of the kernel. This one is updated by the projection.

integer, intent(in) :: currentLevel

The current level

public subroutine atl_modg_ensure_pos_facemean(nElems_fluid, volState, faceRep, nScalars, ensure_positivity)

Lift the mean on the face to a positive value if necessary.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nElems_fluid

Number of fluid elements

real(kind=rk), intent(in) :: volState(:,:,:)

Volumetric modal states for each element

type(atl_faceRep_type), intent(inout) :: faceRep(:)

Modal representation on the face that might need limiting.

Read more…
integer, intent(in) :: nScalars

Number of variables

logical, intent(in) :: ensure_positivity(:)

Indication for each variable, whether positivity is to be ensured or not.

Read more…

public subroutine atl_modg_modalVolToModalFace(nElems_fluid, length, volState, faceRep, nScalars, nDerivatives, modg)

Projects modal representation of each cell to its faces, i.e. this subroutine creates a modal representation on the faces.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nElems_fluid

number of fluid elements

real(kind=rk), intent(in) :: length

length of cubic element

real(kind=rk), intent(in) :: volState(:,:,:)

Volumetric, modal states for each element.

type(atl_faceRep_type), intent(inout) :: faceRep(:)

Modal representation on the face (will be updated by this routine for all fluid elements in mesh).

integer, intent(in) :: nScalars

number of variables

integer, intent(in) :: nDerivatives

number of derivatives

type(atl_modg_scheme_type), intent(in) :: modg

The parameters of your modg scheme.

public subroutine atl_modg_invMassMatrix(mesh, kerneldata, statedata, elementalTimestep, timestep, scheme)

Applies the inverse of the mass matrix for a 3D scheme.

Arguments

Type IntentOptional Attributes Name
type(atl_cube_elem_type) :: mesh

The mesh you are working with.

type(atl_kerneldata_type) :: kerneldata

The data of the kernel.

type(atl_statedata_type) :: statedata

THe state if the equation

procedure(atl_elemental_timestep_vec), intent(in), pointer :: elementalTimestep

The elemental timestepping routine, because of performance, this is constant.

type(atl_timestep_type) :: timestep

The timestepping data.

type(atl_modg_scheme_type), intent(in) :: scheme

Parameters of the modal dg scheme

public subroutine atl_modg_scaledTransposedInvMassMatrix_Q(nTotalElems, nDofs, nScalars, maxPolyDegree, nElems, state)

Applies a scaled transposed inverse of the mass matrix for a 3D scheme. The result is a transformation of the polynomial basis from the ansatz- to the test-polynomials. This is useful for a local predictor

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nTotalElems

defines the dimensions of the state array

integer, intent(in) :: nDofs

defines the dimensions of the state array

integer, intent(in) :: nScalars

defines the dimensions of the state array

integer, intent(in) :: maxPolyDegree

polynomial degree of the modal dg scheme

integer, intent(in) :: nElems

number of elements to work with

real(kind=rk), intent(inout) :: state(nTotalElems,nDofs,nScalars)

the state to transform

public subroutine atl_modg_scaledTransposedInvMassMatrix_P(nTotalElems, nDofs, nScalars, maxPolyDegree, nElems, state)

Applies a scaled transposed inverse of the mass matrix for a 3D scheme. The result is a transformation of the polynomial basis from the ansatz- to the test-polynomials. This is useful for a local predictor

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nTotalElems

defines the dimensions of the state array

integer, intent(in) :: nDofs

defines the dimensions of the state array

integer, intent(in) :: nScalars

defines the dimensions of the state array

integer, intent(in) :: maxPolyDegree

polynomial degree of the modal dg scheme

integer, intent(in) :: nElems

number of elements to work with

real(kind=rk), intent(inout) :: state(nTotalElems,nDofs,nScalars)

the state to transform

public subroutine atl_modg_scaledTransposedProject_physFlux_Q(nScalars, maxPolyDegree, length, nElems, state, iDir, dirVec)

Projection of the physical flux for the local predictor: This function expects the physical flux transformed in the basis of test-polynomials and projects it onto the ansatz-functions. Thus, the result is directly given in the basis of ansatz-polynomials (no invMassMatrix-call needed afterwards)

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nScalars

The number of scalar variables in your equation system.

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree in each spatial direction.

real(kind=rk), intent(in) :: length

The length of the cubes.

integer, intent(in) :: nElems

The element index to project for

real(kind=rk), intent(inout) :: state(:,:,:,:)

The state to alter.

integer, intent(in) :: iDir
integer, intent(in) :: dirVec(3)

ordering of xyz for current direction

public subroutine atl_modg_scaledTransposedProject_physFlux_P(nScalars, maxPolyDegree, length, nElems, state, iDir, dirVec)

Projection of the physical flux for the local predictor: This function expects the physical flux transformed in the basis of test-polynomials and projects it onto the ansatz-functions. Thus, the result is directly given in the basis of ansatz-polynomials (no invMassMatrix-call needed afterwards)

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nScalars

The number of scalar variables in your equation system.

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree in each spatial direction.

real(kind=rk), intent(in) :: length

The length of the cubes.

integer, intent(in) :: nElems

The element index to project for

real(kind=rk), intent(inout) :: state(:,:,:,:)

The state to alter.

integer, intent(in) :: iDir
integer, intent(in) :: dirVec(3)

ordering of xyz for current direction

public subroutine atl_modg_kernel_utests(passed)

Subroutine to test the various routines of this module.

Arguments

Type IntentOptional Attributes Name
logical, intent(out) :: passed

private subroutine modg_project_stabViscNumFluxX_Q(numFlux, faceState, equation, maxPolyDegree, length, nElems_fluid, projection, poly_proj)

Projection of the numerical flux in x direction onto the testfunctions.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(inout) :: numFlux(:,:,:,:)

The numerical flux on the faces in modal representations. Dimension is (maxPolyDegree+1)^2 , nScalars

real(kind=rk), intent(inout) :: faceState(:,:,:,:)

The state on the faces in modal representations. Dimension is (maxPolyDegree+1)^2 , nScalars

type(atl_Equations_type), intent(in) :: equation

The equation system under consideration

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree in each spatial direction.

real(kind=rk), intent(in) :: length

The length of the cubes.

integer, intent(in) :: nElems_fluid

The element index

real(kind=rk), intent(inout) :: projection(:,:,:)

The numerical flux projected onto the test functions.

type(ply_poly_project_type), intent(inout) :: poly_proj

Projection for the current level

private subroutine modg_project_stabViscNumFluxY_Q(numFlux, faceState, equation, maxPolyDegree, length, nElems_fluid, projection, poly_proj)

Projection of the numerical flux in y direction onto the testfunctions.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(inout) :: numFlux(:,:,:,:)

The numerical flux on the faces in modal representations. Dimension is (maxPolyDegree+1)^2 , nScalars

real(kind=rk), intent(inout) :: faceState(:,:,:,:)

The state on the faces in modal representations. Dimension is (maxPolyDegree+1)^2 , nScalars

type(atl_Equations_type), intent(in) :: equation

The equation system under consideration

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree in each spatial direction.

real(kind=rk), intent(in) :: length

The length of the cubes.

integer, intent(in) :: nElems_fluid

The element index

real(kind=rk), intent(inout) :: projection(:,:,:)

The numerical flux projected onto the test functions.

type(ply_poly_project_type), intent(inout) :: poly_proj

Projection for the current level

private subroutine modg_project_stabViscNumFluxZ_Q(numFlux, faceState, equation, maxPolyDegree, length, nElems_fluid, projection, poly_proj)

Projection of the numerical flux in y direction onto the testfunctions.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(inout) :: numFlux(:,:,:,:)

The numerical flux on the faces in modal representations. Dimension is (maxPolyDegree+1)^2 , nScalars

real(kind=rk), intent(inout) :: faceState(:,:,:,:)

The state on the faces in modal representations. Dimension is (maxPolyDegree+1)^2 , nScalars

type(atl_Equations_type), intent(in) :: equation

The equation system under consideration

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree in each spatial direction.

real(kind=rk), intent(in) :: length

The length of the cubes.

integer, intent(in) :: nElems_fluid

The element index

real(kind=rk), intent(inout) :: projection(:,:,:)

The numerical flux projected onto the test functions.

type(ply_poly_project_type), intent(inout) :: poly_proj

Projection for the current level

private subroutine modg_project_penalization_Q(mesh, maxPolyDegree, kerneldata, penalizationdata)

Projection of the penalization terms (in modal representation) to the test functions.

Arguments

Type IntentOptional Attributes Name
type(atl_cube_elem_type), intent(in) :: mesh

The cubical elements.

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree of the modg scheme

type(atl_kerneldata_type), intent(inout) :: kerneldata

The data of the kernel. This one is updated by the projection.

type(atl_penalizationData_type), intent(in) :: penalizationdata

Volumetric data for the penalization

private subroutine atl_modg_project_source_Q(sourcedata, nScalars, mesh, maxPolyDegree, kerneldata, currentLevel)

Projection of the source terms (in modal representation) to the test functions.

Arguments

Type IntentOptional Attributes Name
type(atl_source_type), intent(in) :: sourcedata

The modal representation of the source

integer, intent(in) :: nScalars

The number scalar variables in the equation system.

type(atl_cube_elem_type), intent(in) :: mesh

The cubical elements.

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree of the modg scheme

type(atl_kerneldata_type), intent(inout) :: kerneldata

The data of the kernel. This one is updated by the projection.

integer, intent(in) :: currentLevel

The current level

private subroutine atl_modg_project_source_P(sourcedata, nScalars, mesh, maxPolyDegree, kerneldata, currentLevel)

Projection of the source terms (in modal representation) to the test functions.

Arguments

Type IntentOptional Attributes Name
type(atl_source_type), intent(in) :: sourcedata

The modal representation of the source

integer, intent(in) :: nScalars

The number scalar variables in the equation system.

type(atl_cube_elem_type), intent(in) :: mesh

The cubical elements.

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree of the modg scheme

type(atl_kerneldata_type), intent(inout) :: kerneldata

The data of the kernel. This one is updated by the projection.

integer, intent(in) :: currentLevel

The current level

private subroutine modg_project_numFlux_Q(nTotalFaces, nFaceDofs, nScalars, faceFlux, maxPolyDegree, length, nElems_fluid, dl_prod, projection, dirVec)

Projection of the numerical flux onto the testfunctions for Q_space.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nTotalFaces

dimensions

integer, intent(in) :: nFaceDofs

dimensions

integer, intent(in) :: nScalars

dimensions

real(kind=rk), intent(in) :: faceFlux(:,:,:,:)

The numerical flux on the left face in modal representations. Dimension is nTotalFaces, (maxPolyDegree+1)^2 , nScalars, 2

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree in each spatial direction.

real(kind=rk), intent(in) :: length

The length of the cubes.

integer, intent(in) :: nElems_fluid

The element index

real(kind=rk), intent(in) :: dl_prod(2,maxPolyDegree+1)

Precomputed dual Legendre products:

real(kind=rk), intent(inout) :: projection(:,:,:)

The numerical flux projected onto the test functions.

integer, intent(in) :: dirVec(3)

direction (x,y,z)

private subroutine modg_project_numFlux_diffTest_Q(nScalars, faceFlux, maxPolyDegree, length, nElems_fluid, dl_prod, projection, dirVec)

Projection of the numerical flux onto the differentiated testfunctions.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nScalars

dimensions

real(kind=rk), intent(inout) :: faceFlux(:,:,:,:)

The numerical flux on the left face in modal representations. Dimension is (maxPolyDegree+1)^2 , nScalars

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree in each spatial direction.

real(kind=rk), intent(in) :: length

The length of the cubes.

integer, intent(in) :: nElems_fluid

The element index

real(kind=rk), intent(in) :: dl_prod(2,maxPolyDegree+1)

Precomputed dual Legendre products:

real(kind=rk), intent(inout) :: projection(:,:,:)

The numerical flux projected onto the test functions.

integer, intent(in) :: dirVec(3)

direction (x,y,z)

private subroutine modg_project_numFlux_P(nTotalFaces, nFaceDofs, nScalars, faceFlux, maxPolyDegree, length, nElems_fluid, dl_prod, projection, dirVec)

Projection of the numerical flux onto the testfunctions for P_space.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nTotalFaces

dimensions

integer, intent(in) :: nFaceDofs

dimensions

integer, intent(in) :: nScalars

dimensions

real(kind=rk), intent(in) :: faceFlux(nTotalFaces,nFaceDofs,nScalars,2)

The numerical flux on the left face in modal representations. Dimension is (maxPolyDegree+1)^2 , nScalars

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree in each spatial direction.

real(kind=rk), intent(in) :: length

The length of the cubes.

integer, intent(in) :: nElems_fluid

The element index

real(kind=rk), intent(in) :: dl_prod(2,maxPolyDegree+1)

Precomputed dual Legendre products:

real(kind=rk), intent(inout) :: projection(:,:,:)

The numerical flux projected onto the test functions.

integer, intent(in) :: dirVec(3)

direction (x,y,z)

private subroutine modg_volToFace_Q_x(nScalars, volState, maxPolyDegree, nElems, faceState)

Project modal representation of an element to its two faces in X.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nScalars
real(kind=rk), intent(in) :: volState(:,:,:)

The modal representation in the volume. First dimension is the number of volumetric numbers of degrees of freedom and second dimension is the number of scalar variables in the equation system.

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree per spatial direction.

integer, intent(in) :: nElems

The number of elements

real(kind=rk), intent(inout) :: faceState(:,:,:,:)

The modal representation on the faces in X direction

private subroutine modg_volToFace_Q_y(nScalars, volState, maxPolyDegree, nElems, faceState)

Project modal representation of an element to its two faces in Y.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nScalars
real(kind=rk), intent(in) :: volState(:,:,:)

The modal representation in the volume. First dimension is the number of volumetric numbers of degrees of freedom and second dimension is the number of scalar variables in the equation system.

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree per spatial direction.

integer, intent(in) :: nElems

The number of elements

real(kind=rk), intent(inout) :: faceState(:,:,:,:)

The modal representation on the faces in X direction

private subroutine modg_volToFace_Q_z(nScalars, volState, maxPolyDegree, nElems, faceState)

Project modal representation of an element to its two faces in Y.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nScalars
real(kind=rk), intent(in) :: volState(:,:,:)

The modal representation in the volume. First dimension is the number of volumetric numbers of degrees of freedom and second dimension is the number of scalar variables in the equation system.

integer, intent(in) :: maxPolyDegree

The maximal polynomial degree per spatial direction.

integer, intent(in) :: nElems

The number of elements

real(kind=rk), intent(inout) :: faceState(:,:,:,:)

The modal representation on the faces in X direction

private subroutine modg_invMassMatrix_Q(mesh, kerneldata, scheme, nElems)

Applies the inverse of the mass matrix for a 3D scheme.

Arguments

Type IntentOptional Attributes Name
type(atl_cube_elem_type) :: mesh

The mesh you are working with.

type(atl_kerneldata_type) :: kerneldata

The data of the kernel.

type(atl_modg_scheme_type), intent(in) :: scheme

Parameters of the modal dg scheme

integer, intent(in) :: nElems

private subroutine modg_invMassMatrix_P(mesh, kerneldata, scheme, nElems)

Applies the inverse of the mass matrix for a 3D scheme.

Arguments

Type IntentOptional Attributes Name
type(atl_cube_elem_type) :: mesh

The mesh you are working with.

type(atl_kerneldata_type) :: kerneldata

The data of the kernel.

type(atl_modg_scheme_type), intent(in) :: scheme

Parameters of the modal dg scheme

integer, intent(in) :: nElems

private subroutine test_project_stabViscNumFlux(polydegree, oversamplefactor, dir, equation, length, rotated_mom)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: polydegree
real(kind=rk), intent(in) :: oversamplefactor
integer, intent(in) :: dir
type(atl_Equations_type), intent(in) :: equation
real(kind=rk), intent(in) :: length
real(kind=rk), intent(out) :: rotated_mom(:)