OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
LB_Model.hpp
1 /*
2  * LB_Model.hpp
3  *
4  * Created on: Jan 18, 2017
5  * Author: i-bird
6  */
7 
8 #ifndef SRC_DLB_LB_MODEL_HPP_
9 #define SRC_DLB_LB_MODEL_HPP_
10 
16 struct ModelLin
17 {
18  size_t factor = 1;
19 
20  ModelLin(size_t factor)
21  :factor(factor)
22  {}
23 
24  ModelLin() {}
25 
26  template<typename Decomposition, typename vector> inline void addComputation(Decomposition & dec, const vector & vd, size_t v, size_t p)
27  {
28  dec.addComputationCost(v, 1);
29  }
30 
31  template<typename Decomposition> inline void applyModel(Decomposition & dec, size_t v)
32  {
33  dec.setSubSubDomainComputationCost(v, dec.getSubSubDomainComputationCost(v));
34  }
35 
36  double distributionTol()
37  {
38  return 1.01;
39  }
40 };
41 
48 {
49  size_t factor = 1;
50 
51  template<typename Decomposition, typename vector> inline void addComputation(Decomposition & dec, const vector & vd, size_t v, size_t p)
52  {
53  dec.addComputationCost(v, factor);
54  }
55 
56  template<typename Decomposition> inline void applyModel(Decomposition & dec, size_t v)
57  {
58  dec.setSubSubDomainComputationCost(v, dec.getSubSubDomainComputationCost(v) * dec.getSubSubDomainComputationCost(v));
59  }
60 
61  double distributionTol()
62  {
63  return 1.01;
64  }
65 };
66 
67 
68 #endif /* SRC_DLB_LB_MODEL_HPP_ */
This class define the domain decomposition interface.
Linear model.
Definition: LB_Model.hpp:16
Linear model.
Definition: LB_Model.hpp:47