@@ -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
@@ -2170,6 +2179,13 @@ std::vector<adaption::Info> PatchKernel::_partitioningPrepare(const std::unorder
21702179 }
21712180
21722181 // Fill tracking data structures
2182+ partitioningData.emplace_back ();
2183+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
2184+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
2185+ partitioningVertexInfo.type = adaption::TYPE_PARTITION_SEND;
2186+ partitioningVertexInfo.rank = recvRank;
2187+ partitioningVertexInfo.previous = getOrderedCellsVertices (cellsToSend, true , false );
2188+
21732189 partitioningData.emplace_back ();
21742190 adaption::Info &partitioningCellInfo = partitioningData.back ();
21752191 partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -2418,6 +2434,15 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_deleteGhosts(bool tr
24182434
24192435 // Track changes
24202436 if (trackPartitioning) {
2437+ partitioningData.emplace_back ();
2438+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
2439+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
2440+ partitioningVertexInfo.type = adaption::TYPE_DELETION;
2441+ partitioningVertexInfo.current .reserve (getGhostVertexCount ());
2442+ for (VertexConstIterator itr = ghostVertexConstBegin (); itr != ghostVertexConstEnd (); ++itr) {
2443+ partitioningVertexInfo.current .push_back (itr.getId ());
2444+ }
2445+
24212446 partitioningData.emplace_back ();
24222447 adaption::Info &partitioningCellInfo = partitioningData.back ();
24232448 partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -2868,6 +2893,13 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_sendCells(const std:
28682893 // two processes are able to exchange cell data without additional
28692894 // communications (they already know the list of cells for which
28702895 // data is needed and the order in which these data will be sent).
2896+ partitioningData.emplace_back ();
2897+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
2898+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
2899+ partitioningVertexInfo.type = adaption::TYPE_PARTITION_SEND;
2900+ partitioningVertexInfo.rank = recvRank;
2901+ partitioningVertexInfo.current = getOrderedCellsVertices (cellSendList, true , false );
2902+
28712903 partitioningData.emplace_back ();
28722904 adaption::Info &partitioningCellInfo = partitioningData.back ();
28732905 partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -3147,6 +3179,16 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_sendCells(const std:
31473179 cellCreationInfo.type = adaption::TYPE_CREATION;
31483180 cellCreationInfo.rank = getRank ();
31493181 cellCreationInfo.current = getOrderedCellsVertices (trackedCreatedGhostCells, false , true );
3182+
3183+ std::vector<long > deletedGhostVertices = getOrderedCellsVertices (trackedCreatedGhostCells, false , true );
3184+ if (!deletedGhostVertices.empty ()) {
3185+ partitioningData.emplace_back ();
3186+ adaption::Info &vertexCreationInfo = partitioningData.back ();
3187+ vertexCreationInfo.entity = adaption::ENTITY_VERTEX;
3188+ vertexCreationInfo.type = adaption::TYPE_CREATION;
3189+ vertexCreationInfo.rank = getRank ();
3190+ vertexCreationInfo.current = std::move (deletedGhostVertices);
3191+ }
31503192 }
31513193
31523194 // Delete frame cells that are not ghosts
@@ -3245,11 +3287,43 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_sendCells(const std:
32453287 // Prune stale interfaces
32463288 pruneStaleInterfaces ();
32473289
3290+ // Identify orphan vertices
3291+ std::vector<long > orphanVertices = findOrphanVertices ();
3292+
3293+ // Track ghost vertices deletion
3294+ //
3295+ // Only ghost vertices need to be tracked, all orphan internal vertex
3296+ // have already been tracked among the vertices that have been send.
3297+ if (trackPartitioning && !orphanVertices.empty ()) {
3298+ partitioningData.emplace_back ();
3299+ adaption::Info &vertexDeletionInfo = partitioningData.back ();
3300+ vertexDeletionInfo.entity = adaption::ENTITY_VERTEX;
3301+ vertexDeletionInfo.type = adaption::TYPE_DELETION;
3302+ vertexDeletionInfo.rank = getRank ();
3303+ for (long vertexId : orphanVertices) {
3304+ const Vertex &vertex = getVertex (vertexId);
3305+ if (vertex.isInterior ()) {
3306+ continue ;
3307+ }
3308+
3309+ vertexDeletionInfo.current .push_back (vertexId);
3310+ }
3311+ }
3312+
32483313 // Delete orphan vertices
3249- deleteOrphanVertices ( );
3314+ deleteVertices (orphanVertices );
32503315 } else {
32513316 // All ghost cells will be deleted
32523317 if (trackPartitioning) {
3318+ partitioningData.emplace_back ();
3319+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
3320+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
3321+ partitioningVertexInfo.type = adaption::TYPE_DELETION;
3322+ partitioningVertexInfo.current .reserve (getGhostVertexCount ());
3323+ for (VertexConstIterator itr = ghostVertexConstBegin (); itr != ghostVertexConstEnd (); ++itr) {
3324+ partitioningVertexInfo.current .push_back (itr.getId ());
3325+ }
3326+
32533327 partitioningData.emplace_back ();
32543328 adaption::Info &partitioningCellInfo = partitioningData.back ();
32553329 partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -3905,6 +3979,13 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_receiveCells(const s
39053979 // Track changes
39063980 if (trackPartitioning) {
39073981 if (!trackedReceivedInteriorCells.empty ()) {
3982+ partitioningData.emplace_back ();
3983+ adaption::Info &vertexRecvInfo = partitioningData.back ();
3984+ vertexRecvInfo.entity = adaption::ENTITY_VERTEX;
3985+ vertexRecvInfo.type = adaption::TYPE_PARTITION_RECV;
3986+ vertexRecvInfo.rank = sendRank;
3987+ vertexRecvInfo.current = getOrderedCellsVertices (trackedReceivedInteriorCells, true , false );
3988+
39083989 partitioningData.emplace_back ();
39093990 adaption::Info &cellRecvInfo = partitioningData.back ();
39103991 cellRecvInfo.entity = adaption::ENTITY_CELL;
@@ -3915,6 +3996,14 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_receiveCells(const s
39153996 }
39163997
39173998 if (!trackedCreatedGhostCells.empty ()) {
3999+ partitioningData.emplace_back ();
4000+ adaption::Info &vertexCreationInfo = partitioningData.back ();
4001+ vertexCreationInfo.entity = adaption::ENTITY_VERTEX;
4002+ vertexCreationInfo.type = adaption::TYPE_CREATION;
4003+ vertexCreationInfo.rank = patchRank;
4004+ vertexCreationInfo.current = getOrderedCellsVertices (trackedCreatedGhostCells, false , true );
4005+
4006+
39184007 partitioningData.emplace_back ();
39194008 adaption::Info &cellCreationInfo = partitioningData.back ();
39204009 cellCreationInfo.entity = adaption::ENTITY_CELL;
0 commit comments