mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: ensightWrite has out-of-date subMesh reference (fixes #2499)
- triggered with cell selections (especially with manifold cells). The ensightMesh was still holding an old subMesh reference.
This commit is contained in:
@ -138,25 +138,21 @@ bool Foam::functionObjects::ensightWrite::update()
|
||||
return false;
|
||||
}
|
||||
|
||||
// This is heavy-handed, but with a bounding-box limited sub-mesh,
|
||||
// we don't readily know if the updates affect the subsetted mesh.
|
||||
|
||||
// if (meshSubset_.hasSubMesh())
|
||||
// {
|
||||
// ensMesh_.clear();
|
||||
// meshSubset_.clear();
|
||||
// }
|
||||
// else if (ensMesh_)
|
||||
// {
|
||||
// ensMesh_->expire();
|
||||
// }
|
||||
|
||||
meshSubset_.clear();
|
||||
// Even if selection doesn't nominally change, a new subMesh is built.
|
||||
// Must update the reference for ensightMesh
|
||||
if (meshSubset_.hasSubMesh())
|
||||
{
|
||||
ensMesh_.clear();
|
||||
meshSubset_.clear();
|
||||
}
|
||||
// Probably not needed...
|
||||
/// else if (ensMesh_)
|
||||
/// {
|
||||
/// ensMesh_->expire();
|
||||
/// }
|
||||
|
||||
updateSubset(meshSubset_);
|
||||
|
||||
meshState_ = polyMesh::UNCHANGED;
|
||||
|
||||
if (!ensMesh_)
|
||||
{
|
||||
ensMesh_.reset(new ensightMesh(meshSubset_.mesh(), writeOpts_));
|
||||
@ -166,6 +162,7 @@ bool Foam::functionObjects::ensightWrite::update()
|
||||
ensMesh_->correct();
|
||||
}
|
||||
|
||||
meshState_ = polyMesh::UNCHANGED;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user