Closed JBorrow closed 5 years ago
Isn't it better to check for the presence of the Header/Code == SWIFT
in the HDF5 file such that it will work also in the cases where we don't use the SWIFTEAGLE names? e.g. in DMONLY runs?
I thought the SWIFT/EAGLE names was turned on for ...NAMING_CONVENTION=6
which should be turned on irrespective of whether or not it's a DMOnly?
I suppose both are redundant at the moment since the only SWIFT names we have are all SWIFTEAGLE.
The way I've done this is consistent with the below,
if (opt.ihdfnameconvention==HDFSWIFTEAGLENAMES) {
vlongbuff = read_attribute_v<long long>(Fhdf[i], hdf_header_info[i].names[hdf_header_info[i].INuminFile]);
for (k=0;k<NHDFTYPE;k++) hdf_header_info[i].npart[k]=vlongbuff[k];
}
else{
vuintbuff = read_attribute_v<unsigned int>(Fhdf[i], hdf_header_info[i].names[hdf_header_info[i].INuminFile]);
for (k=0;k<NHDFTYPE;k++) hdf_header_info[i].npart[k]=vuintbuff[k];
}
Looks good. I merged, and then put an additional commit on top to adjust spacing/indentation to keep consistency.
Fixes #39 by replacing the BoxSize reader with one that handles the fact that SWIFT uses a vector of BoxSizes. In the GADGET standard, this value is just a double; in SWIFT the boxes can be non-cubic and so we store a value for all three dimensions.
As far as I can tell, this was returning a pointer to VR when accessing, which then of course caused many problems.