polyMesh: Changed topoChanging -> topoChanged

The topoChanged flag now indicates that the mesh topology has changed at the
start of the current time-step rather than it is changing during the run, for
subsequent time-steps without topology change it is set false until the next
topology change.
This commit is contained in:
Henry Weller
2022-06-10 12:01:28 +01:00
parent 63ef6f59cf
commit d54f5ab9ad
16 changed files with 31 additions and 31 deletions

View File

@ -98,7 +98,7 @@ int main(int argc, char *argv[])
// same divergence
tmp<volScalarField> divU;
if (correctPhi && mesh.topoChanging())
if (correctPhi && mesh.topoChanged())
{
// Construct and register divU for mapping
divU = new volScalarField

View File

@ -100,7 +100,7 @@ int main(int argc, char *argv[])
(
correctPhi
&& !isType<twoPhaseChangeModels::noPhaseChange>(phaseChange)
&& mesh.topoChanging()
&& mesh.topoChanged()
)
{
// Construct and register divU for correctPhi

View File

@ -105,7 +105,7 @@ int main(int argc, char *argv[])
// has the same divergence
tmp<volScalarField> divU;
if (correctPhi && mesh.topoChanging())
if (correctPhi && mesh.topoChanged())
{
// Construct and register divU for mapping
divU = new volScalarField

View File

@ -192,7 +192,7 @@ int main(int argc, char *argv[])
mesh.moving(false);
mesh.topoChanging(false);
mesh.topoChanged(false);
label action = rndGen.sampleAB<label>(0, 6);
@ -293,7 +293,7 @@ int main(int argc, char *argv[])
Info<< nl<< "-- Mesh : moving:" << mesh.moving()
<< " topoChanging:" << mesh.topoChanging()
<< " topoChanged:" << mesh.topoChanged()
<< " changing:" << mesh.changing()
<< endl;

View File

@ -288,7 +288,7 @@ Foam::polyMesh::polyMesh(const IOobject& io)
),
globalMeshDataPtr_(nullptr),
moving_(false),
topoChanging_(false),
topoChanged_(false),
curMotionTimeIndex_(-1),
oldPointsPtr_(nullptr),
oldCellCentresPtr_(nullptr),
@ -472,7 +472,7 @@ Foam::polyMesh::polyMesh
),
globalMeshDataPtr_(nullptr),
moving_(false),
topoChanging_(false),
topoChanged_(false),
curMotionTimeIndex_(-1),
oldPointsPtr_(nullptr),
oldCellCentresPtr_(nullptr),
@ -626,7 +626,7 @@ Foam::polyMesh::polyMesh
),
globalMeshDataPtr_(nullptr),
moving_(false),
topoChanging_(false),
topoChanged_(false),
curMotionTimeIndex_(-1),
oldPointsPtr_(nullptr),
oldCellCentresPtr_(nullptr),

View File

@ -180,7 +180,7 @@ private:
bool moving_;
//- Is the mesh topology changing
bool topoChanging_;
bool topoChanged_;
//- Current time index for mesh motion
mutable label curMotionTimeIndex_;
@ -529,23 +529,23 @@ public:
}
//- Is mesh topology changing
bool topoChanging() const
bool topoChanged() const
{
return topoChanging_;
return topoChanged_;
}
//- Set the mesh topology to be changing
bool topoChanging(const bool c)
bool topoChanged(const bool c)
{
bool c0 = topoChanging_;
topoChanging_ = c;
bool c0 = topoChanged_;
topoChanged_ = c;
return c0;
}
//- Is mesh changing (topology changing and/or moving)
bool changing() const
{
return moving()||topoChanging();
return moving()||topoChanged();
}
//- Move points, returns volumes swept by faces in motion

View File

