Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve VTK output file naming #624

Open
BenjaminRodenberg opened this issue Apr 5, 2021 · 0 comments
Open

Improve VTK output file naming #624

BenjaminRodenberg opened this issue Apr 5, 2021 · 0 comments

Comments

@BenjaminRodenberg
Copy link
Contributor

BenjaminRodenberg commented Apr 5, 2021

The way how treelog.userfile resolves conflicting filenames leads to problems with Paraview. I will provide more information below and I hope it's enough to understand the problems I'm facing.

How do I write output?

Usually a nutils script has the following layout:

# initialization
nutils.export.vtk(`out/solution`, ...)

for step in range(5):
    # computation
    nutils.export.vtk(`out/solution`, ...)

This results in the following output files:

$ ls out/
solution-1.vtk  solution-2.vtk  solution-3.vtk  solution-4.vtk  solution-5.vtk  solution.vtk

I like about the current approach that I only have to provide the prefix solution and nutils takes care of the rest. However, the way how treelog.userfile deals with conflicting filenames is problematic (see below).

What's the problem?

  1. If I run the same script again the output is not overwritten, but the old output files are kept while the new output is "appended". I get
$ ls out/
solution-10.vtk  solution-11.vtk  solution-1.vtk  solution-2.vtk  solution-3.vtk  solution-4.vtk  solution-5.vtk  solution-6.vtk  solution-7.vtk  solution-8.vtk  solution-9.vtk  solution.vtk
  1. The output is not working correctly with paraview, because the files solution-* are considered as one dataset and solution.vtk is ignored here:
    image

What do I expect?

I'm working a lot with FEniCS. Here the following rules are applied, when writing output:

  • when the filename solution is given, start with solution-0.vtk. I currently can get what I want, by manually renaming solution.vtk to solution-0.vtk:
    image
  • override existing files. Here, I currently have to manually delete old files before running a new simulation.

Further resources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant