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 ensightCase &)=delete | |
No copy construct. More... | |
void | operator= (const ensightCase &)=delete |
No copy assignment. More... | |
ensightCase (const fileName &ensightDir, const word &caseName, const options &opts) | |
Construct from components. More... | |
ensightCase (const fileName &ensightDir, const word &caseName, const IOstreamOption::streamFormat fmt=IOstreamOption::BINARY) | |
Construct from components with all default options. More... | |
~ensightCase ()=default | |
Destructor. More... | |
const ensightCase::options & | option () const |
Reference to the case options. More... | |
IOstreamOption::streamFormat | format () const |
The output file format (ascii/binary) More... | |
const fileName & | path () const noexcept |
The nominal path to the case file. More... | |
const word & | mask () 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< ensightGeoFile > | newGeometry (bool moving=false) const |
Open stream for new geometry file (on master). Does not include beginGeometry() marker. More... | |
autoPtr< ensightFile > | newCloud (const word &cloudName) const |
Open stream for new cloud positions (on master). More... | |
template<class Type > | |
autoPtr< ensightFile > | newData (const word &varName, const bool isPointData=false) const |
Open stream for new data file (on master), with current index. More... | |
template<class Type > | |
autoPtr< ensightFile > | newPointData (const word &varName) const |
Open stream for new data file (on master), with current index and marking as containing POINT_DATA. More... | |
template<class Type > | |
autoPtr< ensightFile > | newCloudData (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... | |
Ostream & | operator() () const |
Output stream (master only). More... | |
Ostream & | printInfo (Ostream &os) const |
Print some general information. More... | |
template<class Type > | |
Foam::autoPtr< Foam::ensightFile > | newData (const word &name, const bool isPointData) const |
template<class Type > | |
Foam::autoPtr< Foam::ensightFile > | newPointData (const word &name) const |
template<class Type > | |
Foam::autoPtr< Foam::ensightFile > | newCloudData (const word &cloudName, const word &name) const |
Static Public Member Functions | |
static word | mask (const int nwidth) |
A '*' mask of specified width. More... | |
static word | padded (const int nwidth, const label index) |
Stringified zero-padded integer value of specified width. More... | |
template<class StringType > | |
static StringType | expand_mask (const StringType &input, const label index) |
Replace the '*' mask chars with zero-padded integer value. More... | |
static void | setTimeFormat (OSstream &os, IOstreamOption::floatFormat timeFmt, const int timePrec) |
Set output time format for ensight case file. More... | |
static void | setTimeFormat (OSstream &os, const ensightCase::options &opts) |
Set output time format for ensight case file. More... | |
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 > ×) |
Print time-set for ensight case file, with N times and 0-based file numbering. More... | |
static void | printTimeset (OSstream &os, const label ts, const UList< scalar > ×, const bitSet &indices) |
Print time-set for ensight case file, with N times, 0-based file numbering but perhaps non-contiguous. More... | |
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... | |
Supports writing of ensight cases as well as providing common factory methods to open new files.
Definition at line 63 of file ensightCase.H.
|
delete |
No copy construct.
ensightCase | ( | const fileName & | ensightDir, |
const word & | caseName, | ||
const options & | opts | ||
) |
Construct from components.
Definition at line 555 of file ensightCase.C.
ensightCase | ( | const fileName & | ensightDir, |
const word & | caseName, | ||
const IOstreamOption::streamFormat | fmt = IOstreamOption::BINARY |
||
) |
Construct from components with all default options.
Definition at line 574 of file ensightCase.C.
|
default |
Destructor.
|
delete |
No copy assignment.
|
static |
A '*' mask of specified width.
Definition at line 37 of file ensightCase.C.
|
static |
Stringified zero-padded integer value of specified width.
Definition at line 48 of file ensightCase.C.
References Foam::name(), Foam::setfill(), and Foam::setw().
Referenced by ensightWriter::writeCollated().
|
static |
Replace the '*' mask chars with zero-padded integer value.
Definition at line 28 of file ensightCaseTemplates.C.
References Foam::BitOps::count(), Foam::input(), and timeIndex.
Referenced by ensightSurfaceReader::geometry().
|
inline |
Reference to the case options.
Definition at line 23 of file ensightCaseI.H.
|
inline |
The output file format (ascii/binary)
Definition at line 29 of file ensightCaseI.H.
|
inlinenoexcept |
The nominal path to the case file.
Definition at line 35 of file ensightCaseI.H.
|
inline |
The output '*' mask.
Definition at line 41 of file ensightCaseI.H.
|
inline |
Consistent zero-padded integer value.
Definition at line 47 of file ensightCaseI.H.
|
inline |
Force use of values per node instead of per element.
Definition at line 53 of file ensightCaseI.H.
Referenced by Foam::writeVolField().
|
inline |
Write clouds into their own directory instead in "data" directory.
Definition at line 59 of file ensightCaseI.H.
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 594 of file ensightCase.C.
References setTime().
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 601 of file ensightCase.C.
References Instant< T >::value().
void setTime | ( | const scalar | t, |
const label | index | ||
) |
Set current index and time for time-set 1.
Create corresponding sub-directory
Definition at line 607 of file ensightCase.C.
References UPstream::master(), Foam::mkDir(), fileName::name(), and Foam::nl.
void setTime | ( | const instant & | t, |
const label | index | ||
) |
Set current index and time for time-set 1.
Create corresponding sub-directory
Definition at line 632 of file ensightCase.C.
References setTime(), and Instant< T >::value().
Foam::autoPtr< Foam::ensightGeoFile > newGeometry | ( | bool | moving = false | ) | const |
Open stream for new geometry file (on master). Does not include beginGeometry() marker.
Definition at line 832 of file ensightCase.C.
References filePtr, format(), UPstream::master(), Foam::mkDir(), and path().
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 868 of file ensightCase.C.
References cloudName(), filePtr, UPstream::master(), os(), cloud::prefix, and OBJstream::write().
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(), and Foam::writeVolField().
autoPtr<ensightFile> newPointData | ( | const word & | varName | ) | const |
Open stream for new data file (on master), with current index and marking as containing POINT_DATA.
autoPtr<ensightFile> newCloudData | ( | const word & | cloudName, |
const word & | varName | ||
) | const |
Open stream for new cloud data file (on master), with current index.
void rewind | ( | ) | const |
Rewind the output stream (master only).
Definition at line 893 of file ensightCase.C.
void write | ( | ) | const |
Write the case file.
Definition at line 638 of file ensightCase.C.
References cloudName(), Foam::flush(), Foam::max(), Foam::name(), Foam::nl, cloud::prefix, word::printf(), Foam::setw(), HashTable< T, Key, Hash >::sortedToc(), and Foam::writeHeader().
|
inline |
Foam::Ostream & printInfo | ( | Ostream & | os | ) | const |
Print some general information.
Definition at line 902 of file ensightCase.C.
References format(), Foam::nl, and os().
|
static |
Set output time format for ensight case file.
Definition at line 63 of file ensightCase.C.
References os(), OSstream::precision(), and IOstream::setf().
Referenced by ensightWriter::writeCollated(), and ensightWriter::writeUncollated().
|
static |
Set output time format for ensight case file.
Definition at line 84 of file ensightCase.C.
References os(), OSstream::precision(), IOstream::setf(), ensightCase::options::timeFormat(), and ensightCase::options::timePrecision().
|
static |
Print time-set for ensight case file with a single time.
Definition at line 101 of file ensightCase.C.
References Foam::nl, and os().
Referenced by ensightWriter::writeCollated(), and ensightWriter::writeUncollated().
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 122 of file ensightCase.C.
References Foam::nl, os(), Foam::setf(), Foam::setw(), and Foam::HashTableOps::values().
|
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 157 of file ensightCase.C.
References bitSet::all(), bitSet::count(), Foam::nl, os(), Foam::setf(), Foam::setw(), PackedList< Width >::size(), and Foam::HashTableOps::values().
Foam::autoPtr<Foam::ensightFile> newData | ( | const word & | name, |
const bool | isPointData | ||
) | const |
Definition at line 58 of file ensightCaseTemplates.C.
References Foam::name(), and Foam::output().
Foam::autoPtr<Foam::ensightFile> newPointData | ( | const word & | name | ) | const |
Definition at line 95 of file ensightCaseTemplates.C.
References Foam::name().
Foam::autoPtr<Foam::ensightFile> newCloudData | ( | const word & | cloudName, |
const word & | name | ||
) | const |
Definition at line 106 of file ensightCaseTemplates.C.
References cloudName(), Foam::name(), and Foam::output().
|
static |
The name for data subdirectory: "data".
Definition at line 68 of file ensightCase.H.
|
static |
The name for geometry files: "geometry".
Definition at line 80 of file ensightCase.H.
Referenced by ensightWriter::writeCollated().