Go to the documentation of this file.
48 <<
"# vtk DataFile Version 2.0" <<
nl
49 <<
"sampleSurface" <<
nl
51 <<
"DATASET POLYDATA" <<
nl;
54 os <<
"POINTS " <<
points.size() <<
" float" <<
nl;
58 os << float(pt.
x()) <<
' '
59 << float(pt.
y()) <<
' '
60 << float(pt.
z()) <<
nl;
69 nNodes += faces[faceI].
size();
72 os <<
"POLYGONS " << faces.
size() <<
' '
73 << faces.
size() + nNodes <<
nl;
77 const face&
f = faces[faceI];
99 os <<
"1 " << values.size() <<
" float" <<
nl;
115 os << float(values[elemI]);
128 os <<
"3 " << values.size() <<
" float" <<
nl;
132 const vector& v = values[elemI];
133 os << float(v[0]) <<
' ' << float(v[1]) <<
' ' << float(v[2])
146 os <<
"1 " << values.size() <<
" float" <<
nl;
151 os << float(v[0]) <<
nl;
163 os <<
"6 " << values.size() <<
" float" <<
nl;
168 os << float(v[0]) <<
' ' << float(v[1]) <<
' ' << float(v[2])
170 << float(v[3]) <<
' ' << float(v[4]) <<
' ' << float(v[5])
184 os <<
"9 " << values.size() <<
" float" <<
nl;
188 const tensor& v = values[elemI];
189 os << float(v[0]) <<
' ' << float(v[1]) <<
' ' << float(v[2])
191 << float(v[3]) <<
' ' << float(v[4]) <<
' ' << float(v[5])
193 << float(v[6]) <<
' ' << float(v[7]) <<
' ' << float(v[8])
226 if (!
isDir(outputDir))
231 OFstream os(outputDir/surfaceName +
".vtk");
238 writeGeometry(os,
points, faces);
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
Base class for surface writers.
A class for handling file names.
virtual fileName write(const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const bool verbose=false) const
Write single surface geometry to file.
#define forAll(list, i)
Loop across all elements in list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vtkSurfaceWriter()
Construct null.
Convenience macros for instantiating writer methods for surfaceWriter classes.
static void writeData(Ostream &, const Field< Type > &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
defineSurfaceWriterWriteFields(nastranSurfaceWriter)
static void writeGeometry(Ostream &, const pointField &, const faceList &)
virtual ~vtkSurfaceWriter()
Destructor.
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
Templated 3D SphericalTensor derived from VectorSpace adding construction from 1 component,...
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.
A surfaceWriter for VTK legacy format.
const fileName & name() const
Return the name of the stream.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
makeSurfaceWriterType(boundaryDataSurfaceWriter)
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.