38 nOldFaces_(
mesh.nFaces()),
39 nOldCells_(
mesh.nCells()),
41 pointsFromPointsMap_(),
43 facesFromPointsMap_(),
47 cellsFromPointsMap_(),
56 pointZoneMap_(
mesh.pointZones().size()),
57 faceZonePointMap_(
mesh.faceZones().size()),
58 faceZoneFaceMap_(
mesh.faceZones().size()),
59 cellZoneMap_(
mesh.cellZones().size()),
67 forAll(patchPointMap_, patchi)
70 oldPatchNMeshPoints_[patchi] =
nPoints;
76 forAll(pointZoneMap_, zonei)
81 forAll(faceZonePointMap_, zonei)
83 faceZonePointMap_[zonei] =
87 forAll(faceZoneFaceMap_, zonei)
92 forAll(cellZoneMap_, zonei)
101 const polyMesh&
mesh,
102 const label nOldPoints,
103 const label nOldFaces,
104 const label nOldCells,
106 const List<objectMap>& pointsFromPoints,
108 const List<objectMap>& facesFromPoints,
109 const List<objectMap>& facesFromEdges,
110 const List<objectMap>& facesFromFaces,
112 const List<objectMap>& cellsFromPoints,
113 const List<objectMap>& cellsFromEdges,
114 const List<objectMap>& cellsFromFaces,
115 const List<objectMap>& cellsFromCells,
128 const autoPtr<scalarField>& oldCellVolumesPtr
132 nOldPoints_(nOldPoints),
133 nOldFaces_(nOldFaces),
134 nOldCells_(nOldCells),
136 pointsFromPointsMap_(pointsFromPoints),
138 facesFromPointsMap_(facesFromPoints),
139 facesFromEdgesMap_(facesFromEdges),
140 facesFromFacesMap_(facesFromFaces),
142 cellsFromPointsMap_(cellsFromPoints),
143 cellsFromEdgesMap_(cellsFromEdges),
144 cellsFromFacesMap_(cellsFromFaces),
145 cellsFromCellsMap_(cellsFromCells),
146 reversePointMap_(reversePointMap),
147 reverseFaceMap_(reverseFaceMap),
148 reverseCellMap_(reverseCellMap),
149 flipFaceFlux_(flipFaceFlux),
150 patchPointMap_(patchPointMap),
151 pointZoneMap_(pointZoneMap),
152 faceZonePointMap_(faceZonePointMap),
153 faceZoneFaceMap_(faceZoneFaceMap),
154 cellZoneMap_(cellZoneMap),
155 preMotionPoints_(preMotionPoints),
156 oldPatchSizes_(oldPatchStarts.size()),
157 oldPatchStarts_(oldPatchStarts),
158 oldPatchNMeshPoints_(oldPatchNMeshPoints),
159 oldCellVolumesPtr_(oldCellVolumesPtr)
161 if (oldPatchStarts_.
size())
164 for (label patchi = 0; patchi < oldPatchStarts_.
size() - 1; patchi++)
166 oldPatchSizes_[patchi] =
167 oldPatchStarts_[patchi + 1] - oldPatchStarts_[patchi];
171 const label lastPatchID = oldPatchStarts_.
size() - 1;
173 oldPatchSizes_[lastPatchID] = nOldFaces_ - oldPatchStarts_[lastPatchID];
177 if (
min(oldPatchSizes_) < 0)
189 const polyMesh&
mesh,
190 const label nOldPoints,
191 const label nOldFaces,
192 const label nOldCells,
194 List<objectMap>& pointsFromPoints,
196 List<objectMap>& facesFromPoints,
197 List<objectMap>& facesFromEdges,
198 List<objectMap>& facesFromFaces,
200 List<objectMap>& cellsFromPoints,
201 List<objectMap>& cellsFromEdges,
202 List<objectMap>& cellsFromFaces,
203 List<objectMap>& cellsFromCells,
216 autoPtr<scalarField>& oldCellVolumesPtr,
221 nOldPoints_(nOldPoints),
222 nOldFaces_(nOldFaces),
223 nOldCells_(nOldCells),
224 pointMap_(pointMap, reuse),
225 pointsFromPointsMap_(pointsFromPoints, reuse),
227 facesFromPointsMap_(facesFromPoints, reuse),
228 facesFromEdgesMap_(facesFromEdges, reuse),
229 facesFromFacesMap_(facesFromFaces, reuse),
230 cellMap_(cellMap, reuse),
231 cellsFromPointsMap_(cellsFromPoints, reuse),
232 cellsFromEdgesMap_(cellsFromEdges, reuse),
233 cellsFromFacesMap_(cellsFromFaces, reuse),
234 cellsFromCellsMap_(cellsFromCells, reuse),
235 reversePointMap_(reversePointMap, reuse),
236 reverseFaceMap_(reverseFaceMap, reuse),
237 reverseCellMap_(reverseCellMap, reuse),
238 flipFaceFlux_(flipFaceFlux),
239 patchPointMap_(patchPointMap, reuse),
240 pointZoneMap_(pointZoneMap, reuse),
241 faceZonePointMap_(faceZonePointMap, reuse),
242 faceZoneFaceMap_(faceZoneFaceMap, reuse),
243 cellZoneMap_(cellZoneMap, reuse),
244 preMotionPoints_(preMotionPoints, reuse),
245 oldPatchSizes_(oldPatchStarts.size()),
246 oldPatchStarts_(oldPatchStarts, reuse),
247 oldPatchNMeshPoints_(oldPatchNMeshPoints, reuse),
253 oldCellVolumesPtr_ = std::move(oldCellVolumesPtr);
257 oldCellVolumesPtr_ = oldCellVolumesPtr.clone();
260 if (oldPatchStarts_.size())
263 for (label patchi = 0; patchi < oldPatchStarts_.size() - 1; patchi++)
265 oldPatchSizes_[patchi] =
266 oldPatchStarts_[patchi + 1] - oldPatchStarts_[patchi];
270 const label lastPatchID = oldPatchStarts_.
size() - 1;
272 oldPatchSizes_[lastPatchID] = nOldFaces_ - oldPatchStarts_[lastPatchID];
276 if (
min(oldPatchSizes_) < 0)
279 <<
"Calculated negative old patch size." 280 <<
" Error in mapping data" void size(const label n)
Older name for setAddressableSize.
const polyMesh & mesh() const noexcept
Return polyMesh.
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.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
List< labelList > labelListList
List of labelList.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
vectorField pointField
pointField is a vectorField.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
label size() const noexcept
The number of entries in the list.
mapPolyMesh(const mapPolyMesh &)=delete
No copy construct.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
int debug
Static debugging option.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.