diff --git a/python/mesa_pd/data/ParticleStorage.py b/python/mesa_pd/data/ParticleStorage.py index 5dd9d7703cb74918fb78af86234b653b7a34b361..d6bca7942abc8f78b12b52ea97c866aec98894b2 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 da627c08addf2e50535274d581257ff67b11e7ea..24c4928f3545dcb9c6bc4944f6eaefe6030d5562 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 9ae5d924dbecad544239d744c1e43b2acd723c04..8ec931a686671a285bcfe000807c42425026c67f 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 98a3fc09a96120fbf9e4e27bde8e2b4fcde1be7e..dcf86e8bed632796fb1b36730daf56d0f78126a6 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 73cf820023cc1cf090f8b64b4c3b3ea47a391a4f..5c9402d4c0f0c0f9a8f15343eac067496238514d 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 69ea479ea6806aad83dbecaf9d00e610969bdbc8..77af0197c9e88b355faafb5600cc4f396d911167 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 0000000000000000000000000000000000000000..9fd397201775821331fb425f984fd8f47a47983c --- /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 1a75c13849263038235113f8500dc17c698fd361..d60dda1161b80c0d9f9666003878be845a7e4dda 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 bedc11c5f099fec92c9952f8bda1a557c97b4db6..887244bd5dc7ce864db2de935b8c5a2fbbeec34d 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 17bcdde54912bdaaeb0a60bf584f67d72590018a..0b9d1db826f85044591595ca136d27ff2a84af4a 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 b139495464a60095a75913a3bd046cd7301b7d53..e36c352dc8e60c490d36ded178be585e2a82f62d 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 e1007e7f93adfbc5cfef8e426be89e01c19fd659..8d8364cbf5fd28d1dae06f677a4334ba7293e3d7 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 3a003848858ed6f598e32fee4bcd5961761109fc..417d1a86bd8005173550f358310f19aaba75f07e 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 02ad7557d8c236a216e62db7197920bcecedb65f..2fa8dfc2d9a9e282f3e1f5c72b557e442f030009 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 572ad573b1b1d69f29a08db2462d5a24434a28b6..6b9b751ad4c1912b2cbeff90998c1ea454e52ad4 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 60f80dedb89e935daa9122ede7d3d7acffb8a3ba..741f1950e94b6b971dee05adc3b85240e8642715 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 bba3bcd179ade81faca207394c67906146d6e7aa..0b8265c6f1b3f9b0b7286dfdbc499016a23cc206 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;