expand the name patterns for temporal file series to include time represented as floats
When importing a temporal file series (e.g. foo_N.vtk), paraview currently only recognizes N as an integer sequence (for instance where N=001,002,003,..). If the time series is named after a time represented by a float (e.g. N=0.5,1.0,1.5,... where you can think of that numbers as being seconds) the file series is not recognized.
Since naming a file after it's simulation time seems to be a fairly common practice, it would be helpful to expand the naming patterns and allow for N to be a float and not only an integer.
-
Mathieu Westphal commented
Supported by .series and .pvd files, use these.
-
Anonymous commented
This suggestion here: https://paraview.uservoice.com/forums/11350-general/suggestions/3016109-varying-timestep-size-for-vtk-format-files
seems to be similar -
Greg Vernon commented
To avoid file extension issues, could replace the '.' with 'p' for "point" (e.g: 1.37 ==> One Point Three-Seven ==> 1p37)
-
Anonymous commented
The following patch, would implement this feature, for all files which end with "A.B.ext", where A and B are integers.
--- ParaView-v5.0.0-source/ParaViewCore/VTKExtensions/Default/vtkFileSequenceParser.h 2016-01-08 21:21:35.000000000 +0100
+++ ParaViewCore/VTKExtensions/Default/vtkFileSequenceParser.h 2016-03-04 08:10:27.366157431 +0100
@@ -53,6 +53,7 @@
~vtkFileSequenceParser();
vtksys::RegularExpression * reg_ex;
+ vtksys::RegularExpression * reg_ex22;
vtksys::RegularExpression * reg_ex2;
vtksys::RegularExpression * reg_ex3;
vtksys::RegularExpression * reg_ex4;
--- ParaView-v5.0.0-source/ParaViewCore/VTKExtensions/Default/vtkFileSequenceParser.cxx 2016-01-08 21:21:35.000000000 +0100
+++ ParaViewCore/VTKExtensions/Default/vtkFileSequenceParser.cxx 2016-03-04 08:24:26.358132642 +0100
@@ -26,6 +26,8 @@
vtkFileSequenceParser::vtkFileSequenceParser() :
// sequence ending with numbers.
reg_ex( new vtksys::RegularExpression("^(.*)\\.([0-9.]+)$")),
+ // sequence ending with extension (dual 000.001) .
+ reg_ex22( new vtksys::RegularExpression("^(.*)(\\.|_|-)([0-9.]+)\\.([0-9.]+)\\.(.*)$")),
// sequence ending with extension.
reg_ex2( new vtksys::RegularExpression("^(.*)(\\.|_|-)([0-9.]+)\\.(.*)$")),
// sequence ending with extension, but with no ". or _" before
@@ -49,6 +51,7 @@
vtkFileSequenceParser::~vtkFileSequenceParser()
{
delete this->reg_ex;
+ delete this->reg_ex22;
delete this->reg_ex2;
delete this->reg_ex3;
delete this->reg_ex4;
@@ -69,6 +72,12 @@
this->SequenceIndex = atoi(reg_ex->match(2).c_str());
match = true;
}
+ else if (this->reg_ex22->find(file))
+ {
+ this->SetSequenceName(std::string(this->reg_ex22->match(1) + this->reg_ex22->match(2) + ".." + this->reg_ex22->match(5)).c_str());
+ this->SequenceIndex = atoi((reg_ex22->match(3) + reg_ex22->match(4)).c_str());
+ match = true;
+ }
else if (this->reg_ex2->find(file))
{
this->SetSequenceName(std::string(this->reg_ex2->match(1) + this->reg_ex2->match(2) + ".." + this->reg_ex2->match(4)).c_str());