Go to the documentation of this file.
40 os <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z();
47 for (
direction i=0; i < pTraits<Type>::nComponents; ++i)
62 os <<
" area_x area_y area_z";
68 os <<
" " << fieldName;
75 for (
direction i=0; i < pTraits<Type>::nComponents; ++i)
77 os <<
' ' << fieldName <<
'_' << Type::componentNames[i];
84 writeHeaderComponents<vector>(
os, fieldName);
90 writeHeaderComponents<sphericalTensor>(
os, fieldName);
96 writeHeaderComponents<symmTensor>(
os, fieldName);
102 writeHeaderComponents<tensor>(
os, fieldName);
113 const word& fieldName,
122 if (useTimeDir() && !
timeName().empty())
129 outputFile /= fieldName +
'_' + outputPath_.name();
130 outputFile.
ext(
"raw");
136 const scalar varScale =
138 std::is_integral<Type>::value
140 : fieldScale_.getOrDefault<scalar>(fieldName, 1)
145 Info<<
"Writing field " << fieldName;
146 if (!
equal(varScale, 1))
148 Info<<
" (scaling " << varScale <<
')';
150 Info<<
" to " << outputFile <<
endl;
159 if (Pstream::master() || !parallel_)
161 const auto&
values = tfield();
164 const bool withFaceNormal = (writeNormal_ && !this->isPointData());
172 os.precision(precision_);
176 os <<
"# " << fieldName;
177 if (this->isPointData())
179 os <<
" POINT_DATA ";
188 writeHeader<Type>(
os, fieldName);
197 if (this->isPointData())
212 const face&
f = faces[elemi];
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
A class for handling words, derived from Foam::string.
A class for handling file names.
void writeHeader< sphericalTensor >(Ostream &os, const word &fieldName)
static std::string path(const std::string &str)
Return directory path name (part before last /)
A class for managing temporary objects.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
static void writeHeaderArea(Ostream &os)
virtual const faceList & faces() const =0
The faces used for the surface.
const bool writeData(pdfDictionary.get< bool >("writeData"))
Abstract definition of a meshed surface defined by faces and points.
void writeHeader< vector >(Ostream &os, const word &fieldName)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void writeHeader(Ostream &os, const word &fieldName)
static void writeHeaderXYZ(Ostream &os)
#define forAll(list, i)
Loop across all elements in list.
static void writePoint(Ostream &os, const point &p)
void writeHeader< tensor >(Ostream &os, const word &fieldName)
Generic templated field type.
messageStream Info
Information stream (stdout output on master, null elsewhere)
void writeHeaderComponents(Ostream &os, const word &fieldName)
Istream and Ostream manipulators taking arguments.
virtual const pointField & points() const =0
The points used for the surface.
static void writeData(Ostream &os, const Type &val)
OBJstream os(runTime.globalPath()/outputName)
word ext() const
Return file name extension (part after last .)
Output to file stream, using an OSstream.
A face is a list of labels corresponding to mesh vertices.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
void writeHeader< symmTensor >(Ostream &os, const word &fieldName)
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?