63 referPatchID_(referPatchID)
68 if (nbrProc_[a] < nbrProc_[b])
72 else if (nbrProc_[a] > nbrProc_[b])
79 return referPatchID_[a] < referPatchID_[
b];
89 void Foam::fvMeshDistribute::inplaceRenumberWithFlip
92 const bool oldToNewHasFlip,
93 const bool lstHasFlip,
97 if (!lstHasFlip && !oldToNewHasFlip)
108 label val = lst[elemI];
124 <<
"Problem : zero value " << val
125 <<
" at index " << elemI <<
" out of " << lst.
size()
132 label newVal = oldToNew[val];
148 <<
"Problem : zero value " << newVal
149 <<
" at index " << elemI <<
" out of " 157 lst[elemI] = sign*(newVal+1);
165 const bool selectEqual,
174 if (selectEqual == (values[i] == value))
185 if (selectEqual == (values[i] == value))
195 void Foam::fvMeshDistribute::checkEqualWordList
208 if (allNames[proci] != allNames[0])
211 <<
"When checking for equal " << msg.c_str() <<
" :" <<
endl 212 <<
"processor0 has:" << allNames[0] <<
endl 213 <<
"processor" << proci <<
" has:" << allNames[proci] <<
endl 214 << msg.c_str() <<
" need to be synchronised on all processors." 231 forAll(allNames[proci], i)
233 mergedNames.
insert(allNames[proci][i]);
236 return mergedNames.
toc();
243 Pout<<
"Primitives:" <<
nl 247 <<
" faces :" << mesh.
nFaces() <<
nl 248 <<
" cells :" << mesh.
nCells() <<
nl;
258 <<
" size:" << pp.size()
259 <<
" start:" << pp.
start()
260 <<
" type:" << pp.type()
270 Pout<<
" " << zoneI <<
" name:" << pz.
name()
271 <<
" size:" << pz.
size()
281 Pout<<
" " << zoneI <<
" name:" << fz.
name()
282 <<
" size:" << fz.
size()
292 Pout<<
" " << zoneI <<
" name:" << cz.
name()
293 <<
" size:" << cz.
size()
310 <<
"Current coupling info:" 313 forAll(sourceFace, bFacei)
317 Pout<<
" meshFace:" << meshFacei
319 <<
" connects to proc:" << sourceProc[bFacei]
320 <<
"/face:" << sourceFace[bFacei]
321 <<
" which will move to proc:" << sourceNewNbrProc[bFacei]
328 Foam::label Foam::fvMeshDistribute::findNonEmptyPatch()
const 332 label nonEmptyPatchi = -1;
338 if (!isA<emptyPolyPatch>(pp) && !pp.
coupled())
345 if (nonEmptyPatchi == -1)
348 <<
"Cannot find a patch which is neither of type empty nor" 349 <<
" coupled in patches " << patches.
names() <<
endl 350 <<
"There has to be at least one such patch for" 356 Pout<<
"findNonEmptyPatch : using patch " << nonEmptyPatchi
357 <<
" name:" << patches[nonEmptyPatchi].
name()
358 <<
" type:" << patches[nonEmptyPatchi].type()
359 <<
" to put exposed faces into." <<
endl;
365 label procPatchi = -1;
369 if (isA<processorPolyPatch>(patches[
patchi]))
373 else if (procPatchi != -1)
376 <<
"Processor patches should be at end of patch list." 378 <<
"Have processor patch " << procPatchi
379 <<
" followed by non-processor patch " << patchi
380 <<
" in patches " << patches.
names()
385 return nonEmptyPatchi;
393 const label destinationPatch
398 labelList newPatchID(mesh_.nFaces() - mesh_.nInternalFaces(), -1);
400 label nProcPatches = 0;
406 if (isA<processorPolyPatch>(pp))
410 Pout<<
"Moving all faces of patch " << pp.
name()
411 <<
" into patch " << destinationPatch
415 label offset = pp.
start() - mesh_.nInternalFaces();
419 newPatchID[offset+i] = destinationPatch;
440 if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[
patchi]))
442 oldToNew[
patchi] = newI++;
445 label nNonProcPatches = newI;
450 if (isA<processorPolyPatch>(mesh_.boundaryMesh()[
patchi]))
452 oldToNew[
patchi] = newI++;
471 forAll(newPatchID, bFacei)
473 if (newPatchID[bFacei] != -1)
475 label facei = mesh_.nInternalFaces() + bFacei;
477 label zoneID = mesh_.faceZones().whichZone(facei);
478 bool zoneFlip =
false;
482 const faceZone& fZone = mesh_.faceZones()[zoneID];
490 mesh_.faces()[facei],
492 mesh_.faceOwner()[facei],
510 saveBoundaryFields<scalar, surfaceMesh>(sFlds);
512 saveBoundaryFields<vector, surfaceMesh>(vFlds);
514 saveBoundaryFields<sphericalTensor, surfaceMesh>(sptFlds);
516 saveBoundaryFields<symmTensor, surfaceMesh>(sytFlds);
518 saveBoundaryFields<tensor, surfaceMesh>(tFlds);
530 mesh_.updateMesh(map);
534 mapBoundaryFields<scalar, surfaceMesh>(map, sFlds);
535 mapBoundaryFields<vector, surfaceMesh>(map, vFlds);
536 mapBoundaryFields<sphericalTensor, surfaceMesh>(map, sptFlds);
537 mapBoundaryFields<symmTensor, surfaceMesh>(map, sytFlds);
538 mapBoundaryFields<tensor, surfaceMesh>(map, tFlds);
542 if (map().hasMotionPoints())
544 mesh_.movePoints(map().preMotionPoints());
556 <<
"reverseFaceMap contains -1 at index:" 558 <<
"This means that the repatch operation was not just" 563 forAll(constructFaceMap, proci)
565 inplaceRenumberWithFlip
567 map().reverseFaceMap(),
570 constructFaceMap[proci]
594 forAll(pointToGlobalMaster, pointi)
596 if (pointToGlobalMaster[pointi] != -1)
602 Map<label> globalMasterToLocalMaster(2*nShared);
605 forAll(pointToGlobalMaster, pointi)
607 label globali = pointToGlobalMaster[pointi];
615 if (iter == globalMasterToLocalMaster.
end())
618 globalMasterToLocalMaster.
insert(globali, pointi);
619 pointToMaster.
insert(pointi, pointi);
623 pointToMaster.
insert(pointi, iter());
642 mesh_.updateMesh(map);
645 forAll(constructPointMap, proci)
647 labelList& constructMap = constructPointMap[proci];
651 label oldPointi = constructMap[i];
657 constructMap[i] = -newPointi-2;
659 else if (newPointi >= 0)
666 <<
"Problem. oldPointi:" << oldPointi
675 void Foam::fvMeshDistribute::getCouplingData
688 label nBnd = mesh_.nFaces() - mesh_.nInternalFaces();
692 sourceNewNbrProc.
setSize(nBnd);
706 label offset = pp.
start() - mesh_.nInternalFaces();
711 label bndI = offset + i;
712 nbrFaces[bndI] = pp.
start()+i;
730 label offset = pp.
start() - mesh_.nInternalFaces();
732 if (isA<processorPolyPatch>(pp))
735 refCast<const processorPolyPatch>(pp);
739 if (procPatch.
owner())
744 label bndI = offset + i;
745 sourceFace[bndI] = pp.
start()+i;
747 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
755 label bndI = offset + i;
756 sourceFace[bndI] = nbrFaces[bndI];
758 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
764 if (isA<processorCyclicPolyPatch>(pp))
766 patchi = refCast<const processorCyclicPolyPatch>
774 label bndI = offset + i;
775 sourcePatch[bndI] =
patchi;
778 else if (isA<cyclicPolyPatch>(pp))
786 label bndI = offset + i;
787 sourceFace[bndI] = pp.
start()+i;
789 sourcePatch[bndI] =
patchi;
790 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
797 label bndI = offset + i;
798 sourceFace[bndI] = nbrFaces[bndI];
800 sourcePatch[bndI] =
patchi;
801 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
810 label bndI = offset + i;
811 sourceFace[bndI] = -1;
812 sourceProc[bndI] = -1;
813 sourcePatch[bndI] =
patchi;
814 sourceNewNbrProc[bndI] = -1;
821 sourcePointMaster.
setSize(mesh_.nPoints());
822 sourcePointMaster = -1;
830 const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap();
834 forAll(meshPoints, pointi)
843 elems[pointi] = globalPointi;
846 label sloti = slots[i];
847 if (sloti >= meshPoints.
size())
851 elems[slots[i]] = globalPointi;
861 forAll(meshPoints, pointi)
863 sourcePointMaster[meshPoints[pointi]] = elems[pointi];
870 void Foam::fvMeshDistribute::subsetCouplingData
880 const label oldInternalFaces,
900 forAll(subFace, newBFacei)
904 label oldFacei = faceMap[newFacei];
907 if (oldFacei < oldInternalFaces)
909 subFace[newBFacei] = oldFacei;
911 subPatch[newBFacei] = -1;
913 label oldOwn = oldFaceOwner[oldFacei];
914 label oldNei = oldFaceNeighbour[oldFacei];
916 if (oldOwn == cellMap[mesh.
faceOwner()[newFacei]])
919 subNewNbrProc[newBFacei] = oldDistribution[oldNei];
924 subNewNbrProc[newBFacei] = oldDistribution[oldOwn];
930 label oldBFacei = oldFacei - oldInternalFaces;
932 subFace[newBFacei] = sourceFace[oldBFacei];
933 subProc[newBFacei] = sourceProc[oldBFacei];
934 subPatch[newBFacei] = sourcePatch[oldBFacei];
935 subNewNbrProc[newBFacei] = sourceNewNbrProc[oldBFacei];
946 void Foam::fvMeshDistribute::findCouples
967 forAll(domainProc, bFacei)
969 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
973 labelPair(domainFace[bFacei], domainProc[bFacei]),
986 forAll(sourceFace, bFacei)
988 if (sourceProc[bFacei] != -1 && sourcePatch[bFacei] == -1)
990 labelPair myData(sourceFace[bFacei], sourceProc[bFacei]);
993 iter = map.find(myData);
995 if (iter != map.end())
997 label nbrBFacei = iter();
1000 slaveCoupledFaces[coupledI] =
1009 masterCoupledFaces.
setSize(coupledI);
1010 slaveCoupledFaces.
setSize(coupledI);
1014 Pout<<
"findCouples : found " << coupledI
1015 <<
" faces that will be stitched" <<
nl <<
endl;
1026 const label nInternalFaces1,
1032 forAll(boundaryData0, oldBFacei)
1040 boundaryData0[oldBFacei];
1044 forAll(boundaryData1, addedBFacei)
1051 boundaryData1[addedBFacei];
1055 return newBoundaryData;
1069 forAll(boundaryData0, oldPointi)
1076 newBoundaryData[
newPointi] = boundaryData0[oldPointi];
1080 forAll(boundaryData1, addedPointi)
1086 newBoundaryData[
newPointi] = boundaryData1[addedPointi];
1090 return newBoundaryData;
1098 const label oldInternalPatchi
1116 labelList(exposedFaces.size(), oldInternalPatchi),
1128 saveInternalFields(sFlds);
1130 saveInternalFields(vFlds);
1132 saveInternalFields(sptFlds);
1134 saveInternalFields(sytFlds);
1136 saveInternalFields(tFlds);
1142 mesh_.updateMesh(map);
1149 mapExposedFaces(map(), sFlds);
1150 mapExposedFaces(map(), vFlds);
1151 mapExposedFaces(map(), sptFlds);
1152 mapExposedFaces(map(), sytFlds);
1153 mapExposedFaces(map(), tFlds);
1161 if (map().hasMotionPoints())
1163 mesh_.movePoints(map().preMotionPoints());
1172 void Foam::fvMeshDistribute::addProcPatches
1194 label bFacei = indices[i];
1195 label proci = nbrProc[bFacei];
1199 if (!procPatchID[proci].
found(referPatchID[bFacei]))
1204 if (referPatchID[bFacei] == -1)
1212 mesh_.boundaryMesh().size(),
1213 mesh_.boundaryMesh(),
1218 procPatchID[proci].insert
1220 referPatchID[bFacei],
1234 = refCast<const coupledPolyPatch>
1236 mesh_.boundaryMesh()[referPatchID[bFacei]]
1242 mesh_.boundaryMesh().size(),
1243 mesh_.boundaryMesh(),
1250 procPatchID[proci].insert
1252 referPatchID[bFacei],
1283 label origPatchi = referPatchID[bFacei];
1284 patchIDs[bFacei] = origPatchi;
1286 else if (nbrProc[bFacei] != -1)
1288 label origPatchi = referPatchID[bFacei];
1289 patchIDs[bFacei] = procPatchID[nbrProc[bFacei]][origPatchi];
1293 patchIDs[bFacei] = -1;
1301 void Foam::fvMeshDistribute::sendMesh
1320 Pout<<
"Sending to domain " << domain <<
nl 1322 <<
" nFaces:" << mesh.
nFaces() <<
nl 1323 <<
" nCells:" << mesh.
nCells() <<
nl 1336 forAll(pointZoneNames, nameI)
1342 rowSizes[nameI] = pointZones[myZoneID].
size();
1347 forAll(pointZoneNames, nameI)
1353 zonePoints[nameI].deepCopy(pointZones[myZoneID]);
1366 forAll(faceZoneNames, nameI)
1372 rowSizes[nameI] = faceZones[myZoneID].
size();
1377 zoneFaceFlip.
setSize(rowSizes);
1379 forAll(faceZoneNames, nameI)
1385 zoneFaces[nameI].deepCopy(faceZones[myZoneID]);
1386 zoneFaceFlip[nameI].deepCopy(faceZones[myZoneID].flipMap());
1398 forAll(cellZoneNames, nameI)
1404 rowSizes[nameI] = cellZones[myZoneID].
size();
1410 forAll(cellZoneNames, nameI)
1416 zoneCells[nameI].deepCopy(cellZones[myZoneID]);
1452 << sourcePointMaster;
1457 Pout<<
"Started sending mesh to domain " << domain
1470 const Time& runTime,
1493 >> domainSourcePatch
1494 >> domainSourceNewNbrProc
1495 >> domainSourcePointMaster;
1516 fvMesh& domainMesh = domainMeshPtr();
1524 patchEntries[
patchi].keyword(),
1570 domainMesh.
addZones(pZonePtrs, fZonePtrs, cZonePtrs);
1572 return domainMeshPtr;
1579 Foam::fvMeshDistribute::fvMeshDistribute(
fvMesh& mesh,
const scalar mergeTol)
1594 forAll(distribution, celli)
1596 label newProc = distribution[celli];
1603 <<
"At index " << celli <<
" distribution:" << newProc
1621 <<
"Size of distribution:" 1622 << distribution.
size() <<
" mesh nCells:" << mesh_.
nCells()
1633 <<
"This application requires all non-processor patches" 1634 <<
" to be present in the same order on all patches" <<
nl 1635 <<
"followed by the processor patches (which of course are unique)." 1650 oldPatchNMeshPoints[
patchi] = patches[
patchi].nPoints();
1667 oldPatchStarts.
xfer(),
1668 oldPatchNMeshPoints.xfer(),
1754 checkEqualWordList(
"volScalarFields", volScalars);
1756 checkEqualWordList(
"volVectorFields", volVectors);
1761 checkEqualWordList(
"volSphericalTensorFields", volSphereTensors);
1763 checkEqualWordList(
"volSymmTensorFields", volSymmTensors);
1765 checkEqualWordList(
"volTensorField", volTensors);
1768 checkEqualWordList(
"surfaceScalarFields", surfScalars);
1770 checkEqualWordList(
"surfaceVectorFields", surfVectors);
1775 checkEqualWordList(
"surfaceSphericalTensorFields", surfSphereTensors);
1780 checkEqualWordList(
"surfaceSymmTensorFields", surfSymmTensors);
1782 checkEqualWordList(
"surfaceTensorFields", surfTensors);
1785 const wordList dimScalars(mesh_.
names(dimScalType::typeName));
1786 checkEqualWordList(
"volScalarField::Internal", dimScalars);
1789 const wordList dimVectors(mesh_.
names(dimVecType::typeName));
1790 checkEqualWordList(
"volVectorField::Internal", dimVectors);
1793 const wordList dimSphereTensors(mesh_.
names(dimSphereType::typeName));
1796 "volSphericalTensorField::Internal",
1801 const wordList dimSymmTensors(mesh_.
names(dimSymmTensorType::typeName));
1804 "volSymmTensorField::Internal",
1809 const wordList dimTensors(mesh_.
names(dimTensorType::typeName));
1810 checkEqualWordList(
"volTensorField::Internal", dimTensors);
1815 label oldInternalPatchi = findNonEmptyPatch();
1826 repatchFaceMap = repatchMap().faceMap();
1833 repatchMap().reverseFaceMap(),
1851 Pout<<
nl <<
"MESH WITH PROC PATCHES DELETED:" <<
endl;
1853 printFieldInfo<volScalarField>(mesh_);
1854 printFieldInfo<volVectorField>(mesh_);
1855 printFieldInfo<volSphericalTensorField>(mesh_);
1856 printFieldInfo<volSymmTensorField>(mesh_);
1857 printFieldInfo<volTensorField>(mesh_);
1858 printFieldInfo<surfaceScalarField>(mesh_);
1859 printFieldInfo<surfaceVectorField>(mesh_);
1860 printFieldInfo<surfaceSphericalTensorField>(mesh_);
1861 printFieldInfo<surfaceSymmTensorField>(mesh_);
1862 printFieldInfo<surfaceTensorField>(mesh_);
1914 <<
"SUBSETTING FOR DOMAIN " << recvProc
1915 <<
" cells to send:" 1936 subCellMap[recvProc] = subsetter.
cellMap();
1938 inplaceRenumberWithFlip
1943 subFaceMap[recvProc]
1945 subPointMap[recvProc] = subsetter.
pointMap();
1946 subPatchMap[recvProc] = subsetter.
patchMap();
1977 procSourceNewNbrProc,
1978 procSourcePointMaster
1995 procSourceNewNbrProc,
1996 procSourcePointMaster,
2002 sendFields<volScalarField>(recvProc, volScalars, subsetter, str);
2003 sendFields<volVectorField>(recvProc, volVectors, subsetter, str);
2004 sendFields<volSphericalTensorField>
2011 sendFields<volSymmTensorField>
2018 sendFields<volTensorField>(recvProc, volTensors, subsetter, str);
2021 sendFields<surfaceScalarField>
2028 sendFields<surfaceVectorField>
2035 sendFields<surfaceSphericalTensorField>
2042 sendFields<surfaceSymmTensorField>
2049 sendFields<surfaceTensorField>
2058 sendFields<volScalarField::Internal>
2065 sendFields<volVectorField::Internal>
2072 sendFields<volSphericalTensorField::Internal>
2079 sendFields<volSymmTensorField::Internal>
2086 sendFields<volTensorField::Internal>
2134 faceMap[faceI] += 1;
2139 label faceI = iter.key();
2140 faceMap[faceI] = -faceMap[faceI];
2162 subMap().pointMap(),
2180 domainSourceNewNbrProc,
2181 domainSourcePointMaster
2184 sourceFace.
transfer(domainSourceFace);
2185 sourceProc.
transfer(domainSourceProc);
2186 sourcePatch.
transfer(domainSourcePatch);
2187 sourceNewNbrProc.
transfer(domainSourceNewNbrProc);
2188 sourcePointMaster.
transfer(domainSourcePointMaster);
2197 printFieldInfo<volScalarField>(mesh_);
2198 printFieldInfo<volVectorField>(mesh_);
2199 printFieldInfo<volSphericalTensorField>(mesh_);
2200 printFieldInfo<volSymmTensorField>(mesh_);
2201 printFieldInfo<volTensorField>(mesh_);
2202 printFieldInfo<surfaceScalarField>(mesh_);
2203 printFieldInfo<surfaceVectorField>(mesh_);
2204 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2205 printFieldInfo<surfaceSymmTensorField>(mesh_);
2206 printFieldInfo<surfaceTensorField>(mesh_);
2218 forAll(nSendCells, sendProc)
2230 <<
"RECEIVING FROM DOMAIN " << sendProc
2231 <<
" cells to receive:" 2271 domainMeshPtr = receiveMesh
2278 const_cast<Time&>(mesh_.
time()),
2282 domainSourceNewNbrProc,
2283 domainSourcePointMaster,
2286 fvMesh& domainMesh = domainMeshPtr();
2296 receiveFields<volScalarField>
2304 receiveFields<volVectorField>
2312 receiveFields<volSphericalTensorField>
2320 receiveFields<volSymmTensorField>
2328 receiveFields<volTensorField>
2338 receiveFields<surfaceScalarField>
2346 receiveFields<surfaceVectorField>
2354 receiveFields<surfaceSphericalTensorField>
2362 receiveFields<surfaceSymmTensorField>
2370 receiveFields<surfaceTensorField>
2380 receiveFields<volScalarField::Internal>
2391 receiveFields<volVectorField::Internal>
2402 receiveFields<volSphericalTensorField::Internal>
2414 receiveFields<volSymmTensorField::Internal>
2425 receiveFields<volTensorField::Internal>
2437 const fvMesh& domainMesh = domainMeshPtr();
2440 constructCellMap[sendProc] =
identity(domainMesh.nCells());
2441 constructFaceMap[sendProc] =
identity(domainMesh.nFaces()) + 1;
2442 constructPointMap[sendProc] =
identity(domainMesh.nPoints());
2443 constructPatchMap[sendProc] =
2444 identity(domainMesh.boundaryMesh().size());
2450 Pout<<
nl <<
"RECEIVED MESH FROM:" << sendProc <<
endl;
2452 printFieldInfo<volScalarField>(domainMesh);
2453 printFieldInfo<volVectorField>(domainMesh);
2454 printFieldInfo<volSphericalTensorField>(domainMesh);
2455 printFieldInfo<volSymmTensorField>(domainMesh);
2456 printFieldInfo<volTensorField>(domainMesh);
2457 printFieldInfo<surfaceScalarField>(domainMesh);
2458 printFieldInfo<surfaceVectorField>(domainMesh);
2459 printFieldInfo<surfaceSphericalTensorField>(domainMesh);
2460 printFieldInfo<surfaceSymmTensorField>(domainMesh);
2461 printFieldInfo<surfaceTensorField>(domainMesh);
2519 sourceFace = mapBoundaryData
2524 domainMesh.nInternalFaces(),
2527 sourceProc = mapBoundaryData
2532 domainMesh.nInternalFaces(),
2535 sourcePatch = mapBoundaryData
2540 domainMesh.nInternalFaces(),
2543 sourceNewNbrProc = mapBoundaryData
2548 domainMesh.nInternalFaces(),
2549 domainSourceNewNbrProc
2552 sourcePointMaster = mapPointData
2557 domainSourcePointMaster
2563 const labelList& oldCellMap = map().oldCellMap();
2564 const labelList& oldFaceMap = map().oldFaceMap();
2565 const labelList& oldPointMap = map().oldPointMap();
2566 const labelList& oldPatchMap = map().oldPatchMap();
2569 forAll(constructPatchMap, proci)
2571 if (proci != sendProc && constructPatchMap[proci].size())
2575 inplaceRenumberWithFlip
2580 constructFaceMap[proci]
2592 label nBnd = domainMesh.nFaces()-domainMesh.nInternalFaces();
2593 flippedAddedFaces.
resize(nBnd/4);
2597 label domainFaceI = domainMesh.nInternalFaces();
2598 domainFaceI < domainMesh.nFaces();
2602 label newFaceI = map().addedFaceMap()[domainFaceI];
2605 label domainCellI = domainMesh.faceOwner()[domainFaceI];
2607 if (newCellI != map().addedCellMap()[domainCellI])
2609 flippedAddedFaces.
insert(domainFaceI);
2620 label domainFaceI = iter.key();
2621 label& val = constructFaceMap[sendProc][domainFaceI];
2624 inplaceRenumberWithFlip
2626 map().addedFaceMap(),
2629 constructFaceMap[sendProc]
2636 Pout<<
nl <<
"MERGED MESH FROM:" << sendProc <<
endl;
2638 printFieldInfo<volScalarField>(mesh_);
2639 printFieldInfo<volVectorField>(mesh_);
2640 printFieldInfo<volSphericalTensorField>(mesh_);
2641 printFieldInfo<volSymmTensorField>(mesh_);
2642 printFieldInfo<volTensorField>(mesh_);
2643 printFieldInfo<surfaceScalarField>(mesh_);
2644 printFieldInfo<surfaceVectorField>(mesh_);
2645 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2646 printFieldInfo<surfaceSymmTensorField>(mesh_);
2647 printFieldInfo<surfaceTensorField>(mesh_);
2660 printFieldInfo<volScalarField>(mesh_);
2661 printFieldInfo<volVectorField>(mesh_);
2662 printFieldInfo<volSphericalTensorField>(mesh_);
2663 printFieldInfo<volSymmTensorField>(mesh_);
2664 printFieldInfo<volTensorField>(mesh_);
2665 printFieldInfo<surfaceScalarField>(mesh_);
2666 printFieldInfo<surfaceVectorField>(mesh_);
2667 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2668 printFieldInfo<surfaceSymmTensorField>(mesh_);
2669 printFieldInfo<surfaceTensorField>(mesh_);
2676 mergeSharedPoints(sourcePointMaster, constructPointMap);
2688 addProcPatches(sourceNewNbrProc, sourcePatch, procPatchID);
2707 repatch(newPatchID, constructFaceMap);
2711 initPatchFields<volScalarField, processorFvPatchField<scalar>>
2715 initPatchFields<volVectorField, processorFvPatchField<vector>>
2727 initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor>>
2731 initPatchFields<volTensorField, processorFvPatchField<tensor>>
2745 printFieldInfo<volScalarField>(mesh_);
2746 printFieldInfo<volVectorField>(mesh_);
2747 printFieldInfo<volSphericalTensorField>(mesh_);
2748 printFieldInfo<volSymmTensorField>(mesh_);
2749 printFieldInfo<volTensorField>(mesh_);
2750 printFieldInfo<surfaceScalarField>(mesh_);
2751 printFieldInfo<surfaceVectorField>(mesh_);
2752 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2753 printFieldInfo<surfaceSymmTensorField>(mesh_);
2754 printFieldInfo<surfaceTensorField>(mesh_);
2768 oldPatchStarts.
xfer(),
2769 oldPatchNMeshPoints.xfer(),
2776 constructPointMap.
xfer(),
2777 constructFaceMap.
xfer(),
2778 constructCellMap.
xfer(),
2779 constructPatchMap.
xfer(),
const labelList & oldPointMap() const
From old mesh point/face/cell to new mesh point/face/cell.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
ListType renumber(const labelUList &oldToNew, const ListType &)
Renumber the values (not the indices) of a list.
dimensionedScalar sign(const dimensionedScalar &ds)
List< labelList > labelListList
A List of labelList.
Neighbour processor patch.
void clearOut()
Clear all geometry and addressing.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
A HashTable with keys but without contents.
const labelList & patchMap() const
Return patch map.
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
const word & name() const
Return name.
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
void finishedSends(const bool block=true)
Mark all sends as having been done. This will start receives.
const faceZoneMesh & faceZones() const
Return face zone mesh.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Class describing modification of a face.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
void setRefinement(const labelList &cellsToRemove, const labelList &facesToExpose, const labelList &patchIDs, polyTopoChange &) const
Play commands into polyTopoChange to remove cells.
A list of keyword definitions, which are a keyword followed by any number of values (e...
void addFvPatches(const List< polyPatch *> &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label nInternalFaces() const
virtual const labelList & faceNeighbour() const
Return face neighbour.
Xfer< List< T > > xfer()
Transfer contents to the Xfer container.
static const char *const typeName
Cell-face mesh analysis engine.
void resetMotion() const
Reset motion.
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
const labelList & faceFlipMap() const
Return face map with sign to encode flipped faces.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void size(const label)
Override size to be inconsistent with allocated storage.
const boolList & flipMap() const
Return face flip map.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Given list of cells to remove insert all the topology changes.
wordList names() const
Return the list of names of the IOobjects.
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
Class containing mesh-to-mesh mapping information after a mesh addition where we add a mesh ('added m...
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
Less function class that can be used for sorting processor patches.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
A bounding box defined in terms of the points at its extremities.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const Time & time() const
Return the top-level database.
const labelList & addedPointMap() const
From added mesh point/face/cell to new mesh point/face/cell.
bool insert(const Key &key)
Insert a new entry.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
GeometricField< sphericalTensor, fvPatchField, volMesh > volSphericalTensorField
Combination-Reduction operation for a parallel run. The information from all nodes is collected on th...
label size() const
Return number of elements in table.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Various functions to operate on Lists.
Container for information needed to couple to meshes. When constructed from two meshes and a geometri...
Neighbour processor patch.
virtual const pointField & points() const
Return raw points.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
Xfer< HashTable< T, Key, Hash > > xfer()
Transfer contents to the Xfer container.
Input inter-processor communications stream operating on external buffer.
A list of faces which address into the list of points.
virtual bool owner() const
Does this side own the patch ?
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
A List obtained as a section of another List.
An ordered pair of two objects of type <T> with first() and second() elements.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
bool operator()(const label a, const label b)
const labelUList & faceCells() const
Return face-cell addressing.
label findZoneID(const word &zoneName) const
Find zone index given a name.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
static void mergePoints(const polyMesh &, const Map< label > &pointToMaster, polyTopoChange &meshMod)
Helper: Merge points.
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
const pointZoneMesh & pointZones() const
Return point zone mesh.
label nOldInternalFaces() const
Number of old internal faces.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
wordList names() const
Return a list of patch names.
virtual const labelList & faceOwner() const
Return face owner.
const labelList & oldFaceMap() const
Pair< label > labelPair
Label pair.
const labelList & faceMap() const
Return face map.
List< label > labelList
A List of labels.
const word & name() const
Return name.
virtual const faceList & faces() const
Return raw faces.
int neighbProcNo() const
Return neighbour processor number.
An STL-conforming hash table.
void addZones(const List< pointZone *> &pz, const List< faceZone *> &fz, const List< cellZone *> &cz)
Add mesh zones.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
static autoPtr< mapAddedPolyMesh > add(fvMesh &mesh0, const fvMesh &mesh1, const faceCoupleInfo &coupleInfo, const bool validBoundary=true)
Inplace add mesh to fvMesh. Maps all stored fields. Returns map.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A packed storage unstructured matrix of objects of type <T> using an offset table for access...
void setSize(const label mRows)
Reset size of CompactListList.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Output inter-processor communications stream operating on external buffer.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
defineTypeNameAndDebug(combustionModel, 0)
autoPtr< mapDistributePolyMesh > distribute(const labelList &dist)
Send cells to neighbours according to distribution.
Post-processing mesh subset tool. Given the original mesh and the list of selected cells...
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void setInstance(const fileName &)
Set the instance for mesh files.
This boundary condition enables processor communication across cyclic patches.
label size() const
Return the number of elements in the UPtrList.
void reverseDistribute(const label constructSize, List< T > &, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Reverse distribute data using default commsType.
const vectorField & faceCentres() const
label constructSize() const
Constructed data size.
Calculates points shared by more than two processor patches or cyclic patches.
void setSize(const label)
Reset size of List.
static void printMeshInfo(const fvMesh &)
Print some info on mesh.
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Class containing processor-to-processor mapping information.
const fvMesh & subMesh() const
Return reference to subset mesh.
A subset of mesh points. The labels of points in the zone can be obtained from the addressing() list...
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
prefixOSstream Pout(cout, "Pout")
static void printCoupleInfo(const primitiveMesh &, const labelList &, const labelList &, const labelList &, const labelList &)
Print some info on coupling data.
Mesh data needed to do the Finite Volume discretisation.
A List with indirect addressing.
Direct mesh changes based on v1.3 polyTopoChange syntax.
label start() const
Return start label of this patch in the polyMesh face list.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
lessProcPatches(const labelList &nbrProc, const labelList &referPatchID)
wordList names() const
Return a list of zone names.
virtual transformType transform() const
Type of transform.
void resize(const label newSize)
Resize the hash table for efficiency.
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return a pointer to a new patch created on freestore from.
This boundary condition enables processor communication across patches.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
labelList getExposedFaces(const labelList &cellsToRemove) const
Get labels of exposed faces.
A subset of mesh faces organised as a primitive patch.
List< Key > toc() const
Return the table of contents.
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
A patch is a list of labels that address the faces in the global face list.
label size() const
Return the number of elements in the UList.
static labelList countCells(const labelList &)
Helper function: count cells per processor in wanted distribution.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
const labelList & addedFaceMap() const
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void setLargeCellSubset(const labelList ®ion, const label currentRegion, const label patchID=-1, const bool syncCouples=true)
Set the subset from all cells with region == currentRegion.
const labelList & cellMap() const
Return cell map.
const labelList & pointMap() const
Return point map.
virtual bool owner() const
Does the processor own the patch ?
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.