34void Foam::mapDistributePolyMesh::calcPatchSizes()
36 oldPatchSizes_.resize_nocopy(oldPatchStarts_.size());
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();
238void 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_);
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_;
Inter-processor communications stream.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
void distributePatchIndices(labelList &patchIDs) const
const mapDistribute & patchMap() const noexcept
Patch distribute map.
void distributePointIndices(labelList &pointIDs) const
Distribute list of point/face/cell/patch indices.
void distributeCellData(List< T > &values) const
Distribute list of cell data.
label nOldCells() const noexcept
Number of cells in mesh before distribution.
void distributeFaceData(List< T > &values) const
Distribute list of face data.
void distributeFaceIndices(labelList &faceIDs) const
void distributeCellIndices(labelList &cellIDs) const
const labelList & oldPatchStarts() const noexcept
List of the old patch start labels.
void operator=(const mapDistributePolyMesh &map)
Copy assignment.
label nOldFaces() const noexcept
Number of faces in mesh before distribution.
void distributePointData(List< T > &values) const
Distribute list of point data.
const mapDistribute & cellMap() const noexcept
Cell distribute map.
mapDistributePolyMesh()
Default construct - uses worldComm.
void clear()
Reset to zero size, only retaining communicator(s).
const labelList & oldPatchNMeshPoints() const noexcept
List of numbers of mesh points per old patch.
void transfer(mapDistributePolyMesh &map)
Transfer the contents of the argument and annul the argument.
void distributePatchData(List< T > &values) const
Distribute list of patch data.
const mapDistribute & pointMap() const noexcept
Point distribute map.
const mapDistribute & faceMap() const noexcept
Face distribute map.
label nOldPoints() const noexcept
Number of points in mesh before distribution.
Class containing processor-to-processor mapping information.
Mesh consisting of general polyhedral cells.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< T > createWithValue(const label len, const labelUList &locations, const T &val, const T &deflt=T())
Create a List filled with default values and various locations with another specified value.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
List< bool > boolList
A List of bools.
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
labelList findIndices(const ListType &input, typename ListType::const_reference val, label start=0)
Linear search to find all occurrences of given element.
constexpr char nl
The newline '\n' character (0x0a).