61 cellLevelPtr_.reset(
new Type(rio));
72 pointLevelPtr_.reset(
new Type(rio));
83 level0EdgePtr_.reset(
new Type(rio));
94 refHistoryPtr_.reset(
new Type(rio));
108 if (data.cellLevelPtr_)
110 IOobject rio(
io, data.cellLevelPtr_().name());
121 if (data.pointLevelPtr_)
123 IOobject rio(
io, data.pointLevelPtr_().name());
134 if (data.level0EdgePtr_)
136 IOobject rio(
io, data.level0EdgePtr_().name());
143 if (data.refHistoryPtr_)
147 refHistoryPtr_ = data.refHistoryPtr_().clone(rio, cellMap);
155 const UPtrList<const labelList>& cellMaps,
156 const UPtrList<const labelList>& pointMaps,
157 const UPtrList<const hexRef8Data>& procDatas
160 const polyMesh&
mesh =
dynamic_cast<const polyMesh&
>(
io.db());
164 if (procDatas[0].cellLevelPtr_)
166 IOobject rio(
io, procDatas[0].cellLevelPtr_().
name());
169 auto& cellLevel = *cellLevelPtr_;
173 const labelList& procCellLevel = procDatas[procI].cellLevelPtr_();
181 if (procDatas[0].pointLevelPtr_)
186 auto& pointLevel = *pointLevelPtr_;
190 const labelList& procPointLevel = procDatas[procI].pointLevelPtr_();
191 labelUIndList(pointLevel, pointMaps[procI]) = procPointLevel;
198 if (procDatas[0].level0EdgePtr_)
207 procDatas[0].level0EdgePtr_()
215 if (procDatas[0].refHistoryPtr_)
222 procRefs.set(i, &procDatas[i].refHistoryPtr_());
262 cellLevelPtr_->IOobjectOption::operator=(
io);
277 pointLevelPtr_->IOobjectOption::operator=(
io);
298 level0EdgePtr_->IOobjectOption::operator=(
io);
310 refHistoryPtr_->IOobjectOption::operator=(
io);
320 (cellLevelPtr_ && cellLevelPtr_().size() != map.nOldCells())
321 || (pointLevelPtr_ && pointLevelPtr_().size() != map.nOldPoints())
324 cellLevelPtr_.clear();
325 pointLevelPtr_.clear();
326 level0EdgePtr_.clear();
327 refHistoryPtr_.clear();
334 const labelList& cellMap = map.cellMap();
340 label oldCelli = cellMap[newCelli];
344 newCellLevel[newCelli] = 0;
348 newCellLevel[newCelli] = cellLevel[oldCelli];
352 cellLevelPtr_().instance() = map.mesh().facesInstance();
356 const labelList& pointMap = map.pointMap();
357 labelList& pointLevel = pointLevelPtr_();
359 labelList newPointLevel(pointMap.size());
370 newPointLevel[
newPointi] = pointLevel[oldPointi];
373 pointLevel.transfer(newPointLevel);
374 pointLevelPtr_().instance() = map.mesh().facesInstance();
378 if (refHistoryPtr_ && refHistoryPtr_().active())
380 refHistoryPtr_().updateMesh(map);
381 refHistoryPtr_().instance() = map.mesh().facesInstance();
390 map.cellMap().distribute(*cellLevelPtr_);
394 map.pointMap().distribute(*pointLevelPtr_);
399 if (refHistoryPtr_ && refHistoryPtr_().active())
401 refHistoryPtr_().distribute(map);
411 ok = ok && cellLevelPtr_().write();
415 ok = ok && pointLevelPtr_().write();
419 ok = ok && level0EdgePtr_().write();
423 ok = ok && refHistoryPtr_().write();
void transfer(HashTable< T, Key, Hash > &rhs)
Transfer contents into this table.
readOption readOpt() const noexcept
Get the read option.
@ NO_READ
Nothing to be read.
@ MUST_READ
Reading required.
@ LAZY_READ
Reading is optional [identical to READ_IF_PRESENT].
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (respects is_globalIOobject trait) and check its info. A void type suppresses trait and t...
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
void size(const label n)
Older name for setAddressableSize.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
@ broadcast
broadcast [MPI]
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
label size() const noexcept
The number of entries in the list.
Various for reading/decomposing/reconstructing/distributing refinement data.
hexRef8Data(const hexRef8Data &)=delete
No copy construct.
void distribute(const mapDistributePolyMesh &)
In-place distribute.
void sync(const IOobject &io)
Parallel synchronise. This enforces valid objects on all processors (even if they don't have a mesh)....
~hexRef8Data()
Destructor.
void updateMesh(const mapPolyMesh &)
Update local numbering for changed mesh.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
const mapDistribute & cellMap() const noexcept
Cell distribute map.
const mapDistribute & pointMap() const noexcept
Point distribute map.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute List data using default commsType, default flip/negate operator.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
label nOldCells() const noexcept
Number of old cells.
const polyMesh & mesh() const noexcept
Return polyMesh.
const labelList & cellMap() const noexcept
Old cell map.
const labelList & pointMap() const noexcept
Old point map.
label nOldPoints() const noexcept
Number of old points.
Mesh consisting of general polyhedral cells.
const fileName & facesInstance() const
Return the current instance directory for faces.
label nPoints() const noexcept
Number of mesh points.
label nCells() const noexcept
Number of mesh cells.
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
All refinement history. Used in unrefinement.
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
List< label > labelList
A List of labels.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
UIndirectList< label > labelUIndList
UIndirectList of labels.
IOList< label > labelIOList
IO for a List of label.
UniformDimensionedField< scalar > uniformDimensionedScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.