61 cellLevelPtr_.reset(
new Type(rio));
72 pointLevelPtr_.reset(
new Type(rio));
83 level0EdgePtr_.reset(
new Type(rio));
94 refHistoryPtr_.reset(
new Type(rio));
103 const hexRef8Data& data,
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_)
145 IOobject rio(
io, data.refHistoryPtr_().
name());
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_)
183 IOobject rio(
io, procDatas[0].pointLevelPtr_().
name());
186 auto& pointLevel = *pointLevelPtr_;
190 const labelList& procPointLevel = procDatas[procI].pointLevelPtr_();
191 labelUIndList(pointLevel, pointMaps[procI]) = procPointLevel;
198 if (procDatas[0].level0EdgePtr_)
200 IOobject rio(
io, procDatas[0].level0EdgePtr_().
name());
207 procDatas[0].level0EdgePtr_()
215 if (procDatas[0].refHistoryPtr_)
217 IOobject rio(
io, procDatas[0].refHistoryPtr_().
name());
219 UPtrList<const refinementHistory> procRefs(procDatas.size());
222 procRefs.set(i, &procDatas[i].refHistoryPtr_());
227 new refinementHistory
262 cellLevelPtr_->IOobjectOption::operator=(
io);
267 IOobject rio(
io,
"pointLevel");
277 pointLevelPtr_->IOobjectOption::operator=(
io);
287 IOobject rio(
io,
"level0Edge");
298 level0EdgePtr_->IOobjectOption::operator=(
io);
303 IOobject rio(
io,
"refinementHistory");
305 refHistoryPtr_.reset(
new refinementHistory(rio,
mesh.
nCells(),
true));
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];
351 cellLevel.transfer(newCellLevel);
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();
autoPtr< IOobject > clone() const
Clone.
readOption readOpt() const noexcept
Get the read option.
label nPoints() const noexcept
Number of mesh points.
void sync(const IOobject &io)
Parallel synchronise. This enforces valid objects on all processors (even if they don't have a mesh)...
const word & name() const noexcept
Return the object name.
UIndirectList< label > labelUIndList
UIndirectList of labels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
UniformDimensionedField< scalar > uniformDimensionedScalarField
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-paral...
#define forAll(list, i)
Loop across all elements in list.
IOList< label > labelIOList
IO for a List of label.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
void updateMesh(const mapPolyMesh &)
Update local numbering for changed mesh.
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (respects is_globalIOobject trait) and check its info.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
label nCells() const noexcept
Number of mesh cells.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Reading is optional [identical to READ_IF_PRESENT].
void distribute(const mapDistributePolyMesh &)
In-place distribute.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
All refinement history. Used in unrefinement.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
Defines the attributes of an object for which implicit objectRegistry management is supported...
~hexRef8Data()
Destructor.
hexRef8Data(const hexRef8Data &)=delete
No copy construct.
static constexpr const zero Zero
Global zero (0)