Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 33 additions & 28 deletions src/solvers/dgsem_p4est/dg_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ function prolong2interfaces!(backend::Backend, cache, u,
end

@kernel function prolong2interfaces_KAkernel!(interfaces_u, u,
mT::Type{<:Union{P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
mesh_type::Type{<:Union{P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
Comment on lines +97 to +99
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used MeshT in many other places instead. Could you please unify this?

(I think @sloede suggested MeshT, correct?)

equations, neighbor_ids,
node_indices, index_range)
interface = @index(Global)
prolong2interfaces_per_interface!(interfaces_u, u, interface, mT, equations,
prolong2interfaces_per_interface!(interfaces_u, u, interface, mesh_type, equations,
neighbor_ids, node_indices, index_range)
end

Expand Down Expand Up @@ -195,29 +195,29 @@ function calc_interface_flux!(backend::Backend, surface_flux_values,
end

@kernel function calc_interface_flux_KAkernel!(surface_flux_values,
mt::Type{<:Union{P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
mesh_type::Type{<:Union{P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
have_nonconservative_terms,
equations, surface_integral,
st::Type{<:DG}, u_interface,
solver_type::Type{<:DG}, u_interface,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be SolverT to mimic MeshT.

neighbor_ids, node_indices,
contravariant_vectors, index_range)
interface = @index(Global)
calc_interface_flux_per_interface!(surface_flux_values, mt,
calc_interface_flux_per_interface!(surface_flux_values, mesh_type,
have_nonconservative_terms, equations,
surface_integral, st, u_interface,
surface_integral, solver_type, u_interface,
interface, neighbor_ids, node_indices,
contravariant_vectors, index_range)
end

@inline function calc_interface_flux_per_interface!(surface_flux_values,
mt::Type{<:Union{P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
mesh_type::Type{<:Union{P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
have_nonconservative_terms,
equations, surface_integral,
st::Type{<:DG},
solver_type::Type{<:DG},
u_interface, interface,
neighbor_ids,
node_indices, contravariant_vectors,
Expand Down Expand Up @@ -263,8 +263,9 @@ end
i_primary, j_primary,
primary_element)

calc_interface_flux!(surface_flux_values, mt, have_nonconservative_terms,
equations, surface_integral, st, u_interface, interface,
calc_interface_flux!(surface_flux_values, mesh_type, have_nonconservative_terms,
equations, surface_integral, solver_type, u_interface,
interface,
normal_direction, node, primary_direction,
primary_element, node_secondary,
secondary_direction, secondary_element)
Expand All @@ -285,7 +286,7 @@ end
P4estMeshView{2},
T8codeMesh{2}}},
have_nonconservative_terms::False, equations,
surface_integral, st::Type{<:DG},
surface_integral, solver_type::Type{<:DG},
u_interface, interface_index,
normal_direction, primary_node_index,
primary_direction_index,
Expand All @@ -295,7 +296,7 @@ end
secondary_element_index)
@unpack surface_flux = surface_integral

u_ll, u_rr = get_surface_node_vars(u_interface, equations, st,
u_ll, u_rr = get_surface_node_vars(u_interface, equations, solver_type,
primary_node_index,
interface_index)

Expand All @@ -313,7 +314,7 @@ end
@inline function calc_interface_flux!(surface_flux_values,
MeshT::Type{<:Union{P4estMesh{2}, T8codeMesh{2}}},
have_nonconservative_terms::True, equations,
surface_integral, st::Type{<:DG},
surface_integral, solver_type::Type{<:DG},
u_interface, interface_index,
normal_direction, primary_node_index,
primary_direction_index,
Expand All @@ -326,7 +327,7 @@ end
combine_conservative_and_nonconservative_fluxes(surface_flux,
equations),
equations,
surface_integral, st, u_interface,
surface_integral, solver_type, u_interface,
interface_index, normal_direction,
primary_node_index, primary_direction_index,
primary_element_index,
Expand All @@ -340,15 +341,17 @@ end
have_nonconservative_terms::True,
combine_conservative_and_nonconservative_fluxes::False,
equations,
surface_integral, st::Type{<:DG}, u_interface,
surface_integral, solver_type::Type{<:DG},
u_interface,
interface_index, normal_direction,
primary_node_index, primary_direction_index,
primary_element_index,
secondary_node_index, secondary_direction_index,
secondary_element_index)
surface_flux, nonconservative_flux = surface_integral.surface_flux

u_ll, u_rr = get_surface_node_vars(u_interface, equations, st, primary_node_index,
u_ll, u_rr = get_surface_node_vars(u_interface, equations, solver_type,
primary_node_index,
interface_index)

flux_ = surface_flux(u_ll, u_rr, normal_direction, equations)
Expand Down Expand Up @@ -378,15 +381,17 @@ end
have_nonconservative_terms::True,
combine_conservative_and_nonconservative_fluxes::True,
equations,
surface_integral, st::Type{<:DG}, u_interface,
surface_integral, solver_type::Type{<:DG},
u_interface,
interface_index, normal_direction,
primary_node_index, primary_direction_index,
primary_element_index,
secondary_node_index, secondary_direction_index,
secondary_element_index)
@unpack surface_flux = surface_integral

u_ll, u_rr = get_surface_node_vars(u_interface, equations, st, primary_node_index,
u_ll, u_rr = get_surface_node_vars(u_interface, equations, solver_type,
primary_node_index,
interface_index)

flux_left, flux_right = surface_flux(u_ll, u_rr, normal_direction, equations)
Expand Down Expand Up @@ -934,15 +939,15 @@ function calc_surface_integral!(backend::Backend, du, u,
end

@kernel function calc_surface_integral_KAkernel!(du,
mT::Type{<:Union{P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
mesh_type::Type{<:Union{P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
equations,
surface_integral::SurfaceIntegralWeakForm,
dg::DGSEM, factor,
surface_flux_values)
element = @index(Global)
calc_surface_integral_per_element!(du, mT, equations, surface_integral,
calc_surface_integral_per_element!(du, mesh_type, equations, surface_integral,
dg, factor, surface_flux_values, element)
end

Expand Down
14 changes: 7 additions & 7 deletions src/solvers/dgsem_structured/dg_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -768,15 +768,15 @@ function apply_jacobian!(backend::Backend, du,
end

@kernel function apply_jacobian_KAkernel!(du,
mT::Type{<:Union{StructuredMesh{2},
StructuredMeshView{2},
UnstructuredMesh2D,
P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
mesh_type::Type{<:Union{StructuredMesh{2},
StructuredMeshView{2},
UnstructuredMesh2D,
P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
equations, dg::DG, inverse_jacobian)
element = @index(Global)
apply_jacobian_per_element!(du, mT, equations, dg, inverse_jacobian, element)
apply_jacobian_per_element!(du, mesh_type, equations, dg, inverse_jacobian, element)
end

@inline function apply_jacobian_per_element!(du,
Expand Down
Loading