62 referPatchID_(referPatchID)
67 if (nbrProc_[a] < nbrProc_[b])
71 else if (nbrProc_[a] > nbrProc_[b])
78 return referPatchID_[a] < referPatchID_[
b];
88 void Foam::fvMeshDistribute::inplaceRenumberWithFlip
91 const bool oldToNewHasFlip,
92 const bool lstHasFlip,
96 if (!lstHasFlip && !oldToNewHasFlip)
107 label val = lst[elemI];
123 <<
"Problem : zero value " << val
124 <<
" at index " << elemI <<
" out of " << lst.
size()
131 label newVal = oldToNew[val];
147 <<
"Problem : zero value " << newVal
148 <<
" at index " << elemI <<
" out of " 156 lst[elemI] = sign*(newVal+1);
164 const bool selectEqual,
173 if (selectEqual == (values[i] == value))
184 if (selectEqual == (values[i] == value))
194 void Foam::fvMeshDistribute::checkEqualWordList
207 if (allNames[proci] != allNames[0])
210 <<
"When checking for equal " << msg.c_str() <<
" :" <<
endl 211 <<
"processor0 has:" << allNames[0] <<
endl 212 <<
"processor" << proci <<
" has:" << allNames[proci] <<
endl 213 << msg.c_str() <<
" need to be synchronised on all processors." 230 forAll(allNames[proci], i)
232 mergedNames.
insert(allNames[proci][i]);
235 return mergedNames.
toc();
242 Pout<<
"Primitives:" <<
nl 246 <<
" faces :" << mesh.
nFaces() <<
nl 247 <<
" cells :" << mesh.
nCells() <<
nl;
257 <<
" size:" << pp.size()
258 <<
" start:" << pp.
start()
259 <<
" type:" << pp.type()
269 Pout<<
" " << zoneI <<
" name:" << pz.
name()
270 <<
" size:" << pz.
size()
280 Pout<<
" " << zoneI <<
" name:" << fz.
name()
281 <<
" size:" << fz.
size()
291 Pout<<
" " << zoneI <<
" name:" << cz.
name()
292 <<
" size:" << cz.
size()
309 <<
"Current coupling info:" 312 forAll(sourceFace, bFacei)
316 Pout<<
" meshFace:" << meshFacei
318 <<
" connects to proc:" << sourceProc[bFacei]
319 <<
"/face:" << sourceFace[bFacei]
320 <<
" which will move to proc:" << sourceNewNbrProc[bFacei]
327 Foam::label Foam::fvMeshDistribute::findNonEmptyPatch()
const 331 label nonEmptyPatchi = -1;
337 if (!isA<emptyPolyPatch>(pp) && !pp.
coupled())
344 if (nonEmptyPatchi == -1)
347 <<
"Cannot find a patch which is neither of type empty nor" 348 <<
" coupled in patches " << patches.
names() <<
endl 349 <<
"There has to be at least one such patch for" 355 Pout<<
"findNonEmptyPatch : using patch " << nonEmptyPatchi
356 <<
" name:" << patches[nonEmptyPatchi].
name()
357 <<
" type:" << patches[nonEmptyPatchi].type()
358 <<
" to put exposed faces into." <<
endl;
364 label procPatchi = -1;
368 if (isA<processorPolyPatch>(patches[
patchi]))
372 else if (procPatchi != -1)
375 <<
"Processor patches should be at end of patch list." 377 <<
"Have processor patch " << procPatchi
378 <<
" followed by non-processor patch " << patchi
379 <<
" in patches " << patches.
names()
384 return nonEmptyPatchi;
392 const label destinationPatch
397 labelList newPatchID(mesh_.nFaces() - mesh_.nInternalFaces(), -1);
399 label nProcPatches = 0;
405 if (isA<processorPolyPatch>(pp))
409 Pout<<
"Moving all faces of patch " << pp.
name()
410 <<
" into patch " << destinationPatch
414 label offset = pp.
start() - mesh_.nInternalFaces();
418 newPatchID[offset+i] = destinationPatch;
439 if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[
patchi]))
441 oldToNew[
patchi] = newI++;
444 label nNonProcPatches = newI;
449 if (isA<processorPolyPatch>(mesh_.boundaryMesh()[
patchi]))
451 oldToNew[
patchi] = newI++;
470 forAll(newPatchID, bFacei)
472 if (newPatchID[bFacei] != -1)
474 label facei = mesh_.nInternalFaces() + bFacei;
476 label zoneID = mesh_.faceZones().whichZone(facei);
477 bool zoneFlip =
false;
481 const faceZone& fZone = mesh_.faceZones()[zoneID];
489 mesh_.faces()[facei],
491 mesh_.faceOwner()[facei],
509 saveBoundaryFields<scalar, surfaceMesh>(sFlds);
511 saveBoundaryFields<vector, surfaceMesh>(vFlds);
513 saveBoundaryFields<sphericalTensor, surfaceMesh>(sptFlds);
515 saveBoundaryFields<symmTensor, surfaceMesh>(sytFlds);
517 saveBoundaryFields<tensor, surfaceMesh>(tFlds);
529 mesh_.updateMesh(map);
533 mapBoundaryFields<scalar, surfaceMesh>(map, sFlds);
534 mapBoundaryFields<vector, surfaceMesh>(map, vFlds);
535 mapBoundaryFields<sphericalTensor, surfaceMesh>(map, sptFlds);
536 mapBoundaryFields<symmTensor, surfaceMesh>(map, sytFlds);
537 mapBoundaryFields<tensor, surfaceMesh>(map, tFlds);
541 if (map().hasMotionPoints())
543 mesh_.movePoints(map().preMotionPoints());
555 <<
"reverseFaceMap contains -1 at index:" 557 <<
"This means that the repatch operation was not just" 562 forAll(constructFaceMap, proci)
564 inplaceRenumberWithFlip
566 map().reverseFaceMap(),
569 constructFaceMap[proci]
612 mesh_.updateMesh(map);
615 forAll(constructPointMap, proci)
617 labelList& constructMap = constructPointMap[proci];
621 label oldPointi = constructMap[i];
627 constructMap[i] = -newPointi-2;
629 else if (newPointi >= 0)
636 <<
"Problem. oldPointi:" << oldPointi
646 void Foam::fvMeshDistribute::getNeighbourData
655 label nBnd = mesh_.nFaces() - mesh_.nInternalFaces();
659 sourceNewNbrProc.
setSize(nBnd);
673 label offset = pp.
start() - mesh_.nInternalFaces();
678 label bndI = offset + i;
679 nbrFaces[bndI] = pp.
start()+i;
697 label offset = pp.
start() - mesh_.nInternalFaces();
699 if (isA<processorPolyPatch>(pp))
702 refCast<const processorPolyPatch>(pp);
706 if (procPatch.
owner())
711 label bndI = offset + i;
712 sourceFace[bndI] = pp.
start()+i;
714 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
722 label bndI = offset + i;
723 sourceFace[bndI] = nbrFaces[bndI];
725 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
731 if (isA<processorCyclicPolyPatch>(pp))
733 patchi = refCast<const processorCyclicPolyPatch>
741 label bndI = offset + i;
742 sourcePatch[bndI] =
patchi;
745 else if (isA<cyclicPolyPatch>(pp))
753 label bndI = offset + i;
754 sourceFace[bndI] = pp.
start()+i;
756 sourcePatch[bndI] =
patchi;
757 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
764 label bndI = offset + i;
765 sourceFace[bndI] = nbrFaces[bndI];
767 sourcePatch[bndI] =
patchi;
768 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
777 label bndI = offset + i;
778 sourceFace[bndI] = -1;
779 sourceProc[bndI] = -1;
780 sourcePatch[bndI] =
patchi;
781 sourceNewNbrProc[bndI] = -1;
789 void Foam::fvMeshDistribute::subsetBoundaryData
798 const label oldInternalFaces,
816 forAll(subFace, newBFacei)
820 label oldFacei = faceMap[newFacei];
823 if (oldFacei < oldInternalFaces)
825 subFace[newBFacei] = oldFacei;
827 subPatch[newBFacei] = -1;
829 label oldOwn = oldFaceOwner[oldFacei];
830 label oldNei = oldFaceNeighbour[oldFacei];
832 if (oldOwn == cellMap[mesh.
faceOwner()[newFacei]])
835 subNewNbrProc[newBFacei] = oldDistribution[oldNei];
840 subNewNbrProc[newBFacei] = oldDistribution[oldOwn];
846 label oldBFacei = oldFacei - oldInternalFaces;
848 subFace[newBFacei] = sourceFace[oldBFacei];
849 subProc[newBFacei] = sourceProc[oldBFacei];
850 subPatch[newBFacei] = sourcePatch[oldBFacei];
851 subNewNbrProc[newBFacei] = sourceNewNbrProc[oldBFacei];
859 void Foam::fvMeshDistribute::findCouples
880 forAll(domainProc, bFacei)
882 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
886 labelPair(domainFace[bFacei], domainProc[bFacei]),
899 forAll(sourceFace, bFacei)
901 if (sourceProc[bFacei] != -1 && sourcePatch[bFacei] == -1)
903 labelPair myData(sourceFace[bFacei], sourceProc[bFacei]);
906 iter = map.find(myData);
908 if (iter != map.end())
910 label nbrBFacei = iter();
913 slaveCoupledFaces[coupledI] =
922 masterCoupledFaces.
setSize(coupledI);
923 slaveCoupledFaces.
setSize(coupledI);
927 Pout<<
"findCouples : found " << coupledI
928 <<
" faces that will be stitched" <<
nl <<
endl;
939 const label nInternalFaces1,
945 forAll(boundaryData0, oldBFacei)
953 boundaryData0[oldBFacei];
957 forAll(boundaryData1, addedBFacei)
964 boundaryData1[addedBFacei];
968 return newBoundaryData;
976 const label oldInternalPatchi
994 labelList(exposedFaces.size(), oldInternalPatchi),
1006 saveInternalFields(sFlds);
1008 saveInternalFields(vFlds);
1010 saveInternalFields(sptFlds);
1012 saveInternalFields(sytFlds);
1014 saveInternalFields(tFlds);
1020 mesh_.updateMesh(map);
1027 mapExposedFaces(map(), sFlds);
1028 mapExposedFaces(map(), vFlds);
1029 mapExposedFaces(map(), sptFlds);
1030 mapExposedFaces(map(), sytFlds);
1031 mapExposedFaces(map(), tFlds);
1039 if (map().hasMotionPoints())
1041 mesh_.movePoints(map().preMotionPoints());
1050 void Foam::fvMeshDistribute::addProcPatches
1072 label bFacei = indices[i];
1073 label proci = nbrProc[bFacei];
1077 if (!procPatchID[proci].
found(referPatchID[bFacei]))
1082 if (referPatchID[bFacei] == -1)
1090 mesh_.boundaryMesh().size(),
1091 mesh_.boundaryMesh(),
1096 procPatchID[proci].insert
1098 referPatchID[bFacei],
1112 = refCast<const coupledPolyPatch>
1114 mesh_.boundaryMesh()[referPatchID[bFacei]]
1120 mesh_.boundaryMesh().size(),
1121 mesh_.boundaryMesh(),
1128 procPatchID[proci].insert
1130 referPatchID[bFacei],
1161 label origPatchi = referPatchID[bFacei];
1162 patchIDs[bFacei] = origPatchi;
1164 else if (nbrProc[bFacei] != -1)
1166 label origPatchi = referPatchID[bFacei];
1167 patchIDs[bFacei] = procPatchID[nbrProc[bFacei]][origPatchi];
1171 patchIDs[bFacei] = -1;
1179 void Foam::fvMeshDistribute::sendMesh
1197 Pout<<
"Sending to domain " << domain <<
nl 1199 <<
" nFaces:" << mesh.
nFaces() <<
nl 1200 <<
" nCells:" << mesh.
nCells() <<
nl 1213 forAll(pointZoneNames, nameI)
1219 rowSizes[nameI] = pointZones[myZoneID].
size();
1224 forAll(pointZoneNames, nameI)
1230 zonePoints[nameI].deepCopy(pointZones[myZoneID]);
1243 forAll(faceZoneNames, nameI)
1249 rowSizes[nameI] = faceZones[myZoneID].
size();
1254 zoneFaceFlip.
setSize(rowSizes);
1256 forAll(faceZoneNames, nameI)
1262 zoneFaces[nameI].deepCopy(faceZones[myZoneID]);
1263 zoneFaceFlip[nameI].deepCopy(faceZones[myZoneID].flipMap());
1275 forAll(cellZoneNames, nameI)
1281 rowSizes[nameI] = cellZones[myZoneID].
size();
1287 forAll(cellZoneNames, nameI)
1293 zoneCells[nameI].deepCopy(cellZones[myZoneID]);
1328 << sourceNewNbrProc;
1333 Pout<<
"Started sending mesh to domain " << domain
1346 const Time& runTime,
1368 >> domainSourcePatch
1369 >> domainSourceNewNbrProc;
1390 fvMesh& domainMesh = domainMeshPtr();
1398 patchEntries[
patchi].keyword(),
1444 domainMesh.
addZones(pZonePtrs, fZonePtrs, cZonePtrs);
1446 return domainMeshPtr;
1453 Foam::fvMeshDistribute::fvMeshDistribute(
fvMesh& mesh,
const scalar mergeTol)
1468 forAll(distribution, celli)
1470 label newProc = distribution[celli];
1477 <<
"At index " << celli <<
" distribution:" << newProc
1495 <<
"Size of distribution:" 1496 << distribution.
size() <<
" mesh nCells:" << mesh_.
nCells()
1507 <<
"This application requires all non-processor patches" 1508 <<
" to be present in the same order on all patches" <<
nl 1509 <<
"followed by the processor patches (which of course are unique)." 1524 oldPatchNMeshPoints[
patchi] = patches[
patchi].nPoints();
1542 oldPatchStarts.
xfer(),
1543 oldPatchNMeshPoints.xfer(),
1628 checkEqualWordList(
"volScalarFields", volScalars);
1630 checkEqualWordList(
"volVectorFields", volVectors);
1635 checkEqualWordList(
"volSphericalTensorFields", volSphereTensors);
1637 checkEqualWordList(
"volSymmTensorFields", volSymmTensors);
1639 checkEqualWordList(
"volTensorField", volTensors);
1642 checkEqualWordList(
"surfaceScalarFields", surfScalars);
1644 checkEqualWordList(
"surfaceVectorFields", surfVectors);
1649 checkEqualWordList(
"surfaceSphericalTensorFields", surfSphereTensors);
1654 checkEqualWordList(
"surfaceSymmTensorFields", surfSymmTensors);
1656 checkEqualWordList(
"surfaceTensorFields", surfTensors);
1659 const wordList dimScalars(mesh_.
names(dimScalType::typeName));
1660 checkEqualWordList(
"volScalarField::Internal", dimScalars);
1663 const wordList dimVectors(mesh_.
names(dimVecType::typeName));
1664 checkEqualWordList(
"volVectorField::Internal", dimVectors);
1667 const wordList dimSphereTensors(mesh_.
names(dimSphereType::typeName));
1670 "volSphericalTensorField::Internal",
1675 const wordList dimSymmTensors(mesh_.
names(dimSymmTensorType::typeName));
1678 "volSymmTensorField::Internal",
1683 const wordList dimTensors(mesh_.
names(dimTensorType::typeName));
1684 checkEqualWordList(
"volTensorField::Internal", dimTensors);
1689 label oldInternalPatchi = findNonEmptyPatch();
1700 repatchFaceMap = repatchMap().faceMap();
1707 repatchMap().reverseFaceMap(),
1725 Pout<<
nl <<
"MESH WITH PROC PATCHES DELETED:" <<
endl;
1727 printFieldInfo<volScalarField>(mesh_);
1728 printFieldInfo<volVectorField>(mesh_);
1729 printFieldInfo<volSphericalTensorField>(mesh_);
1730 printFieldInfo<volSymmTensorField>(mesh_);
1731 printFieldInfo<volTensorField>(mesh_);
1732 printFieldInfo<surfaceScalarField>(mesh_);
1733 printFieldInfo<surfaceVectorField>(mesh_);
1734 printFieldInfo<surfaceSphericalTensorField>(mesh_);
1735 printFieldInfo<surfaceSymmTensorField>(mesh_);
1736 printFieldInfo<surfaceTensorField>(mesh_);
1788 <<
"SUBSETTING FOR DOMAIN " << recvProc
1789 <<
" cells to send:" 1810 subCellMap[recvProc] = subsetter.
cellMap();
1812 inplaceRenumberWithFlip
1817 subFaceMap[recvProc]
1819 subPointMap[recvProc] = subsetter.
pointMap();
1820 subPatchMap[recvProc] = subsetter.
patchMap();
1848 procSourceNewNbrProc
1866 procSourceNewNbrProc,
1871 sendFields<volScalarField>(recvProc, volScalars, subsetter, str);
1872 sendFields<volVectorField>(recvProc, volVectors, subsetter, str);
1873 sendFields<volSphericalTensorField>
1880 sendFields<volSymmTensorField>
1887 sendFields<volTensorField>(recvProc, volTensors, subsetter, str);
1890 sendFields<surfaceScalarField>
1897 sendFields<surfaceVectorField>
1904 sendFields<surfaceSphericalTensorField>
1911 sendFields<surfaceSymmTensorField>
1918 sendFields<surfaceTensorField>
1927 sendFields<volScalarField::Internal>
1934 sendFields<volVectorField::Internal>
1941 sendFields<volSphericalTensorField::Internal>
1948 sendFields<volSymmTensorField::Internal>
1955 sendFields<volTensorField::Internal>
2003 faceMap[faceI] += 1;
2008 label faceI = iter.key();
2009 faceMap[faceI] = -faceMap[faceI];
2046 domainSourceNewNbrProc
2049 sourceFace.
transfer(domainSourceFace);
2050 sourceProc.
transfer(domainSourceProc);
2051 sourcePatch.
transfer(domainSourcePatch);
2052 sourceNewNbrProc.
transfer(domainSourceNewNbrProc);
2061 printFieldInfo<volScalarField>(mesh_);
2062 printFieldInfo<volVectorField>(mesh_);
2063 printFieldInfo<volSphericalTensorField>(mesh_);
2064 printFieldInfo<volSymmTensorField>(mesh_);
2065 printFieldInfo<volTensorField>(mesh_);
2066 printFieldInfo<surfaceScalarField>(mesh_);
2067 printFieldInfo<surfaceVectorField>(mesh_);
2068 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2069 printFieldInfo<surfaceSymmTensorField>(mesh_);
2070 printFieldInfo<surfaceTensorField>(mesh_);
2082 forAll(nSendCells, sendProc)
2094 <<
"RECEIVING FROM DOMAIN " << sendProc
2095 <<
" cells to receive:" 2134 domainMeshPtr = receiveMesh
2141 const_cast<Time&>(mesh_.
time()),
2145 domainSourceNewNbrProc,
2148 fvMesh& domainMesh = domainMeshPtr();
2158 receiveFields<volScalarField>
2166 receiveFields<volVectorField>
2174 receiveFields<volSphericalTensorField>
2182 receiveFields<volSymmTensorField>
2190 receiveFields<volTensorField>
2200 receiveFields<surfaceScalarField>
2208 receiveFields<surfaceVectorField>
2216 receiveFields<surfaceSphericalTensorField>
2224 receiveFields<surfaceSymmTensorField>
2232 receiveFields<surfaceTensorField>
2242 receiveFields<volScalarField::Internal>
2253 receiveFields<volVectorField::Internal>
2264 receiveFields<volSphericalTensorField::Internal>
2276 receiveFields<volSymmTensorField::Internal>
2287 receiveFields<volTensorField::Internal>
2299 const fvMesh& domainMesh = domainMeshPtr();
2302 constructCellMap[sendProc] =
identity(domainMesh.nCells());
2303 constructFaceMap[sendProc] =
identity(domainMesh.nFaces()) + 1;
2304 constructPointMap[sendProc] =
identity(domainMesh.nPoints());
2305 constructPatchMap[sendProc] =
2306 identity(domainMesh.boundaryMesh().size());
2312 Pout<<
nl <<
"RECEIVED MESH FROM:" << sendProc <<
endl;
2314 printFieldInfo<volScalarField>(domainMesh);
2315 printFieldInfo<volVectorField>(domainMesh);
2316 printFieldInfo<volSphericalTensorField>(domainMesh);
2317 printFieldInfo<volSymmTensorField>(domainMesh);
2318 printFieldInfo<volTensorField>(domainMesh);
2319 printFieldInfo<surfaceScalarField>(domainMesh);
2320 printFieldInfo<surfaceVectorField>(domainMesh);
2321 printFieldInfo<surfaceSphericalTensorField>(domainMesh);
2322 printFieldInfo<surfaceSymmTensorField>(domainMesh);
2323 printFieldInfo<surfaceTensorField>(domainMesh);
2381 sourceFace = mapBoundaryData
2386 domainMesh.nInternalFaces(),
2389 sourceProc = mapBoundaryData
2394 domainMesh.nInternalFaces(),
2397 sourcePatch = mapBoundaryData
2402 domainMesh.nInternalFaces(),
2405 sourceNewNbrProc = mapBoundaryData
2410 domainMesh.nInternalFaces(),
2411 domainSourceNewNbrProc
2416 const labelList& oldCellMap = map().oldCellMap();
2417 const labelList& oldFaceMap = map().oldFaceMap();
2418 const labelList& oldPointMap = map().oldPointMap();
2419 const labelList& oldPatchMap = map().oldPatchMap();
2422 forAll(constructPatchMap, proci)
2424 if (proci != sendProc && constructPatchMap[proci].size())
2428 inplaceRenumberWithFlip
2433 constructFaceMap[proci]
2445 label nBnd = domainMesh.nFaces()-domainMesh.nInternalFaces();
2446 flippedAddedFaces.
resize(nBnd/4);
2450 label domainFaceI = domainMesh.nInternalFaces();
2451 domainFaceI < domainMesh.nFaces();
2455 label newFaceI = map().addedFaceMap()[domainFaceI];
2458 label domainCellI = domainMesh.faceOwner()[domainFaceI];
2460 if (newCellI != map().addedCellMap()[domainCellI])
2462 flippedAddedFaces.
insert(domainFaceI);
2473 label domainFaceI = iter.key();
2474 label& val = constructFaceMap[sendProc][domainFaceI];
2477 inplaceRenumberWithFlip
2479 map().addedFaceMap(),
2482 constructFaceMap[sendProc]
2489 Pout<<
nl <<
"MERGED MESH FROM:" << sendProc <<
endl;
2491 printFieldInfo<volScalarField>(mesh_);
2492 printFieldInfo<volVectorField>(mesh_);
2493 printFieldInfo<volSphericalTensorField>(mesh_);
2494 printFieldInfo<volSymmTensorField>(mesh_);
2495 printFieldInfo<volTensorField>(mesh_);
2496 printFieldInfo<surfaceScalarField>(mesh_);
2497 printFieldInfo<surfaceVectorField>(mesh_);
2498 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2499 printFieldInfo<surfaceSymmTensorField>(mesh_);
2500 printFieldInfo<surfaceTensorField>(mesh_);
2513 printFieldInfo<volScalarField>(mesh_);
2514 printFieldInfo<volVectorField>(mesh_);
2515 printFieldInfo<volSphericalTensorField>(mesh_);
2516 printFieldInfo<volSymmTensorField>(mesh_);
2517 printFieldInfo<volTensorField>(mesh_);
2518 printFieldInfo<surfaceScalarField>(mesh_);
2519 printFieldInfo<surfaceVectorField>(mesh_);
2520 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2521 printFieldInfo<surfaceSymmTensorField>(mesh_);
2522 printFieldInfo<surfaceTensorField>(mesh_);
2537 addProcPatches(sourceNewNbrProc, sourcePatch, procPatchID);
2560 repatch(newPatchID, constructFaceMap);
2564 mergeSharedPoints(constructPointMap);
2568 initPatchFields<volScalarField, processorFvPatchField<scalar>>
2572 initPatchFields<volVectorField, processorFvPatchField<vector>>
2584 initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor>>
2588 initPatchFields<volTensorField, processorFvPatchField<tensor>>
2602 printFieldInfo<volScalarField>(mesh_);
2603 printFieldInfo<volVectorField>(mesh_);
2604 printFieldInfo<volSphericalTensorField>(mesh_);
2605 printFieldInfo<volSymmTensorField>(mesh_);
2606 printFieldInfo<volTensorField>(mesh_);
2607 printFieldInfo<surfaceScalarField>(mesh_);
2608 printFieldInfo<surfaceVectorField>(mesh_);
2609 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2610 printFieldInfo<surfaceSymmTensorField>(mesh_);
2611 printFieldInfo<surfaceTensorField>(mesh_);
2625 oldPatchStarts.
xfer(),
2626 oldPatchNMeshPoints.xfer(),
2633 constructPointMap.
xfer(),
2634 constructFaceMap.
xfer(),
2635 constructCellMap.
xfer(),
2636 constructPatchMap.
xfer(),
ListType renumber(const labelUList &oldToNew, const ListType &)
Renumber the values (not the indices) of a list.
dimensionedScalar sign(const dimensionedScalar &ds)
const labelList & faceFlipMap() const
Return face map with sign to encode flipped faces.
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.
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.
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 setRefinement(const labelList &cellsToRemove, const labelList &facesToExpose, const labelList &patchIDs, polyTopoChange &) const
Play commands into polyTopoChange to remove cells.
void finishedSends(const bool block=true)
Mark all sends as having been done. This will start receives.
const labelList & pointMap() const
Return point map.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
errorManipArg< error, int > exit(error &err, const int errNo=1)
wordList names() const
Return a list of patch names.
const boolList & flipMap() const
Return face flip map.
Class describing modification of a face.
void resetMotion() const
Reset motion.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Xfer< List< T > > xfer()
Transfer contents to the Xfer container.
static const char *const typeName
Cell-face mesh analysis engine.
int neighbProcNo() const
Return neigbour processor number.
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 dictionary & subDict(const word &) const
Find and return a sub-dictionary.
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.
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 size() const
Return number of elements in table.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const labelList & oldFaceMap() const
const vectorField & faceCentres() const
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
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
void addFvPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
Combination-Reduction operation for a parallel run. The information from all nodes is collected on th...
virtual transformType transform() const
Type of transform.
const fvMesh & subMesh() const
Return reference to subset mesh.
const labelList & addedFaceMap() const
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
virtual const pointField & points() const
Return raw points.
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.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
Xfer< HashTable< T, Key, Hash > > xfer()
Transfer contents to the Xfer container.
Input inter-processor communications stream operating on external buffer.
const word & name() const
Return name.
A List obtained as a section of another List.
label findZoneID(const word &zoneName) const
Find zone index given a name.
const labelList & faceMap() const
Return face map.
An ordered pair of two objects of type <T> with first() and second() elements.
label start() const
Return start label of this patch in the polyMesh face list.
bool operator()(const label a, const label b)
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.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
wordList names() const
Return a list of zone names.
Pair< label > labelPair
Label pair.
List< label > labelList
A List of labels.
const labelList & patchMap() const
Return patch map.
labelList getExposedFaces(const labelList &cellsToRemove) const
Get labels of exposed faces.
wordList names() const
Return the list of names of the IOobjects.
const word & name() const
Return name.
An STL-conforming hash table.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
List< Key > toc() const
Return the table of contents.
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.
prefixOSstream Pout(cout,"Pout")
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 occurence of given element and return index,.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
const pointZoneMesh & pointZones() const
Return point zone mesh.
label nOldInternalFaces() const
Number of old internal faces.
void setInstance(const fileName &)
Set the instance for mesh files.
This boundary condition enables processor communication across cyclic patches.
const labelList & cellMap() const
Return cell map.
label size() const
Return the number of elements in the UList.
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?
const cellZoneMesh & cellZones() const
Return cell zone mesh.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
virtual const labelList & faceNeighbour() const
Return face neighbour.
A subset of mesh points. The labels of points in the zone can be obtained from the addressing() list...
virtual bool owner() const
Does the processor own the patch ?
const labelUList & faceCells() const
Return face-cell addressing.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
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.
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)
virtual bool owner() const
Does this side own the patch ?
void resize(const label newSize)
Resize the hash table for efficiency.
const faceZoneMesh & faceZones() const
Return face zone mesh.
void addZones(const List< pointZone * > &pz, const List< faceZone * > &fz, const List< cellZone * > &cz)
Add mesh zones.
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...
A subset of mesh faces organised as a primitive patch.
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.
virtual const labelList & faceOwner() const
Return face owner.
A patch is a list of labels that address the faces in the global face list.
virtual const faceList & faces() const
Return raw faces.
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 polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
label nInternalFaces() 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.
static Map< label > findSharedPoints(const polyMesh &, const scalar mergeTol)
Find topologically and geometrically shared points.
const word & name() const
Return name.
const Time & time() const
Return the top-level database.
label size() const
Return the number of elements in the UPtrList.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.