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 const fileName& writeHandlerInstance,
307 refPtr<fileOperation>& writeHandler
311 << (decompose ?
"decompose" :
"reconstruct")
312 <<
") procAddressing files to " 331 ioAddr.rename(
"cellProcAddressing");
335 ioAddr.rename(
"faceProcAddressing");
339 ioAddr.rename(
"pointProcAddressing");
343 ioAddr.rename(
"boundaryProcAddressing");
352 cellMap =
identity(map.nOldCells());
353 map.distributeCellData(cellMap);
357 const mapDistribute& faceDistMap = map.faceMap();
359 if (faceDistMap.subHasFlip() || faceDistMap.constructHasFlip())
365 faceDistMap.mapDistributeBase::distribute
373 pointMap =
identity(map.nOldPoints());
374 map.distributePointData(pointMap);
376 patchMap =
identity(map.oldPatchSizes().size());
377 map.patchMap().mapDistributeBase::distribute
391 map.cellMap().reverseDistribute(map.nOldCells(), cellMap);
395 const mapDistribute& faceDistMap = map.faceMap();
397 if (faceDistMap.subHasFlip() || faceDistMap.constructHasFlip())
403 faceDistMap.mapDistributeBase::reverseDistribute
413 map.pointMap().reverseDistribute(map.nOldPoints(), pointMap);
416 map.patchMap().mapDistributeBase::reverseDistribute
419 map.oldPatchSizes().size(),
434 const auto& tm = cellMap.time();
435 const IOstreamOption opt(tm.writeFormat(), tm.writeCompression());
439 cellMap.instance() = writeHandlerInstance;
440 const bool cellOk =
fileHandler().writeObject(cellMap, opt,
true);
442 faceMap.instance() = writeHandlerInstance;
445 pointMap.instance() = writeHandlerInstance;
446 const bool pointOk =
fileHandler().writeObject(pointMap, opt,
true);
448 patchMap.instance() = writeHandlerInstance;
449 const bool patchOk =
fileHandler().writeObject(patchMap, opt,
true);
453 if (!cellOk || !faceOk || !pointOk || !patchOk)
456 <<
"Failed to write some of " 457 << cellMap.objectRelPath() <<
", " 458 <<
faceMap.objectRelPath() <<
", " 459 << pointMap.objectRelPath() <<
", " 460 << patchMap.objectRelPath() <<
endl;
const polyBoundaryMesh & pbm
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.
static void gatherList(const UList< commsStruct > &comms, UList< T > &values, const int tag, const label comm)
Gather data, but keep individual values separate. Uses the specified communication schedule...
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
Ignore writing from objectRegistry::writeObject()
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
label nFaces() const noexcept
Number of mesh faces.
List< labelList > labelListList
List of labelList.
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). It is 1 for serial run. ...
IOList< label > labelIOList
IO for a List of label.
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...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
static constexpr int masterNo() noexcept
Relative rank for the master process - is always 0.
label size() const noexcept
The number of entries in the list.
Reading is optional [identical to LAZY_READ].
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)
True if process corresponds to the master rank in the communicator.
fileName objectRelPath() const
The object path relative to the root.
"nonBlocking" (immediate) : (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 const fileOperation & fileHandler()
Return the current file handler. Will create the default file handler if necessary.
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.
Do not request registration (bool: false)
static constexpr const zero Zero
Global zero (0)