From 4b2737673559f6b14a4b639c318b73430203921f Mon Sep 17 00:00:00 2001
From: Sebastian Eibl <sebastian.eibl@fau.de>
Date: Mon, 27 Jan 2020 15:13:54 +0100
Subject: [PATCH] renamed ParticleCopyNotification

ParticleCopyNotification into ParticleGhostCopyNotification
---
 python/mesa_pd/data/ParticleStorage.py        |   3 +-
 .../templates/mpi/SyncGhostOwners.templ.cpp   |   8 +-
 .../templates/mpi/SyncGhostOwners.templ.h     |   2 +-
 .../templates/mpi/SyncNextNeighbors.templ.cpp |   4 +-
 .../templates/mpi/SyncNextNeighbors.templ.h   |   2 +-
 .../mpi/notifications/ParseMessage.templ.h    |  10 +-
 .../ParticleGhostCopyNotification.templ.h     | 119 ++++++++++++++++++
 .../domain/BlockForestDataHandling.cpp        |  10 +-
 src/mesa_pd/mpi/SyncGhostOwners.cpp           |   8 +-
 src/mesa_pd/mpi/SyncGhostOwners.h             |   2 +-
 src/mesa_pd/mpi/SyncNextNeighbors.cpp         |   4 +-
 src/mesa_pd/mpi/SyncNextNeighbors.h           |   2 +-
 .../mpi/SyncNextNeighborsBlockForest.cpp      |   4 +-
 .../mpi/SyncNextNeighborsBlockForest.h        |   2 +-
 .../mpi/notifications/NotificationType.h      |   2 +-
 src/mesa_pd/mpi/notifications/ParseMessage.h  |  10 +-
 ...tion.h => ParticleGhostCopyNotification.h} |  16 +--
 17 files changed, 164 insertions(+), 44 deletions(-)
 create mode 100644 python/mesa_pd/templates/mpi/notifications/ParticleGhostCopyNotification.templ.h
 rename src/mesa_pd/mpi/notifications/{ParticleCopyNotification.h => ParticleGhostCopyNotification.h} (90%)

diff --git a/python/mesa_pd/data/ParticleStorage.py b/python/mesa_pd/data/ParticleStorage.py
index 5dd9d7703..d6bca7942 100644
--- a/python/mesa_pd/data/ParticleStorage.py
+++ b/python/mesa_pd/data/ParticleStorage.py
@@ -39,7 +39,8 @@ class ParticleStorage(Container):
       generateFile(path, 'mpi/notifications/ForceTorqueNotification.templ.h', context)
       generateFile(path, 'mpi/notifications/HeatFluxNotification.templ.h', context)
       generateFile(path, 'mpi/notifications/ParseMessage.templ.h', context)
-      generateFile(path, 'mpi/notifications/ParticleCopyNotification.templ.h', context)
+      #generateFile(path, 'mpi/notifications/ParticleCopyNotification.templ.h', context)
+      generateFile(path, 'mpi/notifications/ParticleGhostCopyNotification.templ.h', context)
       generateFile(path, 'mpi/notifications/NewGhostParticleNotification.templ.h', context)
       generateFile(path, 'mpi/notifications/ParticleMigrationNotification.templ.h', context)
       generateFile(path, 'mpi/notifications/ParticleRemoteMigrationNotification.templ.h', context)
