40 os <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z();
45 static inline void writeData(Ostream&
os,
const Type& val)
47 for (
direction d = 0; d < pTraits<Type>::nComponents; ++d)
56 os <<
" area_x area_y area_z";
61 static inline void writeHeader(Ostream&
os,
const word& fieldName)
65 const auto nCmpts(pTraits<Type>::nComponents);
67 if (pTraits<Type>::rank || nCmpts > 1)
71 os <<
' ' << fieldName
72 <<
'_' << pTraits<Type>::componentNames[d];
77 os <<
' ' << fieldName;
89 const word& fieldName,
106 outputFile.
ext(
"raw");
114 Info<<
" to " << outputFile <<
endl;
122 const auto&
values = tfield();
124 const faceList& faces = surf.faces();
125 const bool withFaceNormal = (writeNormal_ && !this->
isPointData());
132 OFstream
os(outputFile, streamOpt_);
133 os.precision(precision_);
137 os <<
"# " << fieldName;
140 os <<
" POINT_DATA ";
149 writeHeader<Type>(
os, fieldName);
173 const face&
f = faces[elemi];
A class for handling file names.
static void writeHeader(Ostream &os, const word &fieldName)
static void writeData(Ostream &os, const Type &val)
bool empty() const
The surface to write is empty if the global number of faces is zero.
void checkOpen() const
Verify that the outputPath_ has been set or FatalError.
constexpr char nl
The newline '\n' character (0x0a)
List< face > faceList
A List of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const meshedSurfRef & adjustSurface() const
Merge surfaces (if not upToDate) and return merged (parallel) or regular surface (non-parallel) and a...
static std::string path(const std::string &str)
Return directory path name (part before last /)
bool parallel_
Writing in parallel (via master)
bool wroteGeom_
Track if geometry has been written since the last open.
word ext() const
Return file name extension (part after last .)
bool isPointData() const noexcept
Are the field data to be treated as point data?
const word & timeName() const
The current time value/name.
#define forAll(list, i)
Loop across all elements in list.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
vectorField pointField
pointField is a vectorField.
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.
tmp< Field< label > > adjustField(const word &fieldName, const tmp< Field< label >> &tfield) const
static void writePoint(Ostream &os, const point &p)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Istream and Ostream manipulators taking arguments.
tmp< Field< label > > mergeField(const Field< label > &fld) const
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
OBJstream os(runTime.globalPath()/outputName)
bool useTimeDir() const noexcept
Should a time directory be spliced into the output path?
fileName outputPath_
The full output directory and file (surface) name.
static bool master(const label communicator=worldComm)
Am I the master rank.
static void writeHeaderArea(Ostream &os)
messageStream Info
Information stream (stdout output on master, null elsewhere)
bool verbose_
Additional output verbosity.
A class for managing temporary objects.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)