Provides a means of accumulating and generating VTK file series. More...
#include <foamVtkSeriesWriter.H>
Public Member Functions | |
| seriesWriter () noexcept | |
| Construct an empty series (.series ending). | |
| seriesWriter (const seriesWriter &)=default | |
| Copy construct. | |
| seriesWriter (seriesWriter &&)=default | |
| Move construct. | |
| seriesWriter & | operator= (const seriesWriter &)=default |
| Copy assignment. | |
| seriesWriter & | operator= (seriesWriter &&)=default |
| Move assignment. | |
| ~seriesWriter ()=default | |
| Destructor. | |
| bool | empty () const noexcept |
| True if there are no data sets. | |
| label | size () const noexcept |
| The number of data sets. | |
| bool | json () const noexcept |
| Preferred extension is "json" instead of "series". | |
| bool | json (bool on) noexcept |
| Toggle the preferred extension to "json" on/off. Return the old json state. | |
| void | clear () |
| Clear entries. | |
| bool | append (const fileNameInstant &inst) |
| Append the specified file instant. | |
| bool | append (fileNameInstant &&inst) |
| Append the specified file instant. | |
| bool | append (scalar timeValue, const fileName &file) |
| Append the specified file instant. | |
| bool | append (scalar timeValue, fileName &&file) |
| Append the specified file instant. | |
| label | load (const fileName &seriesName, const bool checkFiles=false, const scalar restartTime=ROOTVGREAT) |
| Clear contents and reload by parsing the specified file. | |
| label | scan (const fileName &seriesName, const scalar restartTime=ROOTVGREAT) |
| Clear contents and scan directory for files. | |
| bool | removeNewer (const scalar timeValue) |
| Remove entries that are greater_equal the time value. | |
| void | sort () |
| Sort by time value and by file name. | |
| void | print (Ostream &os) const |
| Print file series as (JSON format). | |
| void | write (const fileName &seriesName) const |
| Write file series as (JSON format) to disk. | |
Static Public Member Functions | |
| static fileName | base (const fileName &outputName, char sep='_') |
| Extract the base name for a file series. | |
| static word | suffix (const fileName &file, char sep='_') |
| Extract the time-varying ending of files. | |
| static Ostream & | print (Ostream &os, const fileName &seriesName, const UList< instant > &series, const char sep='_') |
| Print file series (JSON format) for specified time instances. | |
| static void | write (const fileName &base, const UList< instant > &series, const char sep='_') |
| Write file series (JSON format) to disk, for specified instances. | |
| static Ostream & | print (Ostream &os, const UList< fileNameInstant > &series) |
| Print file series (JSON format) for specified time instances. | |
| static void | write (const fileName &seriesName, const UList< fileNameInstant > &series) |
| Write file series (JSON format) to disk, for specified instances. | |
Provides a means of accumulating and generating VTK file series.
The VTK file series format is a simple JSON format with the following type of content:
{
"file-series-version" : "1.0",
"files": [
{ "name" : "file1.vtk", "time" : 10 },
{ "name" : "file2.vtk", "time" : 20 },
{ "name" : "file3.vtk", "time" : 30 },
]
}
The append() operations include various sanity checks. Entries with an empty name are ignored. If an entry with an identical name already exists, its place will be overwritten with the new time value.
Definition at line 73 of file foamVtkSeriesWriter.H.
|
inlinenoexcept |
Construct an empty series (.series ending).
Definition at line 23 of file foamVtkSeriesWriterI.H.
References Foam::noexcept.
Referenced by operator=(), operator=(), seriesWriter(), and seriesWriter().

|
default |
|
default |
|
default |
Destructor.
|
default |
|
default |
Extract the base name for a file series.
| outputName | The name of the data output file Eg, "somefile_0001.vtk" would extract to "somefile.vtk" |
| sep | The separator used between file stem and suffix. |
References outputName().
Referenced by write().


Extract the time-varying ending of files.
| file | The name of the file Eg, "somefile_0001.vtk" would extract to "0001" |
| sep | The separator used between file stem and suffix. |
|
static |
Print file series (JSON format) for specified time instances.
| os | The output stream |
| base | The name for the series (eg, "path/file.vtk") |
| series | The list of suffix/value entries |
| sep | The separator used between file stem and suffix. |
References os().
Referenced by print(), and sort().


Write file series (JSON format) to disk, for specified instances.
| base | The name for the series (eg, "path/file.vtk") |
| series | The list of suffix/value entries |
| sep | The separator used between file stem and suffix. |
References base().
Referenced by write().


|
static |
Print file series (JSON format) for specified time instances.
Since the VTK file series does not currently (OCT-2018) support sub-directories, these will be stripped on output.
| os | The output stream |
| series | The list of filename/value entries |
References os().

|
static |
Write file series (JSON format) to disk, for specified instances.
| seriesName | The name for the series (eg, "path/file.vtk") |
| series | The list of filename/value entries |
References append(), clear(), json(), Foam::noexcept, and size().

|
inlinenoexcept |
True if there are no data sets.
Definition at line 31 of file foamVtkSeriesWriterI.H.
References Foam::noexcept.
|
inlinenoexcept |
The number of data sets.
Definition at line 37 of file foamVtkSeriesWriterI.H.
References Foam::noexcept.
Referenced by write().

|
inlinenoexcept |
Preferred extension is "json" instead of "series".
Definition at line 43 of file foamVtkSeriesWriterI.H.
References Foam::noexcept.
Referenced by write().

|
inlinenoexcept |
Toggle the preferred extension to "json" on/off. Return the old json state.
Definition at line 49 of file foamVtkSeriesWriterI.H.
|
inline |
Clear entries.
Definition at line 57 of file foamVtkSeriesWriterI.H.
Referenced by write().

|
inline |
Append the specified file instant.
Definition at line 64 of file foamVtkSeriesWriterI.H.
References fileName::name(), Instant< T >::name(), and Instant< T >::value().
Referenced by write().


|
inline |
Append the specified file instant.
Definition at line 71 of file foamVtkSeriesWriterI.H.
|
inline |
Append the specified file instant.
Definition at line 80 of file foamVtkSeriesWriterI.H.
References fileName::name().

|
inline |
Append the specified file instant.
Definition at line 91 of file foamVtkSeriesWriterI.H.
| label load | ( | const fileName & | seriesName, |
| const bool | checkFiles = false, | ||
| const scalar | restartTime = ROOTVGREAT ) |
Clear contents and reload by parsing the specified file.
| seriesName | Base name of the series to scan, without the ".series" ending |
| checkFiles | Verify that the files also exist |
| restartTime | Ignore entries with a time greater-equal to the specified restart time |
References load().
Referenced by load().


| label scan | ( | const fileName & | seriesName, |
| const scalar | restartTime = ROOTVGREAT ) |
Clear contents and scan directory for files.
The expected xml header content is a comment with the following:
* <!-- ... time='3.14159' ... --> *
| seriesName | Base name of the series to scan, without the ".series" ending |
| restartTime | Ignore entries with a time greater-equal to the specified restart time |
References scan().
Referenced by scan().


| bool removeNewer | ( | const scalar | timeValue | ) |
Remove entries that are greater_equal the time value.
References removeNewer().
Referenced by removeNewer().


| void sort | ( | ) |
|
inline |
Print file series as (JSON format).
Definition at line 104 of file foamVtkSeriesWriterI.H.

| void write | ( | const fileName & | seriesName | ) | const |
Write file series as (JSON format) to disk.
References write().
