Actual source code: example1.edp
 1 /*******************************************************
 2  *  This file is part of the FreeFEM tutorial made by  *
 3  *      Pierre Jolivet <pierre@joliv.et>               *
 4  *                                                     *
 5  *  See https://joliv.et/FreeFem-tutorial for more     *
 6  *                                                     *
 7  *   Description: Mat data structure and basic usage   *
 8  *******************************************************/
  
10 load "PETSc"
11 macro dimension()2// EOM
12 include "macro_ddm.idp"
 
14 func Pk = P1;
 
16 border upper(t=0, pi)    { x=cos(t); y=sin(t); label=1; }
17 border lower(t=pi, 2*pi) { x=cos(t); y=sin(t); label=2; }
18 mesh Th = buildmesh(upper(100) + lower(100));
19 Mat A;
20 MatCreate(Th, A, Pk);
21 plotDmesh(Th, cmm = "Domain decomposition");
 
23 fespace Vh(Th, Pk);
24 Vh u;
25 u[] = 0:Vh.ndof - 1;
26 plotD(Th, u, cmm = "Local numbering");
 
28 GlobalNumbering(A, u[]);
29 plotD(Th, u, cmm = "Global numbering");