1//  Scicos
2//
3//  Copyright (C) INRIA - Author : EADS-CCR
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18//
19// See the file ../license.txt
20//
21
22function [xc,x]=unimesh1D(N,a,b)
23    // maillage pour les volumes finis 1D en incluant les noeuds    //
24    // aux limites.                                                 //
25    // sorties :                                                    //
26    //    - x (Double) : vecteur colonne representant les noeuds   //
27    //    - xc (Double) : vecteur colonne representant les cellules //
28    //      (les volumes de contr�le).                              //
29    //    - N (Entier) : est le nombre de noeuds                    //
30    //    - a, b (Doubles) :correspondent aux deux points limites   //
31    //--------------------------------------------------------------//
32
33    deltax=(b-a)/(N-1);
34    dx2=deltax/2;
35    x=(a:deltax:b)';
36    xc=[a-dx2;(dx2:deltax:b)';b+dx2];
37
38endfunction
39