OSX> cd "/Users/jburkardt/public_html/examples/freefem++";/usr/local/bin/FreeFem++ "/Users/jburkardt/public_html/examples/freefem++/example_2.1a.edp"
-- FreeFem++ v 3.310001 (date Jeu 10 jul 2014 21:47:51 CEST)
Load: lg_fem lg_mesh lg_mesh3 eigenvalue
1 : // Discussion:
2 : //
3 : // Example_2.1a solves the Poisson equation in a domain C
4 : // which is a circle C1 with an elliptical hole C2.
5 : //
6 : // - uxx - uyy = x * y in the interior of C
7 : // u(x,y) = 0 on the boundary of C1.
8 : // u(x,y) = 1 on the boundary of C2.
9 : //
10 : // Location:
11 : //
12 : // http://people.sc.fsu.edu/~jburkardt/examples/freefem++/example_2.1a.edp
13 : //
14 : // Modified:
15 : //
16 : // 04 December 2014
17 : //
18 : // Reference:
19 : //
20 : // Frederic Hecht,
21 : // Freefem++,
22 : // Third Edition, version 3.22
23 :
24 : //
25 : // Define C1 and C2, the boundaries.
26 : //
27 : border C1 ( t = 0, 2 * pi ) { x = cos ( t ); y = sin ( t ); }
28 : border C2 ( t = 2 * pi, 0 ) { x = 0.1+0.3*cos ( t ); y = 0.5*sin ( t ); }
29 : //
30 : // Define Th, the triangulation of the "left" side of the boundaries.
31 : //
32 : mesh Th = buildmesh ( C1(50) + C2(20) );
33 : //
34 : // Define Vh, the finite element space defined over Th, using P1 basis functions.
35 : //
36 : fespace Vh ( Th, P1 );
37 : //
38 : // Define u and v, piecewise P1 continuous functions over Th.
39 : //
40 : Vh u, v;
41 : //
42 : // Define f, the right hand side function.
43 : //
44 : func f = x * y;
45 : //
46 : // Request the current CPU time in seconds.
47 : //
48 : real cpu1 = clock ( );
49 : //
50 : // Request a solution of the discrete weak system.
51 : // Note that the boundary condition is included,
52 : // defined "on C1" and "on C2", the boundaries.
53 : //
54 : solve Poisson ( u, v, solver = LU )
55 : = int2d(Th) ( dx(u)*dx(v) + dy(u)*dy(v) )
56 : - int2d(Th) ( f*v )
57 : + on(C1,u=0.0)
58 : + on(C2,u=1.0);
59 : //
60 : // Plot the solution.
61 : //
62 : plot ( u );
63 : //
64 : // Get final CPU clock reading.
65 : //
66 : real cpu2 = clock ( );
67 : cout << " CPU time = " << cpu2 - cpu1 << endl;
68 :
69 : sizestack + 1024 =1944 ( 920 )
-- mesh: Nb of Triangles = 356, Nb of Vertices 213
-- Solve :
min 9.36267e-32 max 1
CPU time = 0.003382
times: compile 0.007474s, execution 0.006136s, mpirank:0