BUG: solidBodyMotionFvMesh - correct parallel running after commit f3f82ff

This commit is contained in:
andy
2014-04-09 09:12:46 +01:00
committed by Andrew Heather
parent f147a276ae
commit e71788f323
2 changed files with 24 additions and 17 deletions

View File

@ -76,6 +76,7 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
)
),
pointIDs_(),
moveAllCells_(false),
UName_(dynamicMeshCoeffs_.lookupOrDefault<word>("UName", "U"))
{
if (undisplacedPoints_.size() != nPoints())
@ -142,7 +143,14 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
cellIDs = set.toc();
}
if (cellIDs.size())
label nCells = returnReduce(cellIDs.size(), sumOp<label>());
moveAllCells_ = nCells == 0;
if (moveAllCells_)
{
Info<< "Applying solid body motion to entire mesh" << endl;
}
else
{
// collect point IDs of points in cell zone
@ -176,10 +184,6 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
pointIDs_.transfer(ptIDs);
}
else
{
Info<< "Applying solid body motion to entire mesh" << endl;
}
}
@ -195,7 +199,18 @@ bool Foam::solidBodyMotionFvMesh::update()
{
static bool hasWarned = false;
if (pointIDs_.size())
if (moveAllCells_)
{
fvMesh::movePoints
(
transform
(
SBMFPtr_().transformation(),
undisplacedPoints_
)
);
}
else
{
pointField transformedPts(undisplacedPoints_);
@ -208,17 +223,6 @@ bool Foam::solidBodyMotionFvMesh::update()
fvMesh::movePoints(transformedPts);
}
else
{
fvMesh::movePoints
(
transform
(
SBMFPtr_().transformation(),
undisplacedPoints_
)
);
}
if (foundObject<volVectorField>(UName_))

View File

@ -68,6 +68,9 @@ class solidBodyMotionFvMesh
//- Points to move when cell zone is supplied
labelList pointIDs_;
//- Flag to indicate whether all cells should move
bool moveAllCells_;
//- Name of velocity field
word UName_;