Skip to content
Snippets Groups Projects
Commit 22ea1c6a authored by Alain O' Miniussi's avatar Alain O' Miniussi
Browse files

C->C++

Former-commit-id: 6e63ef4d4f69cadfa8b0b2936ccfa96b87cdff69
parent 4b668669
Branches
Tags OldPlanetPrinting
No related merge requests found
......@@ -83,12 +83,19 @@ namespace D3 {
Planet p = sys.planet(i);
Triplet pos = p.position;
Triplet vel = p.velocity;
FILE *output = OFileOpenIndexed("planet%d.dat", i, "a");
fprintf (output, "%d\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%.10g\t%.10g\t%.10g\t%f\t%f\n",
progress.outputIndex(), pos.x, pos.y, pos.z, vel.x, vel.y, vel.z, p.mass,
sys.lostMass()*RHO0*VOL0/XMSOL,sys.lostMassZ()*RHO0*VOL0/XMSOL,sys.lostAccretion(),
progress.physicalTime(), *disk.referential().omega);
fclose (output);
std::ofstream out(OFilePathIndexed("planet%d.dat", i), std::ofstream::trunc);
out << std::scientific;
out.precision(10);
out << progress.outputIndex()
<< pos.x << pos.y << pos.z
<< vel.x << vel.y << vel.z
<< p.mass
<< sys.lostMass()*RHO0*VOL0/XMSOL
<< sys.lostMassZ()*RHO0*VOL0/XMSOL
<< sys.lostAccretion()
<< progress.physicalTime()
<< *disk.referential().omega
<< std::endl;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment