26Info<<
"Write faMesh in vtk format:" <<
nl;
30 vtk::uindirectPatchWriter
writer
42 globalIndex procAddr(aMesh.nFaces());
45 if (UPstream::master())
47 cellIDs.resize(procAddr.totalSize());
48 for (
const labelRange&
range : procAddr.ranges())
50 auto slice = cellIDs.slice(
range);
58 writer.write(
"cellID", cellIDs);
59 writer.write(
"area", aMesh.S().field());
60 writer.write(
"normal", aMesh.faceAreaNormals());
64 writer.write(
"normal", aMesh.pointAreaNormals());
91 faMeshTools::flattenEdgeField(aMesh.magLe(),
true)
98 writer.write(
"normal", aMesh.pointAreaNormals());
100 Info<<
" " <<
writer.output().name() << nl;
107 faMeshTools::flattenEdgeField(aMesh.edgeCentres(),
true)
132 faMeshTools::flattenEdgeField(aMesh.Le(),
true)
140 faMeshTools::flattenEdgeField(aMesh.edgeAreaNormals(),
true)
145 Info<<
" " <<
writer.output().name() << nl;
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Info<< " "<< writer.output().name()<< nl;}{ const Field< vector > edgeCentres(faMeshTools::flattenEdgeField(aMesh.edgeCentres(), true))
vtk::lineWriter writer(edgeCentres, edgeList::null(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edgesCentres")))
word vtkBaseFileName(aMesh.regionName())
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
constexpr char nl
The newline '\n' character (0x0a).