FAbstractBalanceAlgorithm.hpp 2.75 KB
Newer Older
1
// ===================================================================================
2 3 4 5
// Copyright ScalFmm 2016 INRIA, Olivier Coulaud, Bérenger Bramas,
// Matthias Messner olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the
// FMM.
6
//
7
// This software is governed by the CeCILL-C and LGPL licenses and
8
// abiding by the rules of distribution of free software.
9 10 11
// An extension to the license is given to allow static linking of scalfmm
// inside a proprietary application (no matter its license).
// See the main license file for more details.
12
//
13 14 15
// This program 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
16 17 18
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
// ===================================================================================

#ifndef FABSTRACTBALANCEALGORITHM_H
#define FABSTRACTBALANCEALGORITHM_H


/**
 * @author Cyrille Piacibello
 * @class FAbstractBalanceAlgorithm
 *
 * @brief This class provide the methods that are used to balance a
 * tree FMpiTreeBuilder::EqualizeAndFillTree
 */
class FAbstractBalanceAlgorithm{
public:
  virtual ~FAbstractBalanceAlgorithm(){
  }
36

37 38 39 40 41 42 43 44 45 46
  /**
   * @brief Give the right leaves (ie the min) of the interval that
   * will be handle by idxOfProc
   * @param numberOfLeaves Total number of leaves that exist.
   * @param numberOfPartPerLeaf Array of lenght numberOfLeaves containing the number of particles in each leaf
   * @param numberOfPart Number of particles in the whole field
   * @param idxOfLeaves Array of lenght numberOfLeaves containing the Morton Index of each Leaf
   * @param numberOfProc Number of MPI processus that will handle the Octree
   * @param idxOfProc Idx of the proc calling.
   */
47 48
  virtual FSize getRight(const FSize numberOfLeaves,
                         const int numberOfProc, const int idxOfProc) = 0;
49 50 51 52 53 54 55 56 57 58 59

  /**
   * @brief Give the Leaft leaves (ie the max) of the interval that
   * will be handle by idxOfProc
   * @param numberOfLeaves Total number of leaves that exist.
   * @param numberOfPartPerLeaf Array of lenght numberOfLeaves containing the number of particles in each leaf
   * @param numberOfPart Number of particles in the whole field
   * @param idxOfLeaves Array of lenght numberOfLeaves containing the Morton Index of each Leaf
   * @param numberOfProc Number of MPI processus that will handle the Octree
   * @param idxOfProc Idx of the proc calling.
   */
60 61
  virtual FSize getLeft(const FSize numberOfLeaves,
                        const int numberOfProc, const int idxOfProc) = 0;
62 63 64 65

};

#endif //FABSTRACTBALANCEALGORITHM_H