mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: solidBodyMotionFvMesh - correct parallel running after commit f3f82ff
This commit is contained in:
@ -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_))
|
||||
|
||||
@ -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_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user