build_fixbuf.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This file is part of NS2DDV. %
% %
% Copyright(C) 2011-2018 C. Calgaro (caterina.calgaro@math.univ-lille1.fr) %
% E. Creusé (emmanuel.creuse@math.univ-lille1.fr) %
% T. Goudon (thierry.goudon@inria.fr) %
% A. Mouton (alexandre.mouton@math.univ-lille1.fr) %
% %
% NS2DDV is free software: you can redistribute it and/or modify it under the terms %
% of the GNU General Public License as published by the Free Software Foundation, %
% either version 3 of the License, or (at your option) any later version. %
% %
% NS2DDV is distributed in the hope that it will be useful, but WITHOUT ANY %
% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A %
% PARTICULAR PURPOSE. See the GNU General Public License for more details. %
% %
% You should have received a copy of the GNU General Public License along with %
% NS2DDV. If not, see <http://www.gnu.org/licenses/>. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function[fixbuf] = build_fixbuf(answers)
% Header for the part of manual_setup that cannot be modified by the user
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fixbuf = {};
k = 1;
fixbuf{k} = '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%';
k = k+1;
fixbuf{k} = '% This file has been generated by NS2DDV routine generate_setup_file.m %';
k = k+1;
fixbuf{k} = '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%';
k = k+1;
fixbuf{k} = '';
k = k+1;
fixbuf{k} = '% This part has been automatically generated: please do not modify it !';
k = k+1;
fixbuf{k} = '% The parameters you can modify are located at the end of this file ';
k = k+1;
fixbuf{k} = '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%';
k = k+1;
fixbuf{k} = '';
k = k+1;
% Add the cluster
%%%%%%%%%%%%%%%%%
fixbuf{k} = strcat('PARAMETERS.PARALLELIZATION.SERVER = ''', answers.CLUSTER, ''';');
k = k+1;
% Add the model
%%%%%%%%%%%%%%%
fixbuf{k} = strcat('PARAMETERS.MODEL = ''', answers.MODEL, ''';');
k = k+1;
% Add the test case
%%%%%%%%%%%%%%%%%%%
fixbuf{k} = strcat('PARAMETERS.TESTCASE = ''', answers.TESTCASE, ''';');
k = k+1;
% Add the convergence study
%%%%%%%%%%%%%%%%%%%%%%%%%%%
fixbuf{k} = strcat('PARAMETERS.CV_STUDY = ''', answers.CV_STUDY, ''';');
k = k+1;
% Add the geometry
%%%%%%%%%%%%%%%%%%
fixbuf{k} = strcat('PARAMETERS.DOMAIN.GEOMETRY = ''', answers.GEOM, ''';');
k = k+1;
% Add the Finite Volumes parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
switch answers.MODEL
case {'NSDV'}
fixbuf{k} = strcat('PARAMETERS.FV.SCHEME = ''', answers.FV, ''';');
k = k+1;
case {'NS'}
otherwise
error('Unknown model');
end
% Add the parallelization parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fixbuf{k} = strcat('PARAMETERS.PARALLELIZATION.TOOLBOX = ''', answers.PARALLEL, ''';');
k = k+1;
if ~strcmp(answers.PARALLEL, 'SERIAL')
fixbuf{k} = 'localcluster = parcluster(''local'');';
k = k+1;
end
% Linear system resolution parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fixbuf{k} = 'PARAMETERS.LINSYS.DIRECT_INVERSION = ''YES'';';
k = k+1;
% Linear system resolution parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fixbuf{k} = 'PARAMETERS.MESH.ADAPTATIVE = ''NO'';';
k = k+1;
fixbuf{k} = '';
k = k+1;
fixbuf{k} = '';
k = k+1;
fixbuf{k} = '';
k = k+1;
fixbuf{k} = '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%';
k = k+1;
fixbuf{k} = '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%';
k = k+1;
fixbuf{k} = '% From this line, you can modify the values of the parameters';
k = k+1;
fixbuf{k} = '% Every string you mention must be written between simple quotes ('' '')';
k = k+1;
fixbuf{k} = '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%';
k = k+1;
fixbuf{k} = '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%';
k = k+1;
end