mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 23:31:12 +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
|
try
|
||||||
{
|
{
|
||||||
d = loadGadgetMulti(snapshot.c_str(), 0, 0);
|
d = loadGadgetMulti(snapshot.c_str(), 0, 0);
|
||||||
|
num_files = 0;
|
||||||
}
|
}
|
||||||
catch(const NoSuchFileException& e)
|
catch(const NoSuchFileException& e)
|
||||||
{
|
{
|
||||||
|
@ -100,11 +101,17 @@ SimulationLoader *gadgetLoader(const std::string& snapshot, double Mpc_unitLengt
|
||||||
|
|
||||||
if (!singleFile)
|
if (!singleFile)
|
||||||
{
|
{
|
||||||
while ((d = loadGadgetMulti(snapshot.c_str(), num_files, 0)) != 0)
|
try
|
||||||
{
|
{
|
||||||
num_files++;
|
while ((d = loadGadgetMulti(snapshot.c_str(), num_files, 0)) != 0)
|
||||||
delete d;
|
{
|
||||||
}
|
num_files++;
|
||||||
|
delete d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(const NoSuchFileException& e)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new GadgetLoader(snapshot, header, flags, singleFile, num_files, Mpc_unitLength);
|
return new GadgetLoader(snapshot, header, flags, singleFile, num_files, Mpc_unitLength);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue