40 #include <HashTable.H>
47 const faceList& faces = cMesh_.faces();
56 scalar minDet = GREAT;
62 if (cMesh_.isInternalFace(facei))
68 vector Cf = cMesh_.faceCentres()[facei];
73 wf2[i] = 1/magSqr(df[i]);
76 addToG = addToG * wf2[i];
85 if (mag(G.xx()) < SMALL)
90 if (mag(G.yy()) < SMALL)
95 if (mag(G.zz()) < SMALL)
101 if (cellDim != cMesh_.nGeometricD())
104 <<
"face " << facei <<
" with center "
105 << cMesh_.faceCentres()[facei] << nl
106 <<
" connected to cells with dimensions " << cellDim
107 <<
" less then geometric " << cMesh_.nGeometricD()
109 Pout <<
"Degenerate face: " << facei << endl;
159 Pout <<
"Min determinant : " << minDet << endl;
160 Pout <<
"Total # of deg. faces: " << nDegFaces << endl;
165 if (Pstream::parRun())
173 label nCorCells = -1;
177 forAll(ownCellCenters, iProcPatch)
182 forAll(ownCellCenters[iProcPatch], iFace)
184 ownCellCenters[iProcPatch][iFace].resize
192 corCellCenters[iProcPatch][iFace].resize
197 forAll(ownCellCenters[iProcPatch][iFace], iCell)
200 ownCellCenters[iProcPatch][iFace][iCell] = cMesh_.C()[cellId];
208 PstreamBuffers pBuffers(Pstream::commsTypes::nonBlocking);
215 UOPstream oProcStr(procId, pBuffers);
216 oProcStr << ownCellCenters[iProcPair];
220 pBuffers.finishedSends();
227 UIPstream iProcStr(procId, pBuffers);
228 iProcStr >> neiCellCenters[iProcPair];
237 PstreamBuffers pBuffers(Pstream::commsTypes::nonBlocking);
245 UOPstream oProcStr(procId, pBuffers);
253 locCc[iCell] = cMesh_.C()[cellId];
261 pBuffers.finishedSends();
268 UIPstream iProcStr(procId, pBuffers);
270 List<vector> corCc (iProcStr);
274 const List<Triple<label> > & addr =
corAddr_[iCorProc];
281 patchNo = addr[iCell][0];
282 faceNo = addr[iCell][1];
283 cellNo = addr[iCell][2];
285 corCellCenters[patchNo][faceNo][cellNo] = corCc[iCell];
304 const label iProcPatchId =
procPairs_[iProcPatch];
305 const fvPatch& fvp = cMesh_.boundary()[iProcPatchId];
307 label nFaceCells = 0;
309 forAll(ownCellCenters[iProcPatch], facei)
311 nFaceCells =
corEnd_[iProcPatch][facei] + 1;
313 List<vector> df (nFaceCells, vector::zero);
314 List<scalar> wf2(nFaceCells, 0.0);
318 forAll(ownCellCenters[iProcPatch][facei], i)
320 df[i] = ownCellCenters[iProcPatch][facei][i] - fvp.Cf()[facei];
321 wf2[i] = 1/magSqr(df[i]);
322 symmTensor addToG(0);
324 addToG = addToG * wf2[i];
329 forAll(neiCellCenters[iProcPatch][facei], i)
331 df[k] = neiCellCenters[iProcPatch][facei][i] - fvp.Cf()[facei];
332 wf2[k] = 1/magSqr(df[k]);
333 symmTensor addToG(0);
335 addToG = addToG * wf2[k];
341 forAll(corCellCenters[iProcPatch][facei], i)
343 df[l] = corCellCenters[iProcPatch][facei][i] - fvp.Cf()[facei];
344 wf2[l] = 1/magSqr(df[l]);
345 symmTensor addToG(0);
347 addToG = addToG * wf2[l];
372 if (mag(G.xx()) < SMALL)
377 if (mag(G.yy()) < SMALL)
382 if (mag(G.zz()) < SMALL)
389 if (cellDim != cMesh_.nGeometricD())
392 <<
"face " << facei <<
" with center "
393 << fvp.Cf()[facei] << nl
394 <<
" connected to cells with dimensions " << cellDim
395 <<
" 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_