1 //--------------------------------------------------//
3 //--------------------------------------------------//
4 if(min(J.internalField()) > 0)
6 Info << "Moving mesh using least squares interpolation" << endl;
8 leastSquaresVolPointInterpolation pointInterpolation(stressMesh);
11 pointMesh pMesh(stressMesh);
15 pMesh.boundary().size(),
16 calculatedFvPatchVectorField::typeName
19 pointVectorField pointDU
28 dimensionedVector("zero", dimLength, vector::zero),
32 pointInterpolation.interpolate(DU, pointDU);
34 const vectorField& pointDUI =
35 pointDU.internalField();
38 vectorField newPoints = stressMesh.allPoints();
40 forAll (pointDUI, pointI)
42 newPoints[pointI] += pointDUI[pointI];
45 // Correct symmetryPlane points
47 forAll(stressMesh.boundaryMesh(), patchI)
49 if (isA<symmetryPolyPatch>(stressMesh.boundaryMesh()[patchI]))
51 const labelList& meshPoints =
52 stressMesh.boundaryMesh()[patchI].meshPoints();
55 gAverage(stressMesh.boundaryMesh()[patchI].pointNormals());
61 if (mag(avgN&i) > 0.95)
63 forAll(meshPoints, pI)
65 newPoints[meshPoints[pI]].x() = 0;
68 else if (mag(avgN&j) > 0.95)
70 forAll(meshPoints, pI)
72 newPoints[meshPoints[pI]].y() = 0;
75 else if (mag(avgN&k) > 0.95)
77 forAll(meshPoints, pI)
79 newPoints[meshPoints[pI]].z() = 0;
85 # include "calcUnusedNewPoints.H"
87 twoDPointCorrector twoDCorrector(stressMesh);
88 twoDCorrector.correctPoints(newPoints);
89 stressMesh.movePoints(newPoints);
91 stressMesh.moving(false);
95 FatalErrorIn(args.executable())
96 << "Negative Jacobian"