cglosser / QuEST

Quantum Electromagnetics Simulation Toolkit (QuEST)
GNU General Public License v2.0
3 stars 3 forks source link

Write output data in History class #47

Open cglosser opened 4 years ago

cglosser commented 4 years ago

The change to the History class in #46 means that main() won't be able to write out all of the simulation data to a file after it's finished simulating, so this logic should move into History and the object should write incrementally.

tbertus commented 4 years ago

The issue I have is that I do not want to write the output every time I change a value in the history array. Suppose I have a method history::set_value_at_time(step) that would change a value in the array and write the old value to the output file, If i were to call this during each corrector step I would have a problem. Presumably I should have something like history::write_results(step) that I call from inside PredictorCorrector::solve(), correct?

cglosser commented 4 years ago

Yes, definitely. Writing at the end of PredictorCorrector::solve() probably makes the most sense. You may also want to think about how you'll do this; it might make sense to develop a Writer or Logger that you construct the Integrator with that manages all of this.