[firedrake] Output for time-stepping?
Lawrence Mitchell
lawrence.mitchell at imperial.ac.uk
Fri Nov 13 11:52:52 GMT 2015
> On 13 Nov 2015, at 11:47, Justin Chang <jychang48 at gmail.com> wrote:
>
> Hi all,
>
> So I am running simulations which have many time steps and normally I would save the files as .pvd via outfile << File(...). This creates a new file for each time level
>
> However, if I need to solve a large geochemistry system of equations (~20 unknowns) over 100+ time steps, I would prefer not to have 2000+ pvd files sitting my file system/laptop. Is there a way to store the solution of all time levels into a single file?
You can store multiple time steps, of the same Function, in a single pvd file:
out = File("foo.pvd")
for i in range(200):
...
out << f
If you also want to store the timestep in the file, do:
for i in range(200};
...
out << (f, t)
Where t is the current timestep.
You cannot, however, store /different/ functions in the same file. So you'll presumably need one pvd per unknown. However, this is hopefully better than one per timestep as well.
Cheers,
Lawrence
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.ic.ac.uk/pipermail/firedrake/attachments/20151113/4ea8ebff/attachment.sig>
More information about the firedrake
mailing list