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;
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);
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]);
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
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);
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(const label n)
Alias for resize()
const T * set(const label i) const
void setSize(const label newLen)
Same as resize()
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
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
label size() const noexcept
The number of elements 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...
Sums a given list of (at least two or more) fields and outputs the result into a new field,...
Adds two fvMeshes without using any polyMesh morphing. Uses polyMeshAdder.
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
void clearOut()
Clear all geometry and addressing.
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 additional search methods and registered IO.
label nNonProcessor() const
The number of patches before the first processor patch.
Mesh consisting of general polyhedral cells.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const polyBoundaryMesh & boundaryMesh() const
Return boundary 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)
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())
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
List< label > labelList
A List of labels.
#define forAll(list, i)
Loop across all elements in list.