53 "volPointInterpolate(" +
psi.name() +
')',
73 scalar
phi[4], phiCandidate[4];
74 label tetLabelCandidate[2], tetPointLabels[2];
81 const vector& cellCentre = this->pMesh_.cellCentres()[cellI];
82 const labelList& cellFaces = this->pMesh_.cells()[cellI];
84 vector projection = position - cellCentre;
92 bool foundTet =
false;
93 label closestFace = -1;
94 scalar minDistance = GREAT;
98 label nFace = cellFaces[faceI];
103 const vector& faceCentreTmp = this->pMeshFaceCentres_[nFace];
105 scalar multiplierNumerator = (faceCentreTmp - cellCentre) &
normal;
106 scalar multiplierDenominator = projection &
normal;
110 if (
mag(multiplierDenominator) > SMALL)
112 scalar multiplier = multiplierNumerator/multiplierDenominator;
113 vector iPoint = cellCentre + multiplier*projection;
114 scalar dist =
mag(position - iPoint);
116 if (dist < minDistance)
131 if (closestFace != -1)
133 label nFace = closestFace;
151 if (minDistance < 1.0
e-5)
154 for (
label i=0; i<4; i++)
156 phi[i] = phiCandidate[i];
158 tetPointLabels[0] = tetLabelCandidate[0];
159 tetPointLabels[1] = tetLabelCandidate[1];
172 while (faceI < cellFaces.
size() && !foundTet)
174 label nFace = cellFaces[faceI];
175 if (nFace < this->pMeshFaceAreas_.size())
198 if (minDistance < 1.0
e-3)
201 for (
label i=0; i<4; i++)
203 phi[i] = phiCandidate[i];
205 tetPointLabels[0] = tetLabelCandidate[0];
206 tetPointLabels[1] = tetLabelCandidate[1];
217 for (
label i=0; i<2; i++)
219 ts[i] = psip_[tetPointLabels[i]];
222 if (closestFace < psis_.size())
224 ts[2] = psis_[closestFace];
229 this->pMesh_.boundaryMesh().whichPatch(closestFace);
233 if (this->psi_.boundaryField()[patchI].size())
237 this->pMesh_.boundaryMesh()[patchI].whichFace
245 ts[2] = this->psi_[cellI];
249 ts[3] = this->psi_[cellI];
261 Info<<
"interpolationCellPointFace<Type>::interpolate"
262 <<
"(const vector&, const label cellI) const : "
263 <<
"search failed; using closest cellFace value" <<
endl
264 <<
"cell number " << cellI <<
tab
265 <<
"position " << position <<
endl;
267 if (closestFace < psis_.size())
269 t = psis_[closestFace];
274 this->pMesh_.boundaryMesh().whichPatch(closestFace);
278 if (this->psi_.boundaryField()[patchI].size())
280 t = this->psi_.boundaryField()[patchI]
282 this->pMesh_.boundaryMesh()[patchI].whichFace
290 t = this->psi_[cellI];
297 bool foundTriangle = findTriangle
308 for (
label i=0; i<2; i++)
310 Type vel = psip_[tetPointLabels[i]];
315 if (faceI < psis_.size())
317 t +=
phi[2]*psis_[faceI];
321 label patchI = this->pMesh_.boundaryMesh().whichPatch(faceI);
325 if (this->psi_.boundaryField()[patchI].size())
328 [this->pMesh_.boundaryMesh()[patchI].whichFace(faceI)];
332 t +=
phi[2]*this->psi_[cellI];
339 if (faceI < psis_.size())
345 label patchI = this->pMesh_.boundaryMesh().whichPatch(faceI);
349 if (this->psi_.boundaryField()[patchI].size())
352 [this->pMesh_.boundaryMesh()[patchI].whichFace(faceI)];
356 t = this->psi_[cellI];