ensightCase Class Reference

Supports writing of ensight cases as well as providing common factory methods to open new files. More...

Classes

class  options
 Configuration options for the ensightCase. More...
 

Public Member Functions

 ensightCase (const fileName &ensightDir, const word &caseName, const options &opts)
 Construct from components. More...
 
 ensightCase (const fileName &ensightDir, const word &caseName, const IOstreamOption::streamFormat format=IOstreamOption::BINARY)
 Construct from components with all default options. More...
 
 ~ensightCase ()=default
 Destructor. More...
 
const ensightCase::optionsoption () const
 Reference to the case options. More...
 
IOstreamOption::streamFormat format () const
 The output file format (ascii/binary) More...
 
const fileNamepath () const noexcept
 The nominal path to the case file. More...
 
const wordmask () const
 The output '*' mask. More...
 
word padded (const label i) const
 Consistent zero-padded integer value. More...
 
bool nodeValues () const
 Force use of values per node instead of per element. More...
 
bool separateCloud () const
 Write clouds into their own directory instead in "data" directory. More...
 
void nextTime (const scalar t)
 Set time for time-set 1, using next available index. More...
 
void nextTime (const instant &t)
 Set time for time-set 1, using next available index. More...
 
void setTime (const scalar t, const label index)
 Set current index and time for time-set 1. More...
 
void setTime (const instant &t, const label index)
 Set current index and time for time-set 1. More...
 
autoPtr< ensightGeoFilenewGeometry (bool moving=false) const
 Open stream for new geometry file (on master). More...
 
autoPtr< ensightFilenewCloud (const word &cloudName) const
 Open stream for new cloud positions (on master). More...
 
template<class Type >
autoPtr< ensightFilenewData (const word &varName, const bool isPointData=false) const
 Open stream for new data file (on master), with current index. More...
 
template<class Type >
autoPtr< ensightFilenewPointData (const word &varName) const
 
template<class Type >
autoPtr< ensightFilenewCloudData (const word &cloudName, const word &varName) const
 Open stream for new cloud data file (on master), with current index. More...
 
void rewind () const
 Rewind the output stream (master only). More...
 
void write () const
 Write the case file. More...
 
Ostreamoperator() () const
 Output stream (master only). More...
 
OstreamprintInfo (Ostream &os) const
 Print some general information. More...
 
template<class Type >
Foam::autoPtr< Foam::ensightFilenewData (const word &name, const bool isPointData) const
 
template<class Type >
Foam::autoPtr< Foam::ensightFilenewPointData (const word &name) const
 
template<class Type >
Foam::autoPtr< Foam::ensightFilenewCloudData (const word &cloudName, const word &name) const
 

Static Public Member Functions

static void printTimeset (OSstream &os, const label ts, const scalar timeValue)
 Print time-set for ensight case file with a single time. More...
 
static void printTimeset (OSstream &os, const label ts, const UList< scalar > &times)
 
static void printTimeset (OSstream &os, const label ts, const UList< scalar > &times, const bitSet &indices)
 

Static Public Attributes

static const char * dataDirName = "data"
 The name for data subdirectory: "data". More...
 
static const char * geometryName = "geometry"
 The name for geometry files: "geometry". More...
 

Detailed Description

Supports writing of ensight cases as well as providing common factory methods to open new files.

Source files

Definition at line 68 of file ensightCase.H.

Constructor & Destructor Documentation

◆ ensightCase() [1/2]

ensightCase ( const fileName ensightDir,
const word caseName,
const options opts 
)

Construct from components.

Definition at line 500 of file ensightCase.C.

◆ ensightCase() [2/2]

ensightCase ( const fileName ensightDir,
const word caseName,
const IOstreamOption::streamFormat  format = IOstreamOption::BINARY 
)

Construct from components with all default options.

Definition at line 525 of file ensightCase.C.

◆ ~ensightCase()

