## Copyright (C) 2013 fotios
##
## This program 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.
##
## This program 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 Octave; see the file COPYING. If not, see
## .
## boundary
## Author: fotios
## Created: 2013-05-30
function [ s ] = boundary (label, xfunc, yfunc, tspan, nop = 10)
if ( (nargin == 0) || (nargin > 5) )
print_usage ();
endif
if ( !isscalar (label) )
error ("label expected to be a unique scalar identifier");
endif
if ( !ischar (xfunc) || !ischar (yfunc) )
error ("functions must be given as strings");
endif
if ( !isvector (tspan) || (numel (tspan) != 2) )
error ("tspan expected to be a two element vector");
endif
fname = "ff2O_bound.idp";
bname = ["B", num2str(label)];
ti = num2str (tspan(1), 17);
tf = num2str (tspan(2), 17);
fid = fopen (fname, "a+");
fprintf (fid, ["border ", bname, "(t = ", ti, ", ", tf, "){ x = ", xfunc, "; y = ", yfunc, "; }\n"]);
fclose (fid);
s = [bname, "(", num2str(nop), ")"];
endfunction