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?
- 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
- The output is not working correctly with paraview, because the files
solution-* are considered as one dataset and solution.vtk is ignored here:

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:

- override existing files. Here, I currently have to manually delete old files before running a new simulation.
Further resources:
The way how
treelog.userfileresolves 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:
This results in the following output files:
I like about the current approach that I only have to provide the prefix
solutionand nutils takes care of the rest. However, the way howtreelog.userfiledeals with conflicting filenames is problematic (see below).What's the problem?
solution-*are considered as one dataset andsolution.vtkis ignored here:What do I expect?
I'm working a lot with FEniCS. Here the following rules are applied, when writing output:
solutionis given, start withsolution-0.vtk. I currently can get what I want, by manually renamingsolution.vtktosolution-0.vtk:Further resources:
Full example of nutils code that we are using + workaround for the problems described above: https://github.com/precice/tutorials/blob/5783ae56fbb10bb3ca4a5e8e9808ca248cc645b8/partitioned-heat-conduction/nutils/heat.py#L97-L166
solution.vtksuch that the first file nutils write is notsolution.vtk, butsolution-1.vtk(see precice/tutorials@e7b4459).How FEniCS uses output files in a similar context:
Minimal example using
treelog.userfile:nutils-export.txt