Actual source code: example4.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: varf definition and Dirichlet BC     *
 8  *******************************************************/
  
10 mesh sq = square(10, 10);
11 plot(sq, wait = true);
 
13 varf vPbNeumann(u, v) = int2d(sq)(dx(u) * dx(v) + dy(u) * dy(v));
14 fespace Vh(sq, P1);
 
16 matrix A = vPbNeumann(Vh, Vh);
 
18 func f = 1;
19 varf vRHS(u, v) = int2d(sq)(f * v);
20 Vh b = vRHS(0, Vh);
 
22 int myLabel;
23 varf vGamma(u, v) = on(myLabel, u = 1.0);
24 for(myLabel = 1; myLabel <= 4; ++myLabel) {
25     b[] = vGamma(0, Vh, tgv = -1);
26     plot(b, wait = 1);
27 }