13
13
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" version="5.0-subset Scilab" xml:lang="en" xml:id="fec">
15
<refname>fec</refname>
16
<refpurpose> pseudo-color plot of a function defined on a triangular mesh</refpurpose>
19
<title>Calling Sequence</title>
20
<synopsis>fec(x,y,triangles,func,<opt_args>)
21
fec(x,y,triangles,func,[strf,leg,rect,nax,zminmax,colminmax,colout,mesh])
25
<title>Arguments</title>
31
two vectors of size <literal>n</literal>, <literal>(x(i),y(i))</literal> gives the coordinates of
32
node <literal>i</literal>
40
a vector of size <literal>n</literal> : <literal>func(i)</literal> gives the value at node <literal>i</literal>
41
of the function for which we want the pseudo-color plot.
46
<term>triangles</term>
49
is a <literal>[Ntr,5]</literal> matrix. Each line of <literal>triangles</literal> specifies a triangle
50
of the mesh <literal>triangle(j) = [number,node1,node2,node3,flag]</literal>.
51
<literal>node1,node2,node3</literal> are the number of the nodes which constitutes
52
the triangle. number is the number of the triangle and flag is an integer
53
not used in the fec function
58
<term><opt_args></term>
61
This represents a sequence of statements <literal>key1=value1, key2=value2</literal>,... where <literal>key1</literal>,
62
<literal>key2,...</literal> can be one of the following: strf, leg, rect, nax, zminmax, colminmax, colout, mesh
63
(see <link linkend="plot2d">plot2d</link> for the 4 first ones).
68
<term>strf,leg,rect,nax</term>
70
<para>see plot2d</para>
76
<para>vector with 2 components [zmin zmax] (useful in particular for animation)</para>
80
<term>colminmax</term>
82
<para>vector of 2 positives integers [colmin colmax]</para>
88
<para>vector of 2 integers [under_min_col upper_max_col]</para>
94
<para>boolean scalar, default value %f (must be true if you want also display the mesh)</para>
100
<title>Description</title>
101
<para>This function is the good one to draw linear triangular finite element solutions
102
or simply to display a function defined on a triangulation. The color interpolation
103
is done through software computation and so it is not too fast.
106
The function <link linkend="colorbar">colorbar</link> may be used to see the color scale (see the example
110
The <literal>zminmax</literal> argument gives the z values associated with the first and the last
111
color (of the current colormap). More exactly if the colormap have nc colors and if we note
112
<emphasis>dz = (zmax-zmin)/nc</emphasis>, then the part of the triangulation where
113
<emphasis>zmin + (i-1)dz <= z < zmin + i dz</emphasis> is filled with the color <emphasis>i</emphasis>).
114
By default <emphasis>zmin = min(func)</emphasis> and <emphasis>zmax = max(func)</emphasis>. If you want to do
115
an animation with func values that varie in time, take for zmin and zmax the global
116
minimum and maximum or something close.
119
The <literal>colout</literal> argument lets the user choosing the colors for the 2 extremes
120
regions <emphasis>{func < zmin}</emphasis> and <emphasis>{func > zmax}</emphasis>, <literal>under_min_col</literal> and
121
<literal>upper_max_col</literal> may be equal (independantly) to:
127
<para>in this case the same color than in the neighbouring zone is used (CAUTION:
128
you do not see that the corresponding limit is crossed), this is the
136
<para>in this case the extreme region is not painting at all.</para>
142
<para>(k being a valid index to a color of the current colormap) the extreme region
143
is painting in color k.
149
If you do not want to use the complete colormap you may use the <literal>colminmax</literal>
150
argument with <emphasis>1 <= colmin < colmax <= nc</emphasis> (nc being the number of colors
151
of the current colormap) so as to use only the [colmin,colmax] sub-part of the colormap.
152
(by default all the colors of the colormap are used).
155
See the demo files <literal>demos/fec</literal>:
158
<literal>fec.ex1</literal> is a simple demo file in which a mesh and a function
159
on that mesh is completely built in Scilab syntax
162
<literal>fec.ex2</literal> is an example for which the mesh and the function value where
163
computed by an external mesh builder (amdba type mesh) and an external program.
164
A set of macros ( provided in file <literal>macros.sci</literal>) can be used to read the
165
data files in Scilab and plot the results.
169
<title>Sample</title>
170
<scilab:image>fec();</scilab:image>
173
<title>Examples</title>
174
<programlisting role="example"><![CDATA[
15
<refname>fec</refname>
16
<refpurpose> pseudo-color plot of a function defined on a triangular mesh</refpurpose>
19
<title>Calling Sequence</title>
20
<synopsis>fec(x,y,triangles,func,<opt_args>)
21
fec(x,y,triangles,func,[strf,leg,rect,nax,zminmax,colminmax,colout,mesh])
25
<title>Arguments</title>
31
two vectors of size <literal>n</literal>, <literal>(x(i),y(i))</literal> gives the coordinates of
32
node <literal>i</literal>
40
a vector of size <literal>n</literal> : <literal>func(i)</literal> gives the value at node <literal>i</literal>
41
of the function for which we want the pseudo-color plot.
46
<term>triangles</term>
49
is a <literal>[Ntr,5]</literal> matrix. Each line of <literal>triangles</literal> specifies a triangle
50
of the mesh <literal>triangle(j) = [number,node1,node2,node3,flag]</literal>.
51
<literal>node1,node2,node3</literal> are the number of the nodes which constitutes
52
the triangle. number is the number of the triangle and flag is an integer
53
not used in the fec function
58
<term><opt_args></term>
61
This represents a sequence of statements <literal>key1=value1, key2=value2</literal>,... where <literal>key1</literal>,
62
<literal>key2,...</literal> can be one of the following: strf, leg, rect, nax, zminmax, colminmax, colout, mesh
63
(see <link linkend="plot2d">plot2d</link> for the 4 first ones).
68
<term>strf,leg,rect,nax</term>
70
<para>see plot2d</para>
76
<para>vector with 2 components [zmin zmax] (useful in particular for animation)</para>
80
<term>colminmax</term>
82
<para>vector of 2 positives integers [colmin colmax]</para>
88
<para>vector of 2 integers [under_min_col upper_max_col]</para>
94
<para>boolean scalar, default value %f (must be true if you want also display the mesh)</para>
100
<title>Description</title>
101
<para>This function is the good one to draw linear triangular finite element solutions
102
or simply to display a function defined on a triangulation. The color interpolation
103
is done through software computation and so it is not too fast.
106
The function <link linkend="colorbar">colorbar</link> may be used to see the color scale (see the example
110
The <literal>zminmax</literal> argument gives the z values associated with the first and the last
111
color (of the current colormap). More exactly if the colormap have nc colors and if we note
112
<emphasis>dz = (zmax-zmin)/nc</emphasis>, then the part of the triangulation where
113
<emphasis>zmin + (i-1)dz <= z < zmin + i dz</emphasis> is filled with the color <emphasis>i</emphasis>).
114
By default <emphasis>zmin = min(func)</emphasis> and <emphasis>zmax = max(func)</emphasis>. If you want to do
115
an animation with func values that varie in time, take for zmin and zmax the global
116
minimum and maximum or something close.
119
The <literal>colout</literal> argument lets the user choosing the colors for the 2 extremes
120
regions <emphasis>{func < zmin}</emphasis> and <emphasis>{func > zmax}</emphasis>, <literal>under_min_col</literal> and
121
<literal>upper_max_col</literal> may be equal (independantly) to:
127
<para>in this case the same color than in the neighbouring zone is used (CAUTION:
128
you do not see that the corresponding limit is crossed), this is the
136
<para>in this case the extreme region is not painting at all.</para>
142
<para>(k being a valid index to a color of the current colormap) the extreme region
143
is painting in color k.
149
If you do not want to use the complete colormap you may use the <literal>colminmax</literal>
150
argument with <emphasis>1 <= colmin < colmax <= nc</emphasis> (nc being the number of colors
151
of the current colormap) so as to use only the [colmin,colmax] sub-part of the colormap.
152
(by default all the colors of the colormap are used).
155
See the demo files <literal>demos/fec</literal>:
158
<literal>fec.ex1</literal> is a simple demo file in which a mesh and a function
159
on that mesh is completely built in Scilab syntax
162
<literal>fec.ex2</literal> is an example for which the mesh and the function value where
163
computed by an external mesh builder (amdba type mesh) and an external program.
164
A set of macros ( provided in file <literal>macros.sci</literal>) can be used to read the
165
data files in Scilab and plot the results.
169
<title>Sample</title>
170
<scilab:image>fec();</scilab:image>
173
<title>Examples</title>
174
<programlisting role="example"><![CDATA[
175
175
// define a mini triangulation (4 vertices, 2 triangles)