Skip to content

Commit a443f55

Browse files
committed
patchkernel: add alteration flags to the data structures that will be squeezed
1 parent 563aff8 commit a443f55

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

src/patchkernel/patch_kernel.cpp

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -874,11 +874,6 @@ void PatchKernel::finalizeAlterations(bool squeezeStorage)
874874
// Flush interfaces data structures
875875
m_interfaces.flush();
876876

877-
// Squeeze the patch
878-
if (squeezeStorage) {
879-
squeeze();
880-
}
881-
882877
#if BITPIT_ENABLE_MPI==1
883878
// Update partitioning information
884879
bool partitioningInfoDirty = arePartitioningInfoDirty();
@@ -888,12 +883,12 @@ void PatchKernel::finalizeAlterations(bool squeezeStorage)
888883
#endif
889884

890885
// Clear alteration flags
886+
m_alteredCells.clear();
887+
m_alteredInterfaces.clear();
888+
889+
// Squeeze the patch
891890
if (squeezeStorage) {
892-
AlterationFlagsStorage().swap(m_alteredCells);
893-
AlterationFlagsStorage().swap(m_alteredInterfaces);
894-
} else {
895-
m_alteredCells.clear();
896-
m_alteredInterfaces.clear();
891+
squeeze();
897892
}
898893

899894
// Synchronize storage
@@ -5391,8 +5386,24 @@ bool PatchKernel::squeezeInterfaces()
53915386
*/
53925387
bool PatchKernel::squeeze()
53935388
{
5394-
bool status = squeezeVertices();
5389+
bool status = true;
5390+
5391+
// Alteration flags
5392+
if (m_alteredCells.empty()) {
5393+
AlterationFlagsStorage().swap(m_alteredCells);
5394+
}
5395+
5396+
if (m_alteredInterfaces.empty()) {
5397+
AlterationFlagsStorage().swap(m_alteredInterfaces);
5398+
}
5399+
5400+
// Vertices
5401+
status |= squeezeVertices();
5402+
5403+
// Cells
53955404
status |= squeezeCells();
5405+
5406+
// Interfaces
53965407
status |= squeezeInterfaces();
53975408

53985409
return status;

0 commit comments

Comments
 (0)