24enum BCType { Free, Periodic, PeriodicShearing, Fixed, Ghost, FixedGradient, AntiPeriodic };
31 using vec = sycl::vec<flt, 3>;
32 using vec_box = std::tuple<vec, vec>;
36 std::optional<u32_3> periodic_search_min_vec;
37 std::optional<u32_3> periodic_search_max_vec;
44 inline bool has_outdomain_object() {
45 switch (boundary_type) {
46 case Periodic :
return true;
break;
47 case PeriodicShearing:
return true;
break;
61 inline void check_boundary() {
62 if (boundary_type == PeriodicShearing) {
64 "[SimulationDomain] Boundary CD : Shearing periodic mode not implemented");
67 if (boundary_type == Fixed) {
69 "[SimulationDomain] Boundary CD : Dirichelt mode not implemented");
72 if (boundary_type == Ghost) {
74 "[SimulationDomain] Boundary CD : Ghost mode not implemented");
77 if (boundary_type == FixedGradient) {
79 "[SimulationDomain] Boundary CD : FixedGradient mode not implemented");
82 if (boundary_type == AntiPeriodic) {
84 "[SimulationDomain] Boundary CD : AntiPeriodic mode not implemented");
88 inline void set_box(
const vec_box &b) {
92 inline vec get_periodicity_vector()
const {
95 if (boundary_type == Periodic || boundary_type == PeriodicShearing) {
96 pvec = box_bc.get_size();
97 }
else if (boundary_type == Free) {
101 "[SimulationDomain] Can not set box size with free boundary conditions");
107 inline void set_periodic_search_range(u32_3 min, u32_3 max) {
108 if (!(has_outdomain_object())) {
110 "[SimulationDomain] Can not set periodic search range without periodic bc");
112 periodic_search_min_vec = min;
113 periodic_search_max_vec = max;