clc; clear;

format_spec = '%0.15f';
directory_string = 'generace_dat/';

Globals2D;
N_faces = 3;

Problem;
mesh_size_parameter_string = sprintf('%0.3f',mesh_size_parametr);
mesh_size_parameter_string = strrep(mesh_size_parameter_string,'.',',');

filename = sprintf('P_for_h=%s.txt',mesh_size_parameter_string);
filename = [directory_string,filename];
MatrixToTextFile(P,filename,format_spec,' ');
filename = sprintf('E_for_h=%s.txt',mesh_size_parameter_string);
filename = [directory_string,filename];
MatrixToTextFile(E,filename,'%d',' ');
filename = sprintf('E_partitions_for_h=%s.txt',mesh_size_parameter_string);
filename = [directory_string,filename];
MatrixToTextFile(E_parts,filename,'%d',' ');

StartUp2D_generace_dat;

filename = sprintf('EtoE_for_h=%s.txt',mesh_size_parameter_string);
filename = [directory_string,filename];
MatrixToTextFile(EtoE,filename,'%d',' ');
filename = sprintf('EtoF_for_h=%s.txt',mesh_size_parameter_string);
filename = [directory_string,filename];
MatrixToTextFile(EtoF,filename,'%d',' ');