createNonConformalCyclics: Corrected overwrite

The handling of existing constant/fvMesh/polyFaces data has been
corrected so that it no longer interferes with the construction
of a new couple.
This commit is contained in:
Will Bainbridge
2022-06-14 11:15:31 +01:00
parent cc4f63fbd6
commit da7286bc1d
4 changed files with 18 additions and 8 deletions

View File

@ -384,7 +384,7 @@ int main(int argc, char *argv[])
);
// Connect the mesh so that the new stitching topology gets written out
stitcher.connect(false, false);
stitcher.connect(false, false, false);
mesh.setInstance(runTime.timeName());

View File

@ -340,7 +340,7 @@ Foam::fvMesh::fvMesh(const IOobject& io, const bool changers)
}
// Stitch or Re-stitch if necessary
stitcher_->connect(false, changers);
stitcher_->connect(false, changers, true);
// Construct changers
if (changers)
@ -625,7 +625,7 @@ bool Foam::fvMesh::move()
curTimeIndex_ = time().timeIndex();
stitcher_->connect(true, true);
stitcher_->connect(true, true, false);
return moved;
}
@ -752,7 +752,7 @@ Foam::polyMesh::readUpdateState Foam::fvMesh::readUpdate()
if (stitcher_.valid() && state != polyMesh::UNCHANGED)
{
stitcher_->connect(false, false);
stitcher_->connect(false, false, true);
}
return state;

View File

@ -1149,7 +1149,8 @@ bool Foam::fvMeshStitcher::disconnect
bool Foam::fvMeshStitcher::connect
(
const bool changing,
const bool geometric
const bool geometric,
const bool load
)
{
if (!stitches() || (changing && !mesh_.dynamic()))
@ -1172,7 +1173,7 @@ bool Foam::fvMeshStitcher::connect
tmp<surfaceLabelField::Boundary> tOrigFacesNbrBf;
tmp<surfaceVectorField::Boundary> tOrigSfNbrBf;
tmp<surfaceVectorField::Boundary> tOrigCfNbrBf;
if (!changing)
if (load)
{
const IOobject polyFacesBfIO(mesh_.polyFacesBfIO(IOobject::MUST_READ));

View File

@ -369,10 +369,19 @@ public:
virtual void movePoints();
//- Disconnect the mesh by removing faces from the nonConformalCyclics
virtual bool disconnect(const bool changing, const bool geometric);
virtual bool disconnect
(
const bool changing,
const bool geometric
);
//- Connect the mesh by adding faces into the nonConformalCyclics
virtual bool connect(const bool changing, const bool geometric);
virtual bool connect
(
const bool changing,
const bool geometric,
const bool load
);
//- Write the mover state
virtual bool write(const bool write = true) const