% collect data from computation from armadillo
n_partitions = max(E_parts);
partitions_matrix = zeros(n_partitions,K);
pointers = ones(1,n_partitions);
for i = 1:K
    part_ID = E_parts(i);
    partitions_matrix(part_ID,pointers(part_ID)) = i;
    pointers(part_ID) = pointers(part_ID) + 1;
end
partitions = cell(n_partitions,1);
for i = 1:n_partitions
    partitions_vector = partitions_matrix(i,:);
    partitions_vector(pointers(i):end) = [];
    partitions{i} = partitions_vector;
end

mesh_size_parameter_string = sprintf('%0.3f',mesh_size_parametr);
mesh_size_parameter_string = strrep(mesh_size_parameter_string,'.',',');
u = zeros(N_p,K);
for i = 1:n_partitions
    filename = ['advekce_2D_u_spoctene_pro_N=',num2str(N),'_a_h=',mesh_size_parameter_string,'_partition',num2str(i - 1),'.txt'];
    u_partition = load(filename);
    u(:,partitions{i}) = u_partition;
end