43 void Foam::vtkSurfaceWriter::writeGeometry
52 <<
"# vtk DataFile Version 2.0" << nl
53 <<
"sampleSurface" << nl
55 <<
"DATASET POLYDATA" <<
nl;
58 os <<
"POINTS " << points.size() <<
" double" <<
nl;
61 const point& pt = points[pointi];
62 os << float(pt.x()) <<
' ' 63 <<
float(pt.y()) <<
' ' 64 <<
float(pt.z()) << nl;
73 nNodes += faces[facei].size();
76 os <<
"POLYGONS " << faces.size() <<
' ' 77 << faces.size() + nNodes <<
nl;
81 const face&
f = faces[facei];
97 void Foam::vtkSurfaceWriter::writeData
103 os <<
"1 " << values.
size() <<
" float" <<
nl;
119 os << float(values[elemI]);
126 void Foam::vtkSurfaceWriter::writeData
132 os <<
"3 " << values.
size() <<
" float" <<
nl;
136 const vector& v = values[elemI];
137 os << float(v[0]) <<
' ' << float(v[1]) <<
' ' << float(v[2])
144 void Foam::vtkSurfaceWriter::writeData
150 os <<
"1 " << values.
size() <<
" float" <<
nl;
155 os << float(v[0]) <<
nl;
161 void Foam::vtkSurfaceWriter::writeData
167 os <<
"6 " << values.
size() <<
" float" <<
nl;
172 os << float(v[0]) <<
' ' << float(v[1]) <<
' ' << float(v[2])
174 << float(v[3]) <<
' ' << float(v[4]) <<
' ' << float(v[5])
182 void Foam::vtkSurfaceWriter::writeData
188 os <<
"9 " << values.
size() <<
" float" <<
nl;
192 const tensor& v = values[elemI];
193 os << float(v[0]) <<
' ' << float(v[1]) <<
' ' << float(v[2])
195 << float(v[3]) <<
' ' << float(v[4]) <<
' ' << float(v[5])
197 << float(v[6]) <<
' ' << float(v[7]) <<
' ' << float(v[8])
207 void Foam::vtkSurfaceWriter::writeData
213 os <<
"1 " << values.
size() <<
" float" <<
nl;
217 os << float(0) <<
nl;
223 void Foam::vtkSurfaceWriter::writeTemplate
229 const word& fieldName,
231 const bool isNodeValues,
235 if (!
isDir(outputDir))
240 OFstream os(outputDir/fieldName +
'_' + surfaceName +
".vtk");
244 Info<<
"Writing field " << fieldName <<
" to " << os.
name() <<
endl;
247 writeGeometry(os, points, faces);
259 os << values.
size() << nl
260 <<
"FIELD attributes 1" << nl
293 if (!
isDir(outputDir))
298 OFstream os(outputDir/surfaceName +
".vtk");
305 writeGeometry(os, points, faces);
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual ~vtkSurfaceWriter()
Destructor.
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.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
vectorField pointField
pointField is a vectorField.
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.
defineSurfaceWriterWriteFields(nastranSurfaceWriter)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
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.
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.
vtkSurfaceWriter()
Construct null.
vector point
Point is a vector.
A surfaceWriter for VTK legacy format.
makeSurfaceWriterType(ensightSurfaceWriter)
Base class for surface writers.