37 void Foam::polyTopoChange::reorder
40 DynamicList<Type>& lst
44 DynamicList<Type> oldLst(lst);
48 const label newIdx = oldToNew[i];
52 lst[newIdx] = oldLst[i];
59 void Foam::polyTopoChange::reorder
62 List<DynamicList<Type>>& lst
66 List<DynamicList<Type>> oldLst(lst);
70 const label newIdx = oldToNew[i];
74 lst[newIdx].transfer(oldLst[i]);
81 void Foam::polyTopoChange::renumberKey
87 Map<Type> newMap(map.capacity());
91 const label newKey = oldToNew[iter.key()];
95 newMap.insert(newKey, iter.val());
110 const bool syncParallel,
111 const bool orderCells,
112 const bool orderPoints
117 Pout<<
"polyTopoChange::changeMesh" 118 <<
"(autoPtr<fvMesh>&, const IOobject&, const fvMesh&" 119 <<
", const bool, const bool, const bool)" 132 label nInternalPoints;
137 List<objectMap> pointsFromPoints;
138 List<objectMap> facesFromPoints;
139 List<objectMap> facesFromEdges;
140 List<objectMap> facesFromFaces;
141 List<objectMap> cellsFromPoints;
142 List<objectMap> cellsFromEdges;
143 List<objectMap> cellsFromFaces;
144 List<objectMap> cellsFromCells;
147 List<Map<label>> oldPatchMeshPointMaps;
150 List<Map<label>> oldFaceZoneMeshPointMaps;
173 oldPatchMeshPointMaps,
176 oldFaceZoneMeshPointMaps
196 std::move(newPoints),
198 std::move(faceOwner_),
199 std::move(faceNeighbour_)
202 Type& newMesh = *newMeshPtr;
206 retiredPoints_.clearStorage();
207 region_.clearStorage();
214 label nAdd, nInflate, nMerge, nRemove;
215 countMap(pointMap_, reversePointMap_, nAdd, nInflate, nMerge, nRemove);
217 <<
" added(from point):" << nAdd
218 <<
" added(from nothing):" << nInflate
219 <<
" merged(into other point):" << nMerge
220 <<
" removed:" << nRemove
223 countMap(faceMap_, reverseFaceMap_, nAdd, nInflate, nMerge, nRemove);
225 <<
" added(from face):" << nAdd
226 <<
" added(inflated):" << nInflate
227 <<
" merged(into other face):" << nMerge
228 <<
" removed:" << nRemove
231 countMap(cellMap_, reverseCellMap_, nAdd, nInflate, nMerge, nRemove);
233 <<
" added(from cell):" << nAdd
234 <<
" added(inflated):" << nInflate
235 <<
" merged(into other cell):" << nMerge
236 <<
" removed:" << nRemove
249 const label oldPatchi = patchMap[patchi];
256 oldPatches[oldPatchi].clone
258 newMesh.boundaryMesh(),
277 newMesh.boundaryMesh(),
283 newMesh.addFvPatches(newBoundary);
292 List<pointZone*> pZonePtrs(oldPointZones.size());
296 pZonePtrs[i] =
new pointZone
298 oldPointZones[i].
name(),
306 List<faceZone*> fZonePtrs(oldFaceZones.size());
310 fZonePtrs[i] =
new faceZone
312 oldFaceZones[i].
name(),
320 List<cellZone*> cZonePtrs(oldCellZones.size());
324 cZonePtrs[i] =
new cellZone
326 oldCellZones[i].
name(),
333 newMesh.addZones(pZonePtrs, fZonePtrs, cZonePtrs);
342 resetZones(
mesh, newMesh, pointZoneMap, faceZoneFaceMap, cellZoneMap);
346 pointZone_.clearStorage();
347 faceZone_.clearStorage();
348 faceZoneFlip_.clearStorage();
349 cellZone_.clearStorage();
358 oldPatchMeshPointMaps,
360 newMesh.boundaryMesh(),
366 calcFaceZonePointMap(newMesh, oldFaceZoneMeshPointMaps, faceZonePointMap);
371 writeMeshStats(newMesh,
Pout);
429 const bool syncParallel,
430 const bool orderCells,
431 const bool orderPoints
void size(const label n)
Older name for setAddressableSize.
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with the type faceZone.
labelHashSet used(const bitSet &select)
Convert a bitset to a labelHashSet of the indices used.
label nPoints() const noexcept
Number of mesh points.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label nFaces() const noexcept
Number of mesh faces.
List< labelList > labelListList
List of labelList.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
vectorField pointField
pointField is a vectorField.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
autoPtr< mapPolyMesh > makeMesh(autoPtr< Type > &newMesh, const IOobject &io, const polyMesh &mesh, const labelUList &patchMap, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Create new mesh with old mesh patches. Additional dictionaries.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
label size() const noexcept
The number of entries in the list.
static const word null
An empty word.
ZoneMesh< pointZone, polyMesh > pointZoneMesh
A ZoneMesh with the type pointZone.
int debug
Static debugging option.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
label nCells() const noexcept
Number of mesh cells.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Defines the attributes of an object for which implicit objectRegistry management is supported...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
ZoneMesh< cellZone, polyMesh > cellZoneMesh
A ZoneMesh with the type cellZone.
forAllConstIters(mixture.phases(), phase)
const scalarField & cellVolumes() const