diff --git a/python/mesa_pd/templates/mpi/SyncGhostOwners.templ.cpp b/python/mesa_pd/templates/mpi/SyncGhostOwners.templ.cpp
index da627c08a..24c4928f3 100644
--- a/python/mesa_pd/templates/mpi/SyncGhostOwners.templ.cpp
+++ b/python/mesa_pd/templates/mpi/SyncGhostOwners.templ.cpp
@@ -249,8 +249,8 @@ void SyncGhostOwners::checkAndResolveOverlap( data::ParticleStorage& ps,
             if( domain.intersectsWithProcessSubdomain( nbProcessRank, pIt->getPosition(), pIt->getInteractionRadius() + dx ) )
             {
                // no ghost there -> create ghost
-               WALBERLA_LOG_DETAIL( "Sending copy notification for body " << pIt->getUid() << " to process " << (nbProcessRank) << "\n master: " << pIt->getOwner());
-               packNotification(sb, ParticleCopyNotification( *pIt ));
+               WALBERLA_LOG_DETAIL( "Sending ghost copy notification for body " << pIt->getUid() << " to process " << (nbProcessRank) << "\n master: " << pIt->getOwner());
+               packNotification(sb, ParticleGhostCopyNotification( *pIt ));
                packNotification(sbMaster, NewGhostParticleNotification( *pIt, int_c(nbProcessRank) ));
                pIt->getNeighborStateRef().insert( int_c(nbProcessRank) );
             }
@@ -274,8 +274,8 @@ void SyncGhostOwners::checkAndResolveOverlap( data::ParticleStorage& ps,
             if( domain.intersectsWithProcessSubdomain( nbProcessRank, pIt->getPosition(), pIt->getInteractionRadius() + dx ) )
             {
                // no ghost there -> create ghost
-               WALBERLA_LOG_DETAIL( "Sending copy notification for body " << pIt->getUid() << " to process " << (nbProcessRank) << "\n master: " << pIt->getOwner());
-               packNotification(sb, ParticleCopyNotification( *pIt ));
+               WALBERLA_LOG_DETAIL( "Sending ghost copy notification for body " << pIt->getUid() << " to process " << (nbProcessRank) << "\n master: " << pIt->getOwner());
+               packNotification(sb, ParticleGhostCopyNotification( *pIt ));
                packNotification(sbMaster, NewGhostParticleNotification( *pIt, int_c(nbProcessRank) ));
                pIt->getNeighborStateRef().insert( int_c(nbProcessRank) );
             }
diff --git a/python/mesa_pd/templates/mpi/SyncGhostOwners.templ.h b/python/mesa_pd/templates/mpi/SyncGhostOwners.templ.h
index 9ae5d924d..8ec931a68 100644
--- a/python/mesa_pd/templates/mpi/SyncGhostOwners.templ.h
+++ b/python/mesa_pd/templates/mpi/SyncGhostOwners.templ.h
@@ -33,7 +33,7 @@
 #include <mesa_pd/mpi/notifications/NewGhostParticleNotification.h>
 #include <mesa_pd/mpi/notifications/PackNotification.h>
 #include <mesa_pd/mpi/notifications/ParseMessage.h>
-#include <mesa_pd/mpi/notifications/ParticleCopyNotification.h>
+#include <mesa_pd/mpi/notifications/ParticleGhostCopyNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemoteMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemovalInformationNotification.h>
diff --git a/python/mesa_pd/templates/mpi/SyncNextNeighbors.templ.cpp b/python/mesa_pd/templates/mpi/SyncNextNeighbors.templ.cpp
index 98a3fc09a..dcf86e8be 100644
--- a/python/mesa_pd/templates/mpi/SyncNextNeighbors.templ.cpp
+++ b/python/mesa_pd/templates/mpi/SyncNextNeighbors.templ.cpp
@@ -142,8 +142,8 @@ void SyncNextNeighbors::generateSynchronizationMessages(data::ParticleStorage& p
             {
                // no ghost there -> create ghost
                auto& buffer( bs.sendBuffer(nbProcessRank) );
-               WALBERLA_LOG_DETAIL( "Sending shadow copy notification for particle " << pIt->getUid() << " to process " << (nbProcessRank) );
-               packNotification(buffer, ParticleCopyNotification( *pIt ));
+               WALBERLA_LOG_DETAIL( "Sending ghost copy notification for particle " << pIt->getUid() << " to process " << (nbProcessRank) );
+               packNotification(buffer, ParticleGhostCopyNotification( *pIt ));
                pIt->getGhostOwnersRef().insert( int_c(nbProcessRank) );
             }
          }
diff --git a/python/mesa_pd/templates/mpi/SyncNextNeighbors.templ.h b/python/mesa_pd/templates/mpi/SyncNextNeighbors.templ.h
index 73cf82002..5c9402d4c 100644
--- a/python/mesa_pd/templates/mpi/SyncNextNeighbors.templ.h
+++ b/python/mesa_pd/templates/mpi/SyncNextNeighbors.templ.h
@@ -32,7 +32,7 @@
 #include <mesa_pd/domain/IDomain.h>
 #include <mesa_pd/mpi/notifications/PackNotification.h>
 #include <mesa_pd/mpi/notifications/ParseMessage.h>
-#include <mesa_pd/mpi/notifications/ParticleCopyNotification.h>
+#include <mesa_pd/mpi/notifications/ParticleGhostCopyNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemoteMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemovalNotification.h>
diff --git a/python/mesa_pd/templates/mpi/notifications/ParseMessage.templ.h b/python/mesa_pd/templates/mpi/notifications/ParseMessage.templ.h
index 69ea479ea..77af0197c 100644
--- a/python/mesa_pd/templates/mpi/notifications/ParseMessage.templ.h
+++ b/python/mesa_pd/templates/mpi/notifications/ParseMessage.templ.h
@@ -31,7 +31,7 @@
 #include <mesa_pd/domain/IDomain.h>
 #include <mesa_pd/mpi/notifications/NewGhostParticleNotification.h>
 #include <mesa_pd/mpi/notifications/NotificationType.h>
-#include <mesa_pd/mpi/notifications/ParticleCopyNotification.h>
+#include <mesa_pd/mpi/notifications/ParticleGhostCopyNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemoteMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemovalNotification.h>
@@ -66,11 +66,11 @@ void ParseMessage::operator()(int sender,
    rb >> notificationType;
 
    switch( notificationType ) {
-   case PARTICLE_COPY_NOTIFICATION: {
-      typename ParticleCopyNotification::Parameters objparam;
+   case PARTICLE_GHOST_COPY_NOTIFICATION: {
+      typename ParticleGhostCopyNotification::Parameters objparam;
       rb >> objparam;
 
-      WALBERLA_LOG_DETAIL( "Received PARTICLE_COPY_NOTIFICATION for particle " << objparam.uid << "from neighboring process with rank " << sender );
+      WALBERLA_LOG_DETAIL( "Received PARTICLE_GHOST_COPY_NOTIFICATION for particle " << objparam.uid << "from neighboring process with rank " << sender );
 
       if ( ps.find(objparam.uid) == ps.end() )
       {
@@ -85,7 +85,7 @@ void ParseMessage::operator()(int sender,
          WALBERLA_LOG_DETAIL("Ghost particle with id " << objparam.uid << " already existend.");
       }
 
-      WALBERLA_LOG_DETAIL( "Processed PARTICLE_COPY_NOTIFICATION for particle " << objparam.uid << "."  );
+      WALBERLA_LOG_DETAIL( "Processed PARTICLE_GHOST_COPY_NOTIFICATION for particle " << objparam.uid << "."  );
 
       break;
    }
diff --git a/python/mesa_pd/templates/mpi/notifications/ParticleGhostCopyNotification.templ.h b/python/mesa_pd/templates/mpi/notifications/ParticleGhostCopyNotification.templ.h
new file mode 100644
index 000000000..9fd397201
--- /dev/null
+++ b/python/mesa_pd/templates/mpi/notifications/ParticleGhostCopyNotification.templ.h
@@ -0,0 +1,119 @@
+//======================================================================================================================
+//
+//  This file is part of waLBerla. waLBerla is free software: you can
+//  redistribute it and/or modify it under the terms of the GNU General Public
+//  License as published by the Free Software Foundation, either version 3 of
+//  the License, or (at your option) any later version.
+//
+//  waLBerla is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+//  for more details.
+//
+//  You should have received a copy of the GNU General Public License along
+//  with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
+//
+//! \file ParticleGhostCopyNotification.h
+//! \author Sebastian Eibl <sebastian.eibl@fau.de>
+//
+//======================================================================================================================
+
+//======================================================================================================================
+//
+//  THIS FILE IS GENERATED - PLEASE CHANGE THE TEMPLATE !!!
+//
+//======================================================================================================================
+
+#pragma once
+
+#include <mesa_pd/data/DataTypes.h>
+#include <mesa_pd/data/ParticleStorage.h>
+#include <mesa_pd/mpi/ShapePackUnpack.h>
+#include <mesa_pd/mpi/notifications/NotificationType.h>
+
+#include <core/mpi/Datatype.h>
+#include <core/mpi/RecvBuffer.h>
+#include <core/mpi/SendBuffer.h>
+
+namespace walberla {
+namespace mesa_pd {
+
+/**
+ * A complete particle copy for a new ghost particle.
+ *
+ * Copies all properties marked ON_GHOST_CREATION or ALWAYS.
+ */
+class ParticleGhostCopyNotification
+{
+public:
+   struct Parameters
+   {
+      {%- for prop in properties %}
+      {%- if prop.syncMode in ["ON_GHOST_CREATION", "ALWAYS"] %}
+      {{prop.type}} {{prop.name}} {{'{'}}{{prop.defValue}}{{'}'}};
+      {%- endif %}
+      {%- endfor %}
+   };
+
+   inline explicit ParticleGhostCopyNotification( const data::Particle& particle ) : particle_(particle) {}
+   const data::Particle& particle_;
+};
+
+inline data::ParticleStorage::iterator createNewParticle(data::ParticleStorage& ps, const ParticleGhostCopyNotification::Parameters& data)
+{
+   WALBERLA_ASSERT_EQUAL(ps.find(data.uid), ps.end(), "Particle with same uid already existent!");
+
+   auto pIt = ps.create(data.uid);
+   {%- for prop in properties %}
+   {%- if prop.syncMode in ["ON_GHOST_CREATION", "ALWAYS"] %}
+   pIt->set{{prop.name | capFirst}}(data.{{prop.name}});
+   {%- endif %}
+   {%- endfor %}
+   return pIt;
+}
+
+template<>
+struct NotificationTrait<ParticleGhostCopyNotification>
+{
+   static const NotificationType id = PARTICLE_GHOST_COPY_NOTIFICATION;
+};
+
+}  // namespace mesa_pd
+}  // namespace walberla
+
+//======================================================================================================================
+//
+//  Send/Recv Buffer Serialization Specialization
+//
+//======================================================================================================================
+
+namespace walberla {
+namespace mpi {
+
+template< typename T,    // Element type of SendBuffer
+          typename G>    // Growth policy of SendBuffer
+mpi::GenericSendBuffer<T,G>& operator<<( mpi::GenericSendBuffer<T,G> & buf, const mesa_pd::ParticleGhostCopyNotification& obj )
+{
+   buf.addDebugMarker( "cn" );
+   {%- for prop in properties %}
+   {%- if prop.syncMode in ["ON_GHOST_CREATION", "ALWAYS"] %}
+   buf << obj.particle_.get{{prop.name | capFirst}}();
+   {%- endif %}
+   {%- endfor %}
+   return buf;
+}
+
+template< typename T>    // Element type  of RecvBuffer
+mpi::GenericRecvBuffer<T>& operator>>( mpi::GenericRecvBuffer<T> & buf, mesa_pd::ParticleGhostCopyNotification::Parameters& objparam )
+{
+   buf.readDebugMarker( "cn" );
+   {%- for prop in properties %}
+   {%- if prop.syncMode in ["ON_GHOST_CREATION", "ALWAYS"] %}
+   buf >> objparam.{{prop.name}};
+   {%- endif %}
+   {%- endfor %}
+   return buf;
+}
+
+} // mpi
+} // walberla
diff --git a/src/mesa_pd/domain/BlockForestDataHandling.cpp b/src/mesa_pd/domain/BlockForestDataHandling.cpp
index 1a75c1384..d60dda116 100644
--- a/src/mesa_pd/domain/BlockForestDataHandling.cpp
+++ b/src/mesa_pd/domain/BlockForestDataHandling.cpp
@@ -23,7 +23,7 @@
 #include <mesa_pd/data/DataTypes.h>
 #include <mesa_pd/data/ParticleStorage.h>
 
-#include <mesa_pd/mpi/notifications/ParticleCopyNotification.h>
+#include <mesa_pd/mpi/notifications/ParticleGhostCopyNotification.h>
 
 #include "blockforest/BlockDataHandling.h"
 #include "blockforest/BlockForest.h"
@@ -97,7 +97,7 @@ void BlockForestDataHandling::serialize( IBlock * const block,
       //skip globals
       if (data::particle_flags::isSet( pIt->getFlags(), data::particle_flags::GLOBAL)) continue;
 
-      buffer << ParticleCopyNotification( *pIt );
+      buffer << ParticleGhostCopyNotification( *pIt );
       ++numOfParticles;
    }
 
@@ -140,7 +140,7 @@ void BlockForestDataHandling::serializeCoarseToFine( Block * const block, const
 
       if( childAABB.contains( pIt->getPosition()) )
       {
-         buffer << ParticleCopyNotification( *pIt );
+         buffer << ParticleGhostCopyNotification( *pIt );
          ++numOfParticles;
       }
    }
@@ -164,7 +164,7 @@ void BlockForestDataHandling::serializeFineToCoarse( Block * const block, const
       //skip globals
       if (data::particle_flags::isSet( pIt->getFlags(), data::particle_flags::GLOBAL)) continue;
 
-      buffer << ParticleCopyNotification( *pIt );
+      buffer << ParticleGhostCopyNotification( *pIt );
       ++numOfParticles;
    }
 
@@ -200,7 +200,7 @@ void BlockForestDataHandling::deserializeImpl( IBlock * const block, const Block
 
    while( numBodies > 0 )
    {
-      typename ParticleCopyNotification::Parameters objparam;
+      typename ParticleGhostCopyNotification::Parameters objparam;
       buffer >> objparam;
 
       auto pIt = createNewParticle(*ps_, objparam);
diff --git a/src/mesa_pd/mpi/SyncGhostOwners.cpp b/src/mesa_pd/mpi/SyncGhostOwners.cpp
index bedc11c5f..887244bd5 100644
--- a/src/mesa_pd/mpi/SyncGhostOwners.cpp
+++ b/src/mesa_pd/mpi/SyncGhostOwners.cpp
@@ -249,8 +249,8 @@ void SyncGhostOwners::checkAndResolveOverlap( data::ParticleStorage& ps,
             if( domain.intersectsWithProcessSubdomain( nbProcessRank, pIt->getPosition(), pIt->getInteractionRadius() + dx ) )
             {
                // no ghost there -> create ghost
-               WALBERLA_LOG_DETAIL( "Sending copy notification for body " << pIt->getUid() << " to process " << (nbProcessRank) << "\n master: " << pIt->getOwner());
-               packNotification(sb, ParticleCopyNotification( *pIt ));
+               WALBERLA_LOG_DETAIL( "Sending ghost copy notification for body " << pIt->getUid() << " to process " << (nbProcessRank) << "\n master: " << pIt->getOwner());
+               packNotification(sb, ParticleGhostCopyNotification( *pIt ));
                packNotification(sbMaster, NewGhostParticleNotification( *pIt, int_c(nbProcessRank) ));
                pIt->getNeighborStateRef().insert( int_c(nbProcessRank) );
             }
@@ -274,8 +274,8 @@ void SyncGhostOwners::checkAndResolveOverlap( data::ParticleStorage& ps,
             if( domain.intersectsWithProcessSubdomain( nbProcessRank, pIt->getPosition(), pIt->getInteractionRadius() + dx ) )
             {
                // no ghost there -> create ghost
-               WALBERLA_LOG_DETAIL( "Sending copy notification for body " << pIt->getUid() << " to process " << (nbProcessRank) << "\n master: " << pIt->getOwner());
-               packNotification(sb, ParticleCopyNotification( *pIt ));
+               WALBERLA_LOG_DETAIL( "Sending ghost copy notification for body " << pIt->getUid() << " to process " << (nbProcessRank) << "\n master: " << pIt->getOwner());
+               packNotification(sb, ParticleGhostCopyNotification( *pIt ));
                packNotification(sbMaster, NewGhostParticleNotification( *pIt, int_c(nbProcessRank) ));
                pIt->getNeighborStateRef().insert( int_c(nbProcessRank) );
             }
diff --git a/src/mesa_pd/mpi/SyncGhostOwners.h b/src/mesa_pd/mpi/SyncGhostOwners.h
index 17bcdde54..0b9d1db82 100644
--- a/src/mesa_pd/mpi/SyncGhostOwners.h
+++ b/src/mesa_pd/mpi/SyncGhostOwners.h
@@ -33,7 +33,7 @@
 #include <mesa_pd/mpi/notifications/NewGhostParticleNotification.h>
 #include <mesa_pd/mpi/notifications/PackNotification.h>
 #include <mesa_pd/mpi/notifications/ParseMessage.h>
-#include <mesa_pd/mpi/notifications/ParticleCopyNotification.h>
+#include <mesa_pd/mpi/notifications/ParticleGhostCopyNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemoteMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemovalInformationNotification.h>
diff --git a/src/mesa_pd/mpi/SyncNextNeighbors.cpp b/src/mesa_pd/mpi/SyncNextNeighbors.cpp
index b13949546..e36c352dc 100644
--- a/src/mesa_pd/mpi/SyncNextNeighbors.cpp
+++ b/src/mesa_pd/mpi/SyncNextNeighbors.cpp
@@ -142,8 +142,8 @@ void SyncNextNeighbors::generateSynchronizationMessages(data::ParticleStorage& p
             {
                // no ghost there -> create ghost
                auto& buffer( bs.sendBuffer(nbProcessRank) );
-               WALBERLA_LOG_DETAIL( "Sending shadow copy notification for particle " << pIt->getUid() << " to process " << (nbProcessRank) );
-               packNotification(buffer, ParticleCopyNotification( *pIt ));
+               WALBERLA_LOG_DETAIL( "Sending ghost copy notification for particle " << pIt->getUid() << " to process " << (nbProcessRank) );
+               packNotification(buffer, ParticleGhostCopyNotification( *pIt ));
                pIt->getGhostOwnersRef().insert( int_c(nbProcessRank) );
             }
          }
diff --git a/src/mesa_pd/mpi/SyncNextNeighbors.h b/src/mesa_pd/mpi/SyncNextNeighbors.h
index e1007e7f9..8d8364cbf 100644
--- a/src/mesa_pd/mpi/SyncNextNeighbors.h
+++ b/src/mesa_pd/mpi/SyncNextNeighbors.h
@@ -32,7 +32,7 @@
 #include <mesa_pd/domain/IDomain.h>
 #include <mesa_pd/mpi/notifications/PackNotification.h>
 #include <mesa_pd/mpi/notifications/ParseMessage.h>
-#include <mesa_pd/mpi/notifications/ParticleCopyNotification.h>
+#include <mesa_pd/mpi/notifications/ParticleGhostCopyNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemoteMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemovalNotification.h>
diff --git a/src/mesa_pd/mpi/SyncNextNeighborsBlockForest.cpp b/src/mesa_pd/mpi/SyncNextNeighborsBlockForest.cpp
index 3a0038488..417d1a86b 100644
--- a/src/mesa_pd/mpi/SyncNextNeighborsBlockForest.cpp
+++ b/src/mesa_pd/mpi/SyncNextNeighborsBlockForest.cpp
@@ -181,8 +181,8 @@ void SyncNextNeighborsBlockForest::generateSynchronizationMessages(data::Particl
             {
                // no ghost there -> create ghost
                auto& buffer( bs.sendBuffer(nbProcessRank) );
-               WALBERLA_LOG_DETAIL( "Sending shadow copy notification for particle " << pIt->getUid() << " to process " << (nbProcessRank) );
-               packNotification(buffer, ParticleCopyNotification( *pIt ));
+               WALBERLA_LOG_DETAIL( "Sending ghost copy notification for particle " << pIt->getUid() << " to process " << (nbProcessRank) );
+               packNotification(buffer, ParticleGhostCopyNotification( *pIt ));
                pIt->getGhostOwnersRef().insert( int_c(nbProcessRank) );
             }
          }
diff --git a/src/mesa_pd/mpi/SyncNextNeighborsBlockForest.h b/src/mesa_pd/mpi/SyncNextNeighborsBlockForest.h
index 02ad7557d..2fa8dfc2d 100644
--- a/src/mesa_pd/mpi/SyncNextNeighborsBlockForest.h
+++ b/src/mesa_pd/mpi/SyncNextNeighborsBlockForest.h
@@ -32,7 +32,7 @@
 #include <mesa_pd/domain/BlockForestDomain.h>
 #include <mesa_pd/mpi/notifications/PackNotification.h>
 #include <mesa_pd/mpi/notifications/ParseMessage.h>
-#include <mesa_pd/mpi/notifications/ParticleCopyNotification.h>
+#include <mesa_pd/mpi/notifications/ParticleGhostCopyNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemoteMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemovalNotification.h>
diff --git a/src/mesa_pd/mpi/notifications/NotificationType.h b/src/mesa_pd/mpi/notifications/NotificationType.h
index 572ad573b..6b9b751ad 100644
--- a/src/mesa_pd/mpi/notifications/NotificationType.h
+++ b/src/mesa_pd/mpi/notifications/NotificationType.h
@@ -39,7 +39,7 @@ enum NotificationType : uint8_t
 {
    PARTICLE_DELETION_NOTIFICATION = 1,
    PARTICLE_REMOVAL_NOTIFICATION,
-   PARTICLE_COPY_NOTIFICATION,
+   PARTICLE_GHOST_COPY_NOTIFICATION,
    PARTICLE_FORCE_NOTIFICATION,
    PARTICLE_UPDATE_NOTIFICATION,
    PARTICLE_MIGRATION_NOTIFICATION,
diff --git a/src/mesa_pd/mpi/notifications/ParseMessage.h b/src/mesa_pd/mpi/notifications/ParseMessage.h
index 60f80dedb..741f1950e 100644
--- a/src/mesa_pd/mpi/notifications/ParseMessage.h
+++ b/src/mesa_pd/mpi/notifications/ParseMessage.h
@@ -31,7 +31,7 @@
 #include <mesa_pd/domain/IDomain.h>
 #include <mesa_pd/mpi/notifications/NewGhostParticleNotification.h>
 #include <mesa_pd/mpi/notifications/NotificationType.h>
-#include <mesa_pd/mpi/notifications/ParticleCopyNotification.h>
+#include <mesa_pd/mpi/notifications/ParticleGhostCopyNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemoteMigrationNotification.h>
 #include <mesa_pd/mpi/notifications/ParticleRemovalNotification.h>
@@ -66,11 +66,11 @@ void ParseMessage::operator()(int sender,
    rb >> notificationType;
 
    switch( notificationType ) {
-   case PARTICLE_COPY_NOTIFICATION: {
-      typename ParticleCopyNotification::Parameters objparam;
+   case PARTICLE_GHOST_COPY_NOTIFICATION: {
+      typename ParticleGhostCopyNotification::Parameters objparam;
       rb >> objparam;
 
-      WALBERLA_LOG_DETAIL( "Received PARTICLE_COPY_NOTIFICATION for particle " << objparam.uid << "from neighboring process with rank " << sender );
+      WALBERLA_LOG_DETAIL( "Received PARTICLE_GHOST_COPY_NOTIFICATION for particle " << objparam.uid << "from neighboring process with rank " << sender );
 
       if ( ps.find(objparam.uid) == ps.end() )
       {
@@ -85,7 +85,7 @@ void ParseMessage::operator()(int sender,
          WALBERLA_LOG_DETAIL("Ghost particle with id " << objparam.uid << " already existend.");
       }
 
-      WALBERLA_LOG_DETAIL( "Processed PARTICLE_COPY_NOTIFICATION for particle " << objparam.uid << "."  );
+      WALBERLA_LOG_DETAIL( "Processed PARTICLE_GHOST_COPY_NOTIFICATION for particle " << objparam.uid << "."  );
 
       break;
    }
diff --git a/src/mesa_pd/mpi/notifications/ParticleCopyNotification.h b/src/mesa_pd/mpi/notifications/ParticleGhostCopyNotification.h
similarity index 90%
rename from src/mesa_pd/mpi/notifications/ParticleCopyNotification.h
rename to src/mesa_pd/mpi/notifications/ParticleGhostCopyNotification.h
index bba3bcd17..0b8265c6f 100644
--- a/src/mesa_pd/mpi/notifications/ParticleCopyNotification.h
+++ b/src/mesa_pd/mpi/notifications/ParticleGhostCopyNotification.h
@@ -13,7 +13,7 @@
 //  You should have received a copy of the GNU General Public License along
 //  with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
-//! \file ParticleCopyNotification.h
+//! \file ParticleGhostCopyNotification.h
 //! \author Sebastian Eibl <sebastian.eibl@fau.de>
 //
 //======================================================================================================================
@@ -43,7 +43,7 @@ namespace mesa_pd {
  *
  * Copies all properties marked ON_GHOST_CREATION or ALWAYS.
  */
-class ParticleCopyNotification
+class ParticleGhostCopyNotification
 {
 public:
    struct Parameters
@@ -63,11 +63,11 @@ public:
       walberla::real_t temperature {real_t(0)};
    };
 
-   inline explicit ParticleCopyNotification( const data::Particle& particle ) : particle_(particle) {}
+   inline explicit ParticleGhostCopyNotification( const data::Particle& particle ) : particle_(particle) {}
    const data::Particle& particle_;
 };
 
-inline data::ParticleStorage::iterator createNewParticle(data::ParticleStorage& ps, const ParticleCopyNotification::Parameters& data)
+inline data::ParticleStorage::iterator createNewParticle(data::ParticleStorage& ps, const ParticleGhostCopyNotification::Parameters& data)
 {
    WALBERLA_ASSERT_EQUAL(ps.find(data.uid), ps.end(), "Particle with same uid already existent!");
 
@@ -89,9 +89,9 @@ inline data::ParticleStorage::iterator createNewParticle(data::ParticleStorage&
 }
 
 template<>
-struct NotificationTrait<ParticleCopyNotification>
+struct NotificationTrait<ParticleGhostCopyNotification>
 {
-   static const NotificationType id = PARTICLE_COPY_NOTIFICATION;
+   static const NotificationType id = PARTICLE_GHOST_COPY_NOTIFICATION;
 };
 
 }  // namespace mesa_pd
@@ -108,7 +108,7 @@ namespace mpi {
 
 template< typename T,    // Element type of SendBuffer
           typename G>    // Growth policy of SendBuffer
-mpi::GenericSendBuffer<T,G>& operator<<( mpi::GenericSendBuffer<T,G> & buf, const mesa_pd::ParticleCopyNotification& obj )
+mpi::GenericSendBuffer<T,G>& operator<<( mpi::GenericSendBuffer<T,G> & buf, const mesa_pd::ParticleGhostCopyNotification& obj )
 {
    buf.addDebugMarker( "cn" );
    buf << obj.particle_.getUid();
@@ -128,7 +128,7 @@ mpi::GenericSendBuffer<T,G>& operator<<( mpi::GenericSendBuffer<T,G> & buf, cons
 }
 
 template< typename T>    // Element type  of RecvBuffer
-mpi::GenericRecvBuffer<T>& operator>>( mpi::GenericRecvBuffer<T> & buf, mesa_pd::ParticleCopyNotification::Parameters& objparam )
+mpi::GenericRecvBuffer<T>& operator>>( mpi::GenericRecvBuffer<T> & buf, mesa_pd::ParticleGhostCopyNotification::Parameters& objparam )
 {
    buf.readDebugMarker( "cn" );
    buf >> objparam.uid;
-- 
GitLab