-- FreeFem++ v 3.320001 (date Ven 7 nov 2014 14:28:55 CET) Load: lg_fem lg_mesh lg_mesh3 eigenvalue 1 : // Discussion: 2 : // 3 : // -del p del(u) = 0 in [-1,+1]x[-1,+1]. 4 : // u = g on the boundary. 5 : // 6 : // p = a1*I in Q1 and Q3 7 : // = a2*I in Q2 and Q4 8 : // f = 0 9 : // g = r^gamma * mu(theta) 10 : // 11 : // mu(theta) = 12 : // Q1: cos ( gamma * ( pi/2-sigma) ) * cos ( gamma * ( theta-pi/2+rho ) ) 13 : // Q2: cos ( gamma * rho ) * cos ( gamma * ( theta-pi+sigma ) ) 14 : // Q3: cos ( gamma * sigma ) * cos ( gamma * ( theta-pi-rho ) ) 15 : // Q4: cos ( gamma * ( pi/2 - rho) ) * cos ( gamma * ( theta-3pi/2-sigma ) ) 16 : // 17 : // Parameter values: 18 : // 19 : // a1 = 161.4476387975881 20 : // a2 = 1.0 21 : // gamma = 0.1 22 : // rho = pi / 4 23 : // sigma = -14.92256510455152 24 : // 25 : // Note that the formulation in the Mitchell reference uses different 26 : // names for variables, a somewhat different formulation for mu(theta), 27 : // some typographical errors, and does not seem to produce the result 28 : // displayed in the figure. The data and formulation from the Morin 29 : // reference seems more satisfactory. 30 : // 31 : // I CANNOT get this problem to give me anything like the results 32 : // displayed by Mitchell, nor can I explain the lack of symmetry. 33 : // 34 : // Location: 35 : // 36 : // http://people.sc.fsu.edu/~jburkardt/examples/mitchell_freefem++/test11.edp 37 : // 38 : // Licensing: 39 : // 40 : // This code is distributed under the GNU LGPL license. 41 : // 42 : // Modified: 43 : // 44 : // 09 February 2015 45 : // 46 : // Author: 47 : // 48 : // John Burkardt 49 : // 50 : // Reference: 51 : // 52 : // Frederic Hecht, 53 : // Freefem++, 54 : // Third Edition, version 3.22 55 : // 56 : // William Mitchell, 57 : // A collection of 2D elliptic problems for testing adaptive 58 : // grid refinement algorithms, 59 : // Applied Mathematics and Computation, 60 : // Volume 220, 1 September 2013, pages 350-364. 61 : // 62 : // Pedro Morin, Ricardo Nochetto, Kunibert Siebert, 63 : // Data oscillation and convergence of adaptive FEM, 64 : // SIAM Journal on Numerical Analysis, 65 : // Volume 38, Number 2, 2000, pages 466-488. 66 : // 67 : 68 : // 69 : // Set parameters. 70 : // 71 : real a1 = 161.4476387975881; 72 : real a2 = 1.0; 73 : real gam = 0.1; 74 : real rho = pi / 4.0; 75 : real sigma = -14.92256510455152; 76 : // 77 : // Set the borders. 78 : // 79 : border bottom ( t = -1.0, 1.0 ) { x = t; y = -1.0; label = 1; } 80 : border right ( t = -1.0, 1.0 ) { x = 1.0; y = t; label = 1; } 81 : border top ( t = 1.0, -1.0 ) { x = t; y = +1.0; label = 1; } 82 : border left ( t = 1.0, -1.0 ) { x = -1.0; y = t; label = 1; } 83 : // 84 : // Define Th, the triangulation of the "left" side of the boundaries. 85 : // 86 : int n = 20; 87 : mesh Th = buildmesh ( bottom ( n ) + right ( n ) + top ( n ) + left ( n ) ); 88 : // 89 : // Define Vh, the finite element space defined over Th, using P1 basis functions. 90 : // 91 : fespace Vh ( Th, P1 ); 92 : // 93 : // Define U, V, and F, piecewise continuous functions over Th. 94 : // 95 : Vh u; 96 : Vh v; 97 : // 98 : // Define the exact solution function G = r^gam * mu(theta). 99 : // 100 : //func g { 101 : //func real g ( real xx, real yy ) 102 : func g 103 : { Error line number 103, in file test11.edp, before token { syntax error current line = 102 Compile error : syntax error line number :103, { error Compile error : syntax error line number :103, { code = 1 mpirank: 0