28 const vtk::vtuCells topoCells(
topoMesh, vtk::formatType::INLINE_ASCII);
34 vtk::formatType::INLINE_ASCII,
38 Info<<
"Writing block topology in vtk format: "
48 vectorField localNormal(blocks.size());
53 const label faceMin = label(2*cmpt);
54 const label faceMax = faceMin+1;
56 localNormal.resize(blocks.size());
60 const cellShape& shape = blocks[blocki].blockShape();
61 const pointField& verts = blocks[blocki].vertices();
63 if (shape.model() == cellModel::ref(cellModel::HEX))
70 shape.face(faceMax).centre(verts)
71 - shape.face(faceMin).centre(verts)
76 shape.face(faceMax).areaNormal(verts)
77 - shape.face(faceMin).areaNormal(verts)
84 localNormal[blocki] = Zero;
93 word(
"local-direction" +
name(cmpt)),
107 const label nIntFaces =
topoMesh.nInternalFaces();
108 const label nBndFaces =
topoMesh.nBoundaryFaces();
112 faceList::subList(
topoMesh.faces(), nBndFaces, nIntFaces)
119 vtk::formatType::INLINE_ASCII,
133 for (
const polyPatch& pp :
patches)
135 label bndFacei = pp.start() - nIntFaces;
136 label meshFacei = pp.start();
140 const label celli = own[meshFacei];
141 const label cellFacei =
cells[celli].find(meshFacei);
143 blockIds[bndFacei] = celli;
144 cellFaceIds[bndFacei] = cellFacei;
153 Info<<
"Writing block boundary faces in vtk format: "
159 writer.writeCellData(
"block", blockIds);
160 writer.writeCellData(
"face", cellFaceIds);
vtk::internalMeshWriter writer(topoMesh, topoCells, vtk::formatType::INLINE_ASCII, runTime.path()/"blockTopology")
const polyMesh & topoMesh
refPtr< polyMesh > topoMeshPtr(blocks.topology(true))
void resize(const label len)
Adjust allocated size of list.
fileName relativePath(const fileName &input, const bool caseTag=false) const
static constexpr direction nComponents
Number of components in bool is 1.
const polyBoundaryMesh & patches
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
List< label > labelList
A List of labels.
List< cell > cellList
A List of cells.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
List< face > faceList
A List of faces.
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.