Skip to content
Snippets Groups Projects
Commit d0efd825 authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

adjusted weight assignment

parent af7f8f03
No related merge requests found
......@@ -41,11 +41,34 @@ void createWithNeighborhood(const BlockForest& bf, const BlockDataID 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())) );
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()));
}
for (uint_t branchID = 0; branchID < 8; ++branchID)
{
const auto childID = BlockID(block->getId(), branchID);
const auto childAABB = bf.getAABBFromBlockId(childID);
uint_t local = 0;
for (auto bodyIt = localStorage.begin(); bodyIt != localStorage.end(); ++bodyIt)
{
if (childAABB.contains(bodyIt->getPosition()))
++local;
}
uint_t shadow = 0;
for (auto bodyIt = shadowStorage.begin(); bodyIt != shadowStorage.end(); ++bodyIt)
{
if (childAABB.contains(bodyIt->getPosition()))
++shadow;
}
ic.insert( InfoCollection::value_type(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));
}
}
}
// size of buffer is unknown and changes with each send
......
......@@ -50,9 +50,9 @@ public:
if (block->sourceBlockIsLarger())
{
auto infoIt = ic_->find( block->getId().getFatherId() );
auto infoIt = ic_->find( block->getId()/*.getFatherId()*/ );
WALBERLA_ASSERT_UNEQUAL( infoIt, ic_->end() );
it->second = PhantomBlockWeight( double_c(infoIt->second.numberOfLocalBodies) / double_c(8) + baseWeight );
it->second = PhantomBlockWeight( double_c(infoIt->second.numberOfLocalBodies) + baseWeight );
continue;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment