Fixed detection of number of files in Gadget loader

This commit is contained in:
Guilhem Lavaux 2012-11-23 13:54:42 -05:00
parent 529024c5ab
commit cc28abc14d

View file

@ -88,6 +88,7 @@ SimulationLoader *gadgetLoader(const std::string& snapshot, double Mpc_unitLengt
try
{
d = loadGadgetMulti(snapshot.c_str(), 0, 0);
num_files = 0;
}
catch(const NoSuchFileException& e)
{
@ -99,6 +100,8 @@ SimulationLoader *gadgetLoader(const std::string& snapshot, double Mpc_unitLengt
SimuData *header = d;
if (!singleFile)
{
try
{
while ((d = loadGadgetMulti(snapshot.c_str(), num_files, 0)) != 0)
{
@ -106,6 +109,10 @@ SimulationLoader *gadgetLoader(const std::string& snapshot, double Mpc_unitLengt
delete d;
}
}
catch(const NoSuchFileException& e)
{
}
}
return new GadgetLoader(snapshot, header, flags, singleFile, num_files, Mpc_unitLength);
}