summaryrefslogtreecommitdiff
path: root/c++/particle/geometry/circle.hpp
blob: 65b8966d7c2fbf878dd7257eb7398fa5411f0a7a (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
#pragma once

namespace kel {
namespace lbm {

template<typename T>
class particle_circle_geometry {
private:
	saw::data<T> radius_;
public:
	particle_circle_geometry(saw::data<T> radius__):
		radius_{radius__}
	{}

	template<typename MT>
	saw::data<sch::ParticleMask<MT,2>> generate_mask(uint64_t resolution, uint64_t boundary_nodes = 0) const {
		saw::data<sch::ParticleMask<MT,2>> mask;

		auto& grid = mask.template get<"grid">();

		uint64_t size = resolution + 2*boundary_nodes;
		grid = {{size,size}};

		saw::data<T> radius_squared = radius_ * radius_;



		for(uint64_t i = 0; i < size; ++i){
			for(uint64_t j = 0; j < size; ++j){
				if(i < boundary_nodes || j < boundary_nodes || i >= resolution+boundary_nodes || j >= resolution + boundary_nodes ){
					grid.at({i,j}).set(0);
				}else{

				}
			}
		}

		return mask;
	}
};

}
}