Public Member Functions | Static Public Member Functions | List of all members
seriesWriter Class Reference

Provides a means of accumulating and generating VTK file series. More...

Public Member Functions

 seriesWriter ()=default
 
 seriesWriter (const seriesWriter &)=default
 
 seriesWriter (seriesWriter &&)=default
 
seriesWriteroperator= (const seriesWriter &)=default
 
seriesWriteroperator= (seriesWriter &&)=default
 
 ~seriesWriter ()=default
 
bool empty () const noexcept
 
label size () const noexcept
 
void clear ()
 
bool append (const fileNameInstant &inst)
 
bool append (fileNameInstant &&inst)
 
bool append (scalar timeValue, const fileName &file)
 
bool append (scalar timeValue, fileName &&file)
 
label load (const fileName &seriesName, const bool checkFiles=false, const scalar restartTime=ROOTVGREAT)
 
label scan (const fileName &seriesName, const scalar restartTime=ROOTVGREAT)
 
bool removeNewer (const scalar timeValue)
 
void sort ()
 
void print (Ostream &os) const
 
void write (const fileName &seriesName) const
 

Static Public Member Functions

static fileName base (const fileName &outputName, char sep='_')
 
static word suffix (const fileName &file, char sep='_')
 
static Ostreamprint (Ostream &os, const fileName &seriesName, const UList< instant > &series, const char sep='_')
 
static void write (const fileName &base, const UList< instant > &series, const char sep='_')
 
static Ostreamprint (Ostream &os, const UList< fileNameInstant > &series)
 
static void write (const fileName &seriesName, const UList< fileNameInstant > &series)
 

Detailed Description

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.

Source files

Definition at line 71 of file foamVtkSeriesWriter.H.

Constructor & Destructor Documentation

◆ seriesWriter() [1/3]

seriesWriter ( )
default

◆ seriesWriter() [2/3]

seriesWriter ( const seriesWriter )
default

◆ seriesWriter() [3/3]

seriesWriter ( seriesWriter &&  )
default

◆ ~seriesWriter()

~seriesWriter ( )
default

Member Function Documentation

◆ operator=() [1/2]

seriesWriter& operator= ( const seriesWriter )
default

◆ operator=() [2/2]

seriesWriter& operator= ( seriesWriter &&  )
default

◆ base()

Foam::fileName base ( const fileName outputName,
char  sep = '_' 
)
static

Definition at line 84 of file foamVtkSeriesWriter.C.

References Foam::dot(), and outputName().

Referenced by vtkCloud::write(), and vtkWrite::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suffix()

Foam::word suffix ( const fileName file,
char  sep = '_' 
)
static

Definition at line 114 of file foamVtkSeriesWriter.C.

References Foam::dot().

Here is the call graph for this function:

◆ print() [1/3]

Foam::Ostream & print ( Ostream os,
const fileName seriesName,
const UList< instant > &  series,
const char  sep = '_' 
)
static

Definition at line 144 of file foamVtkSeriesWriter.C.

References fileName::ext(), fileName::nameLessExt(), Foam::nl, os(), and UList::size().

Referenced by seriesWriter::print().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write() [1/3]

void write ( const fileName base,
const UList< instant > &  series,
const char  sep = '_' 
)
static

Definition at line 226 of file foamVtkSeriesWriter.C.

References fileName::hasExt(), Foam::mkDir(), Foam::New(), fileName::path(), and Foam::BitOps::print().

Referenced by seriesWriter::write(), vtkCloud::write(), and vtkWrite::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print() [2/3]

Foam::Ostream & print ( Ostream os,
const UList< fileNameInstant > &  series 
)
static

Definition at line 191 of file foamVtkSeriesWriter.C.

References Foam::nl, os(), and UList::size().

Here is the call graph for this function:

◆ write() [2/3]

void write ( const fileName seriesName,
const UList< fileNameInstant > &  series 
)
static

Definition at line 247 of file foamVtkSeriesWriter.C.

References fileName::hasExt(), Foam::mkDir(), Foam::New(), fileName::path(), and Foam::BitOps::print().

Here is the call graph for this function:

◆ empty()

bool empty ( ) const
inlinenoexcept

Definition at line 23 of file foamVtkSeriesWriterI.H.

Referenced by vtkCloud::write(), and vtkWrite::write().

Here is the caller graph for this function:

◆ size()

Foam::label size ( ) const
inlinenoexcept

Definition at line 29 of file foamVtkSeriesWriterI.H.

◆ clear()

void clear ( )
inline

Definition at line 35 of file foamVtkSeriesWriterI.H.

◆ append() [1/4]

bool append ( const fileNameInstant inst)
inline

Definition at line 42 of file foamVtkSeriesWriterI.H.

References Instant< T >::name(), and Instant< T >::value().

Referenced by vtkCloud::write(), and vtkWrite::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ append() [2/4]

bool append ( fileNameInstant &&  inst)
inline

Definition at line 49 of file foamVtkSeriesWriterI.H.

◆ append() [3/4]

bool append ( scalar  timeValue,
const fileName file 
)
inline

Definition at line 59 of file foamVtkSeriesWriterI.H.

References fileName::name().

Here is the call graph for this function:

◆ append() [4/4]

bool append ( scalar  timeValue,
fileName &&  file 
)
inline

Definition at line 70 of file foamVtkSeriesWriterI.H.

References fileName::removePath().

Here is the call graph for this function:

◆ load()

Foam::label load ( const fileName seriesName,
const bool  checkFiles = false,
const scalar  restartTime = ROOTVGREAT 
)

◆ scan()

Foam::label scan ( const fileName seriesName,
const scalar  restartTime = ROOTVGREAT 
)

◆ removeNewer()

bool removeNewer ( const scalar  timeValue)

Definition at line 708 of file foamVtkSeriesWriter.C.

References Foam::lessThan(), Instant< T >::name(), Foam::name(), and Instant< T >::value().

Here is the call graph for this function:

◆ sort()

void sort ( )

Definition at line 738 of file foamVtkSeriesWriter.C.

References Foam::sort().

Here is the call graph for this function:

◆ print() [3/3]

void print ( Ostream os) const
inline

Definition at line 82 of file foamVtkSeriesWriterI.H.

References os(), and seriesWriter::print().

Here is the call graph for this function:

◆ write() [3/3]

void write ( const fileName seriesName) const
inline

Definition at line 88 of file foamVtkSeriesWriterI.H.

References seriesWriter::write().

Here is the call graph for this function:

The documentation for this class was generated from the following files: