34 void Foam::mapDistributePolyMesh::calcPatchSizes()
38 if (oldPatchStarts_.size())
41 for (label patchi = 0; patchi < oldPatchStarts_.size() - 1; patchi++)
43 oldPatchSizes_[patchi] =
44 oldPatchStarts_[patchi + 1] - oldPatchStarts_[patchi];
48 const label lastPatchID = oldPatchStarts_.
size() - 1;
50 oldPatchSizes_[lastPatchID] = nOldFaces_ - oldPatchStarts_[lastPatchID];
52 if (
min(oldPatchSizes_) < 0)
55 <<
"Calculated negative old patch size:" << oldPatchSizes_ <<
nl 77 oldPatchNMeshPoints_(),
128 const polyMesh&
mesh,
131 const label nOldPoints,
132 const label nOldFaces,
133 const label nOldCells,
149 const bool subFaceHasFlip,
150 const bool constructFaceHasFlip
153 nOldPoints_(nOldPoints),
154 nOldFaces_(nOldFaces),
155 nOldCells_(nOldCells),
157 oldPatchStarts_(
std::move(oldPatchStarts)),
158 oldPatchNMeshPoints_(
std::move(oldPatchNMeshPoints)),
162 std::move(subPointMap),
163 std::move(constructPointMap)
168 std::move(subFaceMap),
169 std::move(constructFaceMap),
176 std::move(subCellMap),
177 std::move(constructCellMap)
181 mesh.boundaryMesh().size(),
182 std::move(subPatchMap),
183 std::move(constructPatchMap)
193 const label nOldPoints,
194 const label nOldFaces,
195 const label nOldCells,
206 nOldPoints_(nOldPoints),
207 nOldFaces_(nOldFaces),
208 nOldCells_(nOldCells),
210 oldPatchStarts_(
std::move(oldPatchStarts)),
211 oldPatchNMeshPoints_(
std::move(oldPatchNMeshPoints)),
212 pointMap_(
std::move(pointMap)),
214 cellMap_(
std::move(cellMap)),
215 patchMap_(
std::move(patchMap))
228 oldPatchSizes_.clear();
229 oldPatchStarts_.clear();
230 oldPatchNMeshPoints_.clear();
238 void Foam::mapDistributePolyMesh::deepCopy(
const mapDistributePolyMesh& rhs)
246 nOldPoints_ = rhs.nOldPoints_;
247 nOldFaces_ = rhs.nOldFaces_;
248 nOldCells_ = rhs.nOldCells_;
249 oldPatchSizes_ = rhs.oldPatchSizes_;
250 oldPatchStarts_ = rhs.oldPatchStarts_;
251 oldPatchNMeshPoints_ = rhs.oldPatchNMeshPoints_;
252 pointMap_ = rhs.pointMap_;
253 faceMap_ = rhs.faceMap_;
254 cellMap_ = rhs.cellMap_;
255 patchMap_ = rhs.patchMap_;
267 nOldPoints_ = rhs.nOldPoints_;
268 nOldFaces_ = rhs.nOldFaces_;
269 nOldCells_ = rhs.nOldCells_;
270 oldPatchSizes_.transfer(rhs.oldPatchSizes_);
271 oldPatchStarts_.transfer(rhs.oldPatchStarts_);
272 oldPatchNMeshPoints_.transfer(rhs.oldPatchNMeshPoints_);
273 pointMap_.transfer(rhs.pointMap_);
274 faceMap_.transfer(rhs.faceMap_);
275 cellMap_.transfer(rhs.cellMap_);
276 patchMap_.transfer(rhs.patchMap_);
289 ListOps::createWithValue<bool>(nOldPoints(), lst,
true,
false)
293 distributePointData(isSelected);
305 ListOps::createWithValue<bool>(nOldFaces(), lst,
true,
false)
309 distributeFaceData(isSelected);
321 ListOps::createWithValue<bool>(nOldCells(), lst,
true,
false)
325 distributeCellData(isSelected);
337 ListOps::createWithValue<bool>
339 oldPatchStarts().size(),
347 distributePatchData(isSelected);
364 nOldPoints_ = rhs.nOldPoints_;
365 nOldFaces_ = rhs.nOldFaces_;
366 nOldCells_ = rhs.nOldCells_;
367 oldPatchSizes_ = rhs.oldPatchSizes_;
368 oldPatchStarts_ = rhs.oldPatchStarts_;
369 oldPatchNMeshPoints_ = rhs.oldPatchNMeshPoints_;
370 pointMap_ = rhs.pointMap_;
371 faceMap_ = rhs.faceMap_;
372 cellMap_ = rhs.cellMap_;
373 patchMap_ = rhs.patchMap_;
void size(const label n)
Older name for setAddressableSize.
void distributeCellIndices(labelList &cellIDs) const
void distributePatchIndices(labelList &patchIDs) const
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.
void operator=(const mapDistributePolyMesh &map)
Copy assignment.
constexpr char nl
The newline '\n' character (0x0a)
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
labelList findIndices(const ListType &input, typename ListType::const_reference val, label start=0)
Linear search to find all occurrences of given element.
void clear()
Reset to zero size, only retaining communicator(s)
List< labelList > labelListList
List of labelList.
mapDistributePolyMesh()
Default construct - uses worldComm.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
void transfer(mapDistributePolyMesh &map)
Transfer the contents of the argument and annul the argument.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
void distributeFaceIndices(labelList &faceIDs) const
Class containing processor-to-processor mapping information.
void distributePointIndices(labelList &pointIDs) const
Distribute list of point/face/cell/patch indices.
List< label > labelList
A List of labels.
Inter-processor communications stream.