UG4 / ugcore

The core functionality of UG4. Includes sources, build-scripts, and utility scripts.
https://github.com/UG4/ugcore
Other
36 stars 23 forks source link

Behaviour of VTKOuput #20

Closed ghost closed 3 years ago

ghost commented 5 years ago

While trying to save a series of files using WriteGridFunctionToVTK from ugcore/ugbase/lib_disc/io/vtkoutput.h I found out that anything behind the last perio in the filename is handled as a file extension and is deleted.

I found that counterintuitive. If you want to save a series of files where the output is changed depending on one or more variables it is common to include its values in the filename (e.g. 1, 100, 0.005). While it was easy to just add another suffix at the end, I think the standard behaviour should be to allow these naming schemes if this behaviour does not produce any other problems somewhere else in the codebase.

stephanmg commented 5 years ago

Hello @Sanjihan,

I ran into the same issue once, but you can simply use another character for the period like "_".

Considering this note about period characters in filenames (https://en.wikipedia.org/wiki/Filename) for me the behaviour seems okay but I wouldn't be unhappy if somebody changes it:

Allowed, but the last occurrence will be interpreted to be the extension separator in VMS, DOS, and Windows. In other OSes, usually considered as part of the filename, and more than one period (full stop) may be allowed. In Unix, a leading period means the file or folder is normally hidden.