2012-09-11 15:42:55 +00:00
|
|
|
//--------------------------------------------------//
|
|
|
|
//- move mesh
|
|
|
|
//--------------------------------------------------//
|
2013-10-11 13:31:14 +00:00
|
|
|
// if(min(J.internalField()) > 0)
|
2015-05-17 14:25:35 +00:00
|
|
|
{
|
2012-09-11 15:42:55 +00:00
|
|
|
Info << "Move solid mesh using inverse distance interpolation" << endl;
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
// Create point mesh
|
|
|
|
pointMesh pMesh(mesh);
|
|
|
|
|
|
|
|
// Create point interpolation
|
|
|
|
volPointInterpolation pointInterpolation(mesh);
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
wordList types
|
2015-05-17 14:25:35 +00:00
|
|
|
(
|
2012-09-11 15:42:55 +00:00
|
|
|
pMesh.boundary().size(),
|
|
|
|
calculatedFvPatchVectorField::typeName
|
2015-05-17 14:25:35 +00:00
|
|
|
);
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
pointVectorField pointDU
|
2015-05-17 14:25:35 +00:00
|
|
|
(
|
2013-10-11 13:31:14 +00:00
|
|
|
IOobject
|
|
|
|
(
|
2015-05-17 14:25:35 +00:00
|
|
|
"pointDU",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh
|
|
|
|
),
|
2013-10-11 13:31:14 +00:00
|
|
|
pMesh,
|
|
|
|
dimensionedVector("zero", dimLength, vector::zero),
|
|
|
|
types
|
2015-05-17 14:25:35 +00:00
|
|
|
);
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
// Calculate mesh points displacement
|
|
|
|
pointInterpolation.interpolate(DU, pointDU);
|
|
|
|
|
|
|
|
//- correct edge interpolation
|
|
|
|
//- this is the stuff from edgeCorrectedVolPointInterpolation but
|
|
|
|
//- that class no longer works
|
2015-05-17 14:25:35 +00:00
|
|
|
# include "performEdgeCorrectedVolPointInterpolation.H"
|
2012-09-11 15:42:55 +00:00
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
const vectorField& pointDUI =
|
2015-05-17 14:25:35 +00:00
|
|
|
pointDU.internalField();
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
//- see the effect of correctBCs
|
|
|
|
|
|
|
|
// Move mesh
|
|
|
|
vectorField newPoints = mesh.allPoints();
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2015-05-17 14:25:35 +00:00
|
|
|
forAll (pointDUI, pointI)
|
|
|
|
{
|
|
|
|
newPoints[pointI] += pointDUI[pointI];
|
|
|
|
}
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
twoDPointCorrector twoDCorrector(mesh);
|
|
|
|
twoDCorrector.correctPoints(newPoints);
|
|
|
|
mesh.movePoints(newPoints);
|
|
|
|
mesh.V00();
|
|
|
|
mesh.moving(false);
|
2015-05-17 14:25:35 +00:00
|
|
|
}
|
2013-10-11 13:31:14 +00:00
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// FatalErrorIn(args.executable())
|
2015-05-17 15:11:30 +00:00
|
|
|
// << "Negative Jacobian"
|
|
|
|
// << exit(FatalError);
|
2013-10-11 13:31:14 +00:00
|
|
|
// }
|