diff --git a/apps/benchmarks/AdaptiveMeshRefinementFluidParticleCoupling/AMRSedimentSettling.cpp b/apps/benchmarks/AdaptiveMeshRefinementFluidParticleCoupling/AMRSedimentSettling.cpp index bdfc7cd490ec94f10cf429a31af43816a6be42ab..54fd1ac6122eeb7fad8e78517bcb86ab60c06d01 100644 --- a/apps/benchmarks/AdaptiveMeshRefinementFluidParticleCoupling/AMRSedimentSettling.cpp +++ b/apps/benchmarks/AdaptiveMeshRefinementFluidParticleCoupling/AMRSedimentSettling.cpp @@ -796,7 +796,7 @@ private: real_t weightEvaluation(BlockForest & forest, const shared_ptr<pe_coupling::InfoCollection>& couplingInfoCollection, - const shared_ptr<pe::InfoCollection> & peInfoCollection, + const shared_ptr<blockforest::InfoCollection> & peInfoCollection, real_t peBlockBaseWeight, const std::string & loadEvaluationStrategy, uint_t level, @@ -1587,7 +1587,7 @@ int main( int argc, char **argv ) bool balanceLevelwise = true; auto peBlockBaseWeight = real_t(1); //default value, might not be the best - shared_ptr<pe::InfoCollection> peInfoCollection = walberla::make_shared<pe::InfoCollection>(); + shared_ptr<blockforest::InfoCollection> peInfoCollection = walberla::make_shared<blockforest::InfoCollection>(); if( loadDistributionStrategy == "Hilbert" || loadDistributionStrategy == "Morton") { diff --git a/apps/benchmarks/GranularGas/MESA_PD_KernelLoadBalancing.cpp b/apps/benchmarks/GranularGas/MESA_PD_KernelLoadBalancing.cpp index 33c97b2b931821ca2a2dfeffed0be236b6ad17a2..44375e3f5f82f3e6a4461e3fd9cc0b138dc208a6 100644 --- a/apps/benchmarks/GranularGas/MESA_PD_KernelLoadBalancing.cpp +++ b/apps/benchmarks/GranularGas/MESA_PD_KernelLoadBalancing.cpp @@ -58,6 +58,7 @@ #include <blockforest/Initialization.h> #include <blockforest/loadbalancing/DynamicCurve.h> #include <blockforest/loadbalancing/DynamicParMetis.h> +#include <blockforest/loadbalancing/InfoCollection.h> #include <blockforest/loadbalancing/PODPhantomData.h> #include <core/Abort.h> #include <core/Environment.h> @@ -134,7 +135,7 @@ int main( int argc, char ** argv ) forest->checkForEarlyOutInRefresh( params.checkForEarlyOutInRefresh ); forest->checkForLateOutInRefresh( params.checkForLateOutInRefresh ); - auto ic = make_shared<pe::InfoCollection>(); + auto ic = make_shared<blockforest::InfoCollection>(); pe::amr::MinMaxLevelDetermination regrid(ic, params.regridMin, params.regridMax); forest->setRefreshMinTargetLevelDeterminationFunction( regrid ); diff --git a/apps/benchmarks/GranularGas/MESA_PD_LoadBalancing.cpp b/apps/benchmarks/GranularGas/MESA_PD_LoadBalancing.cpp index 856edfc886c0fa2588919325148f825495a4d319..6048d5b7bf05e23a29d65f8a8799389cfed4d417 100644 --- a/apps/benchmarks/GranularGas/MESA_PD_LoadBalancing.cpp +++ b/apps/benchmarks/GranularGas/MESA_PD_LoadBalancing.cpp @@ -56,6 +56,7 @@ #include <blockforest/Initialization.h> #include <blockforest/loadbalancing/DynamicCurve.h> #include <blockforest/loadbalancing/DynamicParMetis.h> +#include <blockforest/loadbalancing/InfoCollection.h> #include <blockforest/loadbalancing/PODPhantomData.h> #include <core/Abort.h> #include <core/Environment.h> @@ -130,7 +131,7 @@ int main( int argc, char ** argv ) forest->checkForEarlyOutInRefresh( params.checkForEarlyOutInRefresh ); forest->checkForLateOutInRefresh( params.checkForLateOutInRefresh ); - auto ic = make_shared<pe::InfoCollection>(); + auto ic = make_shared<blockforest::InfoCollection>(); pe::amr::MinMaxLevelDetermination regrid(ic, params.regridMin, params.regridMax); forest->setRefreshMinTargetLevelDeterminationFunction( regrid ); diff --git a/apps/benchmarks/GranularGas/PE_LoadBalancing.cpp b/apps/benchmarks/GranularGas/PE_LoadBalancing.cpp index 42eb4181a00245a17f6c3397390fa036e1c80ade..511624fdeebfe51fba151c0456fc5842e3e93ee7 100644 --- a/apps/benchmarks/GranularGas/PE_LoadBalancing.cpp +++ b/apps/benchmarks/GranularGas/PE_LoadBalancing.cpp @@ -130,7 +130,7 @@ int main( int argc, char ** argv ) WALBERLA_LOG_INFO_ON_ROOT("blocks: " << Vector3<uint_t>(forest->getXSize(), forest->getYSize(), forest->getZSize()) ); - auto ic = make_shared<pe::InfoCollection>(); + auto ic = make_shared<blockforest::InfoCollection>(); pe::amr::MinMaxLevelDetermination regrid(ic, params.regridMin, params.regridMax); forest->setRefreshMinTargetLevelDeterminationFunction( regrid ); diff --git a/python/waLBerla/tools/sqlitedb/merge.py b/python/waLBerla/tools/sqlitedb/merge.py index acad5bd12637026b32acdb0a0b60ac0bff8f469b..c63582e669947aa6fa2b4e227eee62181d528127 100644 --- a/python/waLBerla/tools/sqlitedb/merge.py +++ b/python/waLBerla/tools/sqlitedb/merge.py @@ -118,6 +118,7 @@ if __name__ == "__main__": isFirstFile = True for r,d,f in os.walk('.'): for file in f: + print(r, file) if r != '.' and file.endswith('.sqlite'): if isFirstFile: print( 'Copying ' + os.path.join(r,file) ) diff --git a/src/pe/amr/BlockInfo.h b/src/blockforest/loadbalancing/BlockInfo.h similarity index 97% rename from src/pe/amr/BlockInfo.h rename to src/blockforest/loadbalancing/BlockInfo.h index e1f3446f30c80e2479f56dc2bf61151514b04796..bf15815ef87967c2633b74d498336e9bcf34be34 100644 --- a/src/pe/amr/BlockInfo.h +++ b/src/blockforest/loadbalancing/BlockInfo.h @@ -26,7 +26,7 @@ #include <ostream> namespace walberla { -namespace pe { +namespace blockforest { struct BlockInfo { @@ -43,7 +43,7 @@ struct BlockInfo , communicationWeight(commWeight) {} - BlockInfo& operator+=( const BlockInfo& rhs ) + BlockInfo& operator+=( const BlockInfo& rhs ) { computationalWeight += rhs.computationalWeight; communicationWeight += rhs.communicationWeight; diff --git a/src/blockforest/loadbalancing/InfoCollection.h b/src/blockforest/loadbalancing/InfoCollection.h new file mode 100644 index 0000000000000000000000000000000000000000..dd06c20fbbf350820f526c0c7e941fde613ba0fd --- /dev/null +++ b/src/blockforest/loadbalancing/InfoCollection.h @@ -0,0 +1,35 @@ +//====================================================================================================================== +// +// 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 InfoCollection.h +//! \author Sebastian Eibl <sebastian.eibl@fau.de> +// +//====================================================================================================================== + +#pragma once + +#include "../BlockID.h" +#include "BlockInfo.h" + +#include <map> + +namespace walberla { +namespace blockforest { + +using InfoCollection = std::map<BlockID, BlockInfo>; +using InfoCollectionPair = std::pair<InfoCollection::key_type, InfoCollection::mapped_type>; + +} +} diff --git a/src/mesa_pd/CMakeLists.txt b/src/mesa_pd/CMakeLists.txt index 744387e40311a51f3e963f26a6448f551b53949d..d953b4269777c9357add6fcf2237f591437d26f6 100644 --- a/src/mesa_pd/CMakeLists.txt +++ b/src/mesa_pd/CMakeLists.txt @@ -5,4 +5,4 @@ # ################################################################################################### -waLBerla_add_module( DEPENDS blockforest core pe stencil vtk ) +waLBerla_add_module( DEPENDS blockforest core stencil vtk ) diff --git a/src/mesa_pd/domain/InfoCollection.h b/src/mesa_pd/domain/InfoCollection.h index be0d280ffdcc3125bc9c0d545324fd7ef4ead20b..90df6dbf7444cee08ae06f86cd3e9d1241d0c8c1 100644 --- a/src/mesa_pd/domain/InfoCollection.h +++ b/src/mesa_pd/domain/InfoCollection.h @@ -23,17 +23,19 @@ #include <mesa_pd/data/ParticleStorage.h> #include <blockforest/BlockForest.h> +#include <blockforest/loadbalancing/BlockInfo.h> +#include <blockforest/loadbalancing/InfoCollection.h> #include <core/mpi/BufferSystem.h> -#include <pe/amr/BlockInfo.h> -#include <pe/amr/InfoCollection.h> namespace walberla { namespace mesa_pd { namespace domain { template <typename Accessor> -void createWithNeighborhood(Accessor& ac, const BlockForest& bf, pe::InfoCollection& ic ) +void createWithNeighborhood(Accessor& ac, const BlockForest& bf, blockforest::InfoCollection& ic ) { + using namespace walberla::blockforest; + ic.clear(); walberla::mpi::BufferSystem bs( MPIManager::instance()->comm(), 756 ); @@ -44,7 +46,7 @@ void createWithNeighborhood(Accessor& ac, const BlockForest& bf, pe::InfoCollect { const blockforest::Block* block = static_cast<const blockforest::Block*> (&(*blockIt)); - pe::BlockInfo& info = ic[block->getId()]; + BlockInfo& info = ic[block->getId()]; if (block->getAABB().contains(ac.getPosition(idx))) { if (data::particle_flags::isSet( ac.getFlags(idx), data::particle_flags::GHOST)) @@ -59,7 +61,7 @@ void createWithNeighborhood(Accessor& ac, const BlockForest& bf, pe::InfoCollect { const auto childID = BlockID(block->getId(), branchID); const auto childAABB = bf.getAABBFromBlockId(childID); - pe::BlockInfo& childInfo = ic[childID]; + BlockInfo& childInfo = ic[childID]; if (childAABB.contains(ac.getPosition(idx))) { if (data::particle_flags::isSet( ac.getFlags(idx), data::particle_flags::GHOST)) @@ -81,21 +83,21 @@ void createWithNeighborhood(Accessor& ac, const BlockForest& bf, pe::InfoCollect { const blockforest::Block* block = static_cast<const blockforest::Block*> (&(*blockIt)); - pe::BlockInfo& info = ic[block->getId()]; + BlockInfo& info = ic[block->getId()]; for( uint_t nb = uint_t(0); nb < block->getNeighborhoodSize(); ++nb ) { - bs.sendBuffer( block->getNeighborProcess(nb) ) << pe::InfoCollection::value_type(block->getId(), info); + bs.sendBuffer( block->getNeighborProcess(nb) ) << InfoCollection::value_type(block->getId(), info); } for (uint_t branchID = 0; branchID < 8; ++branchID) { const auto childID = BlockID(block->getId(), branchID); - pe::BlockInfo& childInfo = ic[childID]; + BlockInfo& childInfo = ic[childID]; for( uint_t nb = uint_t(0); nb < block->getNeighborhoodSize(); ++nb ) { - bs.sendBuffer( block->getNeighborProcess(nb) ) << pe::InfoCollection::value_type(childID, childInfo); + bs.sendBuffer( block->getNeighborProcess(nb) ) << InfoCollection::value_type(childID, childInfo); } } } @@ -108,7 +110,7 @@ void createWithNeighborhood(Accessor& ac, const BlockForest& bf, pe::InfoCollect { while( !recvIt.buffer().isEmpty() ) { - pe::InfoCollectionPair val; + InfoCollectionPair val; recvIt.buffer() >> val; ic.insert(val); } diff --git a/src/pe/amr/InfoCollection.cpp b/src/pe/amr/InfoCollection.cpp index 6f19bd8f97e3d528208a94454b40d7248db654c5..b2b777daec77a6fbd975dcd8c5d63035cae66405 100644 --- a/src/pe/amr/InfoCollection.cpp +++ b/src/pe/amr/InfoCollection.cpp @@ -31,22 +31,23 @@ namespace pe { void createWithNeighborhoodLocalShadow( const BlockForest& bf, const BlockDataID storageID, - InfoCollection& ic ) + blockforest::InfoCollection& ic ) { + using namespace walberla::blockforest; ic.clear(); mpi::BufferSystem bs( MPIManager::instance()->comm(), 756 ); for (auto blockIt = bf.begin(); blockIt != bf.end(); ++blockIt) { - const blockforest::Block* block = static_cast<const blockforest::Block*> (&(*blockIt)); + const Block* block = static_cast<const Block*> (&(*blockIt)); Storage const * storage = block->getData< Storage >( storageID ); BodyStorage const & localStorage = (*storage)[StorageType::LOCAL]; BodyStorage const & shadowStorage = (*storage)[StorageType::SHADOW]; - ic.insert( InfoCollection::value_type(block->getId(), BlockInfo(localStorage.size(), shadowStorage.size())) ); + ic.insert( InfoCollectionPair(block->getId(), BlockInfo(localStorage.size(), shadowStorage.size())) ); for( uint_t nb = uint_t(0); nb < block->getNeighborhoodSize(); ++nb ) { - bs.sendBuffer( block->getNeighborProcess(nb) ) << InfoCollection::value_type(block->getId(), BlockInfo(localStorage.size(), shadowStorage.size())); + bs.sendBuffer( block->getNeighborProcess(nb) ) << InfoCollectionPair(block->getId(), BlockInfo(localStorage.size(), shadowStorage.size())); } for (uint_t branchID = 0; branchID < 8; ++branchID) @@ -65,11 +66,11 @@ void createWithNeighborhoodLocalShadow( const BlockForest& bf, if (childAABB.contains(bodyIt->getPosition())) ++shadow; } - ic.insert( InfoCollection::value_type(childID, BlockInfo(local, shadow)) ); + ic.insert( InfoCollectionPair(childID, BlockInfo(local, shadow)) ); for( uint_t nb = uint_t(0); nb < block->getNeighborhoodSize(); ++nb ) { - bs.sendBuffer( block->getNeighborProcess(nb) ) << InfoCollection::value_type(childID, BlockInfo(local, shadow)); + bs.sendBuffer( block->getNeighborProcess(nb) ) << InfoCollectionPair(childID, BlockInfo(local, shadow)); } } } @@ -92,22 +93,24 @@ void createWithNeighborhoodLocalShadow( const BlockForest& bf, void createWithNeighborhoodContactsShadow( BlockForest& bf, const BlockDataID storageID, const BlockDataID fcdID, - InfoCollection& ic ) + blockforest::InfoCollection& ic ) { + using namespace walberla::blockforest; + ic.clear(); mpi::BufferSystem bs( MPIManager::instance()->comm(), 756 ); for (auto blockIt = bf.begin(); blockIt != bf.end(); ++blockIt) { - blockforest::Block* block = static_cast<blockforest::Block*> (&(*blockIt)); + Block* block = static_cast<Block*> (&(*blockIt)); Storage const * storage = block->getData< Storage >( storageID ); BodyStorage const & shadowStorage = (*storage)[StorageType::SHADOW]; fcd::IFCD * fcd = block->getData< fcd::IFCD >( fcdID ); - ic.insert( InfoCollection::value_type(block->getId(), BlockInfo(fcd->getContacts().size(), shadowStorage.size())) ); + ic.insert( InfoCollectionPair(block->getId(), BlockInfo(fcd->getContacts().size(), shadowStorage.size())) ); for( uint_t nb = uint_t(0); nb < block->getNeighborhoodSize(); ++nb ) { - bs.sendBuffer( block->getNeighborProcess(nb) ) << InfoCollection::value_type(block->getId(), BlockInfo(fcd->getContacts().size(), shadowStorage.size())); + bs.sendBuffer( block->getNeighborProcess(nb) ) << InfoCollectionPair(block->getId(), BlockInfo(fcd->getContacts().size(), shadowStorage.size())); } for (uint_t branchID = 0; branchID < 8; ++branchID) @@ -127,11 +130,11 @@ void createWithNeighborhoodContactsShadow( BlockForest& bf, if (childAABB.contains(bodyIt->getPosition())) ++shadow; } - ic.insert( InfoCollection::value_type(childID, BlockInfo(localContacts, shadow)) ); + ic.insert( InfoCollectionPair(childID, BlockInfo(localContacts, shadow)) ); for( uint_t nb = uint_t(0); nb < block->getNeighborhoodSize(); ++nb ) { - bs.sendBuffer( block->getNeighborProcess(nb) ) << InfoCollection::value_type(childID, BlockInfo(localContacts, shadow)); + bs.sendBuffer( block->getNeighborProcess(nb) ) << InfoCollectionPair(childID, BlockInfo(localContacts, shadow)); } } } diff --git a/src/pe/amr/InfoCollection.h b/src/pe/amr/InfoCollection.h index b8df5f46c49c4315bc40797044feb4f2efcc4b54..5398bce538759dd4e7b1e22ddb6a6e2b142f7fec 100644 --- a/src/pe/amr/InfoCollection.h +++ b/src/pe/amr/InfoCollection.h @@ -20,18 +20,15 @@ #pragma once -#include "BlockInfo.h" - #include "blockforest/BlockForest.h" +#include "blockforest/loadbalancing/BlockInfo.h" +#include "blockforest/loadbalancing/InfoCollection.h" #include <map> namespace walberla { namespace pe { -typedef std::map<blockforest::BlockID, BlockInfo> InfoCollection; -typedef std::pair<blockforest::BlockID, BlockInfo> InfoCollectionPair; - /** * @brief Fills \a InfoCollection with up to date information. * @@ -41,7 +38,7 @@ typedef std::pair<blockforest::BlockID, BlockInfo> InfoCollectionPair; */ void createWithNeighborhoodLocalShadow( const BlockForest& bf, const BlockDataID storageID, - InfoCollection& ic ); + blockforest::InfoCollection& ic ); /** * @brief Fills \a InfoCollection with up to date information. @@ -53,7 +50,7 @@ void createWithNeighborhoodLocalShadow( const BlockForest& bf, void createWithNeighborhoodContactsShadow( BlockForest& bf, const BlockDataID storageID, const BlockDataID fcdID, - InfoCollection& ic ); + blockforest::InfoCollection& ic ); } } diff --git a/src/pe/amr/level_determination/MinMaxLevelDetermination.cpp b/src/pe/amr/level_determination/MinMaxLevelDetermination.cpp index bb1de0695648a5f9a3ce32d4a0bf8aaeba8e8ce7..d29f5011c77aafb66a5da612664e0de5be5d5797 100644 --- a/src/pe/amr/level_determination/MinMaxLevelDetermination.cpp +++ b/src/pe/amr/level_determination/MinMaxLevelDetermination.cpp @@ -25,7 +25,8 @@ namespace pe { namespace amr { void MinMaxLevelDetermination::operator()( std::vector< std::pair< const Block *, uint_t > > & minTargetLevels, - std::vector< const Block * > &, const BlockForest & /*forest*/ ) + std::vector< const Block * > &, + const BlockForest & /*forest*/ ) { for( auto it = minTargetLevels.begin(); it != minTargetLevels.end(); ++it ) { @@ -53,13 +54,13 @@ void MinMaxLevelDetermination::operator()( std::vector< std::pair< const Block * } } -InfoCollection::const_iterator MinMaxLevelDetermination::getOrCreateCoarseInfo( const blockforest::BlockID& id ) +blockforest::InfoCollection::const_iterator MinMaxLevelDetermination::getOrCreateCoarseInfo( const blockforest::BlockID& id ) { auto fatherId = id.getFatherId(); auto infoIt = ic_->find( fatherId ); if (infoIt != ic_->end()) return infoIt; - BlockInfo newWeight( 0, 0); + blockforest::BlockInfo newWeight( 0, 0); for (uint_t child = 0; child < 8; ++child) { blockforest::BlockID childId(fatherId, child); @@ -68,8 +69,8 @@ InfoCollection::const_iterator MinMaxLevelDetermination::getOrCreateCoarseInfo( //return giant number to prevent coarsening if (childIt == ic_->end()) { - newWeight = BlockInfo( std::numeric_limits<uint_t>::max(), - std::numeric_limits<uint_t>::max()); + newWeight = blockforest::BlockInfo( std::numeric_limits<uint_t>::max(), + std::numeric_limits<uint_t>::max()); break; } else { diff --git a/src/pe/amr/level_determination/MinMaxLevelDetermination.h b/src/pe/amr/level_determination/MinMaxLevelDetermination.h index 6f5433822d457ba7b5705063b41864b45c42d966..a5b91e62e3631fa4ac7e1f0b1e71ec998e359ed8 100644 --- a/src/pe/amr/level_determination/MinMaxLevelDetermination.h +++ b/src/pe/amr/level_determination/MinMaxLevelDetermination.h @@ -36,19 +36,22 @@ class MinMaxLevelDetermination { public: - MinMaxLevelDetermination( const shared_ptr<InfoCollection>& ic, const size_t minBodies, const size_t maxBodies) : + MinMaxLevelDetermination( const shared_ptr<blockforest::InfoCollection>& ic, + const size_t minBodies, + const size_t maxBodies) : ic_( ic ), minBodies_(minBodies), maxBodies_(maxBodies) {} void operator()( std::vector< std::pair< const Block *, uint_t > > & minTargetLevels, - std::vector< const Block * > &, const BlockForest & forest ); + std::vector< const Block * > &, + const BlockForest & forest ); public: - const shared_ptr<InfoCollection> ic_; + const shared_ptr<blockforest::InfoCollection> ic_; size_t minBodies_; size_t maxBodies_; - InfoCollection::const_iterator getOrCreateCoarseInfo( const blockforest::BlockID& id ); + blockforest::InfoCollection::const_iterator getOrCreateCoarseInfo( const blockforest::BlockID& id ); }; } // namespace amr diff --git a/src/pe/amr/weight_assignment/MetisAssignmentFunctor.h b/src/pe/amr/weight_assignment/MetisAssignmentFunctor.h index 2848a23b6dbfdeea87f54daf3d8c35087a2a1170..4d0aeb411c46a77749f8a13226d9dac4824ca245 100644 --- a/src/pe/amr/weight_assignment/MetisAssignmentFunctor.h +++ b/src/pe/amr/weight_assignment/MetisAssignmentFunctor.h @@ -20,9 +20,10 @@ #pragma once -#include "pe/amr/InfoCollection.h" - +#include "blockforest/BlockForest.h" +#include "blockforest/PhantomBlockForest.h" #include "blockforest/loadbalancing/DynamicParMetis.h" +#include "blockforest/loadbalancing/InfoCollection.h" #include "domain_decomposition/PeriodicIntersectionVolume.h" namespace walberla { @@ -43,9 +44,10 @@ public: ///Convenience typdef for pack and unpack functions to be used in conjunction with PhantomBlockWeight. typedef blockforest::DynamicParMetisBlockInfoPackUnpack PhantomBlockWeightPackUnpackFunctor; - MetisAssignmentFunctor( shared_ptr<InfoCollection>& ic, const real_t baseWeight = real_t(10.0) ) : ic_(ic), baseWeight_(baseWeight) {} + MetisAssignmentFunctor( shared_ptr<blockforest::InfoCollection>& ic, const real_t baseWeight = real_t(10.0) ) : ic_(ic), baseWeight_(baseWeight) {} - void operator()( std::vector< std::pair< const PhantomBlock *, walberla::any > > & blockData, const PhantomBlockForest & forest ) + void operator()( std::vector< std::pair< const PhantomBlock *, walberla::any > > & blockData, + const PhantomBlockForest & forest ) { const std::array< bool, 3 > periodic {{forest.getBlockForest().isPeriodic(0), forest.getBlockForest().isPeriodic(1), @@ -85,7 +87,7 @@ public: inline double getBaseWeight() const { return baseWeight_; } private: - shared_ptr< InfoCollection > ic_; + shared_ptr< blockforest::InfoCollection > ic_; ///Base weight due to allocated data structures. A weight of zero for blocks is dangerous as empty blocks might accumulate on one process! double baseWeight_ = 10.0; diff --git a/src/pe/amr/weight_assignment/WeightAssignmentFunctor.h b/src/pe/amr/weight_assignment/WeightAssignmentFunctor.h index b18b9b0fdcb762414af23b1cf275f58840550b96..66f267af0510bce6cb60ce4d74fb30d5594d9e7c 100644 --- a/src/pe/amr/weight_assignment/WeightAssignmentFunctor.h +++ b/src/pe/amr/weight_assignment/WeightAssignmentFunctor.h @@ -21,9 +21,9 @@ #pragma once -#include "pe/amr/InfoCollection.h" - +#include "blockforest/loadbalancing/InfoCollection.h" #include "blockforest/loadbalancing/PODPhantomData.h" +#include "blockforest/PhantomBlockForest.h" namespace walberla { namespace pe { @@ -42,7 +42,7 @@ public: ///Convenience typdef for pack and unpack functions to be used in conjunction with PhantomBlockWeight. typedef walberla::blockforest::PODPhantomWeightPackUnpack<double> PhantomBlockWeightPackUnpackFunctor; - WeightAssignmentFunctor( shared_ptr<InfoCollection>& ic, const real_t baseWeight = real_t(10.0) ) : ic_(ic), baseWeight_(baseWeight) {} + WeightAssignmentFunctor( shared_ptr<blockforest::InfoCollection>& ic, const real_t baseWeight = real_t(10.0) ) : ic_(ic), baseWeight_(baseWeight) {} void operator()( std::vector< std::pair< const PhantomBlock *, walberla::any > > & blockData, const PhantomBlockForest & ) { @@ -62,7 +62,7 @@ public: inline double getBaseWeight() const { return baseWeight_; } private: - shared_ptr<InfoCollection> ic_; + shared_ptr<blockforest::InfoCollection> ic_; ///Base weight due to allocated data structures. A weight of zero for blocks is dangerous as empty blocks might accumulate on one process! double baseWeight_ = real_t(10.0); diff --git a/tests/mesa_pd/domain/DynamicRefinement.cpp b/tests/mesa_pd/domain/DynamicRefinement.cpp index 1696d2485dc05af36481e7aa07f9a52d493ab572..f9378da981ff54f4b6ea82ac93139327fdd434e6 100644 --- a/tests/mesa_pd/domain/DynamicRefinement.cpp +++ b/tests/mesa_pd/domain/DynamicRefinement.cpp @@ -26,9 +26,9 @@ #include <blockforest/Initialization.h> #include <blockforest/loadbalancing/DynamicCurve.h> +#include <blockforest/loadbalancing/InfoCollection.h> #include <core/debug/TestSubsystem.h> #include <core/logging/Logging.h> -#include <pe/amr/InfoCollection.h> #include <pe/amr/level_determination/MinMaxLevelDetermination.h> #include <pe/amr/weight_assignment/WeightAssignmentFunctor.h> @@ -91,7 +91,7 @@ int main( bool simple ) forest->checkForEarlyOutInRefresh( true ); forest->checkForLateOutInRefresh( true ); - auto infoCollection = make_shared<pe::InfoCollection>(); + auto infoCollection = make_shared<blockforest::InfoCollection>(); if (simple) { diff --git a/tests/pe/MinMaxRefinement.cpp b/tests/pe/MinMaxRefinement.cpp index 782d3235a6c0018f6df0cc8bd92859e61cf17345..1e47e2e1e3ecc3208b3a61e1426b47a4bd1080ee 100644 --- a/tests/pe/MinMaxRefinement.cpp +++ b/tests/pe/MinMaxRefinement.cpp @@ -20,6 +20,7 @@ #include "blockforest/all.h" +#include "blockforest/loadbalancing/InfoCollection.h" #include <blockforest/loadbalancing/PODPhantomData.h> #include "core/all.h" #include "domain_decomposition/all.h" @@ -28,7 +29,6 @@ #include "pe/basic.h" -#include "pe/amr/InfoCollection.h" #include "pe/amr/level_determination/MinMaxLevelDetermination.h" #include "pe/amr/weight_assignment/WeightAssignmentFunctor.h" #include "pe/ccd/SimpleCCDDataHandling.h" @@ -95,7 +95,7 @@ int main( int argc, char ** argv ) blockforest.checkForEarlyOutInRefresh( true ); blockforest.checkForLateOutInRefresh( true ); - auto infoCollection = make_shared<InfoCollection>(); + auto infoCollection = make_shared<blockforest::InfoCollection>(); amr::MinMaxLevelDetermination levelDetermination(infoCollection, 2, 5); blockforest.setRefreshMinTargetLevelDeterminationFunction( levelDetermination ); diff --git a/tests/pe/RefinementWithSpareProcesses.cpp b/tests/pe/RefinementWithSpareProcesses.cpp index e4f1d4c80aec4bfc749908539f526a830e01c4fe..ef31e726ce35d57b8c32d5cd0c5b945b39ff7cd2 100644 --- a/tests/pe/RefinementWithSpareProcesses.cpp +++ b/tests/pe/RefinementWithSpareProcesses.cpp @@ -23,10 +23,10 @@ #include "blockforest/loadbalancing/DynamicCurve.h" #include "blockforest/loadbalancing/DynamicDiffusive.h" #include "blockforest/loadbalancing/DynamicParMetis.h" +#include "blockforest/loadbalancing/InfoCollection.h" #include "blockforest/loadbalancing/PODPhantomData.h" #include "pe/basic.h" -#include "pe/amr/InfoCollection.h" #include "pe/amr/level_determination/MinMaxLevelDetermination.h" #include "pe/amr/weight_assignment/MetisAssignmentFunctor.h" #include "pe/amr/weight_assignment/WeightAssignmentFunctor.h" @@ -77,7 +77,7 @@ int main( int /*argc*/, char ** /*argv*/, const std::string& LBAlgorithm ) blockforest->checkForEarlyOutInRefresh( true ); blockforest->checkForLateOutInRefresh( true ); - auto ic = make_shared<InfoCollection>(); + auto ic = make_shared<blockforest::InfoCollection>(); blockforest->setRefreshMinTargetLevelDeterminationFunction( amr::MinMaxLevelDetermination(ic, 50, 100) );