Commit efb60a0b authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

add .hdf5 detection file for gadget3

parent 04b7bace
......@@ -583,8 +583,13 @@ template <class T> bool CSnapshotSimIn<T>::buildGadgetH5File()
PRINT("CSnapshotSimIn<T>::buildGadgetH5File() myfile=["<<myfile<<"]\n";)
if (snapshot) delete snapshot;
// try to open file
snapshot = new CSnapshotGadgetH5In<T>(myfile, this->select_part, this->select_time, this->verbose);
// try to open file with ".hdf5 extension"
snapshot = new CSnapshotGadgetH5In<T>(myfile+".hdf5", this->select_part, this->select_time, this->verbose);
if (!snapshot->isValidData()) {
delete snapshot;
// try to open file without ".hdf5 extension"
snapshot = new CSnapshotGadgetH5In<T>(myfile, this->select_part, this->select_time, this->verbose);
}
if (snapshot->isValidData()) { // file exist
T t;
bool ok=snapshot->getData("time",&t);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment