-- FreeFem++ v4.6 (Thu Apr 2 15:47:38 CEST 2020 - git v4.6) Load: lg_fem lg_mesh lg_mesh3 eigenvalue 1 : // Discussion: 2 : // 3 : // This script implements the Schwarz method. 4 : // In this example, the domain is decomposed into two subdomains, 5 : // with overlap. 6 : // 7 : // Location: 8 : // 9 : // http://people.sc.fsu.edu/~jburkardt/freefem_src/schwarz_overlap/schwarz_overlap.edp 10 : // 11 : // Licensing: 12 : // 13 : // This code is distributed under the GNU LGPL license. 14 : // 15 : // Modified: 16 : // 17 : // 03 February 2016 18 : // 19 : // Author: 20 : // 21 : // Frederic Hecht 22 : // 23 : // Reference: 24 : // 25 : // Frederic Hecht, 26 : // Freefem++, 27 : // Third Edition, version 3.22 28 : // 29 : cout << "\n"; 30 : cout << "schwarz_overlap\n"; 31 : cout << " FreeFem++ version\n"; 32 : cout << " The Schwarz method of domain decomposition is u ... : sed, replacing\n"; 33 : cout << " the problem domain by two overlapping subdomain ... : s.\n"; 34 : // 35 : // Region labels. 36 : // 37 : int inner = 2; 38 : int outer = 1; 39 : // 40 : // Define the border. 41 : // 42 : border a ( t = 1, 2 ) { x = t; y = 0; label = outer; }; 43 : border b ( t = 0, 1 ) { x = 2; y = t; label = outer; }; 44 : border c ( t = 2, 0 ) { x = t; y = 1; label = outer; }; 45 : border d ( t = 1, 0 ) { x = 1-t; y = t; label = inner; }; 46 : border e ( t = 0, pi/2 ) { x = cos ( t ); y = sin ( t ); label = inner; }; 47 : border e1 ( t = pi/2, 2*pi ) { x = cos ( t ); y = sin ( t ); label = outer; }; 48 : 49 : int n = 4; 50 : mesh Th1 = buildmesh ( a ( 5 * n ) + b ( 5 * n ) + c ( 10 * n ) + d ( 5 * n ) ); 51 : mesh Th2 = buildmesh ( e ( 5 * n ) + e1 ( 25 * n ) ); 52 : // 53 : // Plot the mesh. 54 : // 55 : plot ( Th1, Th2, wait = true, ps = "schwarz_overlap_mesh.eps" ); 56 : // 57 : // Define the finite element spaces. 58 : // 59 : int i = 0; 60 : 61 : fespace Vh1 ( Th1, P1 ); 62 : Vh1 u1 = 0.0; 63 : Vh1 v1; 64 : 65 : fespace Vh2 ( Th2, P1 ); 66 : Vh2 u2 = 0.0; 67 : Vh2 v2; 68 : 69 : problem pb1 ( u1, v1, init = i, solver = Cholesky ) = 70 : int2d ( Th1 ) ( dx ( u1 ) * dx ( v1 ) + dy ( u1 ) * dy ( v1 ) ) 71 : + int2d ( Th1 ) ( -v1 ) 72 : + on ( inner, u1 = u2 ) 73 : + on ( outer, u1 = 0.0 ); 74 : 75 : problem pb2 ( u2, v2, init = i, solver = Cholesky ) = 76 : int2d ( Th2 ) ( dx ( u2 ) * dx ( v2 ) + dy ( u2 ) * dy ( v2 ) ) 77 : + int2d ( Th2 ) ( -v2 ) 78 : + on ( inner, u2 = u1 ) 79 : + on ( outer, u2 = 0.0 ) ; 80 : 81 : for ( i = 0; i < 10; i++ ) 82 : { 83 : pb1; 84 : pb2; 85 : plot ( u1, u2, wait = true ); 86 : }; 87 : 88 : plot ( u1, u2, ps = "schwarz_overlap_u.eps" ); 89 : // 90 : // Terminate. 91 : // 92 : cout << "\n"; 93 : cout << "schwarz_overlap:\n"; 94 : cout << " Normal end of execution.\n"; 95 : 96 : sizestack + 1024 =2368 ( 1344 ) schwarz_overlap FreeFem++ version The Schwarz method of domain decomposition is used, replacing the problem domain by two overlapping subdomains. -- mesh: Nb of Triangles = 1164, Nb of Vertices 633 -- mesh: Nb of Triangles = 2000, Nb of Vertices 1061 SkyLineMatrix: size pL/pU: 633 12396 12396 moy=19.5829 -- Solve : min 3.2567e-65 max 0.0949787 SkyLineMatrix: size pL/pU: 1061 35085 35085 moy=33.0679 -- Solve : min 2.23119e-32 max 0.258194 -- Solve : min 4.82284e-63 max 0.15581 -- Solve : min 2.26832e-32 max 0.270668 -- Solve : min 4.86586e-63 max 0.197845 -- Solve : min 2.27815e-32 max 0.274581 -- Solve : min 4.88084e-63 max 0.210987 -- Solve : min 2.28138e-32 max 0.276041 -- Solve : min 4.88615e-63 max 0.215473 -- Solve : min 2.28249e-32 max 0.276548 -- Solve : min 4.88805e-63 max 0.217024 -- Solve : min 2.28288e-32 max 0.276728 -- Solve : min 4.88873e-63 max 0.217573 -- Solve : min 2.28302e-32 max 0.276793 -- Solve : min 4.88898e-63 max 0.217769 -- Solve : min 2.28307e-32 max 0.276816 -- Solve : min 4.88907e-63 max 0.21784 -- Solve : min 2.28309e-32 max 0.276825 -- Solve : min 4.8891e-63 max 0.217866 -- Solve : min 2.2831e-32 max 0.276828 schwarz_overlap: Normal end of execution. times: compile 0.005039s, execution 0.155376s, mpirank:0 CodeAlloc : nb ptr 3759, size :485720 mpirank: 0 Ok: Normal End