Path: blob/main/src/solvers/dgsem_unstructured/indicators_2d.jl
5590 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 apply_smoothing!(mesh::UnstructuredMesh2D, alpha, alpha_tmp, dg, cache)8# Diffuse alpha values by setting each alpha to at least 50% of neighboring elements' alpha9# Copy alpha values such that smoothing is indpedenent of the element access order10alpha_tmp .= alpha1112# Loop over interfaces13for interface in eachinterface(dg, cache)14# Get neighboring element ids15left = cache.interfaces.element_ids[1, interface]16right = cache.interfaces.element_ids[2, interface]1718# Apply smoothing19alpha[left] = max(alpha_tmp[left], 0.5f0 * alpha_tmp[right], alpha[left])20alpha[right] = max(alpha_tmp[right], 0.5f0 * alpha_tmp[left], alpha[right])21end2223return nothing24end25end # @muladd262728