52 const bool allTopology
65 if (nInternalPoints != -Pstream::nProcs())
67 Info<<
" internal points: " << nInternalPoints <<
nl;
72 <<
"Some processors have their points sorted into internal"
73 <<
" and external and some do not." <<
endl
74 <<
"This can cause problems later on." <<
endl;
78 if (allTopology && nInternalPoints != -Pstream::nProcs())
97 Info<<
" edges: " << nEdges <<
nl
98 <<
" internal edges: " << nInternalEdges <<
nl
99 <<
" internal edges using one boundary point: "
100 << nInternal1Edges-nInternal0Edges <<
nl
101 <<
" internal edges using two boundary points: "
102 << nInternalEdges-nInternal1Edges <<
nl;
109 Info<<
" faces: " << nFaces <<
nl
110 <<
" internal faces: " << nIntFaces <<
nl
111 <<
" cells: " << nCells <<
nl
112 <<
" faces per cell: "
113 << scalar(nFaces + nIntFaces)/
max(1, nCells) <<
nl
139 for (
label celli = 0; celli < mesh.
nCells(); celli++)
141 if (
hex.isA(mesh, celli))
145 else if (tet.
isA(mesh, celli))
149 else if (pyr.
isA(mesh, celli))
153 else if (prism.
isA(mesh, celli))
157 else if (wedge.
isA(mesh, celli))
161 else if (tetWedge.
isA(mesh, celli))
168 polyhedralFaces(mesh.
cells()[celli].
size())++;
180 Info<<
"Overall number of cells of each type:" <<
nl
181 <<
" hexahedra: " << nHex <<
nl
182 <<
" prisms: " << nPrism <<
nl
183 <<
" wedges: " << nWedge <<
nl
184 <<
" pyramids: " << nPyr <<
nl
185 <<
" tet wedges: " << nTetWedge <<
nl
186 <<
" tetrahedra: " << nTet <<
nl
187 <<
" polyhedra: " << nUnknown
194 Info<<
" Breakdown of polyhedra by number of faces:" <<
nl
195 <<
" faces" <<
" number of cells" <<
endl;
201 const label nFaces = sortedKeys[keyI];
204 << nFaces <<
" " << polyhedralFaces[nFaces] <<
nl;
221 if (Pstream::parRun())
237 uniqueMeshPointLabels,
246 if (Pstream::master())
248 writer.
write(outputDir,
name, mergedPoints, mergedFaces);
268 /functionObjects::writeFile::outputPrefix
270 (mesh.
name() != polyMesh::defaultRegion)
285 const polyMesh& mesh = refCast<const polyMesh>(set.
db());
303 const polyMesh& mesh = refCast<const polyMesh>(set.
db());
311 isInSet[iter.key()] =
true;
325 syncTools::swapBoundaryFaceList(mesh, bndInSet);
331 bool ownVal = isInSet[mesh.
faceOwner()[facei]];
334 if (ownVal != neiVal)
336 outsideFaces.
append(facei);
352 if (isInSet[fc[i]] && !neiVal)
354 outsideFaces.
append(facei);
390 const polyMesh& mesh = refCast<const polyMesh>(set.
db());
395 if (Pstream::parRun())
413 myIDs[i] = globalNumbering.
toGlobal(setPointIDs[i]);
416 if (Pstream::master())
422 pOffset += myPoints.
size();
425 for (
int slave=1; slave<Pstream::nProcs(); slave++)
427 IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
434 pOffset += slaveIDs.
size();
443 Pstream::commsTypes::scheduled,
447 toMaster << myPoints << myIDs;
457 if (Pstream::master())
463 coordSet(
false, word::null, mergedPts),
Istream and Ostream manipulators taking arguments.
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
label size() const
Return number of elements in table.
const objectRegistry & db() const
Return the local objectRegistry.
const word & name() const
Return name.
Input inter-processor communications stream.
A List with indirect addressing.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
Output inter-processor communications stream.
const Map< label > & meshPointMap() const
Mesh point map. Given the global point index find its.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
A List obtained as a section of another List.
fileName globalPath() const
Return the global path.
std::streamsize byteSize() const
Return the binary size in number of characters of the UList.
label size() const
Return the number of elements in the UPtrList.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A collection of cell labels.
Holds list of sampling positions.
A class for handling file names.
bool clean()
Cleanup file name.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label toGlobal(const label i) const
From local to global.
Calculates points shared by more than two processor patches or cyclic patches.
A cellMatcher for hex cells.
const Time & time() const
Return time.
Mesh consisting of general polyhedral cells.
const pointZoneList & pointZones() const
Return point zones.
const cellZoneList & cellZones() const
Return cell zones.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
const fileName & pointsInstance() const
Return the current instance directory for points.
const faceZoneList & faceZones() const
Return face zones.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const labelList & faceNeighbour() const
Return face neighbour.
virtual const pointField & points() const
Return raw points.
A patch is a list of labels that address the faces in the global face list.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
label start() const
Return start label of this patch in the polyMesh face list.
const labelUList & faceCells() const
Return face-cell addressing.
label nInternal1Edges() const
Internal edges using 0 or 1 boundary point.
label nInternalFaces() const
label nInternal0Edges() const
Internal edges (i.e. not on boundary face) using.
label nInternalEdges() const
Internal edges using 0,1 or 2 boundary points.
label nInternalPoints() const
Points not on boundary.
const cellList & cells() const
A cellMatcher for prism cells.
virtual bool isA(const primitiveMesh &mesh, const label celli)
Exact match. Uses faceSizeMatch.
A cellMatcher for pyr cells.
virtual bool isA(const primitiveMesh &mesh, const label celli)
Exact match. Uses faceSizeMatch.
Base class for writing coordinate sets with data.
virtual void write(const fileName &outputDir, const fileName &setName, const coordSet &set, const wordList &valueSetNames #define TypeValueSetsConstArg(Type, nullArg)) const =0
Write a coordSet and associated data.
Base class for surface writers.
virtual void write(const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const wordList &fieldNames, const bool writePointValues #define FieldTypeValuesConstArg(Type, nullArg)) const =0
Write fields for a single surface to file.
A cellMatcher for tet cells.
virtual bool isA(const primitiveMesh &mesh, const label celli)
Exact match. Uses faceSizeMatch.
A cellMatcher for tetWedge cells.
virtual bool isA(const primitiveMesh &mesh, const label celli)
Exact match. Uses faceSizeMatch.
A cellMatcher for wedge cells.
virtual bool isA(const primitiveMesh &mesh, const label celli)
Exact match. Uses faceSizeMatch.
A class for handling words, derived from string.
volScalarField scalarField(fieldObject, mesh)
Tools for checking the mesh.
#define WarningInFunction
Report a warning using Foam::Warning.
void mergeAndWrite(const polyMesh &mesh, const surfaceWriter &setWriter, const word &name, const indirectPrimitivePatch setPatch, const fileName &outputDir)
Generate merged surface on master and write. Needs input patch.
fileName checkMeshOutputDir(const polyMesh &mesh)
Output directory for sets and surfaces.
void printMeshStats(const polyMesh &mesh, const bool allTopology)
Print mesh statistics.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
Omanip< int > setw(const int i)
IOstream & hex(IOstream &io)
vectorField pointField
pointField is a vectorField.
List< scalar > scalarList
A List of scalars.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)