Closed gabrielfougeron closed 9 years ago
You can add all what you want provided that the <key,value>
I need remain (x
, t
and m
for the moment).
I will be able at any moment to parse new variables you would have added to the output file.
Output file at https://github.com/giulioforesto/planets/blob/master/Planets-simulator/output/outfile.txt is almost ok. But for x
and m
I need them to be:
{
"t": <long>,
"x": {
"id1": [<float>, <float>],
"id2": [<float>, <float>]
},
"m": {
"id2": <float>
}
}
Print output routine updated.
Cannot unfortunately write new line at the beginning of file without overwriting the current line
Remember that a "refresh" function might provide an easy (and totally fine) work-arround
I should be able to read backwards, need file example to test.
Otherwise, non-live representation or refresh feature are possible, so the issue about the writing order will be closed as soon as I can check the revised output file example.
Edit: output file is ok. live-representation issues must be discussed in new issue.
I copied the format of you two (short and long) tests. Check if file format is ok.
New variables Is it a problem if I add new variables in the output format (e.g. total energy) ? Do I have to somehow "tell" you, or isthe JSON format conveniant enought that it allows you to discard them ? (until needed)
Order New lines should be added at the beginning of the file. See
testCases.md
on branchplotter
for more details.If necessary, see http://stackoverflow.com/questions/7110616/fortran-how-to-write-data-to-specific-line-in-the-file.