39 template<
class FaceList,
class Po
intField>
48 p.meshPoints()[
p.edges()[edgei][0]],
49 p.meshPoints()[
p.edges()[edgei][1]]
65 const Foam::word Foam::fvMeshStitcher::nccFieldPrefix_ =
66 fvMeshStitcher::typeName +
":";
71 void Foam::fvMeshStitcher::intersectNonConformalCyclic
73 const nonConformalCyclicFvPatch& nccFvp,
74 surfaceLabelField::Boundary& polyFacesBf,
75 surfaceVectorField::Boundary& SfBf,
76 surfaceVectorField::Boundary& CfBf,
77 const tmp<surfaceLabelField::Boundary>& tOrigFacesNbrBf,
78 const tmp<surfaceVectorField::Boundary>& tOrigSfNbrBf,
79 const tmp<surfaceVectorField::Boundary>& tOrigCfNbrBf,
80 List<part>& origEdgeParts
83 const nonConformalCyclicFvPatch& nbrNccFvp = nccFvp.nbrPatch();
86 const polyPatch& origPp = nccFvp.origPatch().patch();
87 const polyPatch& nbrOrigPp = nbrNccFvp.origPatch().patch();
96 const fvPatch& fvp = mesh_.
boundary()[patchj];
98 if (isA<nonConformalProcessorCyclicFvPatch>(fvp))
100 const nonConformalProcessorCyclicFvPatch& ncpcFvp =
101 refCast<const nonConformalProcessorCyclicFvPatch>(fvp);
103 if (ncpcFvp.referPatchID() == nccFvp.index())
105 patchis[ncpcFvp.neighbProcNo()] = patchj;
107 if (ncpcFvp.referPatchID() == nbrNccFvp.index())
109 nbrPatchis[ncpcFvp.neighbProcNo()] = patchj;
115 const patchToPatches::intersection& intersection =
116 nccFvp.nonConformalCyclicPatch().intersection();
122 auto procFacesToIndices = []
124 const List<List<remote>>& faceOtherProcFaces,
130 forAll(faceOtherProcFaces, facei)
132 forAll(faceOtherProcFaces[facei], i)
134 const remote& otherProcFacei = faceOtherProcFaces[facei][i];
136 is[otherProcFacei.proci] ++;
144 indices[proci].resize(is[proci]);
149 forAll(faceOtherProcFaces, facei)
151 forAll(faceOtherProcFaces[facei], i)
153 const remote& otherProcFacei = faceOtherProcFaces[facei][i];
155 FixedList<label, 3>& index =
156 indices[otherProcFacei.proci][is[otherProcFacei.proci] ++];
158 index = {facei, otherProcFacei.elementi, i};
160 if (!owner)
Swap(index[0], index[1]);
167 sort(indices[proci]);
173 List<List<FixedList<label, 3>>> indices =
174 procFacesToIndices(intersection.srcTgtProcFaces(),
true);
176 List<List<FixedList<label, 3>>> nbrIndices =
177 procFacesToIndices(intersection.tgtSrcProcFaces(),
false);
183 auto matchIndices = [&polyFacesBf, &tOrigFacesNbrBf]
185 List<List<FixedList<label, 3>>>& indices,
186 const nonConformalCyclicFvPatch& nccFvp,
187 const polyPatch& origPp,
195 List<List<FixedList<label, 3>>> indicesRef(indices.size());
202 indicesRef[proci].resize(polyFacesBf[
patchi].size());
206 FixedList<label, 3>& indexRef =
207 indicesRef[proci][patchFacei];
211 polyFacesBf[
patchi][patchFacei] - origPp.start(),
212 origFacesNbrBf[
patchi][patchFacei],
216 if (!owner)
Swap(indexRef[0], indexRef[1]);
222 label nCouplesRemoved = 0, nCouplesAdded = 0;
229 label patchFacei = 0, i = 0;
233 patchFacei < polyFacesBf[
patchi].size()
234 && i < indices[proci].size()
237 const FixedList<label, 3> index
239 indices[proci][i][0],
240 indices[proci][i][1],
244 FixedList<label, 3>& indexRef =
245 indicesRef[proci][patchFacei];
247 if (index < indexRef)
252 else if (index == indexRef)
254 indexRef[2] = indices[proci][i][2];
266 min(indices[proci].size() - i, 0);
268 min(polyFacesBf[
patchi].size() - patchFacei, 0);
273 reduce(nCouplesRemoved, sumOp<label>());
274 reduce(nCouplesAdded, sumOp<label>());
275 if ((nCouplesRemoved || nCouplesAdded) && nccFvp.owner())
277 Info<<
indent << nCouplesRemoved <<
'/' << nCouplesAdded
278 <<
" small couplings removed/added to " << nccFvp.
name()
283 Swap(indices, indicesRef);
286 if (tOrigFacesNbrBf.valid())
288 matchIndices(indices, nccFvp, origPp, patchis,
true);
289 matchIndices(nbrIndices, nbrNccFvp, nbrOrigPp, nbrPatchis,
false);
294 auto createCouplings =
303 const List<List<FixedList<label, 3>>>& indices,
304 const List<DynamicList<couple>>& couples,
305 const nonConformalCyclicFvPatch& nccFvp,
306 const polyPatch& origPp,
314 const label patchSize = indices[proci].size();
316 if (
patchi == -1 && patchSize)
319 <<
"Intersection generated coupling through "
320 << nccFvp.name() <<
" between processes "
322 <<
" but a corresponding processor interface was not found"
328 polyFacesBf[
patchi].resize(patchSize);
329 SfBf[
patchi].resize(patchSize);
330 CfBf[
patchi].resize(patchSize);
332 forAll(indices[proci], patchFacei)
334 const label origFacei = indices[proci][patchFacei][!owner];
335 const label i = indices[proci][patchFacei][2];
337 polyFacesBf[
patchi][patchFacei] =
338 origFacei + origPp.start();
343 c = couples[origFacei][i];
352 small*origPp.faceAreas()[origFacei],
353 origPp.faceCentres()[origFacei]
357 small*tOrigSfNbrBf()[
patchi][patchFacei],
358 tOrigCfNbrBf()[
patchi][patchFacei]
368 SfBf[
patchi][patchFacei] =
c.nbr.area;
369 CfBf[
patchi][patchFacei] =
c.nbr.centre;
375 SfBf[origPp.index()][origFacei],
376 CfBf[origPp.index()][origFacei]
380 SfBf[origPp.index()][origFacei] = origP.area;
381 CfBf[origPp.index()][origFacei] = origP.centre;
391 intersection.srcCouples(),
401 intersection.tgtCouples(),
409 forAll(intersection.srcErrorParts(), origFacei)
413 SfBf[origPp.index()][origFacei],
414 CfBf[origPp.index()][origFacei]
416 origP += intersection.srcErrorParts()[origFacei];
418 SfBf[origPp.index()][origFacei] = origP.area;
419 CfBf[origPp.index()][origFacei] = origP.centre;
423 forAll(intersection.srcEdgeParts(), origEdgei)
425 origEdgeParts[origEdgei] += intersection.srcEdgeParts()[origEdgei];
431 Foam::fvMeshStitcher::calculateOwnerOrigBoundaryEdgeParts
433 const List<List<part>>& patchEdgeParts
436 const polyBoundaryMesh& pbMesh = mesh_.boundaryMesh();
439 const labelList& ownerOrigBoundaryPointMeshPoint =
440 ncb.ownerOrigBoundaryPointMeshPoint();
441 const labelList& ownerOrigBoundaryEdgeMeshEdge =
442 ncb.ownerOrigBoundaryEdgeMeshEdge();
443 const edgeList& ownerOrigBoundaryEdges = ncb.ownerOrigBoundaryEdges();
444 const edgeList& ownerOrigBoundaryMeshEdges =
445 ncb.ownerOrigBoundaryMeshEdges();
448 labelList ownerOrigBoundaryEdgeNParts(ownerOrigBoundaryEdges.size(), 0);
449 List<part> ownerOrigBoundaryEdgeParts(ownerOrigBoundaryEdges.size());
452 if (patchEdgeParts[
patchi].empty())
continue;
454 const polyPatch& patch = pbMesh[
patchi];
456 const labelList& patchEdgeOwnerOrigBoundaryEdges =
457 ncb.patchEdgeOwnerOrigBoundaryEdges(
patchi);
461 const label ownerOrigBoundaryEdgei =
462 patchEdgeOwnerOrigBoundaryEdges[patchEdgei];
468 ownerOrigBoundaryMeshEdges[ownerOrigBoundaryEdgei]
471 const part& pU = patchEdgeParts[
patchi][patchEdgei];
472 const part
p =
sign > 0 ? pU : -pU;
474 ownerOrigBoundaryEdgeNParts[ownerOrigBoundaryEdgei] ++;
475 ownerOrigBoundaryEdgeParts[ownerOrigBoundaryEdgei] +=
p;
480 const globalIndex globalOwnerOrigBoundaryPoints
482 ownerOrigBoundaryPointMeshPoint.size()
486 ownerOrigBoundaryPointMeshPoint.size()
488 forAll(ownerOrigBoundaryPointIndices, ownerOrigBoundaryPointi)
490 ownerOrigBoundaryPointIndices[ownerOrigBoundaryPointi] =
491 globalOwnerOrigBoundaryPoints.toGlobal(ownerOrigBoundaryPointi);
496 ownerOrigBoundaryPointMeshPoint,
497 ownerOrigBoundaryPointIndices,
505 forAll(ownerOrigBoundaryEdgeParts, ownerOrigBoundaryEdgei)
507 const edge&
e = ownerOrigBoundaryEdges[ownerOrigBoundaryEdgei];
511 ownerOrigBoundaryPointIndices[
e.start()]
512 > ownerOrigBoundaryPointIndices[
e.end()])
514 ownerOrigBoundaryEdgeParts[ownerOrigBoundaryEdgei] =
515 - ownerOrigBoundaryEdgeParts[ownerOrigBoundaryEdgei];
523 ownerOrigBoundaryEdgeMeshEdge,
524 ownerOrigBoundaryEdgeNParts,
531 ownerOrigBoundaryEdgeMeshEdge,
532 ownerOrigBoundaryEdgeParts,
537 const transformer& vt,
548 fld[i].area = vt.transform(
fld[i].area);
549 fld[i].centre = vt.transformPosition(
fld[i].centre);
559 fld[i].area = vt.invTransform(
fld[i].area);
560 fld[i].centre = vt.invTransformPosition(
fld[i].centre);
566 forAll(ownerOrigBoundaryEdgeParts, ownerOrigBoundaryEdgei)
568 if (ownerOrigBoundaryEdgeNParts[ownerOrigBoundaryEdgei] != 0)
570 ownerOrigBoundaryEdgeParts[ownerOrigBoundaryEdgei].area /=
571 ownerOrigBoundaryEdgeNParts[ownerOrigBoundaryEdgei];
576 forAll(ownerOrigBoundaryEdgeParts, ownerOrigBoundaryEdgei)
578 const edge&
e = ownerOrigBoundaryEdges[ownerOrigBoundaryEdgei];
582 ownerOrigBoundaryPointIndices[
e.start()]
583 > ownerOrigBoundaryPointIndices[
e.end()]
586 ownerOrigBoundaryEdgeParts[ownerOrigBoundaryEdgei] =
587 - ownerOrigBoundaryEdgeParts[ownerOrigBoundaryEdgei];
591 return ownerOrigBoundaryEdgeParts;
596 void Foam::fvMeshStitcher::applyOwnerOrigBoundaryEdgeParts
600 const List<part>& ownerOrigBoundaryEdgeParts
603 const polyBoundaryMesh& pbMesh = mesh_.boundaryMesh();
606 const labelList ownerOrigPatchIDs = ncb.ownerOrigPatchIDs();
607 const labelList& ownerOrigBoundaryEdgeMeshEdge =
608 ncb.ownerOrigBoundaryEdgeMeshEdge();
609 const edgeList& ownerOrigBoundaryMeshEdges =
610 ncb.ownerOrigBoundaryMeshEdges();
612 boolList patchIsOwnerOrig(pbMesh.size(),
false);
613 UIndirectList<bool>(patchIsOwnerOrig, ownerOrigPatchIDs) =
true;
616 labelList ownerOrigBoundaryEdgeNOrigFaces
618 ownerOrigBoundaryEdgeMeshEdge.size(),
621 forAll(ownerOrigBoundaryEdgeMeshEdge, ownerOrigBoundaryEdgei)
623 const label meshEdgei =
624 ownerOrigBoundaryEdgeMeshEdge[ownerOrigBoundaryEdgei];
626 forAll(mesh_.edgeFaces()[meshEdgei], edgeFacei)
628 const label facei = mesh_.edgeFaces()[meshEdgei][edgeFacei];
631 mesh_.isInternalFace(facei)
632 ? -1 : pbMesh.patchID()[facei - mesh_.nInternalFaces()];
636 ownerOrigBoundaryEdgeNOrigFaces[ownerOrigBoundaryEdgei] ++;
645 ownerOrigBoundaryEdgeMeshEdge,
646 ownerOrigBoundaryEdgeNOrigFaces,
652 tmp<surfaceLabelField> tChanged =
658 forAll(ownerOrigBoundaryEdgeMeshEdge, ownerOrigBoundaryEdgei)
660 const label meshEdgei =
661 ownerOrigBoundaryEdgeMeshEdge[ownerOrigBoundaryEdgei];
663 const part& ownerOrigBoundaryEdgeP =
664 ownerOrigBoundaryEdgeParts[ownerOrigBoundaryEdgei];
666 switch (ownerOrigBoundaryEdgeNOrigFaces[ownerOrigBoundaryEdgei])
677 label origFacei = -1, origPatchi = -1, origPatchFacei = -1;
678 forAll(mesh_.edgeFaces()[meshEdgei], edgeFacei)
680 const label facei = mesh_.edgeFaces()[meshEdgei][edgeFacei];
683 mesh_.isInternalFace(facei)
684 ? -1 : pbMesh.patchID()[facei - mesh_.nInternalFaces()];
690 origPatchFacei = facei - pbMesh[
patchi].start();
698 SfSf.boundaryFieldRef()[origPatchi][origPatchFacei];
700 CfSf.boundaryFieldRef()[origPatchi][origPatchFacei];
703 mesh_.faces()[origFacei].edgeDirection
705 ownerOrigBoundaryMeshEdges[ownerOrigBoundaryEdgei]
708 part
p(area, centre);
711 ? ownerOrigBoundaryEdgeP
712 : -ownerOrigBoundaryEdgeP;
720 [origPatchi][origPatchFacei] =
label(1);
731 forAll(mesh_.edgeFaces()[meshEdgei], edgeFacei)
733 const label facei = mesh_.edgeFaces()[meshEdgei][edgeFacei];
736 mesh_.isInternalFace(facei)
737 ? -1 : pbMesh.patchID()[facei - mesh_.nInternalFaces()];
744 const label patchFacei =
750 : SfSf.boundaryFieldRef()[
patchi][patchFacei];
754 : CfSf.boundaryFieldRef()[
patchi][patchFacei];
757 mesh_.faces()[facei].edgeDirection
759 ownerOrigBoundaryMeshEdges[ownerOrigBoundaryEdgei]
762 part
p(area, centre);
765 ? ownerOrigBoundaryEdgeP
766 : -ownerOrigBoundaryEdgeP;
771 if (debug &&
patchi != -1)
784 <<
"Boundary is not manifold"
794 tChanged->boundaryField();
799 changedBf.boundaryNeighbourField()
802 bool synchronised =
true;
809 if (!isA<processorFvPatch>(changedPf.patch()))
continue;
811 forAll(changedPf, patchFacei)
813 if (changedPf[patchFacei] != changedNbrPf[patchFacei])
816 changedPf.patch().start() + patchFacei;
819 <<
"Face not synchronised with centre at "
820 << mesh_.faceCentres()[facei] <<
endl;
822 synchronised =
false;
836 void Foam::fvMeshStitcher::stabiliseOrigPatchFaces
843 const labelList allOrigPatchIDs = ncb.allOrigPatchIDs();
845 forAll(allOrigPatchIDs, i)
847 const label origPatchi = allOrigPatchIDs[i];
848 const polyPatch& origPp = mesh_.boundaryMesh()[origPatchi];
850 forAll(origPp, origPatchFacei)
854 SfBf[origPatchi][origPatchFacei],
855 CfBf[origPatchi][origPatchFacei]
860 small*origPp.faceAreas()[origPatchFacei],
861 origPp.faceCentres()[origPatchFacei]
866 SfBf[origPatchi][origPatchFacei] =
p.area;
867 CfBf[origPatchi][origPatchFacei] =
p.centre;
873 void Foam::fvMeshStitcher::intersectNonConformalCyclics
878 const bool haveTopology
881 const polyBoundaryMesh& pbMesh = mesh_.boundaryMesh();
884 const labelList ownerOrigPatchIDs = ncb.ownerOrigPatchIDs();
891 List<List<part>> patchEdgeParts(mesh_.boundary().size());
892 forAll(ownerOrigPatchIDs, i)
894 const label origPatchi = ownerOrigPatchIDs[i];
896 patchEdgeParts[origPatchi].resize
898 mesh_.boundaryMesh()[origPatchi].nEdges(),
906 tmp<surfaceLabelField::Boundary> tOrigFacesNbrBf;
907 tmp<surfaceVectorField::Boundary> tOrigSfNbrBf;
908 tmp<surfaceVectorField::Boundary> tOrigCfNbrBf;
917 dimensioned<label>(
dimless, -1)
925 const fvPatch& fvp = mesh_.boundary()[
patchi];
927 if (!isA<nonConformalFvPatch>(fvp))
continue;
929 const nonConformalFvPatch& ncFvp =
930 refCast<const nonConformalFvPatch>(fvp);
932 origFaces.boundaryFieldRef()[
patchi] =
933 polyFacesBf[
patchi] - ncFvp.origPatch().start();
934 origSf.boundaryFieldRef()[
patchi] =
936 origCf.boundaryFieldRef()[
patchi] =
944 origFaces.boundaryField().boundaryNeighbourField()
950 origSf.boundaryField().boundaryNeighbourField()
956 origCf.boundaryField().boundaryNeighbourField()
964 if (Cfp.patch().coupled())
966 const transformer& t =
967 refCast<const coupledFvPatch>(Cfp.patch())
969 t.invTransform(Cfp, Cfp);
970 t.transformPosition(Cfp, Cfp);
978 const fvPatch& fvp = mesh_.boundary()[
patchi];
980 if (!isA<nonConformalCyclicFvPatch>(fvp))
continue;
982 const nonConformalCyclicFvPatch& nccFvp =
983 refCast<const nonConformalCyclicFvPatch>(fvp);
985 if (!nccFvp.owner())
continue;
987 intersectNonConformalCyclic
996 patchEdgeParts[nccFvp.origPatchID()]
1001 List<part> ownerOrigBoundaryEdgeParts =
1002 calculateOwnerOrigBoundaryEdgeParts(patchEdgeParts);
1006 forAll(ownerOrigPatchIDs, i)
1008 const label origPatchi = ownerOrigPatchIDs[i];
1009 const polyPatch& origPatch = pbMesh[origPatchi];
1011 const labelList& origPatchEdgeOwnerOrigBoundaryEdges =
1012 ncb.patchEdgeOwnerOrigBoundaryEdges(origPatchi);
1014 forAll(patchEdgeParts[origPatchi], origPatchEdgei)
1016 const label ownerOrigBoundaryEdgei =
1017 origPatchEdgeOwnerOrigBoundaryEdges[origPatchEdgei];
1020 patchEdgeParts[origPatchi][origPatchEdgei];
1021 errorP -= ownerOrigBoundaryEdgeParts[ownerOrigBoundaryEdgei];
1023 forAll(origPatch.edgeFaces()[origPatchEdgei], patchEdgeFacei)
1025 const label patchFacei =
1026 origPatch.edgeFaces()[origPatchEdgei][patchEdgeFacei];
1030 SfBf[origPatchi][patchFacei],
1031 CfBf[origPatchi][patchFacei]
1035 SfBf[origPatchi][patchFacei] =
p.area;
1036 CfBf[origPatchi][patchFacei] =
p.centre;
1042 applyOwnerOrigBoundaryEdgeParts(SfSf, CfSf, ownerOrigBoundaryEdgeParts);
1045 stabiliseOrigPatchFaces(SfBf, CfBf);
1049 template<
class NonConformalFvPatch>
1050 inline void Foam::fvMeshStitcher::createNonConformalStabilisationGeometry
1066 if (!isA<NonConformalFvPatch>(fvp))
continue;
1069 refCast<const nonConformalFvPatch>(fvp).origPatch().patch();
1091 bool result =
false;
1097 if (!isA<nonConformalFvPatch>(fvp))
continue;
1100 mesh_.magSf().boundaryField()[
patchi];
1103 refCast<const nonConformalFvPatch>(fvp).origPatch().patch();
1111 if (
max(magSfp/origMagSfp) > rootSmall)
1131 (small*
sqr(
cbrt(mesh_.V())))()
1142 <<
"Can only compute volume conservation error for this time, or "
1149 n == 0 ? mesh_.time().deltaT() : mesh_.time().deltaT0();
1178 if (isA<nonConformalFvPatch>(mesh_.boundary()[
patchi]))
1198 const bool changing,
1199 const bool geometric
1202 if (!stitches() || (changing && !mesh_.dynamic()))
1208 const bool coupled =
Pstream::parRun() || !mesh_.time().processorCase();
1210 if (coupled && geometric)
1222 preConformSurfaceFields();
1229 conformCorrectMeshPhi(phi);
1238 resizePatchFields<VolField>();
1239 resizePatchFields<SurfaceField>();
1242 mesh_.deltaCoeffs();
1244 if (coupled && geometric)
1247 Info<<
indent <<
"Cell min/avg/max openness = "
1250 for (
label i = 0; mesh_.moving() && i <= mesh_.phi().nOldTimes(); ++ i)
1254 for (
label j = 0; j < i; ++ j)
Info<<
"old-";
1255 Info<< (i ?
"time " :
"") <<
"volume conservation error = "
1262 if (coupled && geometric)
1270 meshObjects::topoChange<fvMesh>(mesh_, map);
1271 meshObjects::topoChange<lduMesh>(mesh_, map);
1273 const_cast<Time&
>(mesh_.time()).functionObjects().topoChange(map);
1281 const bool changing,
1282 const bool geometric,
1286 if (!stitches() || (changing && !mesh_.dynamic()))
1292 const bool coupled =
Pstream::parRun() || !mesh_.time().processorCase();
1302 bool haveTopology =
false;
1314 haveTopology =
true;
1319 if (coupled && (geometric || !haveTopology))
1325 if (!isA<nonConformalCyclicFvPatch>(fvp))
continue;
1328 refCast<const nonConformalCyclicFvPatch>(fvp);
1330 if (!nccFvp.
owner())
continue;
1336 if (coupled && (geometric || !haveTopology))
1346 if (coupled && (geometric || !haveTopology))
1349 intersectNonConformalCyclics(polyFacesBf, Sf, Cf, haveTopology);
1353 createNonConformalStabilisationGeometry<nonConformalErrorFvPatch>
1364 createNonConformalStabilisationGeometry<nonConformalFvPatch>
1376 createNonConformalCorrectMeshPhiGeometry(polyFacesBf, Sf, Cf);
1383 unconformCorrectMeshPhi(polyFacesBf, Sf, Cf, phi);
1384 mesh_.unconform(polyFacesBf, Sf, Cf, phi);
1388 mesh_.unconform(polyFacesBf, Sf, Cf);
1392 resizePatchFields<VolField>();
1393 resizePatchFields<SurfaceField>();
1401 postNonConformSurfaceFields();
1407 evaluateVolFields();
1410 postNonConformSurfaceVelocities();
1414 mesh_.deltaCoeffs();
1416 if (coupled && geometric)
1419 Info<<
indent <<
"Cell min/avg/max openness = "
1422 for (
label i = 0; mesh_.moving() && i <= mesh_.phi().nOldTimes(); ++ i)
1426 for (
label j = 0; j < i; ++ j)
Info<<
"old-";
1427 Info<< (i ?
"time " :
"") <<
"volume conservation error = "
1439 mesh_.phi().boundaryField()
1444 label nNonProcPatches = 0;
1449 if (!isA<processorFvPatch>(fvp))
1451 if (nNonProcPatches !=
patchi)
1454 <<
"Processor patches do not follow non-processor "
1465 scalarField sumMfe(nNonProcPatches, 0), nSumMfe(nNonProcPatches, 0);
1471 const label nccPatchi =
1472 isA<nonConformalCyclicFvPatch>(fvp)
1473 ? refCast<const nonConformalCyclicFvPatch>(fvp)
1475 : isA<nonConformalProcessorCyclicFvPatch>(fvp)
1476 ? refCast<const nonConformalProcessorCyclicFvPatch>(fvp)
1480 if (nccPatchi != -1)
1502 isA<nonConformalCyclicFvPatch>(fvp)
1503 && refCast<const nonConformalCyclicFvPatch>(fvp).owner()
1508 <<
" min/avg/max mesh flux error = " << minMfe[
patchi]
1516 if (coupled && (geometric || !haveTopology))
1524 meshObjects::topoChange<fvMesh>(mesh_, map);
1525 meshObjects::topoChange<lduMesh>(mesh_, map);
1527 const_cast<Time&
>(mesh_.time()).functionObjects().topoChange(map);
1535 if (mesh_.conformal() || geometric == this->geometric())
1558 intersectNonConformalCyclics(polyFacesBf, Sf, Cf,
true);
1562 createNonConformalStabilisationGeometry<nonConformalErrorFvPatch>
1573 createNonConformalStabilisationGeometry<nonConformalFvPatch>
1582 mesh_.unconform(polyFacesBf, Sf, Cf);
1585 mesh_.deltaCoeffs();
1590 meshObjects::topoChange<fvMesh>(mesh_, map);
1591 meshObjects::topoChange<lduMesh>(mesh_, map);
1593 const_cast<Time&
>(mesh_.time()).functionObjects().topoChange(map);
#define forAll(list, i)
Loop across all elements in list.
static nonConformalBoundary & New(const polyMesh &mesh)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static const DimensionedField< Type, GeoMesh > & null()
Return a null DimensionedField.
Generic GeometricBoundaryField class.
tmp< GeometricBoundaryField > boundaryNeighbourField() const
Return BoundaryField of the values on the other side of couples.
void reset(const GeometricBoundaryField< Type, PatchField, GeoMesh > &)
Reset the boundary field contents to the given field.
Generic GeometricField class.
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &)
Return a temporary field constructed from name,.
static const GeometricField< Type, PatchField, GeoMesh > & null()
Return a null geometric field.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
fileName objectPath(const bool global) const
Return complete path + object name including the processor.
virtual const fileName & name() const
Return the name of the stream.
A list of faces which address into the list of points.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static bool & parRun()
Is this a parallel run?
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
label size() const
Return the number of elements in the UPtrList.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
static int compare(const edge &, const edge &)
Compare edges.
Mesh manipulator that uses the intersection provided by the cyclic non-conformal poly patches to crea...
virtual bool disconnect(const bool changing, const bool geometric)
Disconnect the mesh by removing faces from the nonConformalCyclics.
virtual void updateMesh(const polyTopoChangeMap &)
Update local data for topology changes.
virtual bool connect(const bool changing, const bool geometric, const bool load)
Connect the mesh by adding faces into the nonConformalCyclics.
void reconnect(const bool geometric) const
Re-compute the connection. Topology is preserved. Permits a change.
bool geometric() const
Is the connection "geometric", or has the topology just been.
fvMeshStitcher(fvMesh &)
Construct from fvMesh.
virtual void movePoints()
Update local data for mesh motion.
bool stitches() const
Does this stitcher do anything?
tmp< DimensionedField< scalar, volMesh > > openness() const
Return the non-dimensional cell openness for debugging/checking.
patchToPatches::intersection::part part
Alias the patchToPatch intersection part struct.
tmp< DimensionedField< scalar, volMesh > > volumeConservationError(const label n) const
Return the non-dimensional old-time volume conservation error.
patchToPatches::intersection::couple couple
Alias the patchToPatch intersection couple struct.
virtual ~fvMeshStitcher()
Destructor.
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
label index() const
Return the index of this patch in the fvBoundaryMesh.
virtual const word & name() const
Return name.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
A patch is a list of labels that address the faces in the global face list.
const vectorField::subField faceAreas() const
Return face areas.
label start() const
Return start label of this patch in the polyMesh face list.
const vectorField::subField faceCentres() const
Return face centres.
const scalarField::subField magFaceAreas() const
Return face area magnitudes.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for managing temporary objects.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField.
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar c
Speed of light in a vacuum.
tmp< VolField< Type > > surfaceSum(const SurfaceField< Type > &ssf)
void surfaceIntegrate(Field< Type > &ivf, const SurfaceField< Type > &ssf)
bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist as a file in the file system?
const fileOperation & fileHandler()
Get current file handler.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
List< label > labelList
A List of labels.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
dimensionedScalar sign(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
const dimensionSet dimless
SurfaceField< label > surfaceLabelField
vectorField pointField
pointField is a vectorField.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
List< bool > boolList
Bool container classes.
vector point
Point is a vector.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
Vector< scalar > vector
A scalar version of the templated Vector.
fvsPatchField< label > fvsPatchLabelField
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
edge meshEdge(const PrimitivePatch< FaceList, PointField > &p, const label edgei)
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensionSet cmptMag(const dimensionSet &)
Type gAverage(const FieldField< Field, Type > &f)
dimensionedScalar cbrt(const dimensionedScalar &ds)
Type gMin(const FieldField< Field, Type > &f)
static const label labelMax
SurfaceField< vector > surfaceVectorField
Ostream & indent(Ostream &os)
Indent stream.
fvsPatchField< vector > fvsPatchVectorField
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Type gMax(const FieldField< Field, Type > &f)
Operator to apply a binary operation to a pair of lists.
Return the vol-field velocity corresponding to a given surface-field velocity.