38 #include <HashTable.H>
45 const faceList& faces = cMesh_.faces();
54 scalar minDet = GREAT;
60 if (cMesh_.isInternalFace(facei))
66 vector Cf = cMesh_.faceCentres()[facei];
71 wf2[i] = 1/magSqr(df[i]);
74 addToG = addToG * wf2[i];
83 if (mag(G.xx()) < SMALL)
88 if (mag(G.yy()) < SMALL)
93 if (mag(G.zz()) < SMALL)
99 if (cellDim != cMesh_.nGeometricD())
102 <<
"face " << facei <<
" with center "
103 << cMesh_.faceCentres()[facei] << nl
104 <<
" connected to cells with dimensions " << cellDim
105 <<
" less then geometric " << cMesh_.nGeometricD()
107 Pout <<
"Degenerate face: " << facei << endl;
157 Pout <<
"Min determinant : " << minDet << endl;
158 Pout <<
"Total # of deg. faces: " << nDegFaces << endl;
163 if (Pstream::parRun())
171 label nCorCells = -1;
175 forAll(ownCellCenters, iProcPatch)
180 forAll(ownCellCenters[iProcPatch], iFace)
182 ownCellCenters[iProcPatch][iFace].resize
190 corCellCenters[iProcPatch][iFace].resize
195 forAll(ownCellCenters[iProcPatch][iFace], iCell)
198 ownCellCenters[iProcPatch][iFace][iCell] = cMesh_.C()[cellId];
206 PstreamBuffers pBuffers(Pstream::commsTypes::nonBlocking);
213 UOPstream oProcStr(procId, pBuffers);
214 oProcStr << ownCellCenters[iProcPair];
218 pBuffers.finishedSends();
225 UIPstream iProcStr(procId, pBuffers);
226 iProcStr >> neiCellCenters[iProcPair];
235 PstreamBuffers pBuffers(Pstream::commsTypes::nonBlocking);
243 UOPstream oProcStr(procId, pBuffers);
251 locCc[iCell] = cMesh_.C()[cellId];
259 pBuffers.finishedSends();
266 UIPstream iProcStr(procId, pBuffers);
268 List<vector> corCc (iProcStr);
272 const List<Triple<label> > & addr =
corAddr_[iCorProc];
279 patchNo = addr[iCell][0];
280 faceNo = addr[iCell][1];
281 cellNo = addr[iCell][2];
283 corCellCenters[patchNo][faceNo][cellNo] = corCc[iCell];
302 const label iProcPatchId =
procPairs_[iProcPatch];
303 const fvPatch& fvp = cMesh_.boundary()[iProcPatchId];
305 label nFaceCells = 0;
307 forAll(ownCellCenters[iProcPatch], facei)
309 nFaceCells =
corEnd_[iProcPatch][facei] + 1;
311 List<vector> df (nFaceCells, vector::zero);
312 List<scalar> wf2(nFaceCells, 0.0);
316 forAll(ownCellCenters[iProcPatch][facei], i)
318 df[i] = ownCellCenters[iProcPatch][facei][i] - fvp.Cf()[facei];
319 wf2[i] = 1/magSqr(df[i]);
320 symmTensor addToG(0);
322 addToG = addToG * wf2[i];
327 forAll(neiCellCenters[iProcPatch][facei], i)
329 df[k] = neiCellCenters[iProcPatch][facei][i] - fvp.Cf()[facei];
330 wf2[k] = 1/magSqr(df[k]);
331 symmTensor addToG(0);
333 addToG = addToG * wf2[k];
339 forAll(corCellCenters[iProcPatch][facei], i)
341 df[l] = corCellCenters[iProcPatch][facei][i] - fvp.Cf()[facei];
342 wf2[l] = 1/magSqr(df[l]);
343 symmTensor addToG(0);
345 addToG = addToG * wf2[l];
370 if (mag(G.xx()) < SMALL)
375 if (mag(G.yy()) < SMALL)
380 if (mag(G.zz()) < SMALL)
387 if (cellDim != cMesh_.nGeometricD())
390 <<
"face " << facei <<
" with center "
391 << fvp.Cf()[facei] << nl
392 <<
" connected to cells with dimensions " << cellDim
393 <<
" less then geometric " << cMesh_.nGeometricD()
List< DynamicList< label > > procDegFaces_
void calculateWeights()
Compute weights for least squares scheme for gradient calculation.
labelHashTable< label > corProcIds_
List2< label > corCellIds_
List2< Triple< label > > corAddr_
List3< label > myProcPatchCells_
labelListList neighbourCells_
DynamicList< label > internalDegFaces_