1 //--------------------------------------------------//
3 //--------------------------------------------------//
5 //Info << "Moving mesh using least squares interpolation" << endl;
7 leastSquaresVolPointInterpolation pointInterpolation(mesh);
10 pointMesh pMesh(mesh);
11 //pointMesh pMesh(mesh);
15 pMesh.boundary().size(),
16 calculatedFvPatchVectorField::typeName
19 pointVectorField pointDU
28 dimensionedVector("zero", dimLength, vector::zero),
32 pointInterpolation.interpolate(DU, pointDU);
36 const vectorField& pointDUI = pointDU.internalField();
39 //vectorField newPoints = mesh.allPoints();
40 pointVectorField newPoints
49 dimensionedVector("zero", dimLength, vector::zero)
52 newPoints.internalField() = mesh.allPoints();
54 // note: allPoints will have more points than pointDU
55 // if there are globalFaceZones
56 forAll (pointDUI, pointI)
58 newPoints[pointI] += pointDUI[pointI];
61 // Correct symmetryPlane points
63 forAll(mesh.boundaryMesh(), patchI)
65 if (isA<symmetryPolyPatch>(mesh.boundaryMesh()[patchI]))
67 const labelList& meshPoints =
68 mesh.boundaryMesh()[patchI].meshPoints();
71 gAverage(mesh.boundaryMesh()[patchI].pointNormals());
77 if (mag(avgN&i) > 0.95)
79 forAll(meshPoints, pI)
81 newPoints[meshPoints[pI]].x() = 0;
84 else if (mag(avgN&j) > 0.95)
86 forAll(meshPoints, pI)
88 newPoints[meshPoints[pI]].y() = 0;
91 else if (mag(avgN&k) > 0.95)
93 forAll(meshPoints, pI)
95 newPoints[meshPoints[pI]].z() = 0;
102 # include "calcUnusedNewPoints.H"
104 // // now we make sure processor patches are exactly the same
105 // newPoints.correctBoundaryConditions();
107 twoDPointCorrector twoDCorrector(mesh);
108 twoDCorrector.correctPoints(newPoints);
109 mesh.movePoints(newPoints);
114 n = mesh.Sf()/mesh.magSf();