Go to the documentation of this file.
24 objectFile::READ_ALWAYS,
25 objectFile::WRITE_ALWAYS));
29 WARNING <<
"Time folder " <<
timeFolder <<
" does not contain any triSurface data file."
38 objectFile::READ_ALWAYS,
39 objectFile::WRITE_ALWAYS),
72 os <<
"DATASET UNSTRUCTURED_GRID" <<
endl;
73 os <<
"POINTS " << nP <<
" float" <<
endl;
77 os << points[i].
x() <<
78 " " << points[i].
y() <<
79 " " << points[i].
z() <<
endl;
80 if (!os)
return false;
83 auto nTri = subSurf.
size();
85 os <<
"CELLS " << nTri <<
" " << 4*nTri <<
endl;
87 for(
auto i=subSurf.
start(); i<subSurf.
end(); i++)
93 if (!os)
return false;
96 os<<
"CELL_TYPES "<< nTri<<
'\n';
98 for(
uint32 i=0; i<nTri; i++)
103 os <<
"CELL_DATA " << nTri <<
endl;
116 os <<
"DATASET UNSTRUCTURED_GRID" <<
endl;
117 os <<
"POINTS " << numPoints <<
" float" <<
endl;
119 for (
auto i=0; i<numPoints; i++ )
121 os << points[i].
x() <<
122 " " << points[i].
y() <<
123 " " << points[i].
z() <<
endl;
124 if (!os)
return false;
127 os <<
"CELLS " << numTris <<
" " << 4*numTris <<
endl;
129 for(
auto i=0; i<numTris; i++)
132 " "<< vertices[i].
x()<<
133 " "<< vertices[i].
y()<<
134 " "<< vertices[i].
z()<<
endl;
135 if (!os)
return false;
138 os<<
"CELL_TYPES "<< numTris<<
'\n';
140 for(
uint32 i=0; i<numTris; i++)
145 os <<
"CELL_DATA " << numTris <<
endl;
160 vtkFile vtk(destPath, bName, time,
false);
165 auto hPoints =
surface.points().hostView();
166 auto hVertices =
surface.vertices().hostView();
168 realx3 const* pData = hPoints.data();
169 uint32x3 const* vData = hVertices.data();
171 REPORT(2) <<
"Wrting surface to "<<
182 "error in writing triSurface data to vtk file " <<
189 for(
const auto& file:fileList)
195 objectFile::READ_ALWAYS,
196 objectFile::WRITE_ALWAYS) );
204 surfNames.push_back(bName);
220 auto hPoints =
surface.points().hostView();
221 auto hVertices =
surface.vertices().hostView();
223 realx3 const* pData = hPoints.data();
224 uint32x3 const* vData = hVertices.data();
226 REPORT(1) <<
"Wrting triSurface geometry to vtk file . . ."<<
231 auto nSurf =
surface.numSurfaces();
232 for(
auto nS=0; nS<nSurf; nS++)
234 auto sName =
surface.subSurfaceName(nS);
236 vtkFile vtk(destPath, fName, time,
false);
237 REPORT(2) <<
"Wrting sub-surface to "<<
244 sNames.push_back(fName);
253 "error in writing triSurface data to vtk file " <<
261 for(
const auto& file:fileList)
267 objectFile::READ_ALWAYS,
268 objectFile::WRITE_ALWAYS) );
296 if(!checkTriFieldType<realx3>(objectType))
return false;
305 const realx3* data = field.deviceViewAll().data();
331 if(!checkTriFieldType<realx3>(objectType))
return false;
340 const realx3* data = field.deviceViewAll().data();
347 for(
auto nS=0; nS<nSurf; nS++)
351 auto sName = subSurf.name();
353 REPORT(2) <<
"Wrting sub-surface to "<<
360 data+subSurf.start(),
virtual fileSystem fileName() const
fileSystemList containingFiles(const fileSystem &path)
A list of file paths that exist in the path.
bool convertRealx3TypetriSurfaceField(Ostream &os, const IOfileHeader &header, multiTriSurface &tSurface)
iOstream & endl(iOstream &os)
Add newline and flush stream.
bool convertTimeFolderTriSurfaceFieldsSeparate(multiTriSurface &surface, const fileSystem &destPath, real time, const word &bName, wordList &surfNames, wordList &fileNames)
INLINE_FUNCTION_HD T & y()
access component
const subSurfaceList & subSurfaces() const
Manages file pathes, manupulate and combines them.
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
const char * defaultColor
char constants to alter output format and color
const Time & time() const
bool convertTimeFolderTriSurfaceFields(systemControl &control, const fileSystem &destPath, const word &bName, bool separate, wordList &surfNames, wordList &fileNames)
bool triSurfaceToVTK(Ostream &os, const realx3 *points, const uint32x3 *vertices, const subSurface &subSurf)
const char *const triSurfaceFile__
INLINE_FUNCTION_HD T & z()
access component
virtual fileSystem path() const
bool convertRealx3TypetriSurfaceFieldSeparate(const fileSystem &destPath, const IOfileHeader &header, multiTriSurface &tSurface, const word &bName, real time)
uint32 pointStart() const
const repository & geometry() const
word groupNames(const word &bw, const word &tw, char sep='.')
Group words and output bw.tw.
word wordPath() const
Path in word type.
INLINE_FUNCTION_HD T & x()
access component
Standard output stream for BINARY and ASCII formats.
uint32 numSurfaces() const
triSurfaceField< realx3, HostSpace > realx3TriSurfaceField_H
INLINE_FUNCTION_HD real surface(const realx3 &p1, const realx3 &p2, const realx3 &p3)
bool convertTimeFolderTriSurfaceFieldsSingle(multiTriSurface &surface, const fileSystem &destPath, real time, const word &bName, wordList &surfNames, wordList &fileNames)
bool addRealx3PointField(Ostream &os, const word &fieldName, const realx3 *field, uint32 numData)