%--------------------------------------------------------------------------
% CstMeshProperties(fid,CUseRat,CRat,CLinPerWav,CMinStepNum,CAuto,CTMesh)
%
% Pouziti funkce:
% --------------
% Funkce slouzi k zakladnimu nastaveni disktretizace(mesh).
%
% Parametry funkce:
% ----------------
% fid - 
% CUseRat -
% CRat - 
% CLinPerWav -
% CMinStepNum -
% CAuto -
% CTMesh -
%
% Priklad pouziti:
% ----------------
% fid = 
% ...
% CstMeshProperties(fid,'True',20.0,15,50,'True','PBA')
%--------------------------------------------------------------------------
function CstMeshProperties(fid,CUseRat,CRat,CLinPerWav,CMinStepNum,...
    CAuto,CTMesh)
global mws;

% Nastaveni diskretizace
    fprintf(fid, '%% Nastaveni diskretizace\n');
    fprintf(fid, 'mesh = mws.invoke(''Mesh'');\n');
    fprintf(fid, ['mesh.invoke(''UseRatioLimit'',''',CUseRat,''');\n']);
    fprintf(fid, ['mesh.invoke(''RatioLimit'',',num2str(CRat),');\n']);
    fprintf(fid, ['mesh.invoke(''LinesPerWavelength'',',num2str(CLinPerWav),');\n']);
    fprintf(fid, ['mesh.invoke(''MinimumStepNumber'',',num2str(CMinStepNum),');\n']);
    fprintf(fid, ['mesh.invoke(''Automesh'',''',CAuto,''');\n']);
    fprintf(fid, ['mesh.invoke(''MeshType'',''',CTMesh,''');\n']);
   
% Prime  vykonani  programu CST
    mesh = mws.invoke('Mesh');
    mesh.invoke('UseRatioLimit',CUseRat);
    mesh.invoke('RatioLimit',CRat);
    mesh.invoke('LinesPerWavelength',CLinPerWav);
    mesh.invoke('MinimumStepNumber',CMinStepNum);
    mesh.invoke('Automesh',CAuto);
    mesh.invoke('MeshType',CTMesh);


end