This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/calculateExtrapolationVectors.H

74 lines
1.8 KiB
C
Raw Normal View History

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());
{
const labelListList& pfaces = mesh.pointFaces();
2012-09-11 15:42:55 +00:00
const volVectorField& centres = mesh.C();
2012-09-11 15:42:55 +00:00
const fvBoundaryMesh& bm = mesh.boundary();
2012-09-11 15:42:55 +00:00
forAll (ptc, pointI)
2012-09-11 15:42:55 +00:00
{
const label curPoint = ptc[pointI];
const labelList& curFaces = pfaces[curPoint];
// extraVecs.hook(new vectorField(curFaces.size())); //- no hook function
extraVecs.set
(
pointI,
new vectorField(curFaces.size())
);
vectorField& curExtraVectors = extraVecs[pointI];
label nFacesAroundPoint = 0;
const vector& pointLoc = mesh.points()[curPoint];
// 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]);
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])];
nFacesAroundPoint++;
}
}
}
curExtraVectors.setSize(nFacesAroundPoint);
2012-09-11 15:42:55 +00:00
}
2012-09-11 15:42:55 +00:00
}