Removed unneeded lib dependency from mdInitialise
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticNonLinULSolidFoam / moveMeshInverseDistance.H
blob5fe78a0420400ed67bec97ff7c090ada8aefdb4d
1 //--------------------------------------------------//
2 //- move mesh
3 //--------------------------------------------------//
4 // if(min(J.internalField()) > 0)
5   {
6     Info << "Move solid mesh using inverse distance interpolation" << endl;
7     
8     // Create point mesh
9     pointMesh pMesh(mesh);
11     // Create point interpolation
12     volPointInterpolation pointInterpolation(mesh);
13     
14     wordList types
15       (
16         pMesh.boundary().size(),
17         calculatedFvPatchVectorField::typeName
18         );
20     pointVectorField pointDU
21       (
22        IOobject
23        (
24         "pointDU",
25         runTime.timeName(),
26         mesh
27         ),
28        pMesh,
29        dimensionedVector("zero", dimLength, vector::zero),
30        types
31        );
33     // Calculate mesh points displacement
34     pointInterpolation.interpolate(DU, pointDU);
36     //- correct edge interpolation
37     //- this is the stuff from edgeCorrectedVolPointInterpolation but
38     //- that class no longer works
39     #   include "performEdgeCorrectedVolPointInterpolation.H"
41     const vectorField& pointDUI =
42       pointDU.internalField();
44     //- see the effect of correctBCs
46     // Move mesh
47     vectorField newPoints = mesh.allPoints();
48     
49      forAll (pointDUI, pointI)
50        {
51         newPoints[pointI] += pointDUI[pointI];
52       }
53   
54     twoDPointCorrector twoDCorrector(mesh);
55     twoDCorrector.correctPoints(newPoints);
56     mesh.movePoints(newPoints);
57     mesh.V00();
58     mesh.moving(false);
59   }
60 //   else
61 //     {
62 //       FatalErrorIn(args.executable())
63 //      << "Negative Jacobian"
64 //      << exit(FatalError);
65 //     }