65 oldPatchStarts[patchi] = pbm[patchi].
start();
66 oldPatchNumPoints[patchi] = pbm[patchi].nPoints();
74 boundaryProcAddressing,
114 const fvMesh& baseMesh = *baseMeshPtr;
116 const label nNewPoints = baseMesh.
nPoints();
117 const label nNewFaces = baseMesh.
nFaces();
118 const label nNewCells = baseMesh.
nCells();
124 std::move(cellSubMap),
125 std::move(cellAddressing)
131 std::move(faceSubMap),
132 std::move(faceAddressing),
140 std::move(pointSubMap),
141 std::move(pointAddressing)
147 std::move(patchSubMap),
148 std::move(patchAddressing)
156 std::move(oldPatchStarts),
157 std::move(oldPatchNumPoints),
171 std::move(cellSubMap),
178 std::move(faceSubMap),
187 std::move(pointSubMap),
194 std::move(patchSubMap),
203 std::move(oldPatchStarts),
204 std::move(oldPatchNumPoints),
229 mesh.facesInstance(),
247 Info<<
"Reading (cell|face|point|boundary)ProcAddressing from " 248 <<
mesh.facesInstance().c_str() <<
'/' 251 ioAddr.rename(
"cellProcAddressing");
254 ioAddr.rename(
"faceProcAddressing");
257 ioAddr.rename(
"pointProcAddressing");
260 ioAddr.rename(
"boundaryProcAddressing");
265 mesh.nCells() != cellProcAddressing.
size()
266 ||
mesh.nPoints() != pointProcAddressing.
size()
267 ||
mesh.nFaces() != faceProcAddressing.
size()
268 ||
mesh.boundaryMesh().size() != boundaryProcAddressing.
size()
272 <<
"Read addressing inconsistent with mesh sizes" <<
nl 273 <<
"cells:" <<
mesh.nCells()
275 <<
" size:" << cellProcAddressing.
size() <<
nl 276 <<
"faces:" <<
mesh.nFaces()
278 <<
" size:" << faceProcAddressing.
size() <<
nl 279 <<
"points:" <<
mesh.nPoints()
281 <<
" size:" << pointProcAddressing.
size()
282 <<
"patches:" <<
mesh.boundaryMesh().size()
284 <<
" size:" << boundaryProcAddressing.
size()
295 boundaryProcAddressing
304 const mapDistributePolyMesh& map,
305 const bool decompose,
306 autoPtr<fileOperation>&& writeHandler
310 << (decompose ?
"decompose" :
"reconstruct")
311 <<
") procAddressing files to " 330 ioAddr.rename(
"cellProcAddressing");
334 ioAddr.rename(
"faceProcAddressing");
338 ioAddr.rename(
"pointProcAddressing");
342 ioAddr.rename(
"boundaryProcAddressing");
351 cellMap =
identity(map.nOldCells());
352 map.distributeCellData(cellMap);
356 const mapDistribute& faceDistMap = map.faceMap();
358 if (faceDistMap.subHasFlip() || faceDistMap.constructHasFlip())
364 faceDistMap.mapDistributeBase::distribute
372 pointMap =
identity(map.nOldPoints());
373 map.distributePointData(pointMap);
375 patchMap =
identity(map.oldPatchSizes().size());
376 map.patchMap().mapDistributeBase::distribute
390 map.cellMap().reverseDistribute(map.nOldCells(), cellMap);
394 const mapDistribute& faceDistMap = map.faceMap();
396 if (faceDistMap.subHasFlip() || faceDistMap.constructHasFlip())
402 faceDistMap.mapDistributeBase::reverseDistribute
412 map.pointMap().reverseDistribute(map.nOldPoints(), pointMap);
415 map.patchMap().mapDistributeBase::reverseDistribute
418 map.oldPatchSizes().size(),
424 autoPtr<fileOperation> defaultHandler;
427 defaultHandler =
fileHandler(std::move(writeHandler));
430 const bool cellOk = cellMap.write();
431 const bool faceOk =
faceMap.write();
432 const bool pointOk = pointMap.write();
433 const bool patchOk = patchMap.write();
437 writeHandler =
fileHandler(std::move(defaultHandler));
440 if (!cellOk || !faceOk || !pointOk || !patchOk)
443 <<
"Failed to write some of " 444 << cellMap.objectRelPath() <<
", " 445 <<
faceMap.objectRelPath() <<
", " 446 << pointMap.objectRelPath() <<
", " 447 << patchMap.objectRelPath() <<
endl;
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
List< labelList > labelListList
A List of labelList.
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const fileName & facesInstance() const
Return the current instance directory for faces.
label nPoints() const noexcept
Number of mesh points.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
label start() const noexcept
The start label of boundary faces in the polyMesh face list.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
Ostream & endl(Ostream &os)
Add newline and flush stream.
autoPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler.
Ignore writing from objectRegistry::writeObject()
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
label nFaces() const noexcept
Number of mesh faces.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
#define forAll(list, i)
Loop across all elements in list.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator) is 1 for serial run.
static void gatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
Gather data, but keep individual values separate. Uses the specified communication schedule...
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
static constexpr int masterNo() noexcept
Process index of the master (always 0)
label size() const noexcept
The number of elements in the list.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
static mapDistributePolyMesh createReconstructMap(const faMesh &mesh, const autoPtr< faMesh > &baseMeshPtr, const labelUList &faceProcAddr, const labelUList &edgeProcAddr, const labelUList &pointProcAddr, const labelUList &boundaryProcAddr)
Class containing processor-to-processor mapping information.
#define WarningInFunction
Report a warning using Foam::Warning.
label nCells() const noexcept
Number of mesh cells.
Mesh data needed to do the Finite Volume discretisation.
static bool master(const label communicator=worldComm)
Am I the master rank.
fileName objectRelPath() const
The object path relative to the root.
"nonBlocking" : (MPI_Isend, MPI_Irecv)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Defines the attributes of an object for which implicit objectRegistry management is supported...
A List with indirect addressing.
IOList< label > labelIOList
Label container classes.
static constexpr const zero Zero
Global zero (0)