32 #include "globalMeshData.H"
33 #include "hexMatcher.H"
34 #include "wedgeMatcher.H"
35 #include "prismMatcher.H"
36 #include "pyrMatcher.H"
37 #include "tetWedgeMatcher.H"
38 #include "tetMatcher.H"
44 #include "surfaceWriter.H"
45 #include "syncTools.H"
46 #include "globalIndex.H"
47 #include "PatchTools.H"
48 #include "functionObject.H"
54 const surfaceWriter& writer,
56 const indirectPrimitivePatch& setPatch,
57 const fileName& outputDir)
59 if (Pstream::parRun())
61 labelList pointToGlobal;
62 labelList uniqueMeshPointLabels;
63 autoPtr<globalIndex> globalPoints;
64 autoPtr<globalIndex> globalFaces;
66 pointField mergedPoints;
67 Foam::PatchTools::gatherAndMerge(
69 setPatch.localFaces(),
70 setPatch.meshPoints(),
71 setPatch.meshPointMap(),
74 uniqueMeshPointLabels,
82 if (Pstream::master())
98 setPatch.localPoints(),
99 setPatch.localFaces()));
104 const surfaceWriter& writer,
107 const polyMesh&
mesh = refCast<const polyMesh>(set.db());
109 const indirectPrimitivePatch setPatch(
110 IndirectList<face>(
mesh.faces(), set.sortedToc()),
114 set.time().globalPath()
115 / functionObject::outputPrefix
116 /
mesh.pointsInstance()
124 const surfaceWriter& writer,
127 const polyMesh&
mesh = refCast<const polyMesh>(set.db());
128 const polyBoundaryMesh& pbm =
mesh.boundaryMesh();
131 bitSet isInSet(
mesh.nCells());
132 forAllConstIter(cellSet, set, iter)
134 isInSet.set(iter.key());
137 boolList bndInSet(
mesh.nBoundaryFaces());
140 const polyPatch& pp = pbm[patchi];
141 const labelList& fc = pp.faceCells();
144 bndInSet[pp.start() + i -
mesh.nInternalFaces()] = isInSet[fc[i]];
147 syncTools::swapBoundaryFaceList(
mesh, bndInSet);
149 DynamicList<label> outsideFaces(3 * set.size());
150 for (label facei = 0; facei <
mesh.nInternalFaces(); facei++)
152 const bool ownVal = isInSet[
mesh.faceOwner()[facei]];
153 const bool neiVal = isInSet[
mesh.faceNeighbour()[facei]];
155 if (ownVal != neiVal)
157 outsideFaces.append(facei);
163 const polyPatch& pp = pbm[patchi];
164 const labelList& fc = pp.faceCells();
169 label facei = pp.start() + i;
171 const bool neiVal = bndInSet[facei -
mesh.nInternalFaces()];
172 if (isInSet[fc[i]] && !neiVal)
174 outsideFaces.append(facei);
184 outsideFaces.append(pp.start() + i);
190 const indirectPrimitivePatch setPatch(
191 IndirectList<face>(
mesh.faces(), outsideFaces),
195 set.time().globalPath()
196 / functionObject::outputPrefix
197 /
mesh.pointsInstance()