~ensightCase ( )
default

Destructor.

Member Function Documentation

◆ option()

const Foam::ensightCase::options & option ( ) const
inline

Reference to the case options.

Definition at line 30 of file ensightCaseI.H.

◆ format()

Foam::IOstreamOption::streamFormat format ( ) const
inline

The output file format (ascii/binary)

Definition at line 36 of file ensightCaseI.H.

Referenced by Foam::setformat().

Here is the caller graph for this function:

◆ path()

const Foam::fileName & path ( ) const
inlinenoexcept

The nominal path to the case file.

Definition at line 42 of file ensightCaseI.H.

◆ mask()

const Foam::word & mask ( ) const
inline

The output '*' mask.

Definition at line 48 of file ensightCaseI.H.

◆ padded()

Foam::word padded ( const label  i) const
inline

Consistent zero-padded integer value.

Definition at line 54 of file ensightCaseI.H.

Referenced by ensightCase::newData().

Here is the caller graph for this function:

◆ nodeValues()

bool nodeValues ( ) const
inline

Force use of values per node instead of per element.

Definition at line 60 of file ensightCaseI.H.

Referenced by Foam::writeVolField().

Here is the caller graph for this function:

◆ separateCloud()

bool separateCloud ( ) const
inline

Write clouds into their own directory instead in "data" directory.

Definition at line 66 of file ensightCaseI.H.

◆ nextTime() [1/2]

void nextTime ( const scalar  t)

Set time for time-set 1, using next available index.

Create corresponding sub-directory. Do not mix between nextTime and setTime in an application.

Definition at line 552 of file ensightCase.C.

References setTime().

Here is the call graph for this function:

◆ nextTime() [2/2]

void nextTime ( const instant t)

Set time for time-set 1, using next available index.

Create corresponding sub-directory. Do not mix between nextTime and setTime in an application.

Definition at line 559 of file ensightCase.C.

References Instant< T >::value().

Here is the call graph for this function:

◆ setTime() [1/2]

void setTime ( const scalar  t,
const label  index 
)

Set current index and time for time-set 1.

Create corresponding sub-directory

Note
do not mix between nextTime and setTime in an application.

Definition at line 565 of file ensightCase.C.

References splitCell::master(), Foam::mkDir(), fileName::name(), and Foam::nl.

Here is the call graph for this function:

◆ setTime() [2/2]

void setTime ( const instant t,
const label  index 
)

Set current index and time for time-set 1.

Create corresponding sub-directory

Note
do not mix between nextTime and setTime in an application.

Definition at line 590 of file ensightCase.C.

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

Here is the call graph for this function:

◆ newGeometry()

Foam::autoPtr< Foam::ensightGeoFile > newGeometry ( bool  moving = false) const

Open stream for new geometry file (on master).

Definition at line 789 of file ensightCase.C.

References format(), splitCell::master(), Foam::mkDir(), Time::New(), Foam::output(), and path().

Here is the call graph for this function:

◆ newCloud()

Foam::autoPtr< Foam::ensightFile > newCloud ( const word cloudName) const

Open stream for new cloud positions (on master).

Note the use of ensightFile, not ensightGeoFile.

Definition at line 823 of file ensightCase.C.

References cloudName(), splitCell::master(), Foam::output(), cloud::prefix, and Ostream::write().

Here is the call graph for this function:

◆ newData() [1/2]

autoPtr< ensightFile > newData ( const word varName,
const bool  isPointData = false 
) const

Open stream for new data file (on master), with current index.

Optionally marking as containing POINT_DATA

Referenced by Foam::writeAreaField(), Foam::writePointField(), Foam::writeVolField(), and ensightWrite::writeVolFields().

Here is the caller graph for this function:

◆ newPointData() [1/2]

autoPtr< ensightFile > newPointData ( const word varName) const

Open stream for new data file (on master), with current index and marking as containing POINT_DATA

