-- FreeFem++ v4.14 (mer. 06 mars 2024 16:59:04 CET - git v4.14-1-g2b2052ae) file : mitchell_12.edp Load: lg_fem lg_mesh lg_mesh3 eigenvalue 1 : // mitchell_12.edp 2 : // 3 : // Discussion: 4 : // 5 : // -uxx - uyy = f on the upside down L shaped region 6 : // u = g on the boundary. 7 : // 8 : // f = - gxx - gyy 9 : // g = awful formula 10 : // 11 : // Suggested parameter values: 12 : // omega = 3 * pi / 2 13 : // xw = 0.0 14 : // yw = -0.75 15 : // r0 = 0.75 16 : // alphaw = 200.0 17 : // xp = sqrt(5)/4 18 : // yp = -0.25 19 : // alphap = 1000 20 : // epsilon = 0.01 21 : // 22 : // Licensing: 23 : // 24 : // This code is distributed under the MIT license. 25 : // 26 : // Modified: 27 : // 28 : // 26 December 2014 29 : // 30 : // Author: 31 : // 32 : // John Burkardt 33 : // 34 : // Reference: 35 : // 36 : // Frederic Hecht, 37 : // Freefem++, 38 : // Third Edition, version 3.22 39 : // 40 : // William Mitchell, 41 : // A collection of 2D elliptic problems for testing adaptive 42 : // grid refinement algorithms, 43 : // Applied Mathematics and Computation, 44 : // Volume 220, 1 September 2013, pages 350-364. 45 : // 46 : cout << "\n"; 47 : cout << "mitchell_12():\n"; 48 : cout << " FreeFem++ version\n"; 49 : cout << " Solve the multiple difficulties problem.\n"; 50 : // 51 : // Set parameters. 52 : // 53 : 54 : // 55 : // Set the borders of the L-shaped region. 56 : // 57 : border e1 ( t = -1.0, 0.0 ) { x = t; y = -1.0; label = 1; } 58 : border e2 ( t = -1.0, 0.0 ) { x = 0.0; y = t; label = 1; } 59 : border e3 ( t = 0.0, 1.0 ) { x = t; y = 0.0; label = 1; } 60 : border e4 ( t = 0.0, 1.0 ) { x = 1.0; y = t; label = 1; } 61 : border e5 ( t = 1.0, -1.0 ) { x = t; y = 1.0; label = 1; } 62 : border e6 ( t = 1.0, -1.0 ) { x = -1.0; y = t; label = 1; } 63 : // 64 : // Define Th, the triangulation of the "left" side of the boundaries. 65 : // 66 : int n = 10; 67 : int n2 = 2 * n; 68 : mesh Th = buildmesh ( e1 ( n ) + e2 ( n ) + e3 ( n ) + e4 ( n ) + e5 ( n2 ) + e6 ( n2 ) ); 69 : // 70 : // Define Vh, the finite element space defined over Th, using P1 basis functions. 71 : // 72 : fespace Vh ( Th, P1 ); 73 : // 74 : // Define U, V, and F, piecewise continuous functions over Th. 75 : // 76 : Vh u; 77 : Vh v; 78 : // 79 : // Define right hand side function F. 80 : // 81 : func f = 1.0; 82 : // 83 : // Define boundary condition function G. 84 : // 85 : func g = 0.0; 86 : // 87 : // Solve the variational problem. 88 : // 89 : solve Laplace ( u, v ) 90 : = int2d ( Th ) ( dx(u)*dx(v) + dy(u)*dy(v) ) 91 : - int2d ( Th ) ( f * v ) 92 : + on ( 1, u = g ); 93 : // 94 : // Plot the solution. 95 : // 96 : plot ( u, wait = false, fill = true, 97 : cmm = "mitchell_12 u", ps = "mitchell_12_u.ps" ); 98 : // 99 : // Plot the mesh. 100 : // 101 : plot ( Th, wait = false, 102 : cmm = "mitchell_12 mesh", ps = "mitchell_12_mesh.ps" ); 103 : // 104 : // Save the mesh file. 105 : // 106 : savemesh ( Th, "mitchell_12.msh" ); 107 : // 108 : // Terminate. 109 : // 110 : cout << "\n"; 111 : cout << "mitchell_12()\n"; 112 : cout << " Normal end of execution.\n"; 113 : 114 : exit ( 0 ); 115 : sizestack + 1024 =1848 ( 824 ) mitchell_12(): FreeFem++ version Solve the multiple difficulties problem. -- mesh: Nb of Triangles = 664, Nb of Vertices 373 -- Solve : min 1.44985e-62 max 0.147541 number of required edges : 0 mitchell_12() Normal end of execution. current line = 114 exit(0) err code 0 , mpirank 0 CodeAlloc : nb ptr 4026, size :527656 mpirank: 0 Ok: Normal End