Fixing indentation in applications/solvers/solidMechanics
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticPlasticNonLinULSolidFoam / calculateExtrapolationVectors.H
blob8c4451f73312b6fe9e4ea84e7f959ef73c373902
1 //void Foam::edgeCorrectedVolPointInterpolation::makeExtrapolationWeights() const
2 //{
3 // Interpolation:
4 // For each point to be corrected calculate the extrapolated value
5 // for each face around it and combine them using the inverse
6 // distance weighting factors
8 //const labelList& ptc = boundaryPoints();
10 // Calculate the correction vectors
12 //extrapolationVectorsPtr_ =
13 //  new FieldField<Field, vector>(ptc.size());
14 //FieldField<Field, vector>& extraVecs = *extrapolationVectorsPtr_;
15 FieldField<Field, vector> extraVecs(ptc.size());
18     const labelListList& pfaces = mesh.pointFaces();
20     const volVectorField& centres = mesh.C();
22     const fvBoundaryMesh& bm = mesh.boundary();
24     forAll (ptc, pointI)
25     {
26         const label curPoint = ptc[pointI];
28         const labelList& curFaces = pfaces[curPoint];
30         // extraVecs.hook(new vectorField(curFaces.size())); //- no hook function
31         extraVecs.set
32         (
33             pointI,
34             new vectorField(curFaces.size())
35         );
37         vectorField& curExtraVectors = extraVecs[pointI];
39         label nFacesAroundPoint = 0;
41         const vector& pointLoc = mesh.points()[curPoint];
43         // Go through all the faces
44         forAll (curFaces, faceI)
45         {
46             if (!mesh.isInternalFace(curFaces[faceI]))
47             {
48                 // This is a boundary face.  If not in the empty patch
49                 // or coupled calculate the extrapolation vector
50                 label patchID =
51                     mesh.boundaryMesh().whichPatch(curFaces[faceI]);
53                 if
54                 (
55                     !isA<emptyFvPatch>(bm[patchID]) && !bm[patchID].coupled()
56                 )
57                 {
58                     // Found a face for extrapolation
59                     curExtraVectors[nFacesAroundPoint] =
60                         pointLoc
61                       - centres.boundaryField()[patchID]
62                         [bm[patchID].patch().whichFace(curFaces[faceI])];
64                     nFacesAroundPoint++;
65                 }
66             }
67         }
69         curExtraVectors.setSize(nFacesAroundPoint);
70     }