109 const faMesh& baseMesh = *baseMeshPtr;
111 const label nNewPoints = baseMesh.
nPoints();
112 const label nNewFaces = baseMesh.
nFaces();
113 const label nNewEdges = baseMesh.
nEdges();
124 std::move(faceSubMap),
125 std::move(faceAddressing),
133 std::move(edgeSubMap),
134 std::move(edgeAddressing),
142 std::move(pointSubMap),
143 std::move(pointAddressing)
149 std::move(patchSubMap),
150 std::move(patchAddressing)
160 std::move(oldPatchStarts),
174 std::move(faceSubMap),
183 std::move(edgeSubMap),
192 std::move(pointSubMap),
199 std::move(patchSubMap),
210 std::move(oldPatchStarts),
236 mesh.facesInstance(),
253 Info<<
"Reading (face|edge|face|point|boundary)ProcAddressing from " 254 <<
mesh.facesInstance().c_str() <<
'/' 257 ioAddr.rename(
"faceProcAddressing");
260 ioAddr.rename(
"edgeProcAddressing");
263 ioAddr.rename(
"pointProcAddressing");
266 ioAddr.rename(
"boundaryProcAddressing");
271 mesh.nFaces() != faceProcAddressing.
size()
272 ||
mesh.nEdges() != edgeProcAddressing.
size()
273 ||
mesh.nPoints() != pointProcAddressing.
size()
274 ||
mesh.boundary().size() != boundaryProcAddressing.
size()
278 <<
"Read addressing inconsistent with mesh sizes" <<
nl 279 <<
"faces:" <<
mesh.nFaces()
281 <<
" size:" << faceProcAddressing.
size() <<
nl 282 <<
"edges:" <<
mesh.nEdges()
284 <<
" size:" << edgeProcAddressing.
size() <<
nl 285 <<
"points:" <<
mesh.nPoints()
287 <<
" size:" << pointProcAddressing.
size()
288 <<
"patches:" <<
mesh.boundary().size()
290 <<
" size:" << boundaryProcAddressing.
size()
301 boundaryProcAddressing
310 const mapDistributePolyMesh& map,
311 const bool decompose,
312 autoPtr<fileOperation>&& writeHandler,
313 const faMesh* procMesh
317 << (decompose ?
"decompose" :
"reconstruct")
318 <<
") procAddressing files to " 327 (procMesh && !decompose ? procMesh->thisDb() :
mesh.
thisDb()),
335 ioAddr.rename(
"faceProcAddressing");
339 ioAddr.rename(
"edgeProcAddressing");
343 ioAddr.rename(
"pointProcAddressing");
347 ioAddr.rename(
"boundaryProcAddressing");
357 map.cellMap().distribute(
faceMap);
360 edgeMap =
identity(map.nOldFaces());
361 map.faceMap().distribute(edgeMap);
363 pointMap =
identity(map.nOldPoints());
364 map.distributePointData(pointMap);
366 patchMap =
identity(map.patchMap().constructSize());
367 map.patchMap().mapDistributeBase::distribute
382 map.cellMap().reverseDistribute(map.nOldCells(),
faceMap);
386 map.faceMap().reverseDistribute(map.nOldFaces(), edgeMap);
389 map.pointMap().reverseDistribute(map.nOldPoints(), pointMap);
392 map.patchMap().mapDistributeBase::reverseDistribute
395 map.oldPatchSizes().size(),
401 autoPtr<fileOperation> defaultHandler;
404 defaultHandler =
fileHandler(std::move(writeHandler));
411 IOmapDistributePolyMeshRef procAddrMap
446 const bool faceOk =
faceMap.write();
447 const bool edgeOk = edgeMap.write();
448 const bool pointOk = pointMap.write();
449 const bool patchOk = patchMap.write();
453 writeHandler =
fileHandler(std::move(defaultHandler));
456 if (!edgeOk || !faceOk || !pointOk || !patchOk)
459 <<
"Failed to write some of " 460 <<
faceMap.objectRelPath() <<
", " 461 << edgeMap.objectRelPath() <<
", " 462 << pointMap.objectRelPath() <<
", " 463 << patchMap.objectRelPath() <<
endl;
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
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)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
autoPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
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.
label nFaces() const noexcept
Number of patch faces.
label nPoints() const noexcept
Number of local mesh points.
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.
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.
label nEdges() const
Number of mesh edges.
static mapDistributePolyMesh createReconstructMap(const faMesh &mesh, const autoPtr< faMesh > &baseMeshPtr, const labelUList &faceProcAddr, const labelUList &edgeProcAddr, const labelUList &pointProcAddr, const labelUList &boundaryProcAddr)
const faBoundaryMesh & boundary() const noexcept
Return constant reference to boundary mesh.
label nEdges() const noexcept
Number of local mesh edges.
static word meshSubDir
The mesh sub-directory name (usually "faMesh")
Class containing processor-to-processor mapping information.
#define WarningInFunction
Report a warning using Foam::Warning.
static bool master(const label communicator=worldComm)
Am I the master rank.
Finite area boundary mesh.
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...
List< label > labelList
A List of labels.
Defines the attributes of an object for which implicit objectRegistry management is supported...
labelList patchStarts() const
Return a list of patch start indices.
A List with indirect addressing.
Do not request registration (bool: false)
IOList< label > labelIOList
Label container classes.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
static constexpr const zero Zero
Global zero (0)