Pull requests

#117 Merged
Repository
dcollins4096/mhdct-extras mhdct-extras
Branch
week-of-code
Repository
enzo/enzo-dev enzo-dev
Branch
week-of-code

Adding zero acceleration, which is important when combining AccelerationBoundary and point-source-only gravity

Author
  1. dcollins4096
Reviewers
Description

With AccelerationBoundary and only a point source gravity, the gravitational field isn't cleared. Thus it accumulates, leading to hilarious growth of the potential.

  • Learn about pull requests

Comments (9)

  1. dcollins4096 author

    Those are reasonable comments. The original thought was to get the resetting done at a point where no logic was required, but now that I think about it I can make it simpler and put it in ComputeAccelerationFieldExternal. More once it passes push suite.

  2. dcollins4096 author

    Before SetAccelerationBoundary, AccelerationField was deleted at the end of every timestep. Since this makes it impossible to set the boundary conditions from parent grids with the boundary machinery, I removed that delete. With self gravity on, AccelerationField is initialized properly in ComputeAccelerationField, but with it off the necessary initialization is missing.

    This formulation doesn't work though. I pushed too soon. More later.

  3. Brian O'Shea

    Hi all,

    I was just looking through the hanging PRs, and stumbled across this (very simple) one. Can we accept this PR, or is there a reason to reject it?

  4. Greg Bryan

    Dave, I think this can be easily fixed if you add a loop over dims. I believe Yuan Li did this change and it solved this bug for her.

      if( SelfGravity == 0 )
          for (dim = 0; dim < GridRank; dim++) {
             for (i = 0; i < size; i++)
               AccelerationField[dim][i] = 0;
         }