1. The Enzo Project
  2. Untitled project
  3. enzo-dev
  4. Pull requests

Pull requests

#275 Merged at 1d17cf3
Repository
enzo-2.x-larrue
Branch
week-of-code
Repository
enzo-dev
Branch
week-of-code

Move the subtraction of magnetic pressure so that it only occurs if we do not have DualEnergyFormalism.

Author
  1. James Larrue
Reviewers
Description

In one case, the magnetic pressure was incorrectly subtracted from the gas energy when using DualEnergyFormalism.

Comments (5)

  1. dcollins4096

    Fascinating. I wonder how that happened. I'm on vacation right now, I'll put my good code eyes on this some time next week and approve then, but it looks right.

  2. John Wise

    This looks good, but while we're at it, B2 doesn't need to be calculated again. It's computed at the very start of the loop, and it's stored in B2. Since there's an if-statement there for UseMHDCT or MHD_RK, we don't need another one when the magnetic energy is subtracted. It's done nicely in the time-interpolation case in the else portion of the (time == Time) statement.

  3. James Larrue author

    I moved the calculation of B^2 and kinetic energy into the if-cases that actually use them. Not all cases require those values to be calculated, so now they are not calculated unless they will actually be used.