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 << "Moving mesh using least squares interpolation" << endl;
|
|
|
|
|
|
|
|
leastSquaresVolPointInterpolation pointInterpolation(stressMesh);
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
// Create point mesh
|
|
|
|
pointMesh pMesh(stressMesh);
|
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(),
|
|
|
|
calculatedFvPatchVectorField::typeName
|
|
|
|
);
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
pointVectorField pointDU
|
2013-07-18 01:43:15 +00:00
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"pointDU",
|
|
|
|
runTime.timeName(),
|
|
|
|
stressMesh
|
2012-09-11 15:42:55 +00:00
|
|
|
),
|
2013-07-18 01:43:15 +00:00
|
|
|
pMesh,
|
|
|
|
dimensionedVector("zero", dimLength, vector::zero),
|
|
|
|
types
|
|
|
|
);
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
pointInterpolation.interpolate(DU, pointDU);
|
|
|
|
|
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 = stressMesh.allPoints();
|
|
|
|
|
|
|
|
forAll (pointDUI, pointI)
|
2013-07-18 01:43:15 +00:00
|
|
|
{
|
2012-09-11 15:42:55 +00:00
|
|
|
newPoints[pointI] += pointDUI[pointI];
|
2013-07-18 01:43:15 +00:00
|
|
|
}
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
twoDPointCorrector twoDCorrector(stressMesh);
|
|
|
|
twoDCorrector.correctPoints(newPoints);
|
|
|
|
stressMesh.movePoints(newPoints);
|
|
|
|
stressMesh.V00();
|
|
|
|
stressMesh.moving(false);
|
|
|
|
}
|
|
|
|
else
|
2013-07-18 01:43:15 +00:00
|
|
|
{
|
2012-09-11 15:42:55 +00:00
|
|
|
FatalErrorIn(args.executable())
|
2013-07-18 01:43:15 +00:00
|
|
|
<< "Negative Jacobian"
|
|
|
|
<< exit(FatalError);
|
|
|
|
}
|