2012-09-11 15:42:55 +00:00
|
|
|
//void Foam::edgeCorrectedVolPointInterpolation::makeExtrapolationWeights() const
|
|
|
|
//{
|
|
|
|
// Interpolation:
|
|
|
|
// For each point to be corrected calculate the extrapolated value
|
|
|
|
// for each face around it and combine them using the inverse
|
|
|
|
// distance weighting factors
|
|
|
|
|
|
|
|
//const labelList& ptc = boundaryPoints();
|
|
|
|
|
|
|
|
// Calculate the correction vectors
|
|
|
|
|
|
|
|
//extrapolationVectorsPtr_ =
|
|
|
|
// new FieldField<Field, vector>(ptc.size());
|
|
|
|
//FieldField<Field, vector>& extraVecs = *extrapolationVectorsPtr_;
|
|
|
|
FieldField<Field, vector> extraVecs(ptc.size());
|
|
|
|
|
|
|
|
{
|
2013-10-11 13:31:14 +00:00
|
|
|
const labelListList& pfaces = mesh.pointFaces();
|
2012-09-11 15:42:55 +00:00
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
const volVectorField& centres = mesh.C();
|
2012-09-11 15:42:55 +00:00
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
const fvBoundaryMesh& bm = mesh.boundary();
|
2012-09-11 15:42:55 +00:00
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
forAll (ptc, pointI)
|
2012-09-11 15:42:55 +00:00
|
|
|
{
|
2013-10-11 13:31:14 +00:00
|
|
|
const label curPoint = ptc[pointI];
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
const labelList& curFaces = pfaces[curPoint];
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
// extraVecs.hook(new vectorField(curFaces.size())); //- no hook function
|
|
|
|
extraVecs.set
|
|
|
|
(
|
|
|
|
pointI,
|
|
|
|
new vectorField(curFaces.size())
|
|
|
|
);
|
|
|
|
|
|
|
|
vectorField& curExtraVectors = extraVecs[pointI];
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
label nFacesAroundPoint = 0;
|
|
|
|
|
|
|
|
const vector& pointLoc = mesh.points()[curPoint];
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
// Go through all the faces
|
|
|
|
forAll (curFaces, faceI)
|
|
|
|
{
|
|
|
|
if (!mesh.isInternalFace(curFaces[faceI]))
|
|
|
|
{
|
|
|
|
// This is a boundary face. If not in the empty patch
|
|
|
|
// or coupled calculate the extrapolation vector
|
|
|
|
label patchID =
|
|
|
|
mesh.boundaryMesh().whichPatch(curFaces[faceI]);
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
if
|
|
|
|
(
|
|
|
|
!isA<emptyFvPatch>(bm[patchID])
|
|
|
|
&& !bm[patchID].coupled()
|
|
|
|
)
|
|
|
|
{
|
|
|
|
// Found a face for extrapolation
|
|
|
|
curExtraVectors[nFacesAroundPoint] =
|
|
|
|
pointLoc
|
|
|
|
- centres.boundaryField()[patchID]
|
|
|
|
[bm[patchID].patch().whichFace(curFaces[faceI])];
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
nFacesAroundPoint++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
curExtraVectors.setSize(nFacesAroundPoint);
|
2012-09-11 15:42:55 +00:00
|
|
|
}
|
2013-10-11 13:31:14 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
}
|