From 4ca49a570998defa5a1ff0a8650da4e3f077c19a Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Wed, 22 Nov 2023 10:18:08 -0600 Subject: [PATCH 1/6] initial commit --- src/callbacks_step/amr_dg1d.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/callbacks_step/amr_dg1d.jl b/src/callbacks_step/amr_dg1d.jl index b4cd6a00271..41c2db0c015 100644 --- a/src/callbacks_step/amr_dg1d.jl +++ b/src/callbacks_step/amr_dg1d.jl @@ -89,9 +89,11 @@ function refine!(u_ode::AbstractVector, adaptor, mesh::TreeMesh{1}, reinitialize_containers!(mesh, equations, dg, cache_parabolic) # Sanity check - @unpack interfaces = cache_parabolic + #@unpack interfaces = cache_parabolic + (; interfaces) = cache if isperiodic(mesh.tree) - @assert ninterfaces(interfaces)==1 * nelements(dg, cache_parabolic) ("For 1D and periodic domains, the number of interfaces must be the same as the number of elements") + #@assert ninterfaces(interfaces)==1 * nelements(dg, cache_parabolic) ("For 1D and periodic domains, the number of interfaces must be the same as the number of elements") + @assert ninterfaces(interfaces)==1 * nelements(dg, cache) ("For 1D and periodic domains, the number of interfaces must be the same as the number of elements") end return nothing From 80317960c2f6a076fc8b763192f1a1f07d553228 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Sat, 25 Nov 2023 16:18:43 -0600 Subject: [PATCH 2/6] removing more `cache_parabolic` instances (works for periodic only) --- src/solvers/dgsem_tree/dg_1d_parabolic.jl | 73 +++++++++++++++++------ 1 file changed, 54 insertions(+), 19 deletions(-) diff --git a/src/solvers/dgsem_tree/dg_1d_parabolic.jl b/src/solvers/dgsem_tree/dg_1d_parabolic.jl index 90007b05b3d..bd9090c5642 100644 --- a/src/solvers/dgsem_tree/dg_1d_parabolic.jl +++ b/src/solvers/dgsem_tree/dg_1d_parabolic.jl @@ -62,20 +62,28 @@ function rhs_parabolic!(du, u, t, mesh::TreeMesh{1}, # Prolong solution to interfaces @trixi_timeit timer() "prolong2interfaces" begin - prolong2interfaces!(cache_parabolic, flux_viscous, mesh, equations_parabolic, + prolong2interfaces!(cache.interfaces, + flux_viscous, mesh, equations_parabolic, dg.surface_integral, dg, cache) + # prolong2interfaces!(cache_parabolic.interfaces, + # flux_viscous, mesh, equations_parabolic, + # dg.surface_integral, dg, cache) end # Calculate interface fluxes @trixi_timeit timer() "interface flux" begin - calc_interface_flux!(cache_parabolic.elements.surface_flux_values, mesh, - equations_parabolic, dg, cache_parabolic) + calc_interface_flux!(cache.elements.surface_flux_values, mesh, + equations_parabolic, dg, cache) + # calc_interface_flux!(cache_parabolic.elements.surface_flux_values, mesh, + # equations_parabolic, dg, cache_parabolic) end # Prolong solution to boundaries @trixi_timeit timer() "prolong2boundaries" begin - prolong2boundaries!(cache_parabolic, flux_viscous, mesh, equations_parabolic, + prolong2boundaries!(cache.boundaries, flux_viscous, mesh, equations_parabolic, dg.surface_integral, dg, cache) + # prolong2boundaries!(cache_parabolic, flux_viscous, mesh, equations_parabolic, + # dg.surface_integral, dg, cache) end # Calculate boundary fluxes @@ -88,8 +96,10 @@ function rhs_parabolic!(du, u, t, mesh::TreeMesh{1}, # Calculate surface integrals @trixi_timeit timer() "surface integral" begin - calc_surface_integral!(du, u, mesh, equations_parabolic, - dg.surface_integral, dg, cache_parabolic) + calc_surface_integral!(du, u, mesh, equations_parabolic, + dg.surface_integral, dg, cache) + # calc_surface_integral!(du, u, mesh, equations_parabolic, + # dg.surface_integral, dg, cache_parabolic) end # Apply Jacobian from mapping to reference element @@ -144,11 +154,10 @@ end # This is the version used when calculating the divergence of the viscous fluxes # We pass the `surface_integral` argument solely for dispatch -function prolong2interfaces!(cache_parabolic, flux_viscous, +function prolong2interfaces!(interfaces, flux_viscous, mesh::TreeMesh{1}, equations_parabolic::AbstractEquationsParabolic, surface_integral, dg::DG, cache) - @unpack interfaces = cache_parabolic @unpack neighbor_ids = interfaces interfaces_u = interfaces.u @@ -203,15 +212,14 @@ function calc_interface_flux!(surface_flux_values, end # This is the version used when calculating the divergence of the viscous fluxes -function prolong2boundaries!(cache_parabolic, flux_viscous, +function prolong2boundaries!(boundaries, flux_viscous, mesh::TreeMesh{1}, equations_parabolic::AbstractEquationsParabolic, surface_integral, dg::DG, cache) - @unpack boundaries = cache_parabolic @unpack neighbor_sides, neighbor_ids = boundaries boundaries_u = boundaries.u - @threaded for boundary in eachboundary(dg, cache_parabolic) + @threaded for boundary in eachboundary(dg, cache) element = neighbor_ids[boundary] if neighbor_sides[boundary] == 1 @@ -230,6 +238,33 @@ function prolong2boundaries!(cache_parabolic, flux_viscous, return nothing end +# function prolong2boundaries!(cache_parabolic, flux_viscous, +# mesh::TreeMesh{1}, +# equations_parabolic::AbstractEquationsParabolic, +# surface_integral, dg::DG, cache) +# @unpack boundaries = cache_parabolic +# @unpack neighbor_sides, neighbor_ids = boundaries +# boundaries_u = boundaries.u + +# @threaded for boundary in eachboundary(dg, cache_parabolic) +# element = neighbor_ids[boundary] + +# if neighbor_sides[boundary] == 1 +# # element in -x direction of boundary +# for v in eachvariable(equations_parabolic) +# # OBS! `boundaries_u` stores the interpolated *fluxes* and *not the solution*! +# boundaries_u[1, v, boundary] = flux_viscous[v, nnodes(dg), element] +# end +# else # Element in +x direction of boundary +# for v in eachvariable(equations_parabolic) +# # OBS! `boundaries_u` stores the interpolated *fluxes* and *not the solution*! +# boundaries_u[2, v, boundary] = flux_viscous[v, 1, element] +# end +# end +# end + +# return nothing +# end function calc_viscous_fluxes!(flux_viscous, gradients, u_transformed, mesh::TreeMesh{1}, equations_parabolic::AbstractEquationsParabolic, @@ -436,7 +471,7 @@ function calc_gradient!(gradients, u_transformed, t, end # Prolong solution to interfaces - @trixi_timeit timer() "prolong2interfaces" prolong2interfaces!(cache_parabolic, + @trixi_timeit timer() "prolong2interfaces" prolong2interfaces!(cache, u_transformed, mesh, equations_parabolic, dg.surface_integral, @@ -444,10 +479,10 @@ function calc_gradient!(gradients, u_transformed, t, # Calculate interface fluxes @trixi_timeit timer() "interface flux" begin - @unpack surface_flux_values = cache_parabolic.elements - @unpack neighbor_ids, orientations = cache_parabolic.interfaces + @unpack surface_flux_values = cache.elements + @unpack neighbor_ids, orientations = cache.interfaces - @threaded for interface in eachinterface(dg, cache_parabolic) + @threaded for interface in eachinterface(dg, cache) # Get neighboring elements left_id = neighbor_ids[1, interface] right_id = neighbor_ids[2, interface] @@ -458,7 +493,7 @@ function calc_gradient!(gradients, u_transformed, t, right_direction = 2 * orientations[interface] - 1 # Call pointwise Riemann solver - u_ll, u_rr = get_surface_node_vars(cache_parabolic.interfaces.u, + u_ll, u_rr = get_surface_node_vars(cache.interfaces.u, equations_parabolic, dg, interface) flux = 0.5 * (u_ll + u_rr) @@ -471,14 +506,14 @@ function calc_gradient!(gradients, u_transformed, t, end # Prolong solution to boundaries - @trixi_timeit timer() "prolong2boundaries" prolong2boundaries!(cache_parabolic, + @trixi_timeit timer() "prolong2boundaries" prolong2boundaries!(cache, u_transformed, mesh, equations_parabolic, dg.surface_integral, dg) # Calculate boundary fluxes - @trixi_timeit timer() "boundary flux" calc_boundary_flux_gradients!(cache_parabolic, + @trixi_timeit timer() "boundary flux" calc_boundary_flux_gradients!(cache, t, boundary_conditions_parabolic, mesh, @@ -489,7 +524,7 @@ function calc_gradient!(gradients, u_transformed, t, # Calculate surface integrals @trixi_timeit timer() "surface integral" begin @unpack boundary_interpolation = dg.basis - @unpack surface_flux_values = cache_parabolic.elements + @unpack surface_flux_values = cache.elements # Note that all fluxes have been computed with outward-pointing normal vectors. # Access the factors only once before beginning the loop to increase performance. From be9710c01ae941134142ba2669d337376d3344c6 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Sat, 25 Nov 2023 16:21:00 -0600 Subject: [PATCH 3/6] removing more `cache_parabolic` instances --- src/callbacks_step/amr_dg1d.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/callbacks_step/amr_dg1d.jl b/src/callbacks_step/amr_dg1d.jl index 41c2db0c015..15da0152312 100644 --- a/src/callbacks_step/amr_dg1d.jl +++ b/src/callbacks_step/amr_dg1d.jl @@ -89,10 +89,8 @@ function refine!(u_ode::AbstractVector, adaptor, mesh::TreeMesh{1}, reinitialize_containers!(mesh, equations, dg, cache_parabolic) # Sanity check - #@unpack interfaces = cache_parabolic (; interfaces) = cache if isperiodic(mesh.tree) - #@assert ninterfaces(interfaces)==1 * nelements(dg, cache_parabolic) ("For 1D and periodic domains, the number of interfaces must be the same as the number of elements") @assert ninterfaces(interfaces)==1 * nelements(dg, cache) ("For 1D and periodic domains, the number of interfaces must be the same as the number of elements") end @@ -237,9 +235,9 @@ function coarsen!(u_ode::AbstractVector, adaptor, mesh::TreeMesh{1}, reinitialize_containers!(mesh, equations, dg, cache_parabolic) # Sanity check - @unpack interfaces = cache_parabolic + @unpack interfaces = cache if isperiodic(mesh.tree) - @assert ninterfaces(interfaces)==1 * nelements(dg, cache_parabolic) ("For 1D and periodic domains, the number of interfaces must be the same as the number of elements") + @assert ninterfaces(interfaces)==1 * nelements(dg, cache) ("For 1D and periodic domains, the number of interfaces must be the same as the number of elements") end return nothing From b483413bd3c61d75a5e229df8a890435c77287f8 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Sat, 25 Nov 2023 16:24:55 -0600 Subject: [PATCH 4/6] removing boundary `cache_parabolic` instances + commented out code --- src/solvers/dgsem_tree/dg_1d_parabolic.jl | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/solvers/dgsem_tree/dg_1d_parabolic.jl b/src/solvers/dgsem_tree/dg_1d_parabolic.jl index bd9090c5642..ede9aeb5e40 100644 --- a/src/solvers/dgsem_tree/dg_1d_parabolic.jl +++ b/src/solvers/dgsem_tree/dg_1d_parabolic.jl @@ -65,30 +65,23 @@ function rhs_parabolic!(du, u, t, mesh::TreeMesh{1}, prolong2interfaces!(cache.interfaces, flux_viscous, mesh, equations_parabolic, dg.surface_integral, dg, cache) - # prolong2interfaces!(cache_parabolic.interfaces, - # flux_viscous, mesh, equations_parabolic, - # dg.surface_integral, dg, cache) end # Calculate interface fluxes @trixi_timeit timer() "interface flux" begin calc_interface_flux!(cache.elements.surface_flux_values, mesh, equations_parabolic, dg, cache) - # calc_interface_flux!(cache_parabolic.elements.surface_flux_values, mesh, - # equations_parabolic, dg, cache_parabolic) end # Prolong solution to boundaries @trixi_timeit timer() "prolong2boundaries" begin prolong2boundaries!(cache.boundaries, flux_viscous, mesh, equations_parabolic, dg.surface_integral, dg, cache) - # prolong2boundaries!(cache_parabolic, flux_viscous, mesh, equations_parabolic, - # dg.surface_integral, dg, cache) end # Calculate boundary fluxes @trixi_timeit timer() "boundary flux" begin - calc_boundary_flux_divergence!(cache_parabolic, t, + calc_boundary_flux_divergence!(cache, t, boundary_conditions_parabolic, mesh, equations_parabolic, dg.surface_integral, dg) @@ -98,13 +91,11 @@ function rhs_parabolic!(du, u, t, mesh::TreeMesh{1}, @trixi_timeit timer() "surface integral" begin calc_surface_integral!(du, u, mesh, equations_parabolic, dg.surface_integral, dg, cache) - # calc_surface_integral!(du, u, mesh, equations_parabolic, - # dg.surface_integral, dg, cache_parabolic) end # Apply Jacobian from mapping to reference element @trixi_timeit timer() "Jacobian" begin - apply_jacobian_parabolic!(du, mesh, equations_parabolic, dg, cache_parabolic) + apply_jacobian_parabolic!(du, mesh, equations_parabolic, dg, cache) end return nothing From 8a5fcee8fb90bb98211988cbc2f311898679acd0 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Sat, 25 Nov 2023 16:51:37 -0600 Subject: [PATCH 5/6] cleanup 1D --- src/solvers/dgsem_tree/dg_1d_parabolic.jl | 37 +++-------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/src/solvers/dgsem_tree/dg_1d_parabolic.jl b/src/solvers/dgsem_tree/dg_1d_parabolic.jl index ede9aeb5e40..355ca312b6b 100644 --- a/src/solvers/dgsem_tree/dg_1d_parabolic.jl +++ b/src/solvers/dgsem_tree/dg_1d_parabolic.jl @@ -170,10 +170,10 @@ end # This is the version used when calculating the divergence of the viscous fluxes function calc_interface_flux!(surface_flux_values, mesh::TreeMesh{1}, equations_parabolic, - dg::DG, cache_parabolic) - @unpack neighbor_ids, orientations = cache_parabolic.interfaces + dg::DG, cache) + @unpack neighbor_ids, orientations = cache.interfaces - @threaded for interface in eachinterface(dg, cache_parabolic) + @threaded for interface in eachinterface(dg, cache) # Get neighboring elements left_id = neighbor_ids[1, interface] right_id = neighbor_ids[2, interface] @@ -184,7 +184,7 @@ function calc_interface_flux!(surface_flux_values, right_direction = 2 * orientations[interface] - 1 # Get precomputed fluxes at interfaces - flux_ll, flux_rr = get_surface_node_vars(cache_parabolic.interfaces.u, + flux_ll, flux_rr = get_surface_node_vars(cache.interfaces.u, equations_parabolic, dg, interface) @@ -229,33 +229,6 @@ function prolong2boundaries!(boundaries, flux_viscous, return nothing end -# function prolong2boundaries!(cache_parabolic, flux_viscous, -# mesh::TreeMesh{1}, -# equations_parabolic::AbstractEquationsParabolic, -# surface_integral, dg::DG, cache) -# @unpack boundaries = cache_parabolic -# @unpack neighbor_sides, neighbor_ids = boundaries -# boundaries_u = boundaries.u - -# @threaded for boundary in eachboundary(dg, cache_parabolic) -# element = neighbor_ids[boundary] - -# if neighbor_sides[boundary] == 1 -# # element in -x direction of boundary -# for v in eachvariable(equations_parabolic) -# # OBS! `boundaries_u` stores the interpolated *fluxes* and *not the solution*! -# boundaries_u[1, v, boundary] = flux_viscous[v, nnodes(dg), element] -# end -# else # Element in +x direction of boundary -# for v in eachvariable(equations_parabolic) -# # OBS! `boundaries_u` stores the interpolated *fluxes* and *not the solution*! -# boundaries_u[2, v, boundary] = flux_viscous[v, 1, element] -# end -# end -# end - -# return nothing -# end function calc_viscous_fluxes!(flux_viscous, gradients, u_transformed, mesh::TreeMesh{1}, equations_parabolic::AbstractEquationsParabolic, @@ -542,7 +515,7 @@ function calc_gradient!(gradients, u_transformed, t, # Apply Jacobian from mapping to reference element @trixi_timeit timer() "Jacobian" begin apply_jacobian_parabolic!(gradients, mesh, equations_parabolic, dg, - cache_parabolic) + cache) end return nothing From 525a63faa344637c08b4d61dd6aac334294084bd Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Sat, 25 Nov 2023 17:16:58 -0600 Subject: [PATCH 6/6] removing more 2D instances of `cache_parabolic` --- src/solvers/dgsem_tree/dg_2d_parabolic.jl | 66 +++++++++++------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/solvers/dgsem_tree/dg_2d_parabolic.jl b/src/solvers/dgsem_tree/dg_2d_parabolic.jl index 06abff5e85b..091375448a0 100644 --- a/src/solvers/dgsem_tree/dg_2d_parabolic.jl +++ b/src/solvers/dgsem_tree/dg_2d_parabolic.jl @@ -23,19 +23,19 @@ function rhs_parabolic!(du, u, t, mesh::TreeMesh{2}, # Convert conservative variables to a form more suitable for viscous flux calculations @trixi_timeit timer() "transform variables" begin transform_variables!(u_transformed, u, mesh, equations_parabolic, - dg, parabolic_scheme, cache, cache_parabolic) + dg, parabolic_scheme, cache) end # Compute the gradients of the transformed variables @trixi_timeit timer() "calculate gradient" begin calc_gradient!(gradients, u_transformed, t, mesh, equations_parabolic, - boundary_conditions_parabolic, dg, cache, cache_parabolic) + boundary_conditions_parabolic, dg, cache) end # Compute and store the viscous fluxes @trixi_timeit timer() "calculate viscous fluxes" begin calc_viscous_fluxes!(flux_viscous, gradients, u_transformed, mesh, - equations_parabolic, dg, cache, cache_parabolic) + equations_parabolic, dg, cache) end # The remainder of this function is essentially a regular rhs! for parabolic @@ -62,25 +62,25 @@ function rhs_parabolic!(du, u, t, mesh::TreeMesh{2}, # Prolong solution to interfaces @trixi_timeit timer() "prolong2interfaces" begin - prolong2interfaces!(cache_parabolic, flux_viscous, mesh, equations_parabolic, + prolong2interfaces!(cache, flux_viscous, mesh, equations_parabolic, dg.surface_integral, dg, cache) end # Calculate interface fluxes @trixi_timeit timer() "interface flux" begin - calc_interface_flux!(cache_parabolic.elements.surface_flux_values, mesh, - equations_parabolic, dg, cache_parabolic) + calc_interface_flux!(cache.elements.surface_flux_values, mesh, + equations_parabolic, dg, cache) end # Prolong solution to boundaries @trixi_timeit timer() "prolong2boundaries" begin - prolong2boundaries!(cache_parabolic, flux_viscous, mesh, equations_parabolic, - dg.surface_integral, dg, cache) + prolong2boundaries!(cache, flux_viscous, mesh, equations_parabolic, + dg.surface_integral, dg) end # Calculate boundary fluxes @trixi_timeit timer() "boundary flux" begin - calc_boundary_flux_divergence!(cache_parabolic, t, + calc_boundary_flux_divergence!(cache, t, boundary_conditions_parabolic, mesh, equations_parabolic, dg.surface_integral, dg) @@ -94,7 +94,7 @@ function rhs_parabolic!(du, u, t, mesh::TreeMesh{2}, # Calculate mortar fluxes @trixi_timeit timer() "mortar flux" begin - calc_mortar_flux!(cache_parabolic.elements.surface_flux_values, mesh, + calc_mortar_flux!(cache.elements.surface_flux_values, mesh, equations_parabolic, dg.mortar, dg.surface_integral, dg, cache) end @@ -102,12 +102,12 @@ function rhs_parabolic!(du, u, t, mesh::TreeMesh{2}, # Calculate surface integrals @trixi_timeit timer() "surface integral" begin calc_surface_integral!(du, u, mesh, equations_parabolic, - dg.surface_integral, dg, cache_parabolic) + dg.surface_integral, dg, cache) end # Apply Jacobian from mapping to reference element @trixi_timeit timer() "Jacobian" begin - apply_jacobian_parabolic!(du, mesh, equations_parabolic, dg, cache_parabolic) + apply_jacobian_parabolic!(du, mesh, equations_parabolic, dg, cache) end return nothing @@ -118,7 +118,7 @@ end # TODO: can we avoid copying data? function transform_variables!(u_transformed, u, mesh::Union{TreeMesh{2}, P4estMesh{2}}, equations_parabolic::AbstractEquationsParabolic, - dg::DG, parabolic_scheme, cache, cache_parabolic) + dg::DG, parabolic_scheme, cache) transformation = gradient_variable_transformation(equations_parabolic) @threaded for element in eachelement(dg, cache) @@ -206,10 +206,10 @@ end # This is the version used when calculating the divergence of the viscous fluxes function calc_interface_flux!(surface_flux_values, mesh::TreeMesh{2}, equations_parabolic, - dg::DG, cache_parabolic) - @unpack neighbor_ids, orientations = cache_parabolic.interfaces + dg::DG, cache) + @unpack neighbor_ids, orientations = cache.interfaces - @threaded for interface in eachinterface(dg, cache_parabolic) + @threaded for interface in eachinterface(dg, cache) # Get neighboring elements left_id = neighbor_ids[1, interface] right_id = neighbor_ids[2, interface] @@ -222,7 +222,7 @@ function calc_interface_flux!(surface_flux_values, for i in eachnode(dg) # Get precomputed fluxes at interfaces - flux_ll, flux_rr = get_surface_node_vars(cache_parabolic.interfaces.u, + flux_ll, flux_rr = get_surface_node_vars(cache.interfaces.u, equations_parabolic, dg, i, interface) @@ -242,16 +242,16 @@ function calc_interface_flux!(surface_flux_values, end # This is the version used when calculating the divergence of the viscous fluxes -function prolong2boundaries!(cache_parabolic, flux_viscous, +function prolong2boundaries!(cache, flux_viscous, mesh::TreeMesh{2}, equations_parabolic::AbstractEquationsParabolic, - surface_integral, dg::DG, cache) - @unpack boundaries = cache_parabolic + surface_integral, dg::DG) + (; boundaries) = cache @unpack orientations, neighbor_sides, neighbor_ids = boundaries boundaries_u = boundaries.u flux_viscous_x, flux_viscous_y = flux_viscous - @threaded for boundary in eachboundary(dg, cache_parabolic) + @threaded for boundary in eachboundary(dg, cache) element = neighbor_ids[boundary] if orientations[boundary] == 1 @@ -295,7 +295,7 @@ function calc_viscous_fluxes!(flux_viscous, gradients, u_transformed, mesh::Union{TreeMesh{2}, P4estMesh{2}}, equations_parabolic::AbstractEquationsParabolic, - dg::DG, cache, cache_parabolic) + dg::DG, cache) gradients_x, gradients_y = gradients flux_viscous_x, flux_viscous_y = flux_viscous # output arrays @@ -744,7 +744,7 @@ end # Calculate the gradient of the transformed variables function calc_gradient!(gradients, u_transformed, t, mesh::TreeMesh{2}, equations_parabolic, - boundary_conditions_parabolic, dg::DG, cache, cache_parabolic) + boundary_conditions_parabolic, dg::DG, cache) gradients_x, gradients_y = gradients # Reset du @@ -780,16 +780,16 @@ function calc_gradient!(gradients, u_transformed, t, # Prolong solution to interfaces @trixi_timeit timer() "prolong2interfaces" begin - prolong2interfaces!(cache_parabolic, u_transformed, mesh, equations_parabolic, + prolong2interfaces!(cache, u_transformed, mesh, equations_parabolic, dg.surface_integral, dg) end # Calculate interface fluxes @trixi_timeit timer() "interface flux" begin - @unpack surface_flux_values = cache_parabolic.elements - @unpack neighbor_ids, orientations = cache_parabolic.interfaces + @unpack surface_flux_values = cache.elements + @unpack neighbor_ids, orientations = cache.interfaces - @threaded for interface in eachinterface(dg, cache_parabolic) + @threaded for interface in eachinterface(dg, cache) # Get neighboring elements left_id = neighbor_ids[1, interface] right_id = neighbor_ids[2, interface] @@ -802,7 +802,7 @@ function calc_gradient!(gradients, u_transformed, t, for i in eachnode(dg) # Call pointwise Riemann solver - u_ll, u_rr = get_surface_node_vars(cache_parabolic.interfaces.u, + u_ll, u_rr = get_surface_node_vars(cache.interfaces.u, equations_parabolic, dg, i, interface) flux = 0.5 * (u_ll + u_rr) @@ -818,13 +818,13 @@ function calc_gradient!(gradients, u_transformed, t, # Prolong solution to boundaries @trixi_timeit timer() "prolong2boundaries" begin - prolong2boundaries!(cache_parabolic, u_transformed, mesh, equations_parabolic, + prolong2boundaries!(cache, u_transformed, mesh, equations_parabolic, dg.surface_integral, dg) end # Calculate boundary fluxes @trixi_timeit timer() "boundary flux" begin - calc_boundary_flux_gradients!(cache_parabolic, t, + calc_boundary_flux_gradients!(cache, t, boundary_conditions_parabolic, mesh, equations_parabolic, dg.surface_integral, dg) @@ -848,7 +848,7 @@ function calc_gradient!(gradients, u_transformed, t, # Calculate surface integrals @trixi_timeit timer() "surface integral" begin @unpack boundary_interpolation = dg.basis - @unpack surface_flux_values = cache_parabolic.elements + @unpack surface_flux_values = cache.elements # Note that all fluxes have been computed with outward-pointing normal vectors. # Access the factors only once before beginning the loop to increase performance. @@ -895,9 +895,9 @@ function calc_gradient!(gradients, u_transformed, t, # Apply Jacobian from mapping to reference element @trixi_timeit timer() "Jacobian" begin apply_jacobian_parabolic!(gradients_x, mesh, equations_parabolic, dg, - cache_parabolic) + cache) apply_jacobian_parabolic!(gradients_y, mesh, equations_parabolic, dg, - cache_parabolic) + cache) end return nothing