fvMeshStitcher: Standardise mesh change hooks

This commit is contained in:
Will Bainbridge
2023-08-24 12:10:45 +01:00
parent 075c358fb9
commit ba416ac909
3 changed files with 37 additions and 18 deletions

View File

@ -1329,6 +1329,11 @@ void Foam::fvMesh::topoChange(const polyTopoChangeMap& map)
const_cast<Time&>(time()).functionObjects().topoChange(map);
if (stitcher_.valid())
{
stitcher_->topoChange(map);
}
if (topoChanger_.valid())
{
topoChanger_->topoChange(map);
@ -1365,6 +1370,7 @@ void Foam::fvMesh::mapMesh(const polyMeshMap& map)
const_cast<Time&>(time()).functionObjects().mapMesh(map);
stitcher_->mapMesh(map);
topoChanger_->mapMesh(map);
distributor_->mapMesh(map);
mover_->mapMesh(map);
@ -1390,6 +1396,7 @@ void Foam::fvMesh::distribute(const polyDistributionMap& map)
const_cast<Time&>(time()).functionObjects().distribute(map);
stitcher_->distribute(map);
topoChanger_->distribute(map);
distributor_->distribute(map);
mover_->distribute(map);
@ -1714,6 +1721,11 @@ bool Foam::fvMesh::writeObject
ok = ok && V0Ptr_->write(write);
}
if (stitcher_.valid())
{
stitcher_->write(write);
}
if (topoChanger_.valid())
{
topoChanger_->write(write);

View File

@ -1185,14 +1185,6 @@ bool Foam::fvMeshStitcher::stitches() const
}
void Foam::fvMeshStitcher::updateMesh(const polyTopoChangeMap&)
{}
void Foam::fvMeshStitcher::movePoints()
{}
bool Foam::fvMeshStitcher::disconnect
(
const bool changing,
@ -1596,4 +1588,16 @@ void Foam::fvMeshStitcher::reconnect(const bool geometric) const
}
void Foam::fvMeshStitcher::topoChange(const polyTopoChangeMap&)
{}
void Foam::fvMeshStitcher::mapMesh(const polyMeshMap&)
{}
void Foam::fvMeshStitcher::distribute(const polyDistributionMap&)
{}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -375,21 +375,15 @@ public:
//- Does this stitcher do anything?
bool stitches() const;
//- Update local data for topology changes
virtual void updateMesh(const polyTopoChangeMap&);
//- Update local data for mesh motion
virtual void movePoints();
//- Disconnect the mesh by removing faces from the nonConformalCyclics
virtual bool disconnect
bool disconnect
(
const bool changing,
const bool geometric
);
//- Connect the mesh by adding faces into the nonConformalCyclics
virtual bool connect
bool connect
(
const bool changing,
const bool geometric,
@ -400,7 +394,16 @@ public:
// in whether or not the connection is "geometric".
void reconnect(const bool geometric) const;
//- Write the mover state
//- Update corresponding to the given map
virtual void topoChange(const polyTopoChangeMap&);
//- Update from another mesh using the given map
virtual void mapMesh(const polyMeshMap&);
//- Update corresponding to the given distribution map
virtual void distribute(const polyDistributionMap&);
//- Write the stitcher state
virtual bool write(const bool write = true) const
{
return true;