dedalus
dedalus copied to clipboard
Interactive field saving/loading
Original report (archived issue) by Keaton Burns (Bitbucket: kburns).
Better system for easily saving/loading fields, for interactive work or for linear solvers (i.e. outside of an Evaluator context).
Original comment by J. S. Oishi (Bitbucket: jsoishi).
A minimal way of saving a single field phi defined on a domain domain is as follows:
from dedalus.core.problems import Namespace
from dedalus.core.evaluator import FileHandler
nm = Namespace()
nm['phi'] = phi
handler = FileHandler('test_files',domain, nm)
handler.add_task('phi')
handler.tasks[0]['out'] = phi
handler.process(0, 0, 0, 0, 0)
This may not all be necessary, but it is sufficient.