Skip to content

Commit

Permalink
Merge 189a625 into 7be37be
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsdeppe committed Feb 13, 2023
2 parents 7be37be + 189a625 commit e7833e1
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,14 @@ struct ComputeTimeDerivImpl<
for (size_t i = 0; i < dt_var.size(); ++i) {
if constexpr (not tmpl::list_contains_v<
tmpl::list<GrmhdSourceTags...>, GrmhdDtTags>) {
// Zero GRMHD tags that don't have sources.
dt_var[i] = 0.0;
// On the first iteration of the loop over `dim`, zero the GRMHD
// dt(u) for variables that do not have a source term . This is
// necessary to avoid `+=` to a `NaN` (debug mode) or random garbage
// (release mode). `add_cartesian_flux_divergence` does a `+=`
// internally.
if (dim == 0) {
dt_var[i] = 0.0;
}
}

evolution::dg::subcell::add_cartesian_flux_divergence(
Expand Down

0 comments on commit e7833e1

Please sign in to comment.