@ -519,7 +519,7 @@ Foam::polyMesh::polyMesh
),
globalMeshDataPtr_(nullptr),
moving_(false),
topoChanging_(false),
topoChanged_(false),
curMotionTimeIndex_(-1),
oldPointsPtr_(nullptr),
oldCellCentresPtr_(nullptr),
@ -808,7 +808,7 @@ Foam::polyMesh::polyMesh
),
globalMeshDataPtr_(nullptr),
moving_(false),
topoChanging_(false),
topoChanged_(false),
curMotionTimeIndex_(-1),
oldPointsPtr_(nullptr),
oldCellCentresPtr_(nullptr),

View File

@ -1754,7 +1754,7 @@ Foam::autoPtr<Foam::polyDistributionMap> Foam::fvMeshDistribute::distribute
const labelList& distribution
)
{
const bool topoChanging = mesh_.topoChanging();
const bool topoChanged = mesh_.topoChanged();
// Some checks on distribution
if (distribution.size() != mesh_.nCells())
@ -3013,9 +3013,9 @@ Foam::autoPtr<Foam::polyDistributionMap> Foam::fvMeshDistribute::distribute
mesh_.setInstance(mesh_.time().timeName());
// Reset the topoChanging state of the mesh
// Reset the topoChanged state of the mesh
// Distribution is not a topology change
mesh_.topoChanging(topoChanging);
mesh_.topoChanged(topoChanged);
// Print a bit
if (debug)

View File

@ -173,7 +173,7 @@ void Foam::points0MotionSolver::distribute
bool Foam::points0MotionSolver::write() const
{
if (mesh().topoChanging())
if (mesh().topoChanged())
{
points0_.instance() = mesh().time().timeName();
points0_.write();

View File

@ -3224,7 +3224,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
syncParallel
);
mesh.topoChanging(true);
mesh.topoChanged(true);
}
else
{
@ -3239,7 +3239,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
patchStarts,
syncParallel
);
mesh.topoChanging(true);
mesh.topoChanged(true);
}
// Clear out primitives

View File

@ -631,7 +631,7 @@ bool Foam::MRFZone::read(const dictionary& dict)
void Foam::MRFZone::update()
{
if (mesh_.topoChanging())
if (mesh_.topoChanged())
{
setMRFFaces();
}

View File

@ -389,7 +389,7 @@ void Foam::MRFZoneList::correctBoundaryVelocity(volVectorField& U) const
void Foam::MRFZoneList::update()
{
if (mesh_.topoChanging())
if (mesh_.topoChanged())
{
forAll(*this, i)
{

View File

@ -588,10 +588,10 @@ bool Foam::fvMesh::update()
deleteDemandDrivenData(V0Ptr_);
}
// Set topoChanging false before any mesh change
topoChanging(false);
// Set topoChanged false before any mesh change
topoChanged(false);
bool updated = topoChanger_->update();
topoChanging(updated);
topoChanged(updated);
// Register V0 for distribution
if (V0Ptr_)

View File

@ -80,7 +80,7 @@ bool Foam::fvMeshTopoChangers::list::update()
forAllIter(PtrDictionary<fvMeshTopoChanger>, list_, iter)
{
updated = iter().update() || updated;
mesh().topoChanging(updated);
mesh().topoChanged(updated);
}
return updated;

View File

@ -63,7 +63,7 @@ bool Foam::fvMeshTopoChangers::raw::update()
Info<< "raw : Checking for topology changes..."
<< endl;
// Do any topology changes. Sets topoChanging (through polyTopoChange)
// Do any topology changes. Sets topoChanged (through polyTopoChange)
autoPtr<polyTopoChangeMap> topoChangeMap = topoChanger_.changeMesh(true);
bool hasChanged = topoChangeMap.valid();

View File

@ -1678,7 +1678,7 @@ void Foam::fvMeshTopoChangers::refiner::distribute
bool Foam::fvMeshTopoChangers::refiner::write(const bool write) const
{
if (mesh().topoChanging())
if (mesh().topoChanged())
{
// Force refinement data to go to the current time directory.
const_cast<hexRef8&>(meshCutter_).setInstance(mesh().time().timeName());