Path: blob/main/src/callbacks_step/euler_acoustics_coupling_dg2d.jl
2055 views
# By default, Julia/LLVM does not use fused multiply-add operations (FMAs).1# Since these FMAs can increase the performance of many numerical algorithms,2# we need to opt-in explicitly.3# See https://ranocha.de/blog/Optimizing_EC_Trixi for further details.4@muladd begin5#! format: noindent67function calc_acoustic_sources!(acoustic_source_terms, u_euler, u_acoustics,8vorticity_mean,9coupled_element_ids, mesh,10equations::AbstractCompressibleEulerEquations{2},11dg::DGSEM, cache)12acoustic_source_terms .= zero(eltype(acoustic_source_terms))1314@threaded for k in eachindex(coupled_element_ids)15element = coupled_element_ids[k]1617for j in eachnode(dg), i in eachnode(dg)18vorticity = calc_vorticity_node(u_euler, mesh, equations, dg, cache, i, j,19element)2021prim_euler = cons2prim(get_node_vars(u_euler, equations, dg, i, j, element),22equations)23v1 = prim_euler[2]24v2 = prim_euler[3]25v1_mean = u_acoustics[4, i, j, element]26v2_mean = u_acoustics[5, i, j, element]2728vorticity_prime = vorticity - vorticity_mean[i, j, element]29v1_prime = v1 - v1_mean30v2_prime = v2 - v2_mean3132acoustic_source_terms[1, i, j, k] -= -vorticity_prime * v2_mean -33vorticity_mean[i, j, element] *34v2_prime35acoustic_source_terms[2, i, j, k] -= vorticity_prime * v1_mean +36vorticity_mean[i, j, element] *37v1_prime38end39end4041return nothing42end43end # @muladd444546