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

Pull requests

#278 Merged at e2d61cc

Removal of CenteredB

  1. dcollins4096

Cleanup of MHD: Remove CenteredB. This cleans up a bunch of redundant code.

NB: Since its inception two additional changes have been made to this PR. a.) I have added MaxVelocityIndex to clean up cumbersome logic for Vy and Vz for certain solvers. This will be rolled out in full in a forthcoming PR.
b.) I've added a changelog in the run directory to keep track of when test problems change.

In this PR, we remove CenteredB and regularize the usage of UseMHD, UseMHDCT, HydroMethod==4, HydroMethod==6. While this changes several files, there are only a few types of changes.

1.) CenteredB is removed. This is a redundant field, and better handled by BaryonField. In all cases currently existing in the code, it can be wholly replaced by the appropriate BaryonField. This makes the code easier to modify, read, maintain, and compare the two MHD modules.

2.) The behavior of UseMHD is slightly different. Now, UseMHD refers to either MHD module. Behavior specific to the Dedner solver is switched by HydroMethod==MHD_RK; things specific to the Face and Edge Centered magnetic fields are switched by UseMHDCT; Things specific to the MHD_Li method are switched by MHD_Li.

3.) The old SolveMHDEquations is removed

4.) Flags for MHD_UseSpecificEnergy is removed from Read/Write ParameterFile. A future PR will remove the code functionality itself, but I wanted to keep this PR compact.

Documentation that reflects the current changes will follow in a subsequent PR, but I wanted to keep this one as compact as possible.

While this is handled smoothly by the new FieldObjects in enzo3.0, I expect enzo2.x will be with us for some time.

Comments (14)

  1. Brian O'shea

    This PR breaks a ton of the tests: http://srs.slac.stanford.edu/hudson/job/enzo-dev/241/ . The primary failure mode seems to be "YTNoOldAnswer" (see http://srs.slac.stanford.edu/hudson/job/enzo-dev/241/testReport/(root)/FreeExpansiontest_free_expansion/test_collapse_max_value/ for an example), tests that don't run at all (see http://srs.slac.stanford.edu/hudson/job/enzo-dev/241/testReport/(root)/Athena-RayleighTaylortest_standard/test_standard/), and then some tests that run but where there are floating-point differences (the MHD tests). dcollins4096 , could you please look into this a bit? It seems like there's something significantly wrong going on here.

  2. dcollins4096 author

    All tests should pass now.

    The result of MHDCTOrszagTang and MHDCTOrszagTangAMR have changed due to the removal of the MHDUseSpecificEnergy flag. This doesn't change the behavior, only the nature of the TotalEnergy field on disk which is different by 1/Density.

    I added two minor bits that I mention in the description: A changelog of tests for when people are digging through older versions; and MaxVelocityIndex which shortens the logic that typically goes something like

    if ( GridRank > 1 || HydroMethod == MHD_RK || HydroMethod == HD_RK || HydroMethod == MHD_Li){
      do something with vy

    So far its only implemented in IdentifyPhysicalQuantities. I'll make another PR in the near future that fleshes this out.

      1. dcollins4096 author

        All of these failures are expected.
        It's SphericalInfall and DrivenTurbulence, which fail due to previous bug fixes, and the OrszagTang tests, which are now going to fail because I've slightly changed the initializer.