48 const labelList& oldToNew,
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;
77 const faceCoupleInfo& coupleInfo,
78 const bool validBoundary,
79 const bool fullyMapped
85 autoPtr<mapAddedPolyMesh> mapPtr
95 mapAddedPolyMesh& map = *mapPtr;
98 const polyBoundaryMesh&
patches = mesh0.boundaryMesh();
100 fvBoundaryMesh& fvPatches =
const_cast<fvBoundaryMesh&
>(mesh0.boundary());
101 fvPatches.setSize(
patches.size());
119 map, mesh0, mesh1, fullyMapped
156 if (fvMeshes.
set(proci))
158 meshes.set(proci, &fvMeshes[proci]);
165 forAll(localBoundaryFace, proci)
167 const labelList& procFaces = localBoundaryFace[proci];
168 remoteFaceStart[proci].
setSize(procFaces.size(), 0);
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]);
255 meshMod.setCapacity(
nPoints, nFaces, nCells);
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
333 mapPtr().oldPatchStarts(),
334 mapPtr().oldPatchSizes(),
343 mapPtr().oldPatchStarts(),
344 mapPtr().oldPatchSizes(),
353 mapPtr().oldPatchStarts(),
354 mapPtr().oldPatchSizes(),
363 mapPtr().oldPatchStarts(),
364 mapPtr().oldPatchSizes(),
373 mapPtr().oldPatchStarts(),
374 mapPtr().oldPatchSizes(),
384 mapPtr().oldPatchStarts(),
385 mapPtr().oldPatchSizes(),
395 mapPtr().oldPatchStarts(),
396 mapPtr().oldPatchSizes(),
406 mapPtr().oldPatchStarts(),
407 mapPtr().oldPatchSizes(),
417 mapPtr().oldPatchStarts(),
418 mapPtr().oldPatchSizes(),
428 mapPtr().oldPatchStarts(),
429 mapPtr().oldPatchSizes(),
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 setSize(label n)
Alias for resize().
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
void setSize(const label n)
Same as resize().
void size(const label n)
Older name for setAddressableSize.
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,...
const T * get(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.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Container for information needed to couple to meshes. When constructed from two meshes and a geometri...
A fvBoundaryMesh is a fvPatch list with a reference to the associated fvMesh, with additional search ...
Adds two fvMeshes without using any polyMesh morphing. Uses polyMeshAdder.
static void MapSurfaceFields(const mapAddedPolyMesh &, const fvMesh &mesh, const fvMesh &meshToAdd, const bool fullyMapped=false)
Map all surfaceFields of Type.
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.
static void MapDimFields(const mapAddedPolyMesh &, const fvMesh &mesh, const fvMesh &meshToAdd)
Map all DimensionedFields of Type.
static void MapVolFields(const mapAddedPolyMesh &, const fvMesh &mesh, const fvMesh &meshToAdd, const bool fullyMapped=false)
Map all volFields of Type.
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
void clearOut(const bool isMeshUpdate=false)
Clear all geometry and addressing.
static autoPtr< fvPatch > New(const polyPatch &, const fvBoundaryMesh &)
Return a pointer to a new patch created on freestore from polyPatch.
Class containing mesh-to-mesh mapping information after a mesh addition where we add a mesh ('added m...
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
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.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
Direct mesh changes based on v1.3 polyTopoChange syntax.
void setCapacity(const label nPoints, const label nFaces, const label nCells)
Explicitly pre-size the dynamic storage for expected mesh size for if construct-without-mesh.
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const labelUList &patchMap, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
label nPoints() const noexcept
Number of mesh points.
label nCells() const noexcept
Number of mesh cells.
label nFaces() const noexcept
Number of mesh faces.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const polyBoundaryMesh & patches
Foam::PtrList< Foam::fvMesh > meshes(regionNames.size())
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values within a list.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
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...
#define forAll(list, i)
Loop across all elements in list.