42 inline void Foam::rawSurfaceWriter::writeLocation
49 const point& pt = points[pointi];
50 os << pt.
x() <<
' ' << pt.y() <<
' ' << pt.z() <<
' ';
54 inline void Foam::rawSurfaceWriter::writeLocation
63 os << ct.
x() <<
' ' << ct.y() <<
' ' << ct.z() <<
' ';
70 void Foam::rawSurfaceWriter::writeHeader
73 const word& fieldName,
78 <<
"# x y z " << fieldName <<
nl;
83 void Foam::rawSurfaceWriter::writeHeader
86 const word& fieldName,
100 void Foam::rawSurfaceWriter::writeHeader
103 const word& fieldName,
109 << fieldName <<
"_ii" <<
nl;
114 void Foam::rawSurfaceWriter::writeHeader
117 const word& fieldName,
122 <<
"# xx xy xz yy yz ";
123 for (
int i=0; i<6; ++i)
125 os << fieldName <<
"_" << i <<
" ";
132 void Foam::rawSurfaceWriter::writeHeader
135 const word& fieldName,
140 <<
"# xx xy xz yx yy yz zx zy zz";
141 for (
int i=0; i<9; ++i)
143 os << fieldName <<
"_" << i <<
" ";
150 inline void Foam::rawSurfaceWriter::writeData
161 inline void Foam::rawSurfaceWriter::writeData
167 os << v[0] <<
' ' << v[1] <<
' ' << v[2] <<
nl;
172 inline void Foam::rawSurfaceWriter::writeData
183 inline void Foam::rawSurfaceWriter::writeData
189 os << v[0] <<
' ' << v[1] <<
' ' << v[2] <<
' ' 190 << v[3] <<
' ' << v[4] <<
' ' << v[5] <<
nl;
195 inline void Foam::rawSurfaceWriter::writeData
201 os << v[0] <<
' ' << v[1] <<
' ' << v[2] <<
' ' 202 << v[3] <<
' ' << v[4] <<
' ' << v[5] <<
' ' 203 << v[6] <<
' ' << v[7] <<
' ' << v[8] <<
nl;
210 void Foam::rawSurfaceWriter::Write
216 const word& fieldName,
218 const bool isNodeValues
221 if (!
isDir(outputDir))
228 outputDir/fieldName +
'_' + surfaceName +
".raw",
236 Info<<
"Writing field " << fieldName <<
" to " << os.
name() <<
endl;
240 os <<
"# " << fieldName;
243 os <<
" POINT_DATA ";
258 writeLocation(os, points, elemI);
266 writeLocation(os, points, faces, elemI);
289 writeCompression_(
IOstream::UNCOMPRESSED)
291 if (optDict.
found(
"compression"))
315 if (!
isDir(outputDir))
322 outputDir/surfaceName +
".raw",
335 os <<
"# geometry NO_DATA " << faces.
size() <<
nl 341 writeLocation(os, points, faces, elemI);
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
A surfaceWriter for raw output.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static compressionType compressionEnum(const word &)
Return compression of given compression name.
A class for handling file names.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual void write(const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces) const
Write single surface geometry to file.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const fileName & name() const
Return the name of the stream.
Templated 3D SphericalTensor derived from VectorSpace adding construction from 1 component, element access using th ii() member function and the inner-product (dot-product) and outer-product operators.
const Vector< Cmpt > & centre(const Foam::List< Vector< Cmpt >> &) const
Return *this (used for point which is a typedef to Vector<scalar>.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
vectorField pointField
pointField is a vectorField.
virtual ~rawSurfaceWriter()
Destructor.
void writeHeader(std::ostream &, const bool isBinary, const std::string &title)
Write header.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
A class for handling words, derived from string.
Convenience macros for instantiating writer methods for surfaceWriter classes.
streamFormat
Enumeration for the format of data in the stream.
defineSurfaceWriterWriteFields(nastranSurfaceWriter)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
const bool writeData(readBool(pdfDictionary.lookup("writeData")))
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
An IOstream is an abstract base class for all input/output systems; be they streams, files, token lists etc.
vector point
Point is a vector.
static const versionNumber currentVersion
Current version number.
makeSurfaceWriterType(ensightSurfaceWriter)
rawSurfaceWriter(const IOstream::streamFormat writeFormat)
Construct given write format.
Base class for surface writers.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.