function [global_nr,elem_global,neigh_face] = LocalToGlobal_map(local_nr,vector_of_elems)

Globals2D;

elem_local = floor((local_nr - 1) / (N_faces * N_fp)) + 1;
elem_global = vector_of_elems(elem_local);
elem_nr = local_nr - (elem_local - 1) * N_faces * N_fp;
global_nr = (elem_global - 1) * N_faces * N_fp + elem_nr;
neigh_face = floor((elem_nr - 1) / N_fp) + 1;

end