mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 23:31:12 +00:00
Fixes for single file gadget snapshots
This commit is contained in:
parent
69ba427705
commit
8cf7ff563e
1 changed files with 5 additions and 1 deletions
|
@ -71,10 +71,12 @@ SimuData *myLoadGadget(const char *fname, int id, int flags)
|
||||||
SimuData *doLoadSimulation(const char *gadgetname, int velAxis, bool goRedshift, SimuData *(*loadFunction)(const char *fname, int id, int flags))
|
SimuData *doLoadSimulation(const char *gadgetname, int velAxis, bool goRedshift, SimuData *(*loadFunction)(const char *fname, int id, int flags))
|
||||||
{
|
{
|
||||||
SimuData *d, *outd;
|
SimuData *d, *outd;
|
||||||
|
bool singleFile = false;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
d = loadFunction(gadgetname, -1, 0);
|
d = loadFunction(gadgetname, -1, 0);
|
||||||
|
singleFile = true;
|
||||||
}
|
}
|
||||||
catch (const NoSuchFileException& e)
|
catch (const NoSuchFileException& e)
|
||||||
{
|
{
|
||||||
|
@ -102,7 +104,7 @@ SimuData *doLoadSimulation(const char *gadgetname, int velAxis, bool goRedshift,
|
||||||
outd->Vel[2] = new float[outd->NumPart];
|
outd->Vel[2] = new float[outd->NumPart];
|
||||||
delete d;
|
delete d;
|
||||||
|
|
||||||
int curCpu = 0;
|
int curCpu = singleFile ? -1 : 0;
|
||||||
cout << "loading file 0 " << endl;
|
cout << "loading file 0 " << endl;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -123,6 +125,8 @@ SimuData *doLoadSimulation(const char *gadgetname, int velAxis, bool goRedshift,
|
||||||
outd->Pos[velAxis][d->Id[i]-1] += d->Vel[velAxis][i]/100.;
|
outd->Pos[velAxis][d->Id[i]-1] += d->Vel[velAxis][i]/100.;
|
||||||
|
|
||||||
delete d;
|
delete d;
|
||||||
|
if (singleFile)
|
||||||
|
break;
|
||||||
curCpu++;
|
curCpu++;
|
||||||
cout << "loading file " << curCpu << endl;
|
cout << "loading file " << curCpu << endl;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue