Go to the documentation of this file.
40 os <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z();
45 static inline void writeData(Ostream&
os,
const Type& val)
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,
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;
155 tmp<Field<Type>> tfield =
mergeField(localValues) * varScale;
157 const meshedSurf& surf =
surface();
161 const auto&
values = tfield();
163 const faceList& faces = surf.faces();
164 const bool withFaceNormal = (writeNormal_ && !this->
isPointData());
171 OFstream
os(outputFile, streamOpt_);
172 os.precision(precision_);
176 os <<
"# " << fieldName;
179 os <<
" POINT_DATA ";
188 writeHeader<Type>(
os, fieldName);
212 const face&
f = faces[elemi];
vectorField pointField
pointField is a vectorField.
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)
A class for managing temporary objects.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
static void writeHeaderArea(Ostream &os)
static std::string name(const std::string &str)
tmp< Field< label > > mergeField(const Field< label > &fld) const
virtual const faceList & faces() const =0
const meshedSurf & surface() const
const bool writeData(pdfDictionary.get< bool >("writeData"))
Abstract definition of a meshed surface defined by faces and points.
static bool master(const label communicator=worldComm)
void writeHeader< vector >(Ostream &os, const word &fieldName)
Ostream & endl(Ostream &os)
static void writeHeader(Ostream &os, const word &fieldName)
static void writeHeaderXYZ(Ostream &os)
const word & timeName() const
static void writePoint(Ostream &os, const point &p)
void writeHeader< tensor >(Ostream &os, const word &fieldName)
void writeHeaderComponents(Ostream &os, const word &fieldName)
Istream and Ostream manipulators taking arguments.
virtual const pointField & points() const =0
static void writeData(Ostream &os, const Type &val)
OBJstream os(runTime.globalPath()/outputName)
Output to file stream, using an OSstream.
List< face > faceList
A List of faces.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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)
bool equal(const T &s1, const T &s2)
void writeHeader< symmTensor >(Ostream &os, const word &fieldName)
bool isDir(const fileName &name, const bool followLink=true)