Update to CUDA MHD solver:
1. Bug fix in DualEnergyFormalism
2. Added optional Dedner source term; used the same macro for CPU version for consistency
3. Fixed inconsistencies in dimx/idim naming
4. Replaced GPUMemSize magic number
CPU bug fix in EvolveHierarchy.C
It uses function calls inside Macro:
dtProc = min(dtProc, Temp->GridData->ComputeTimeStep());
Since min is a macro (macros_and_parameters.h):
define min(A,B) ((A) < (B) ? (A) : (B))
This causes ComputeTimeStep to be called twice!
I wonder whether there are similar bugs like this.
Hi @Peng Wang , wow -- nice catch on the min() macro!
For the CUDA Dedner source term, from what I understand now this will only use Dedner if DEDNER_SOURCE is defined, is that right? Should we define that by default then? I'm a bit concerned about turning it off by default if that is what the old behavior was. Other than that, this all looks good to me!
Dedner has two parts: hyperbolic cleaning (solving the phi equation) and some artifical source terms. The hyperbolic cleaning is always on when using Dedner MHD. But the Dedner source terms were commented out in the CPU version (Grid_MHDSourceTerms.C). I am not sure why but I followed the CPU version to not turn it on by default. Recently I added that to support some user's experiment to see the difference with that term added (almost none BTW).
Great, thanks for the info. Should we put the #ifdef DEDNER_SOURCE in the CPU version so it is consistent? (I see right now it is just #ifdef NOUSE)? I'm going to go ahead and approve, and I'll wait a day or so to see if anyone else chimes in before accepting it. Thanks!