9#include <kernel/adjacency/graph.hpp>
14 namespace VoxelAssembly
16 template<
typename Shape_>
19 static constexpr int dim = Shape_::dimension;
21 static std::vector<int> create_coloring(
int lvl)
23 int num_per_row = 1 << lvl;
26 if constexpr(dim == 3)
28 vec.resize(std::size_t(num_per_row * num_per_row * num_per_row));
29 for(
int j = 0; j < num_per_row * num_per_row * num_per_row; ++j)
31 vec[std::size_t(j)] = j % 8;
38 vec.resize(std::size_t(num_per_row * num_per_row));
39 for(
int j = 0; j < num_per_row * num_per_row; ++j)
41 vec[std::size_t(j)] = j % 4;
50 static std::vector<int> naive_coloring(
int lvl)
52 int num_per_row = 1 << lvl;
53 std::vector<int> vec(std::size_t(num_per_row * num_per_row));
54 for(
int j = 0; j < num_per_row * num_per_row; ++j)
56 vec[std::size_t(j)] = j;
64 template<
typename Mesh_>
65 bool test_coloring(
const Mesh_& mesh,
const std::vector<int>& coloring)
67 auto& cell_to_vert = mesh.template get_index_set<Mesh_::world_dim, 0>();
71 for(
Index i = 0; i < cell_neighbours.get_num_nodes_domain(); ++i)
73 for(
auto ptr = cell_neighbours.image_begin(i); ptr != cell_neighbours.image_end(i); ++ptr)
77 if(coloring.at(*ptr) == coloring.at(i))
79 std::cout <<
"Same color for neighbour!";
Adjacency Graph implementation.
@ transpose
Render-Transpose mode.
@ injectify
Render-Injectified mode.
std::uint64_t Index
Index data type.