BUGFIX: Uninitialised member variables
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticOrthoNonLinULSolidFoam / moveMeshLeastSquares.H
blob2928b55e7e5132e94714510327de7234b1fd1f27
1 //--------------------------------------------------//
2 //- move mesh
3 //--------------------------------------------------//
4 // if(min(J.internalField()) > 0)
5   {
6     Info << "Moving mesh using least squares interpolation" << endl;
8     leastSquaresVolPointInterpolation pointInterpolation(mesh);
9   
10     // Create point mesh
11     pointMesh pMesh(mesh);
12     
13     wordList types
14       (
15        pMesh.boundary().size(),
16        calculatedFvPatchVectorField::typeName
17        );
18     
19     pointVectorField pointDU
20       (
21        IOobject
22        (
23         "pointDU",
24         runTime.timeName(),
25         mesh
26         ),
27        pMesh,
28        dimensionedVector("zero", dimLength, vector::zero),
29        types
30        );
31     
32     pointInterpolation.interpolate(DU, pointDU);
34     const vectorField& pointDUI =
35       pointDU.internalField();
37     //- Move mesh
38     vectorField newPoints = mesh.allPoints();
40     forAll (pointDUI, pointI)
41       {
42         newPoints[pointI] += pointDUI[pointI];
43       }
45     twoDPointCorrector twoDCorrector(mesh);
46     twoDCorrector.correctPoints(newPoints);
47     mesh.movePoints(newPoints);
48     mesh.V00();
49     mesh.moving(false);
50   }
51   // else
52   //   {
53   //     FatalErrorIn(args.executable())
54   //    << "Negative Jacobian"
55   //    << exit(FatalError);
56   //   }