mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
Fixed detection of number of files in Gadget loader
This commit is contained in:
parent
529024c5ab
commit
cc28abc14d
1 changed files with 12 additions and 5 deletions
|
@ -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)
|
||||
{
|
||||
|
@ -100,11 +101,17 @@ SimulationLoader *gadgetLoader(const std::string& snapshot, double Mpc_unitLengt
|
|||
|
||||
if (!singleFile)
|
||||
{
|
||||
while ((d = loadGadgetMulti(snapshot.c_str(), num_files, 0)) != 0)
|
||||
{
|
||||
num_files++;
|
||||
delete d;
|
||||
}
|
||||
try
|
||||
{
|
||||
while ((d = loadGadgetMulti(snapshot.c_str(), num_files, 0)) != 0)
|
||||
{
|
||||
num_files++;
|
||||
delete d;
|
||||
}
|
||||
}
|
||||
catch(const NoSuchFileException& e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return new GadgetLoader(snapshot, header, flags, singleFile, num_files, Mpc_unitLength);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue