-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathinterval.cpp
More file actions
34 lines (23 loc) · 797 Bytes
/
interval.cpp
File metadata and controls
34 lines (23 loc) · 797 Bytes
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
// Copyright 2018-2025 the samurai's authors
// SPDX-License-Identifier: BSD-3-Clause
#include <iostream>
#include <samurai/cell_array.hpp>
#include <samurai/cell_list.hpp>
int main()
{
constexpr std::size_t dim = 2; // cppcheck-suppress unreadVariable
samurai::CellList<dim> cl;
cl[0][{}].add_interval({0, 2});
cl[0][{}].add_interval({5, 6});
cl[1][{}].add_interval({4, 7});
cl[1][{}].add_interval({8, 10});
cl[2][{}].add_interval({15, 17});
const samurai::CellArray<dim> ca{cl};
std::cout << ca << std::endl;
constexpr std::size_t start_level = 3;
const samurai::Box<double, dim> box({-1, -1}, {1, 1});
samurai::CellArray<dim> ca_box;
ca_box[start_level] = {start_level, box};
std::cout << ca_box << std::endl;
return 0;
}