summaryrefslogtreecommitdiff
path: root/modules/core/c++/descriptor/d2q5.hpp
blob: fef9c405d98757f844c070238140201b86b3b716 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once

#include "common.hpp"

namespace kel {
namespace lbm {
namespace sch {
using D2Q5 = Descriptor<2u,5u>;
}

template<typename T>
class df_info<T,sch::Descriptor<2, 5>> {
public:
	using Descriptor = sch::Descriptor<2,5>;
	
	static constexpr uint64_t D = 2u;
	static constexpr uint64_t Q = 5u;

	static constexpr std::array<std::array<int32_t, D>, Q> directions = {{
		{ 0, 0}, // 0
		{-1, 0}, // 1
		{ 1, 0}, // 2
		{ 0,-1}, // 3
		{ 0, 1}  // 4
	}};

	static constexpr std::array<typename saw::native_data_type<T>::type,Q> weights = {
		1./3.,
		1./6.,
		1./6.,
		1./6.,
		1./6.
	};

	static constexpr std::array<uint64_t,Q> opposite_index = {
		0,
		2,
		1,
		4,
		3
	};
	
	static constexpr typename saw::native_data_type<T>::type inv_cs2 = 3.0;
	static constexpr typename saw::native_data_type<T>::type cs2 = 1./3.;
};


}
}