55 os <<
"# " << axisName;
61 static inline void writeHeader(Ostream&
os,
const word& fieldName)
71 os <<
' ' << fieldName
72 <<
'_' << pTraits<Type>::componentNames[d];
77 os <<
' ' << fieldName;
89 const word& fieldName,
93 if (
coords_.size() != fieldPtrs.size())
96 <<
"Attempted to write field: " << fieldName
97 <<
" (" << fieldPtrs.size() <<
" entries) for " 115 Info<<
"Writing field " << fieldName;
116 Info<<
" to " << outputFile <<
endl;
121 if (!
isDir(outputFile.path()))
123 mkDir(outputFile.path());
126 OFstream
os(outputFile, streamOpt_);
127 os.precision(precision_);
131 os <<
"# " << fieldName <<
" ";
134 writeHeader<Type>(
os, fieldName);
A class for handling file names.
static void writeHeader(Ostream &os, const word &fieldName)
errorManipArg< error, int > exit(error &err, const int errNo=1)
const word & axis() const
The sort axis name.
bool wroteGeom_
Track if geometry has been written since the last open.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
#define forAll(list, i)
Loop across all elements in list.
bool hasVectorAxis() const noexcept
True if axis specification is a vector.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Holds list of sampling positions.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Generic templated field type.
A class for handling words, derived from Foam::string.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Istream and Ostream manipulators taking arguments.
OBJstream os(runTime.globalPath()/outputName)
static void writeTable(Ostream &os, const coordSet &coords, const UList< Type > &values, const char *sep)
Write coordinates and values.
fileName getFieldPrefixedPath(const word &fieldName, const word &fileExt=word::null) const
Get field-prefixed output file name.
UPtrList< const coordSet > coords_
Reference to coordinate set(s)
bool verbose_
Additional output verbosity.
static void writeCoordHeader(Ostream &os, const coordSet &coords, const label count)
::Foam::direction rank(const expressions::valueTypeCode) noexcept
The vector-space rank associated with given valueTypeCode.
messageStream Info
Information stream (stdout output on master, null elsewhere)