25#ifndef __BITPIT_PABLO_PARA_TREE_HPP__
26#define __BITPIT_PABLO_PARA_TREE_HPP__
61#if BITPIT_ENABLE_MPI==1
63#include "DataLBInterface.hpp"
64#include "DataCommInterface.hpp"
65#include "bitpit_communications.hpp"
67#include "tree_constants.hpp"
68#include "LocalTree.hpp"
71#include <unordered_map>
72#include <unordered_set>
77#include "bitpit_common.hpp"
84 typedef std::vector<bool> bvector;
85 typedef std::vector<int> ivector;
86 typedef std::bitset<72> octantID;
87 typedef std::vector<Octant*> ptroctvector;
88 typedef ptroctvector::iterator octantIterator;
129 OP_LOADBALANCE_FIRST,
135 ACTION_UNDEFINED = -1,
155 typedef std::unordered_map<int, std::array<uint64_t, 2>> PartitionIntersections;
157 struct AccretionData {
159 std::unordered_map<uint64_t, int> internalSeeds;
160 std::unordered_map<uint64_t, int> foreignSeeds;
161 std::unordered_map<uint64_t, int> population;
165 std::vector<uint64_t> m_partitionFirstDesc;
166 std::vector<uint64_t> m_partitionLastDesc;
167 std::vector<uint64_t> m_partitionRangeGlobalIdx;
168 std::vector<uint64_t> m_partitionRangeGlobalIdx0;
169 uint64_t m_globalNumOctants;
172 const TreeConstants *m_treeConstants;
173 std::size_t m_nofGhostLayers;
178 std::map<int,u32vector> m_bordersPerProc;
179 ptroctvector m_internals;
180 ptroctvector m_pborders;
189 LoadBalanceRanges m_loadBalanceRanges;
212#if BITPIT_ENABLE_MPI==1
221#if BITPIT_ENABLE_MPI==1
241 virtual void reset();
244 virtual void dump(std::ostream &stream,
bool full =
true);
245 virtual void restore(std::istream &stream);
260#if BITPIT_ENABLE_MPI==1
261 void setComm(MPI_Comm communicator);
262 void replaceComm(MPI_Comm communicator, MPI_Comm *previousCommunicator =
nullptr);
271 double getX0()
const;
272 double getY0()
const;
273 double getZ0()
const;
300 void setTol(
double tol = 1.0e-14);
306 double getX(uint32_t idx)
const;
307 double getY(uint32_t idx)
const;
308 double getZ(uint32_t idx)
const;
309 double getSize(uint32_t idx)
const;
310 double getArea(uint32_t idx)
const;
312 void getCenter(uint32_t idx, darray3& centerCoords)
const;
315 void getFaceCenter(uint32_t idx, uint8_t face, darray3& centerCoords)
const;
316 darray3
getNode(uint32_t idx, uint8_t node)
const;
317 void getNode(uint32_t idx, uint8_t node, darray3& nodeCoords)
const;
318 void getNodes(uint32_t idx, darr3vector & nodesCoords)
const;
319 darr3vector
getNodes(uint32_t idx)
const;
320 void getNormal(uint32_t idx, uint8_t face, darray3 & normal)
const;
321 darray3
getNormal(uint32_t idx, uint8_t face)
const;
323 uint8_t
getLevel(uint32_t idx)
const;
327 bool getBound(uint32_t idx, uint8_t face)
const;
329 bool getPbound(uint32_t idx, uint8_t face)
const;
336 uint32_t
getLocalIdx(uint64_t gidx,
int rank)
const;
337 void getLocalIdx(uint64_t gidx,uint32_t & lidx,
int & rank)
const;
341 void setMarker(uint32_t idx, int8_t marker);
348 double getX(
const Octant* oct)
const;
349 double getY(
const Octant* oct)
const;
350 double getZ(
const Octant* oct)
const;
351 double getSize(
const Octant* oct)
const;
352 double getArea(
const Octant* oct)
const;
353 double getVolume(
const Octant* oct)
const;
354 void getCenter(
const Octant* oct, darray3& centerCoords)
const;
355 darray3
getCenter(
const Octant* oct)
const;
356 darray3
getFaceCenter(
const Octant* oct, uint8_t face)
const;
357 void getFaceCenter(
const Octant* oct, uint8_t face, darray3& centerCoords)
const;
358 darray3
getNode(
const Octant* oct, uint8_t node)
const;
359 void getNode(
const Octant* oct, uint8_t node, darray3& nodeCoords)
const;
360 void getNodes(
const Octant* oct, darr3vector & nodesCoords)
const;
361 darr3vector
getNodes(
const Octant* oct)
const;
362 void getNormal(
const Octant* oct, uint8_t face, darray3 & normal)
const;
363 darray3
getNormal(
const Octant* oct, uint8_t face)
const;
364 int8_t
getMarker(
const Octant* oct)
const;
365 uint8_t
getLevel(
const Octant* oct)
const;
366 uint64_t
getMorton(
const Octant* oct)
const;
370 bool getBound(
const Octant* oct, uint8_t face)
const;
371 bool getBound(
const Octant* oct)
const;
372 bool getPbound(
const Octant* oct, uint8_t face)
const;
376 uint32_t
getIdx(
const Octant* oct)
const;
380 void setMarker(Octant* oct, int8_t marker);
408 uint8_t
getLevel(
const Intersection* inter)
const;
409 bool getFiner(
const Intersection* inter)
const;
410 bool getBound(
const Intersection* inter)
const;
411 bool getIsGhost(
const Intersection* inter)
const;
412 bool getPbound(
const Intersection* inter)
const;
413 uint8_t
getFace(
const Intersection* inter)
const;
414 u32vector
getOwners(
const Intersection* inter)
const;
415 uint32_t
getIn(
const Intersection* inter)
const;
416 uint32_t
getOut(
const Intersection* inter)
const;
418 double getSize(
const Intersection* inter)
const;
419 double getArea(
const Intersection* inter)
const;
420 darray3
getCenter(
const Intersection* inter)
const;
421 darr3vector
getNodes(
const Intersection* inter)
const;
422 darray3
getNormal(
const Intersection* inter)
const;
428 const Octant*
getOctant(uint32_t idx)
const;
442 void setDim(uint8_t dim);
443#if BITPIT_ENABLE_MPI==1
444 void updateGlobalFirstDescMorton();
445 void updateGlobalLasttDescMorton();
452#if BITPIT_ENABLE_MPI==1
453 void _initializeCommunicator(MPI_Comm comm);
455 void _initializeSerialCommunicator();
457 void _initializePartitions();
458 void _initialize(uint8_t dim,
const std::string &logfile);
460#if BITPIT_ENABLE_MPI==1
461 void initialize(
const std::string &logfile, MPI_Comm comm);
462 void initialize(uint8_t dim,
const std::string &logfile, MPI_Comm comm);
464 void initialize(
const std::string &logfile);
465 void initialize(uint8_t dim,
const std::string &logfile);
467 void initializeLogger(
const std::string &logfile);
468 void reinitialize(uint8_t dim,
const std::string &logfile);
470 void reset(
bool createRoot);
472 uint64_t evalPointAnchorMorton(
const double * point)
const;
478 void findNeighbours(
const Octant* oct, uint8_t face, uint8_t codim, u32vector & neighbours, bvector & isghost,
bool onlyinternals,
bool append)
const;
480 void findNeighbours(uint32_t idx, uint8_t face, uint8_t codim, u32vector & neighbours, bvector & isghost)
const;
481 void findNeighbours(uint32_t idx, uint8_t face, uint8_t codim, u32vector & neighbours)
const;
482 void findNeighbours(
const Octant* oct, uint8_t face, uint8_t codim, u32vector & neighbours, bvector & isghost)
const ;
483 void findGhostNeighbours(uint32_t idx, uint8_t face, uint8_t codim, u32vector & neighbours)
const;
484 void findGhostNeighbours(uint32_t idx, uint8_t face, uint8_t codim, u32vector & neighbours, bvector & isghost)
const;
485 void findGhostNeighbours(
const Octant* oct, uint8_t face, uint8_t codim, u32vector & neighbours, bvector & isghost)
const;
487 void findAllNodeNeighbours(
const Octant* oct, uint32_t node, u32vector & neighbours, bvector & isghost)
const;
502 void getMapping(uint32_t idx, u32vector & mapper, bvector & isghost)
const;
503 void getMapping(uint32_t idx, u32vector & mapper, bvector & isghost, ivector & rank)
const;
504 void getPreMapping(u32vector & idx, std::vector<int8_t> & markers, std::vector<bool> & isghost);
505 bool isNodeOnOctant(
const Octant* nodeOctant, uint8_t nodeIndex,
const Octant* octant)
const;
506 bool isEdgeOnOctant(
const Octant* edgeOctant, uint8_t edgeIndex,
const Octant* octant)
const;
507 bool isFaceOnOctant(
const Octant* faceOctant, uint8_t faceIndex,
const Octant* octant)
const;
521 bool adapt(
bool mapper_flag =
false);
530 const u32arr3vector &
getNodes()
const;
537#if BITPIT_ENABLE_MPI==1
539 void loadBalance(uint8_t & level,
const dvector* weight = NULL);
546 ExchangeRanges evalLoadBalanceSendRanges(
const uint32_t *updatedPartition);
547 ExchangeRanges evalLoadBalanceRecvRanges(
const uint32_t *updatedPartition);
549 PartitionIntersections evalPartitionIntersections(
const uint32_t *schema_A,
int rank_A,
const uint32_t *schema_B);
563 Octant& extractOctant(uint32_t idx);
564 bool private_adapt_mapidx(
bool mapflag);
566#if BITPIT_ENABLE_MPI==1
567 void computePartition(uint32_t *partition);
568 void computePartition(
const dvector *weight, uint32_t *partition);
569 void computePartition(uint8_t level_,
const dvector *weight, uint32_t *partition);
570 void updateLoadBalance();
571 void setPboundGhosts();
572 void buildGhostOctants(
const std::map<int, u32vector> &bordersPerProc,
const std::vector<AccretionData> &accretions);
573 void initializeGhostHaloAccretions(std::vector<AccretionData> *accretions);
574 void growGhostHaloAccretions(std::unordered_map<uint32_t, std::vector<uint64_t>> *cachedOneRings, std::vector<AccretionData> *accretions);
575 void exchangeGhostHaloAccretions(DataCommunicator *dataCommunicator, std::vector<AccretionData> *accretions);
577 void computeGhostHalo();
580 void updateAfterCoarse();
581 void balance21(
bool verbose,
bool balanceNewOctants);
582 void createPartitionInfo();
584 bool isInternal(uint64_t gidx)
const;
590 void write(
const std::string &filename);
591 void writeTest(
const std::string &filename, dvector data);
596#if BITPIT_ENABLE_MPI==1
605 size_t fixedDataSize = userData.
fixedSize();
606 std::map<int,u32vector >::iterator bitend = m_bordersPerProc.end();
607 std::map<int,u32vector >::iterator bitbegin = m_bordersPerProc.begin();
608 for(std::map<int,u32vector >::iterator bit = bitbegin; bit != bitend; ++bit){
609 int key = bit->first;
610 const u32vector & pborders = bit->second;
612 size_t nofPbordersPerProc = pborders.size();
613 if(fixedDataSize != 0){
614 buffSize = fixedDataSize*nofPbordersPerProc;
617 for(
size_t i = 0; i < nofPbordersPerProc; ++i){
618 buffSize += userData.
size(pborders[i]);
622 buffSize +=
sizeof(size_t);
624 communicator.
setSend(key,buffSize);
627 sendBuffer << nofPbordersPerProc;
630 for(
size_t j = 0; j < nofPbordersPerProc; ++j){
631 userData.
gather(sendBuffer,pborders[j]);
642 std::vector<int> recvRanks = communicator.
getRecvRanks();
643 std::sort(recvRanks.begin(),recvRanks.end());
644 for(
int rank : recvRanks){
647 size_t nofGhostFromThisProc = 0;
648 recvBuffer >> nofGhostFromThisProc;
649 for(
size_t k = 0; k < nofGhostFromThisProc; ++k){
650 userData.
scatter(recvBuffer, k+ghostOffset);
652 ghostOffset += nofGhostFromThisProc;
668 (*m_log) <<
"---------------------------------------------" << std::endl;
669 (*m_log) <<
" LOAD BALANCE " << std::endl;
671 m_lastOp = OP_LOADBALANCE;
674 std::vector<uint32_t> partition(m_nproc);
676 computePartition(partition.data());
678 computePartition(weight, partition.data());
685 (*m_log) <<
" " << std::endl;
686 (*m_log) <<
" Final Parallel partition : " << std::endl;
687 (*m_log) <<
" Octants for proc "+ std::to_string(
static_cast<unsigned long long>(0))+
" : " + std::to_string(
static_cast<unsigned long long>(m_partitionRangeGlobalIdx[0]+1)) << std::endl;
688 for(
int ii=1; ii<m_nproc; ii++){
689 (*m_log) <<
" Octants for proc "+ std::to_string(
static_cast<unsigned long long>(ii))+
" : " + std::to_string(
static_cast<unsigned long long>(m_partitionRangeGlobalIdx[ii]-m_partitionRangeGlobalIdx[ii-1])) << std::endl;
691 (*m_log) <<
" " << std::endl;
692 (*m_log) <<
"---------------------------------------------" << std::endl;
696 m_loadBalanceRanges.clear();
698 (*m_log) <<
" " << std::endl;
699 (*m_log) <<
" Serial partition : " << std::endl;
700 (*m_log) <<
" Octants for proc "+ std::to_string(
static_cast<unsigned long long>(0))+
" : " + std::to_string(
static_cast<unsigned long long>(m_partitionRangeGlobalIdx[0]+1)) << std::endl;
701 (*m_log) <<
" " << std::endl;
702 (*m_log) <<
"---------------------------------------------" << std::endl;
720 (*m_log) <<
"---------------------------------------------" << std::endl;
721 (*m_log) <<
" LOAD BALANCE " << std::endl;
723 m_lastOp = OP_LOADBALANCE;
726 std::vector<uint32_t> partition(m_nproc);
727 computePartition(level, weight, partition.data());
732 (*m_log) <<
" " << std::endl;
733 (*m_log) <<
" Final Parallel partition : " << std::endl;
734 (*m_log) <<
" Octants for proc "+ std::to_string(
static_cast<unsigned long long>(0))+
" : " + std::to_string(
static_cast<unsigned long long>(m_partitionRangeGlobalIdx[0]+1)) << std::endl;
735 for(
int ii=1; ii<m_nproc; ii++){
736 (*m_log) <<
" Octants for proc "+ std::to_string(
static_cast<unsigned long long>(ii))+
" : " + std::to_string(
static_cast<unsigned long long>(m_partitionRangeGlobalIdx[ii]-m_partitionRangeGlobalIdx[ii-1])) << std::endl;
738 (*m_log) <<
" " << std::endl;
739 (*m_log) <<
"---------------------------------------------" << std::endl;
743 m_loadBalanceRanges.clear();
745 (*m_log) <<
" " << std::endl;
746 (*m_log) <<
" Serial partition : " << std::endl;
747 (*m_log) <<
" Octants for proc "+ std::to_string(
static_cast<unsigned long long>(0))+
" : " + std::to_string(
static_cast<unsigned long long>(m_partitionRangeGlobalIdx[0]+1)) << std::endl;
748 (*m_log) <<
" " << std::endl;
749 (*m_log) <<
"---------------------------------------------" << std::endl;
767 (*m_log) <<
" " << std::endl;
769 (*m_log) <<
" Initial Serial distribution : " << std::endl;
771 (*m_log) <<
" Initial Parallel partition : " << std::endl;
773 (*m_log) <<
" Octants for proc "+ std::to_string(
static_cast<unsigned long long>(0))+
" : " + std::to_string(
static_cast<unsigned long long>(m_partitionRangeGlobalIdx[0]+1)) << std::endl;
774 for(
int ii=1; ii<m_nproc; ii++){
775 (*m_log) <<
" Octants for proc "+ std::to_string(
static_cast<unsigned long long>(ii))+
" : " + std::to_string(
static_cast<unsigned long long>(m_partitionRangeGlobalIdx[ii]-m_partitionRangeGlobalIdx[ii-1])) << std::endl;
779 std::unordered_map<int, std::array<uint32_t, 2>> sendRanges = evalLoadBalanceSendRanges(partition);
780 std::unordered_map<int, std::array<uint32_t, 2>> recvRanges = evalLoadBalanceRecvRanges(partition);
787 uint32_t newSizeOctants = partition[m_rank];
789 uint64_t newLastOctantGlobalIdx;
790 uint64_t newFirstOctantGlobalIdx;
791 if (newSizeOctants > 0) {
792 newLastOctantGlobalIdx = partition[0];
793 for (
int p = 1; p < m_rank + 1; ++p) {
794 newLastOctantGlobalIdx += partition[p];
796 --newLastOctantGlobalIdx;
798 newFirstOctantGlobalIdx = newLastOctantGlobalIdx - newSizeOctants + 1;
800 newLastOctantGlobalIdx = 0;
801 newFirstOctantGlobalIdx = 1;
806 m_lastOp = OP_LOADBALANCE_FIRST;
808 if (newFirstOctantGlobalIdx != 0) {
809 for (uint32_t i = 0; i < newSizeOctants; ++i){
810 m_octree.m_octants[i] = m_octree.m_octants[newFirstOctantGlobalIdx + i];
812 userData->move(newFirstOctantGlobalIdx + i, i);
817 m_octree.m_octants.resize(newSizeOctants);
818 m_octree.m_octants.shrink_to_fit();
821 userData->resize(newSizeOctants);
826 uint64_t lastOctantGlobalIdx = m_partitionRangeGlobalIdx[m_rank];
827 uint64_t firstOctantGlobalIdx = lastOctantGlobalIdx - m_octree.m_octants.size() + 1;
832 if (!userData || userData->fixedSize()) {
833 for (
const auto &entry : recvRanges) {
834 int rank = entry.first;
835 uint32_t beginRecvIdx = entry.second[0];
836 uint32_t endRecvIdx = entry.second[1];
838 uint32_t nOctantsToReceive = endRecvIdx - beginRecvIdx;
841 buffSize += nOctantsToReceive * userData->fixedSize();
844 lbCommunicator.
setRecv(rank, buffSize);
849 for (
const auto &entry : sendRanges) {
850 int rank = entry.first;
851 uint32_t beginSendIdx = entry.second[0];
852 uint32_t endSendIdx = entry.second[1];
854 uint32_t nOctantsToSend = endSendIdx - beginSendIdx;
857 if (userData->fixedSize()) {
858 buffSize += nOctantsToSend * userData->fixedSize();
860 for (uint32_t i = beginSendIdx; i < endSendIdx; ++i) {
861 buffSize += userData->size(i);
865 lbCommunicator.
setSend(rank, buffSize);
868 for (uint32_t i = beginSendIdx; i < endSendIdx; ++i) {
869 sendBuffer << m_octree.m_octants[i];
870 userData->gather(sendBuffer, i);
876 if (userData && !userData->fixedSize()) {
882 if (newSizeOctants > m_octree.m_octants.size()) {
883 m_octree.m_octants.reserve(newSizeOctants);
884 m_octree.m_octants.resize(newSizeOctants);
887 userData->resize(newSizeOctants);
891 bool hasResidentOctants;
892 if (newSizeOctants > 0) {
893 hasResidentOctants =
true;
894 if (newFirstOctantGlobalIdx > lastOctantGlobalIdx) {
895 hasResidentOctants =
false;
896 }
else if (newLastOctantGlobalIdx < firstOctantGlobalIdx) {
897 hasResidentOctants =
false;
900 hasResidentOctants =
false;
903 if (hasResidentOctants) {
904 uint64_t firstResidentGlobalOctantIdx = std::max(firstOctantGlobalIdx, newFirstOctantGlobalIdx);
905 uint64_t lastResidentGlobalOctantIdx = std::min(lastOctantGlobalIdx, newLastOctantGlobalIdx);
907 uint32_t nofResidents =
static_cast<uint32_t
>(lastResidentGlobalOctantIdx - firstResidentGlobalOctantIdx + 1);
908 uint32_t newFirstResidentOffsetIdx =
static_cast<uint32_t
>(firstResidentGlobalOctantIdx - newFirstOctantGlobalIdx);
909 uint32_t firstResidentOffsetIdx =
static_cast<uint32_t
>(firstResidentGlobalOctantIdx - firstOctantGlobalIdx);
916 if (newFirstResidentOffsetIdx != firstResidentOffsetIdx) {
917 for (uint32_t i = 0; i < nofResidents; ++i) {
919 if (newFirstResidentOffsetIdx < firstResidentOffsetIdx) {
922 residentIdx = nofResidents - i - 1;
925 m_octree.m_octants[newFirstResidentOffsetIdx + residentIdx] = m_octree.m_octants[firstResidentOffsetIdx + residentIdx];
927 userData->move(firstResidentOffsetIdx + residentIdx, newFirstResidentOffsetIdx + residentIdx);
933 if (newSizeOctants < m_octree.m_octants.size()) {
934 m_octree.m_octants.resize(newSizeOctants);
935 m_octree.m_octants.shrink_to_fit();
938 userData->resize(newSizeOctants);
944 int nCompletedRecvs = 0;
945 while (nCompletedRecvs < lbCommunicator.
getRecvCount()) {
949 const std::array<uint32_t, 2> &recvRange = recvRanges.at(senderRank);
950 uint32_t beginRecvIdx = recvRange[0];
951 uint32_t endRecvIdx = recvRange[1];
953 assert(!userData || !userData->fixedSize() || ((endRecvIdx - beginRecvIdx) == (recvBuffer.
getSize() / (
Octant::getBinarySize() + userData->fixedSize()))));
955 for (uint32_t i = beginRecvIdx; i < endRecvIdx; ++i) {
956 recvBuffer >> m_octree.m_octants[i];
958 userData->scatter(recvBuffer, i);
972 m_octree.m_ghosts.clear();
977 userData->resizeGhost(m_octree.getNumGhosts());
Base class for data communications.
void scatter(Buffer &buff, const uint32_t e)
void gather(Buffer &buff, const uint32_t e)
size_t size(const uint32_t e) const
The DataCommunicator class provides the infrastructure needed to exchange data among processes.
void setRecv(int rank, long length=0)
void startRecv(int srcRank)
SendBuffer & getSendBuffer(int rank)
const std::vector< int > & getRecvRanks() const
int waitAnyRecv(const std::vector< int > &blackList=std::vector< int >())
void setSend(int rank, long length=0)
RecvBuffer & getRecvBuffer(int rank)
void startSend(int dstRank)
Base class for data communications.
static unsigned int getBinarySize()
Para Tree is the user interface class.
uint8_t getNnodesperface() const
Octant * getPointOwner(const dvector &point)
void write(const std::string &filename)
uint32_t getLocalIdx(uint64_t gidx) const
double levelToSize(uint8_t level) const
uint32_t getGhostLocalIdx(uint64_t gidx) const
void setMarker(uint32_t idx, int8_t marker)
bool isFaceOnOctant(const Octant *faceOctant, uint8_t faceIndex, const Octant *octant) const
const u32array3 & getNodeLogicalCoordinates(uint32_t node) const
uint32_t getNumIntersections() const
int8_t getMaxDepth() const
uint32_t getNumOctants() const
uint8_t getNchildren() const
void getPreMapping(u32vector &idx, std::vector< int8_t > &markers, std::vector< bool > &isghost)
const uint8_t(* getFacenode() const)[4]
bool getPbound(uint32_t idx, uint8_t face) const
void expectedOctantAdapt(const Octant *octant, int8_t marker, octvector *result) const
const u32arr3vector & getNodes() const
bool adaptGlobalCoarse(bool mapper_flag=false)
uint8_t getFamilySplittingNode(const Octant *) const
bool adapt(bool mapper_flag=false)
const int8_t(* getNormals() const)[3]
void findAllNodeNeighbours(uint32_t idx, uint32_t node, u32vector &neighbours, bvector &isghost)
void findGhostAllCodimensionNeighbours(uint32_t idx, u32vector &neighbours, bvector &isghost)
Octant * getOctant(uint32_t idx)
void getMapping(uint32_t idx, u32vector &mapper, bvector &isghost) const
void loadBalance(DataLBInterface< Impl > &userData, dvector *weight=NULL)
octantID getPersistentIdx(uint32_t idx) const
virtual void restore(std::istream &stream)
bool getBalance(uint32_t idx) const
double getLocalMinSize() const
void loadBalance(const dvector *weight=NULL)
void setNofGhostLayers(std::size_t nofGhostLayers)
uint64_t getMorton(uint32_t idx) const
void computeConnectivity()
ParaTree(const std::string &logfile=DEFAULT_LOG_FILE, MPI_Comm comm=MPI_COMM_WORLD)
darray3 getFaceCenter(uint32_t idx, uint8_t face) const
uint8_t getNnodes() const
uint64_t getLastDescMorton() const
int getPointOwnerRank(const darray3 &point)
bool getBound(uint32_t idx, uint8_t face) const
int findOwner(uint64_t morton) const
static BITPIT_PUBLIC_API const std::string DEFAULT_LOG_FILE
uint32_t getIn(const Intersection *inter) const
const uint8_t(* getEdgeface() const)[2]
Operation getLastOperation() const
const std::vector< uint64_t > & getPartitionLastDesc() const
uint32_t getMaxLength() const
bool adaptGlobalRefine(bool mapper_flag=false)
octantIterator getInternalOctantsBegin()
double getSize(uint32_t idx) const
const std::vector< uint64_t > & getPartitionFirstDesc() const
LoadBalanceRanges evalLoadBalanceRanges(dvector *weights)
double getY(uint32_t idx) const
const int8_t(* getEdgecoeffs() const)[3]
const std::vector< uint64_t > & getPartitionRangeGlobalIdx() const
bvector getPeriodic() const
uint32_t getPointOwnerIdx(const double *point) const
void setBalanceCodimension(uint8_t b21codim)
darray3 getNode(uint32_t idx, uint8_t node) const
void writeTest(const std::string &filename, dvector data)
bool isNodeOnOctant(const Octant *nodeOctant, uint8_t nodeIndex, const Octant *octant) const
double getZ(uint32_t idx) const
const std::map< int, std::vector< uint32_t > > & getBordersPerProc() const
const LoadBalanceRanges & getLoadBalanceRanges() const
void setTol(double tol=1.0e-14)
bool getFiner(const Intersection *inter) const
uint64_t computeNodePersistentKey(uint32_t idx, uint8_t node) const
double getArea(uint32_t idx) const
bool getIsGhost(const Intersection *inter) const
uint32_t getIdx(const Octant *oct) const
bool isEdgeOnOctant(const Octant *edgeOctant, uint8_t edgeIndex, const Octant *octant) const
std::size_t getNofGhostLayers() const
void findAllCodimensionNeighbours(uint32_t idx, u32vector &neighbours, bvector &isghost)
uint64_t getFirstDescMorton() const
void findGhostNeighbours(uint32_t idx, uint8_t face, uint8_t codim, u32vector &neighbours) const
darray3 getCoordinates(uint32_t idx) const
octantIterator getPboundOctantsBegin()
void loadBalance(DataLBInterface< Impl > &userData, uint8_t &level, dvector *weight=NULL)
uint8_t getFace(const Intersection *inter) const
int8_t getMarker(uint32_t idx) const
uint32_t getNumGhosts() const
const u32vector2D & getGhostConnectivity() const
uint8_t getNedges() const
const uint8_t(* getNodeface() const)[3]
int getOwnerRank(uint64_t globalIdx) const
octantIterator getInternalOctantsEnd()
uint64_t getGlobalNumOctants() const
uint32_t getNumNodes() const
uint32_t getOut(const Intersection *inter) const
void updateConnectivity()
uint8_t getNfaces() const
bool getOutIsGhost(const Intersection *inter) const
void communicate(DataCommInterface< Impl > &userData)
uint8_t getLocalMaxDepth() const
int getGhostLayer(const Octant *oct) const
double getVolume(uint32_t idx) const
virtual int getDumpVersion() const
const int8_t(* getNodecoeffs() const)[3]
uint8_t getLevel(uint32_t idx) const
const uint8_t * getOppface() const
void clearConnectivity(bool release=true)
double getX(uint32_t idx) const
void computeIntersections()
void replaceComm(MPI_Comm communicator, MPI_Comm *previousCommunicator=nullptr)
bool getIsNewC(uint32_t idx) const
uint64_t getGlobalIdx(uint32_t idx) const
void getCenter(uint32_t idx, darray3 ¢erCoords) const
darray3 getNodeCoordinates(uint32_t node) const
u32vector getOwners(const Intersection *inter) const
void setPeriodic(uint8_t i)
const u32vector2D & getConnectivity() const
void setBalance(uint32_t idx, bool balance)
int8_t getPreMarker(uint32_t idx)
void privateLoadBalance(const uint32_t *partition, DataLBInterface< Impl > *userData=nullptr)
virtual void dump(std::ostream &stream, bool full=true)
uint64_t getGhostGlobalIdx(uint32_t idx) const
void setComm(MPI_Comm communicator)
uint8_t getBalanceCodimension() const
void getNormal(uint32_t idx, uint8_t face, darray3 &normal) const
octantIterator getPboundOctantsEnd()
uint64_t getStatus() const
Intersection * getIntersection(uint32_t idx)
Octant * getGhostOctant(uint32_t idx)
double getLocalMaxSize() const
darray3 getOrigin() const
bool getIsNewR(uint32_t idx) const
Buffer to be used for receive communications.
Buffer to be used for send communications.
std::unordered_map< int, std::array< uint32_t, 2 > > ExchangeRanges