44 inline void Foam::rawSurfaceWriter::writeLocation
51 const point& pt = points[pointI];
52 os << pt.
x() <<
' ' << pt.y() <<
' ' << pt.z() <<
' ';
56 inline void Foam::rawSurfaceWriter::writeLocation
65 os << ct.
x() <<
' ' << ct.y() <<
' ' << ct.z() <<
' ';
72 void Foam::rawSurfaceWriter::writeHeader
75 const word& fieldName,
80 <<
"# x y z " << fieldName <<
nl;
85 void Foam::rawSurfaceWriter::writeHeader
88 const word& fieldName,
102 void Foam::rawSurfaceWriter::writeHeader
105 const word& fieldName,
111 << fieldName <<
"_ii" <<
nl;
116 void Foam::rawSurfaceWriter::writeHeader
119 const word& fieldName,
124 <<
"# xx xy xz yy yz ";
125 for (
int i=0; i<6; ++i)
127 os << fieldName <<
"_" << i <<
" ";
134 void Foam::rawSurfaceWriter::writeHeader
137 const word& fieldName,
142 <<
"# xx xy xz yx yy yz zx zy zz";
143 for (
int i=0; i<9; ++i)
145 os << fieldName <<
"_" << i <<
" ";
152 inline void Foam::rawSurfaceWriter::writeData
163 inline void Foam::rawSurfaceWriter::writeData
169 os << v[0] <<
' ' << v[1] <<
' ' << v[2] <<
nl;
174 inline void Foam::rawSurfaceWriter::writeData
185 inline void Foam::rawSurfaceWriter::writeData
191 os << v[0] <<
' ' << v[1] <<
' ' << v[2] <<
' ' 192 << v[3] <<
' ' << v[4] <<
' ' << v[5] <<
nl;
197 inline void Foam::rawSurfaceWriter::writeData
203 os << v[0] <<
' ' << v[1] <<
' ' << v[2] <<
' ' 204 << v[3] <<
' ' << v[4] <<
' ' << v[5] <<
' ' 205 << v[6] <<
' ' << v[7] <<
' ' << v[8] <<
nl;
212 void Foam::rawSurfaceWriter::writeTemplate
218 const word& fieldName,
220 const bool isNodeValues,
224 if (!
isDir(outputDir))
229 OFstream os(outputDir/fieldName +
'_' + surfaceName +
".raw");
233 Info<<
"Writing field " << fieldName <<
" to " << os.
name() <<
endl;
237 os <<
"# " << fieldName;
240 os <<
" POINT_DATA ";
248 writeHeader(os, fieldName, values);
255 writeLocation(os, points, elemI);
263 writeLocation(os, points, faces, elemI);
296 if (!
isDir(outputDir))
301 OFstream os(outputDir/surfaceName +
".raw");
310 os <<
"# geometry NO_DATA " << faces.
size() <<
nl 316 writeLocation(os, points, faces, elemI);
vector point
Point is a vector.
Templated 3D symmetric tensor derived from VectorSpace adding construction from 6 components...
Convenience macros for instantiating writer methods for surfaceWriter classes.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
defineSurfaceWriterWriteFields(nastranSurfaceWriter)
void size(const label)
Override size to be inconsistent with allocated storage.
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.
vectorField pointField
pointField is a vectorField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual ~rawSurfaceWriter()
Destructor.
const fileName & name() const
Return the name of the stream.
Base class for surface writers.
rawSurfaceWriter()
Construct null.
A surfaceWriter for raw output.
const Vector< Cmpt > & centre(const Foam::List< Vector< Cmpt > > &) const
Return *this (used for point which is a typedef to Vector<scalar>.
Istream and Ostream manipulators taking arguments.
const bool writeData(readBool(pdfDictionary.lookup("writeData")))
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
virtual void write(const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const bool verbose=false) const
Write single surface geometry to file.
A class for handling file names.
makeSurfaceWriterType(dxSurfaceWriter)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.