◆ newCloudData() [1/2]

autoPtr< ensightFile > newCloudData ( const word cloudName,
const word varName 
) const

Open stream for new cloud data file (on master), with current index.

◆ rewind()

void rewind ( ) const

Rewind the output stream (master only).

Definition at line 848 of file ensightCase.C.

Referenced by IListStream::rewind().

Here is the caller graph for this function:

◆ write()

void write ( ) const

Write the case file.

Definition at line 596 of file ensightCase.C.

References cloudName(), Foam::flush(), Foam::name(), Foam::nl, cloud::prefix, word::printf(), Foam::setw(), HashTable< T, Key, Hash >::sortedToc(), and Foam::writeHeader().

Here is the call graph for this function:

◆ operator()()

Foam::Ostream & operator() ( ) const
inline

Output stream (master only).

Definition at line 74 of file ensightCaseI.H.

Referenced by thirdBodyArrheniusReactionRate::operator()().

Here is the caller graph for this function:

◆ printInfo()

Foam::Ostream & printInfo ( Ostream os) const

Print some general information.

Definition at line 857 of file ensightCase.C.

References format(), Foam::nl, and os().

Here is the call graph for this function:

◆ printTimeset() [1/3]

void printTimeset ( OSstream os,
const label  ts,
const scalar  timeValue 
)
static

Print time-set for ensight case file with a single time.

Definition at line 43 of file ensightCase.C.

References Foam::nl, and os().

Referenced by ensightWriter::writeCollated(), and ensightWriter::writeUncollated().

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

◆ printTimeset() [2/3]

void printTimeset ( OSstream os,
const label  ts,
const UList< scalar > &  times 
)
static

Print time-set for ensight case file, with N times and 0-based file numbering

TIME
time set: ts
number of steps: ns
filename start number: 0
filename increment: 1
time values: time_1 time_2 ... time_ns

Definition at line 64 of file ensightCase.C.

References Foam::nl, os(), Foam::setf(), and Foam::setw().

Here is the call graph for this function:

◆ printTimeset() [3/3]

void printTimeset ( OSstream os,
const label  ts,
const UList< scalar > &  times,
const bitSet indices 
)
static

Print time-set for ensight case file, with N times, 0-based file numbering but perhaps non-contiguous

TIME
time set: ts
number of steps: ns
filename numbers: idx_1 idx_2 ... idx_ns
time values: time_1 time_2 ... time_ns

Definition at line 99 of file ensightCase.C.

References bitSet::all(), bitSet::count(), Foam::nl, os(), Foam::setf(), Foam::setw(), and PackedList< Width >::size().

Here is the call graph for this function:

◆ newData() [2/2]

Foam::autoPtr< Foam::ensightFile > newData ( const word name,
const bool  isPointData 
) const

Definition at line 35 of file ensightCaseTemplates.C.

References splitCell::master(), Foam::name(), Foam::output(), ensightCase::padded(), and Ostream::write().

Here is the call graph for this function:

◆ newPointData() [2/2]

Foam::autoPtr< Foam::ensightFile > newPointData ( const word name) const

Definition at line 76 of file ensightCaseTemplates.C.

References Foam::name().

Here is the call graph for this function:

◆ newCloudData() [2/2]

Foam::autoPtr< Foam::ensightFile > newCloudData ( const word cloudName,
const word name 
) const

Definition at line 87 of file ensightCaseTemplates.C.

References cloudName(), splitCell::master(), Foam::name(), Foam::output(), and Ostream::write().

Here is the call graph for this function:

Member Data Documentation

◆ dataDirName

const char * dataDirName = "data"
static

The name for data subdirectory: "data".

Definition at line 78 of file ensightCase.H.

◆ geometryName

const char * geometryName = "geometry"
static

The name for geometry files: "geometry".

Definition at line 81 of file ensightCase.H.

Referenced by ensightWriter::writeCollated().


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