Fixed URL for libccmio-2.6.1 (bug report #5 by Thomas Oliveira)
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticNonLinULSolidFoam / moveMeshInverseDistance.H
blob7e415fd360bb15b1a0a6a7775ad2784620bc75e8
1 //--------------------------------------------------//
2 //- move mesh
3 //--------------------------------------------------//
4 // if(min(J.internalField()) > 0)
6     Info << "Move solid mesh using inverse distance interpolation" << endl;
8     // Create point mesh
9     pointMesh pMesh(mesh);
11     // Create point interpolation
12     volPointInterpolation pointInterpolation(mesh);
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();
49     forAll (pointDUI, pointI)
50     {
51         newPoints[pointI] += pointDUI[pointI];
52     }
54     twoDPointCorrector twoDCorrector(mesh);
55     twoDCorrector.correctPoints(newPoints);
56     mesh.movePoints(newPoints);
57     mesh.V00();
58     mesh.moving(false);
60 //   else
61 //     {
62 //       FatalErrorIn(args.executable())
63 //     << "Negative Jacobian"
64 //     << exit(FatalError);
65 //     }