Path: blob/main/src/callbacks_step/steady_state_dg3d.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 (steady_state_callback::SteadyStateCallback)(du, u, mesh::AbstractMesh{3},8equations, dg::DG, cache)9@unpack abstol, reltol = steady_state_callback1011terminate = true12for element in eachelement(dg, cache)13for k in eachnode(dg), j in eachnode(dg), i in eachnode(dg)14u_local = get_node_vars(u, equations, dg, i, j, k, element)15du_local = get_node_vars(du, equations, dg, i, j, k, element)16threshold = abstol + reltol * residual_steady_state(u_local, equations)17terminate = terminate &&18residual_steady_state(du_local, equations) <= threshold19end20end2122return terminate23end24end # @muladd252627