1 %% Copyright (c) 2010 Juan Pablo Carbajal <carbajal@ifi.uzh.ch>
3 %% This program is free software: you can redistribute it and/or modify
4 %% it under the terms of the GNU General Public License as published by
5 %% the Free Software Foundation, either version 3 of the License, or
8 %% This program is distributed in the hope that it will be useful,
9 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
10 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 %% GNU General Public License for more details.
13 %% You should have received a copy of the GNU General Public License
14 %% along with this program. If not, see <http://www.gnu.org/licenses/>.
17 %% @deftypefn {Function File} @var{str} = lineLoopGeo (@var{id}, @var{nl}, @var{lns})
18 %% Generates a string for Gmsh Line Loop format.
20 %% The third elementary entity is the surface. In order to define a
21 %% simple rectangular surface from defined lines, a
22 %% line loop has first to be defined. A line loop is a list of
23 %% connected lines, a sign being associated with each line (depending
24 %% on the orientation of the line). @var{id} is an indentifier for the loop.
25 %% @var{nl} is the number of lines in the loop. @var{lns} is the list of lines.
29 function str = lineLoopGeo(id,nl,lns)
30 substr = repmat(',%d',1,nl-1);
31 str = sprintf(['Line Loop(%d) = {%d' substr '};\n'],id,lns);