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 ";
173 const face&
f = faces[elemi];
Istream and Ostream manipulators taking arguments.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
bool wroteGeom_
Track if geometry has been written since the last open.
bool verbose_
Additional output verbosity.
fileName outputPath_
The full output directory and file (coords) name.
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
word ext() const
Return file name extension (part after last .).
static std::string path(const std::string &str)
Return directory path name (part before last /).
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
Implements a meshed surface by referencing another meshed surface or faces/points components.
virtual const pointField & points() const
The points used for the surface.
virtual const faceList & faces() const
The faces used for the surface.
A traits class, which is primarily used for primitives and vector-space.
bool wroteGeom_
Track if geometry has been written since the last open.
bool useTimeDir() const noexcept
Should a time directory be spliced into the output path?
bool isPointData() const noexcept
Are the field data to be treated as point data?
const word & timeName() const
The current time value/name.
void checkOpen() const
Verify that the outputPath_ has been set or FatalError.
bool parallel_
Writing in parallel (via master).
bool empty() const
The surface to write is empty if the global number of faces is zero.
tmp< Field< label > > adjustField(const word &fieldName, const tmp< Field< label > > &tfield) const
bool verbose_
Additional output verbosity.
const meshedSurfRef & adjustSurface() const
Merge surfaces (if not upToDate) and return merged (parallel) or regular surface (non-parallel) and a...
tmp< Field< label > > mergeField(const Field< label > &fld) const
fileName outputPath_
The full output directory and file (surface) name.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
static void writePoint(Ostream &os, const point &p)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
static void writeHeader(Ostream &os, const word &fieldName)
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< face > faceList
List of faces.
static void writeHeaderArea(Ostream &os)
Ostream & endl(Ostream &os)
Add newline and flush stream.
vector point
Point is a vector.
vectorField pointField
pointField is a vectorField.
static void writeData(Ostream &os, const Type &val)
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.