2012-09-11 15:42:55 +00:00
|
|
|
//--------------------------------------------------//
|
|
|
|
//- move mesh
|
|
|
|
//--------------------------------------------------//
|
|
|
|
if(min(J.internalField()) > 0)
|
2013-07-18 01:43:15 +00:00
|
|
|
{
|
2012-09-11 15:42:55 +00:00
|
|
|
Info << "Move solid mesh using inverse distance interpolation" << endl;
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
// Create point mesh
|
|
|
|
pointMesh pMesh(mesh);
|
|
|
|
|
|
|
|
// Create point interpolation
|
|
|
|
volPointInterpolation pointInterpolation(mesh);
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
wordList types
|
2013-07-18 01:43:15 +00:00
|
|
|
(
|
|
|
|
pMesh.boundary().size(),
|
|
|
|
//fixedValueFvPatchVectorField::typeName
|
|
|
|
calculatedFvPatchVectorField::typeName
|
|
|
|
);
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
pointVectorField pointDU
|
2013-07-18 01:43:15 +00:00
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"pointDU",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh
|
|
|
|
),
|
|
|
|
pMesh,
|
|
|
|
dimensionedVector("zero", dimLength, vector::zero),
|
|
|
|
types
|
|
|
|
);
|
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
|
|
|
|
# include "performEdgeCorrectedVolPointInterpolation.H"
|
|
|
|
|
|
|
|
//pointDU.write();
|
|
|
|
|
2013-07-18 01:43:15 +00:00
|
|
|
const vectorField& pointDUI = pointDU.internalField();
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
// Move mesh
|
|
|
|
vectorField newPoints = mesh.allPoints();
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2013-07-18 01:43:15 +00:00
|
|
|
forAll (pointDUI, pointI)
|
|
|
|
{
|
|
|
|
newPoints[pointI] += pointDUI[pointI];
|
|
|
|
}
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
twoDPointCorrector twoDCorrector(mesh);
|
|
|
|
twoDCorrector.correctPoints(newPoints);
|
|
|
|
mesh.movePoints(newPoints);
|
|
|
|
mesh.V00();
|
|
|
|
mesh.moving(false);
|
2013-07-18 01:43:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FatalErrorIn(args.executable())
|
|
|
|
<< "Negative Jacobian"
|
|
|
|
<< exit(FatalError);
|
|
|
|
}
|