Closed pgrete closed 2 years ago
@pgrete, I'm pretty confident that you're right; we should probably be checking the value of EnzoBlock::NumberOfBaryonFields[my_processing_element] > 0
. There's also a similar check in EnzoBlock::SolveMHDEquations
Actually, looking at the code within that "if" statement, it would probably be more robust to directly check whether the fields called "density"
, "velox"
, "veloy"
, "veloz"
, "bfieldx"
, "bfieldy"
, and "bfieldz"
are all defined. (As an aside, the field names should probably also be updated so that they are consistent with other solvers, but that might be kind of involved).
I don't think that anyone actually uses this solver, so I would definitely go for the "easy" fix.
This has been addressed in PR #97
This has been addressed in PR #97
Great! I'll link the PR so that the issue will be closed automatically once #97 is in.
After a system update (which came with an updated
g++
), Enzo-E now fails to compile withThis also applies to other files, e.g.,
build-master/Enzo/enzo_SetMinimumSupport.cpp
orbuild-master/Enzo/enzo_SolveMHDEquations.cpp
.As far as I can tell
int EnzoBlock::NumberOfBaryonFields[CONFIG_NODE_SIZE];
fromenzo_EnzoBlock
will always be!= nullptr
becauseCONFIG_NODE_SIZE
is a compile time constant. Thus, the conditional as it stands will always be true (if it compiles).I assume that the idea behind the conditional is that those code pieces should only be called if there are actualy baryon fields. If that's true, then the check should be updated to sth like
EnzoBlock::NumberOfBaryonFields[my_processing_element] > 0
.More generally, I wonder if
NumberOfBaryonFields
actually needs to be an array (similar to the many other variables of EnzoBlock such as the block dimensions) as those numbers are (AFAIK) constant across all PEs for a given simulation.@jobordner it'd be great to get your input on this as I'm probably missing sth (for not being too familiar with the low level design).