source: trunk/src/set_field_list.m @ 1162

Last change on this file since 1162 was 1162, checked in by sommeria, 4 months ago

further cleaning

File size: 2.5 KB
Line 
1%'set_field_list': defines variables needed for the diff fields(velocity, vort, div...)
2%---------------------------------------------------------------------
3% [FieldList,VecColorList]=set_field_list(UName,VName,CName)
4%
5% OUTPUT:
6%  FieldList: list (cell column) of the fields to propose in the menu FieldName
7%  VecColorList: list (cell column) of the fields to propose in the menu for vector color
8%
9% INPUT:
10%  UName: name of the x vector component
11%  VName: name of the y vector component
12%  CName: name of an additional scalar for color
13%
14% RELATED FUNCTIONS:
15%  varname_generator.m: determines the field names to read in the netcdf
16%  file, depending on the scalar
17
18%=======================================================================
19% Copyright 2008-2024, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
20%   http://www.legi.grenoble-inp.fr
21%   Joel.Sommeria - Joel.Sommeria (A) univ-grenoble-alpes.fr
22%
23%     This file is part of the toolbox UVMAT.
24%
25%     UVMAT is free software; you can redistribute it and/or modify
26%     it under the terms of the GNU General Public License as published
27%     by the Free Software Foundation; either version 2 of the license,
28%     or (at your option) any later version.
29%
30%     UVMAT is distributed in the hope that it will be useful,
31%     but WITHOUT ANY WARRANTY; without even the implied warranty of
32%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
33%     GNU General Public License (see LICENSE.txt) for more details.
34%=======================================================================
35
36function [FieldList,VecColorList]=set_field_list(UName,VName,CName,WName)
37if exist('WName','var')% 3D civ case
38    FieldList={['vec(' UName ',' VName ')'];...
39        ['norm(' UName ',' VName ')'];...
40        UName;...
41        VName;...
42        WName};
43    VecColorList={['norm(' UName ',' VName ')'];...
44        WName;...
45        VName};
46else
47FieldList={['vec(' UName ',' VName ')'];...
48    ['norm(' UName ',' VName ')'];...
49    ['curl(' UName ',' VName ')'];...
50    ['div(' UName ',' VName ')'];...
51    ['strain(' UName ',' VName ')'];...
52    ['DUDX(' UName ',' VName ')'];...
53    ['DUDY(' UName ',' VName ')'];...
54    ['DVDX(' UName ',' VName ')'];...
55    ['DVDY(' UName ',' VName ')'];...
56    UName;...
57    VName};
58VecColorList={['norm(' UName ',' VName ')'];...
59    UName;...
60    VName};...
61end
62if exist('CName','var') && ~isempty(CName)
63    VecColorList=[{CName};VecColorList];
64end
65
66
Note: See TracBrowser for help on using the repository browser.