LB_Model.hpp 1.33 KB
Newer Older
incardon's avatar
incardon committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * LB_Model.hpp
 *
 *  Created on: Jan 18, 2017
 *      Author: i-bird
 */

#ifndef SRC_DLB_LB_MODEL_HPP_
#define SRC_DLB_LB_MODEL_HPP_

/*! \brief Linear model
 *
 * The linear model count each particle as weight one
 *
 */
struct ModelLin
{
	size_t factor = 1;

	ModelLin(size_t factor)
	:factor(factor)
	{}

	ModelLin()	{}

	template<typename Decomposition, typename vector> inline void addComputation(Decomposition & dec, const vector & vd, size_t v, size_t p)
	{
		dec.addComputationCost(v, 1);
	}

	template<typename Decomposition> inline void applyModel(Decomposition & dec, size_t v)
	{
		dec.setSubSubDomainComputationCost(v, dec.getSubSubDomainComputationCost(v));
	}
incardon's avatar
incardon committed
35
36
37
38
39

	double setDistributionTol(size_t i)
	{
		return 1.01;
	}
incardon's avatar
incardon committed
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
};

/*! \brief Linear model
 *
 * The linear model count each particle as weight one
 *
 */
struct ModelSquare
{
	size_t factor = 1;

	template<typename Decomposition, typename vector> inline void addComputation(Decomposition & dec, const vector & vd, size_t v, size_t p)
	{
		dec.addComputationCost(v, 1);
	}

	template<typename Decomposition> inline void applyModel(Decomposition & dec, size_t v)
	{
		dec.setSubSubDomainComputationCost(v, dec.getSubSubDomainComputationCost(v) * dec.getSubSubDomainComputationCost(v));
	}
incardon's avatar
incardon committed
60
61
62
63
64

	double setDistributionTol(size_t i)
	{
		return 1.01;
	}
incardon's avatar
incardon committed
65
66
67
68
};


#endif /* SRC_DLB_LB_MODEL_HPP_ */