+
Skip to content

Improve VTK output file naming #624

@BenjaminRodenberg

Description

@BenjaminRodenberg

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载