Go to the documentation of this file.
41 for (
direction i=0; i < pTraits<Type>::nComponents; ++i)
55 <<
" " << fieldName <<
nl;
62 <<
" " << fieldName <<
nl;
69 <<
" " << fieldName <<
"_x"
70 <<
" " << fieldName <<
"_y"
71 <<
" " << fieldName <<
"_z"
79 <<
" " << fieldName <<
"_ii" <<
nl;
86 os <<
"# xx xy xz yy yz zz";
87 for (
direction i=0; i < pTraits<symmTensor>::nComponents; ++i)
89 os <<
" " << fieldName <<
'_' << int(i);
98 os <<
"# xx xy xz yx yy yz zx zy zz";
99 for (
direction i=0; i < pTraits<tensor>::nComponents; ++i)
101 os <<
" " << fieldName <<
'_' << int(i);
114 const word& fieldName,
123 if (useTimeDir() && !
timeName().empty())
130 outputFile /= fieldName +
'_' + outputPath_.name();
131 outputFile.
ext(
"raw");
137 const scalar varScale =
139 std::is_integral<Type>::value
141 : fieldScale_.getOrDefault<scalar>(fieldName, 1)
146 Info<<
"Writing field " << fieldName;
147 if (!
equal(varScale, 1))
149 Info<<
" (scaling " << varScale <<
')';
151 Info<<
" to " << outputFile <<
endl;
160 if (Pstream::master() || !parallel_)
162 const auto&
values = tfield();
171 OFstream os(outputFile, streamOpt_);
175 os <<
"# " << fieldName;
176 if (this->isPointData())
178 os <<
" POINT_DATA ";
187 writeHeader<Type>(os, fieldName);
191 if (this->isPointData())
196 writePoint(os,
points[elemi]*geometryScale_);
205 writePoint(os, faces[elemi].centre(
points)*geometryScale_);
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.
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)
#define forAll(list, i)
Loop across all elements in list.
void writeHeader< tensor >(Ostream &os, const word &fieldName)
Generic templated field type.
messageStream Info
Information stream (uses stdout - output is on the master only)
void writeHeader< scalar >(Ostream &os, const word &fieldName)
Istream and Ostream manipulators taking arguments.
void writeHeader< label >(Ostream &os, const word &fieldName)
virtual const pointField & points() const =0
The points used for the surface.
static void writeData(Ostream &os, const Type &val)
word ext() const
Return file name extension (part after last .)
Output to file stream, using an OSstream.
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?