49 const polyPatch& newPatch,
50 const label unmappedValue
53 labelList newToOld(newPatch.size(), unmappedValue);
55 const label newStart = newPatch.start();
56 const label newSize = newPatch.
size();
58 for (label i = 0; i < oldSize; i++)
60 label newFacei = oldToNew[oldStart+i];
62 if (newFacei >= newStart && newFacei < newStart+newSize)
64 newToOld[newFacei-newStart] = i;
78 const bool validBoundary,
79 const bool fullyMapped
109 fvMeshAdder::MapVolFields<scalar>(map, mesh0, mesh1, fullyMapped);
110 fvMeshAdder::MapVolFields<vector>(map, mesh0, mesh1, fullyMapped);
111 fvMeshAdder::MapVolFields<sphericalTensor>(map, mesh0, mesh1, fullyMapped);
112 fvMeshAdder::MapVolFields<symmTensor>(map, mesh0, mesh1, fullyMapped);
113 fvMeshAdder::MapVolFields<tensor>(map, mesh0, mesh1, fullyMapped);
115 fvMeshAdder::MapSurfaceFields<scalar>(map, mesh0, mesh1, fullyMapped);
116 fvMeshAdder::MapSurfaceFields<vector>(map, mesh0, mesh1, fullyMapped);
117 fvMeshAdder::MapSurfaceFields<sphericalTensor>
119 map, mesh0, mesh1, fullyMapped
121 fvMeshAdder::MapSurfaceFields<symmTensor>(map, mesh0, mesh1, fullyMapped);
122 fvMeshAdder::MapSurfaceFields<tensor>(map, mesh0, mesh1, fullyMapped);
124 fvMeshAdder::MapDimFields<scalar>(map, mesh0, mesh1);
125 fvMeshAdder::MapDimFields<vector>(map, mesh0, mesh1);
126 fvMeshAdder::MapDimFields<sphericalTensor>(map, mesh0, mesh1);
127 fvMeshAdder::MapDimFields<symmTensor>(map, mesh0, mesh1);
128 fvMeshAdder::MapDimFields<tensor>(map, mesh0, mesh1);
156 if (fvMeshes.
set(proci))
165 forAll(localBoundaryFace, proci)
167 const labelList& procFaces = localBoundaryFace[proci];
168 remoteFaceStart[proci].
setSize(procFaces.size(), 0);
197 fvMesh* fvm0 = fvMeshes.
get(0);
198 fvMesh* fvmi = fvMeshes.
get(myProci);
199 fvMeshes.
set(0, fvmi);
200 fvMeshes.
set(myProci, fvm0);
215 std::swap(lbf[0], lbf[myProci]);
218 std::swap(rfp[0], rfp[myProci]);
221 for (label& proc : rfp[proci])
223 if (proc == 0) proc = myProci;
224 else if (proc == myProci) proc = 0;
228 std::swap(rbf[0], rbf[myProci]);
231 std::swap(rfs[0], rfs[myProci]);
234 std::swap(patchMap[0], patchMap[myProci]);
235 std::swap(pointZoneMap[0], pointZoneMap[myProci]);
236 std::swap(faceZoneMap[0], faceZoneMap[myProci]);
237 std::swap(cellZoneMap[0], cellZoneMap[myProci]);
240 polyTopoChange meshMod(
meshes[0].boundaryMesh().size(),
true);
255 meshMod.setCapacity(
nPoints, nFaces, nCells);
281 autoPtr<mapPolyMesh> mapPtr
294 fvMeshes[0].polyMesh::updateMesh(mapPtr());
300 for (
labelList& cellMap : constructCellMap)
308 for (
labelList& pointMap : constructPointMap)
319 constructPatchMap[meshi] = patchMap[meshi];
320 constructPatchMap[meshi].
setSize 322 meshes[meshi].boundaryMesh().size(),
330 fvMeshAdder::MapVolFields<scalar>
333 mapPtr().oldPatchStarts(),
334 mapPtr().oldPatchSizes(),
340 fvMeshAdder::MapVolFields<vector>
343 mapPtr().oldPatchStarts(),
344 mapPtr().oldPatchSizes(),
350 fvMeshAdder::MapVolFields<sphericalTensor>
353 mapPtr().oldPatchStarts(),
354 mapPtr().oldPatchSizes(),
360 fvMeshAdder::MapVolFields<symmTensor>
363 mapPtr().oldPatchStarts(),
364 mapPtr().oldPatchSizes(),
370 fvMeshAdder::MapVolFields<tensor>
373 mapPtr().oldPatchStarts(),
374 mapPtr().oldPatchSizes(),
380 fvMeshAdder::MapSurfaceFields<scalar>
384 mapPtr().oldPatchStarts(),
385 mapPtr().oldPatchSizes(),
391 fvMeshAdder::MapSurfaceFields<vector>
395 mapPtr().oldPatchStarts(),
396 mapPtr().oldPatchSizes(),
402 fvMeshAdder::MapSurfaceFields<sphericalTensor>
406 mapPtr().oldPatchStarts(),
407 mapPtr().oldPatchSizes(),
413 fvMeshAdder::MapSurfaceFields<symmTensor>
417 mapPtr().oldPatchStarts(),
418 mapPtr().oldPatchSizes(),
424 fvMeshAdder::MapSurfaceFields<tensor>
428 mapPtr().oldPatchStarts(),
429 mapPtr().oldPatchSizes(),
435 fvMeshAdder::MapDimFields<scalar>(fvMeshes, constructCellMap);
436 fvMeshAdder::MapDimFields<vector>(fvMeshes, constructCellMap);
437 fvMeshAdder::MapDimFields<sphericalTensor>(fvMeshes, constructCellMap);
438 fvMeshAdder::MapDimFields<symmTensor>(fvMeshes, constructCellMap);
439 fvMeshAdder::MapDimFields<tensor>(fvMeshes, constructCellMap);
444 fvMesh* fvm0 = fvMeshes.get(0);
445 fvMesh* fvmi = fvMeshes.get(myProci);
446 fvMeshes.set(0, fvmi);
447 fvMeshes.set(myProci, fvm0);
451 std::swap(lbf[0], lbf[myProci]);
453 std::swap(rfp[0], rfp[myProci]);
456 for (label& proc : rfp[proci])
458 if (proc == 0) proc = myProci;
459 else if (proc == myProci) proc = 0;
463 std::swap(rbf[0], rbf[myProci]);
465 std::swap(constructPatchMap[0], constructPatchMap[myProci]);
466 std::swap(constructCellMap[0], constructCellMap[myProci]);
467 std::swap(constructFaceMap[0], constructFaceMap[myProci]);
468 std::swap(constructPointMap[0], constructPointMap[myProci]);
void size(const label n)
Older name for setAddressableSize.
label nPoints() const noexcept
Number of mesh points.
void clearOut(const bool isMeshUpdate=false)
Clear all geometry and addressing.
Class containing mesh-to-mesh mapping information after a mesh addition where we add a mesh ('added m...
const T * get(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
label nFaces() const noexcept
Number of mesh faces.
List< labelList > labelListList
List of labelList.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Container for information needed to couple to meshes. When constructed from two meshes and a geometri...
#define forAll(list, i)
Loop across all elements in list.
void setSize(const label n)
Alias for resize()
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.
Foam::PtrList< Foam::fvMesh > meshes(regionNames.size())
static autoPtr< mapAddedPolyMesh > add(fvMesh &mesh0, const fvMesh &mesh1, const faceCoupleInfo &coupleInfo, const bool validBoundary=true, const bool fullyMapped=false)
Inplace add mesh to fvMesh. Maps all stored fields. Returns map.
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...
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
defineTypeNameAndDebug(combustionModel, 0)
void setSize(const label newLen)
Same as resize()
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values within a list.
label nCells() const noexcept
Number of mesh cells.
Mesh data needed to do the Finite Volume discretisation.
const polyBoundaryMesh & patches
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
static autoPtr< fvPatch > New(const polyPatch &, const fvBoundaryMesh &)
Return a pointer to a new patch created on freestore from polyPatch.
List< label > labelList
A List of labels.
label nNonProcessor() const
The number of patches before the first processor patch.
static autoPtr< polyMesh > add(const IOobject &io, const polyMesh &mesh0, const polyMesh &mesh1, const faceCoupleInfo &coupleInfo, autoPtr< mapAddedPolyMesh > &mapPtr)
Add two polyMeshes. Returns new polyMesh and map construct.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...