%**************************************************************************
%This function writes the parameter information to the data file.
%
%Input:
%dat_file, data file for results
%param, structure containing program parameters
%
%Zachary Wolf, 4/8/10

function [] = pm_block_rect_dat_param(dat_file, param)

%Write the parameter information to the data file
fid = fopen(dat_file, 'a');
fprintf(fid, '\r\n');
fprintf(fid, 'Simulation Parameters:\r\n');
fprintf(fid, 'Output file directory = %s\r\n', param.output_file_dir);
fprintf(fid, 'Magnet division size in each dimension for charge calculation = %f m\r\n', param.pm_div_size);
fprintf(fid, 'Permanent magnet remnant field = %f T\r\n', param.pm_br);
fprintf(fid, 'Magnetization [Mx, My, Mz] = [%f, %f, %f] A/m\r\n', param.pm_m(1), param.pm_m(2), param.pm_m(3));
fprintf(fid, 'Magnet block dimensions [Wx, Wy, Wz] = [%f, %f, %f] m\r\n', param.pm_dim(1), param.pm_dim(2), param.pm_dim(3));
fprintf(fid, 'Magnet rotation matrix R_ij = e_rot_i . e_orig_j\r\n');
fprintf(fid, '          [%8.4f, %8.4f, %8.4f\r\n', param.pm_rot(1, 1), param.pm_rot(1, 2), param.pm_rot(1, 3));
fprintf(fid, '      R =  %8.4f, %8.4f, %8.4f\r\n', param.pm_rot(2, 1), param.pm_rot(2, 2), param.pm_rot(2, 3));
fprintf(fid, '           %8.4f, %8.4f, %8.4f]\r\n', param.pm_rot(3, 1), param.pm_rot(3, 2), param.pm_rot(3, 3));
fprintf(fid, 'Magnet translation [Tx, Ty, Tz] = [%f, %f, %f] m\r\n', param.pm_trans(1), param.pm_trans(2), param.pm_trans(3));
fclose(fid);

%Done
