Output for time-stepping?
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? Thanks, Justin
On 13 Nov 2015, at 11:47, Justin Chang <jychang48@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
Lawrence, So the first option is what I have been doing. Yes only one pvd is created. But what ends up also happening is that I get hundreds of .vtu files. Are those files necessary for pvd to work? Sorry I am not in front of my computer so I can't test any of this out yet. Thanks, Justin On Friday, November 13, 2015, Lawrence Mitchell < lawrence.mitchell@imperial.ac.uk> wrote:
On 13 Nov 2015, at 11:47, Justin Chang <jychang48@gmail.com <javascript:;>> 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
Yes the vtu files are necessary (I tried deleting them to check if the pvd would work, but it didn't). Anna. On 13/11/15 12:14, Justin Chang wrote:
Lawrence,
So the first option is what I have been doing. Yes only one pvd is created. But what ends up also happening is that I get hundreds of .vtu files. Are those files necessary for pvd to work? Sorry I am not in front of my computer so I can't test any of this out yet.
Thanks, Justin
On Friday, November 13, 2015, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk <mailto:lawrence.mitchell@imperial.ac.uk>> wrote:
> On 13 Nov 2015, at 11:47, Justin Chang <jychang48@gmail.com <javascript:;>> 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
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
-- Dr Anna Kalogirou Research Fellow School of Mathematics University of Leeds http://www1.maths.leeds.ac.uk/~matak/
On 13 Nov 2015, at 12:14, Justin Chang <jychang48@gmail.com> wrote:
Lawrence,
So the first option is what I have been doing. Yes only one pvd is created. But what ends up also happening is that I get hundreds of .vtu files. Are those files necessary for pvd to work? Sorry I am not in front of my computer so I can't test any of this out yet.
Aha, I see. Yes, unfortunately that's how it is :(. Eventually we intend to have nice HDF5 output for viz, but it's not there yet. Cheers, Lawrence
-----Ursprüngliche Nachricht----- Von: firedrake-bounces@imperial.ac.uk [mailto:firedrake- bounces@imperial.ac.uk] Im Auftrag von Lawrence Mitchell Gesendet: 13 November 2015 13:20 An: firedrake@imperial.ac.uk Betreff: Re: [firedrake] Output for time-stepping?
On 13 Nov 2015, at 12:14, Justin Chang <jychang48@gmail.com> wrote:
Lawrence,
So the first option is what I have been doing. Yes only one pvd is created. But what ends up also happening is that I get hundreds of .vtu files. Are those files necessary for pvd to work? Sorry I am not in front of my computer so I can't test any of this out yet.
Aha, I see. Yes, unfortunately that's how it is :(. Eventually we intend to have nice HDF5 output for viz, but it's not there yet.
Cheers,
Lawrence
[Buesing, Henrik] Since you can also access PETSc directly, shouldn't you be able to use PetscViewerVTKOpen or PetscViewerHDF5Open for the output?
On 13 Nov 2015, at 14:56, Buesing, Henrik <HBuesing@eonerc.rwth-aachen.de> wrote:
-----Ursprüngliche Nachricht----- Von: firedrake-bounces@imperial.ac.uk [mailto:firedrake- bounces@imperial.ac.uk] Im Auftrag von Lawrence Mitchell Gesendet: 13 November 2015 13:20 An: firedrake@imperial.ac.uk Betreff: Re: [firedrake] Output for time-stepping?
On 13 Nov 2015, at 12:14, Justin Chang <jychang48@gmail.com> wrote:
Lawrence,
So the first option is what I have been doing. Yes only one pvd is created. But what ends up also happening is that I get hundreds of .vtu files. Are those files necessary for pvd to work? Sorry I am not in front of my computer so I can't test any of this out yet.
Aha, I see. Yes, unfortunately that's how it is :(. Eventually we intend to have nice HDF5 output for viz, but it's not there yet.
Cheers,
Lawrence
[Buesing, Henrik] Since you can also access PETSc directly, shouldn't you be able to use PetscViewerVTKOpen or PetscViewerHDF5Open for the output?
I think this requires that the Vec you get knows about the topology through a DM of some kind. Unfortunately for a large class of the firedrake meshes (particularly the extruded meshes), although we have a DM describing the topology it's not "correct" for visualisation. Cheers, Lawrence
-----Ursprüngliche Nachricht----- Von: firedrake-bounces@imperial.ac.uk [mailto:firedrake- bounces@imperial.ac.uk] Im Auftrag von Lawrence Mitchell Gesendet: 13 November 2015 16:20 An: firedrake@imperial.ac.uk Betreff: Re: [firedrake] Output for time-stepping?
On 13 Nov 2015, at 14:56, Buesing, Henrik <HBuesing@eonerc.rwth- aachen.de> wrote:
-----Ursprüngliche Nachricht----- Von: firedrake-bounces@imperial.ac.uk [mailto:firedrake- bounces@imperial.ac.uk] Im Auftrag von Lawrence Mitchell Gesendet: 13 November 2015 13:20 An: firedrake@imperial.ac.uk Betreff: Re: [firedrake] Output for time-stepping?
On 13 Nov 2015, at 12:14, Justin Chang <jychang48@gmail.com> wrote:
Lawrence,
So the first option is what I have been doing. Yes only one pvd is created. But what ends up also happening is that I get hundreds of .vtu files. Are those files necessary for pvd to work? Sorry I am not in front of my computer so I can't test any of this out yet.
Aha, I see. Yes, unfortunately that's how it is :(. Eventually we intend to have nice HDF5 output for viz, but it's not there yet.
Cheers,
Lawrence
[Buesing, Henrik] Since you can also access PETSc directly, shouldn't you be able to use PetscViewerVTKOpen or PetscViewerHDF5Open for the output?
I think this requires that the Vec you get knows about the topology through a DM of some kind. Unfortunately for a large class of the firedrake meshes (particularly the extruded meshes), although we have a DM describing the topology it's not "correct" for visualisation.
[Buesing, Henrik] Ah, I see. That's true, you would need a DM or DMPLEX. I thought one might extract this from the KSP or SNES.
participants (4)
- 
                
                Anna Kalogirou
- 
                
                Buesing, Henrik
- 
                
                Justin Chang
- 
                
                Lawrence Mitchell