@@ -1576,7 +1576,8 @@ std::vector<adaption::Info> PatchKernel::partitioningPrepare(MPI_Comm communicat
15761576
15771577 Information available on the sender side for tracking purposes are the
15781578 following:
1579- - internal cells that will be send.
1579+ - internal cells that will be send;
1580+ - internal vertices that will be send.
15801581
15811582 No information about tracking are provided on the receiver side.
15821583
@@ -1675,16 +1676,24 @@ std::vector<adaption::Info> PatchKernel::partitioningPrepare(const std::unordere
16751676 Information available on the sender side for tracking purposes are the
16761677 following:
16771678 - internal cells that have been sent;
1679+ - internal vertices that have been sent;
16781680 - new ghost cells that have been created (some of the internal cells that
16791681 have been sent may have become ghosts cells);
1680- - ghost cells that have been deleted.
1682+ - new ghost vertices that have been created (some of the internal vertices
1683+ that have been sent may have become ghosts vertices);
1684+ - ghost cells that have been deleted;
1685+ - ghost vertices that have been deleted.
16811686
16821687 Information available on the receiver side for tracking purposes are the
16831688 following:
16841689 - internal cells that have been received;
1690+ - internal vertices that have been received;
16851691 - new ghost cells that have been created;
1692+ - new ghost vertices that have been created;
16861693 - ghost cells that have been deleted (some ghost cells may have been
1687- replaced by internal cells that have just been received).
1694+ replaced by internal cells that have just been received);
1695+ - ghost vertices that have been deleted (some ghost vertices may have been
1696+ replaced by internal vertices that have just been received).
16881697
16891698 \param trackPartitioning if set to true the function will return the changes
16901699 done to the patch during the partitioning
@@ -2141,6 +2150,13 @@ std::vector<adaption::Info> PatchKernel::_partitioningPrepare(const std::unorder
21412150 }
21422151
21432152 // Fill tracking data structures
2153+ partitioningData.emplace_back ();
2154+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
2155+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
2156+ partitioningVertexInfo.type = adaption::TYPE_PARTITION_SEND;
2157+ partitioningVertexInfo.rank = recvRank;
2158+ partitioningVertexInfo.previous = getOrderedCellsVertices (cellsToSend, true , false );
2159+
21442160 partitioningData.emplace_back ();
21452161 adaption::Info &partitioningCellInfo = partitioningData.back ();
21462162 partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -2389,6 +2405,15 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_deleteGhosts(bool tr
23892405
23902406 // Track changes
23912407 if (trackPartitioning) {
2408+ partitioningData.emplace_back ();
2409+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
2410+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
2411+ partitioningVertexInfo.type = adaption::TYPE_DELETION;
2412+ partitioningVertexInfo.current .reserve (getGhostVertexCount ());
2413+ for (VertexConstIterator itr = ghostVertexConstBegin (); itr != ghostVertexConstEnd (); ++itr) {
2414+ partitioningVertexInfo.current .push_back (itr.getId ());
2415+ }
2416+
23922417 partitioningData.emplace_back ();
23932418 adaption::Info &partitioningCellInfo = partitioningData.back ();
23942419 partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -2839,6 +2864,13 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_sendCells(const std:
28392864 // two processes are able to exchange cell data without additional
28402865 // communications (they already know the list of cells for which
28412866 // data is needed and the order in which these data will be sent).
2867+ partitioningData.emplace_back ();
2868+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
2869+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
2870+ partitioningVertexInfo.type = adaption::TYPE_PARTITION_SEND;
2871+ partitioningVertexInfo.rank = recvRank;
2872+ partitioningVertexInfo.current = getOrderedCellsVertices (cellSendList, true , false );
2873+
28422874 partitioningData.emplace_back ();
28432875 adaption::Info &partitioningCellInfo = partitioningData.back ();
28442876 partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -3118,6 +3150,16 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_sendCells(const std:
31183150 cellCreationInfo.type = adaption::TYPE_CREATION;
31193151 cellCreationInfo.rank = getRank ();
31203152 cellCreationInfo.current = getOrderedCellsVertices (trackedCreatedGhostCells, false , true );
3153+
3154+ std::vector<long > deletedGhostVertices = getOrderedCellsVertices (trackedCreatedGhostCells, false , true );
3155+ if (!deletedGhostVertices.empty ()) {
3156+ partitioningData.emplace_back ();
3157+ adaption::Info &vertexCreationInfo = partitioningData.back ();
3158+ vertexCreationInfo.entity = adaption::ENTITY_VERTEX;
3159+ vertexCreationInfo.type = adaption::TYPE_CREATION;
3160+ vertexCreationInfo.rank = getRank ();
3161+ vertexCreationInfo.current = std::move (deletedGhostVertices);
3162+ }
31213163 }
31223164
31233165 // Delete frame cells that are not ghosts
@@ -3216,11 +3258,43 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_sendCells(const std:
32163258 // Prune stale interfaces
32173259 pruneStaleInterfaces ();
32183260
3261+ // Identify orphan vertices
3262+ std::vector<long > orphanVertices = findOrphanVertices ();
3263+
3264+ // Track ghost vertices deletion
3265+ //
3266+ // Only ghost vertices need to be tracked, all orphan internal vertex
3267+ // have already been tracked among the vertices that have been send.
3268+ if (trackPartitioning && !orphanVertices.empty ()) {
3269+ partitioningData.emplace_back ();
3270+ adaption::Info &vertexDeletionInfo = partitioningData.back ();
3271+ vertexDeletionInfo.entity = adaption::ENTITY_VERTEX;
3272+ vertexDeletionInfo.type = adaption::TYPE_DELETION;
3273+ vertexDeletionInfo.rank = getRank ();
3274+ for (long vertexId : orphanVertices) {
3275+ const Vertex &vertex = getVertex (vertexId);
3276+ if (vertex.isInterior ()) {
3277+ continue ;
3278+ }
3279+
3280+ vertexDeletionInfo.current .push_back (vertexId);
3281+ }
3282+ }
3283+
32193284 // Delete orphan vertices
3220- deleteOrphanVertices ( );
3285+ deleteVertices (orphanVertices );
32213286 } else {
32223287 // All ghost cells will be deleted
32233288 if (trackPartitioning) {
3289+ partitioningData.emplace_back ();
3290+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
3291+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
3292+ partitioningVertexInfo.type = adaption::TYPE_DELETION;
3293+ partitioningVertexInfo.current .reserve (getGhostVertexCount ());
3294+ for (VertexConstIterator itr = ghostVertexConstBegin (); itr != ghostVertexConstEnd (); ++itr) {
3295+ partitioningVertexInfo.current .push_back (itr.getId ());
3296+ }
3297+
32243298 partitioningData.emplace_back ();
32253299 adaption::Info &partitioningCellInfo = partitioningData.back ();
32263300 partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -3876,6 +3950,13 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_receiveCells(const s
38763950 // Track changes
38773951 if (trackPartitioning) {
38783952 if (!trackedReceivedInteriorCells.empty ()) {
3953+ partitioningData.emplace_back ();
3954+ adaption::Info &vertexRecvInfo = partitioningData.back ();
3955+ vertexRecvInfo.entity = adaption::ENTITY_VERTEX;
3956+ vertexRecvInfo.type = adaption::TYPE_PARTITION_RECV;
3957+ vertexRecvInfo.rank = sendRank;
3958+ vertexRecvInfo.current = getOrderedCellsVertices (trackedReceivedInteriorCells, true , false );
3959+
38793960 partitioningData.emplace_back ();
38803961 adaption::Info &cellRecvInfo = partitioningData.back ();
38813962 cellRecvInfo.entity = adaption::ENTITY_CELL;
@@ -3886,6 +3967,14 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_receiveCells(const s
38863967 }
38873968
38883969 if (!trackedCreatedGhostCells.empty ()) {
3970+ partitioningData.emplace_back ();
3971+ adaption::Info &vertexCreationInfo = partitioningData.back ();
3972+ vertexCreationInfo.entity = adaption::ENTITY_VERTEX;
3973+ vertexCreationInfo.type = adaption::TYPE_CREATION;
3974+ vertexCreationInfo.rank = patchRank;
3975+ vertexCreationInfo.current = getOrderedCellsVertices (trackedCreatedGhostCells, false , true );
3976+
3977+
38893978 partitioningData.emplace_back ();
38903979 adaption::Info &cellCreationInfo = partitioningData.back ();
38913980 cellCreationInfo.entity = adaption::ENTITY_CELL;
0 commit comments