-- FreeFem++ v4.14 (mer. 06 mars 2024 16:59:04 CET - git v4.14-1-g2b2052ae) file : schwarz_overlap.edp Load: lg_fem lg_mesh lg_mesh3 eigenvalue 1 : // schwarz_overlap.edp 2 : // 3 : // Discussion: 4 : // 5 : // This script implements the Schwarz method. 6 : // In this example, the domain is decomposed into two subdomains, 7 : // with overlap. 8 : // 9 : // Licensing: 10 : // 11 : // This code is distributed under the MIT license. 12 : // 13 : // Modified: 14 : // 15 : // 03 February 2016 16 : // 17 : // Author: 18 : // 19 : // Frederic Hecht 20 : // 21 : // Reference: 22 : // 23 : // Frederic Hecht, 24 : // Freefem++, 25 : // Third Edition, version 3.22 26 : // 27 : cout << "\n"; 28 : cout << "schwarz_overlap():\n"; 29 : cout << " FreeFem++ version\n"; 30 : cout << " The Schwarz method of domain decomposition is u ... : sed, replacing\n"; 31 : cout << " the problem domain by two overlapping subdomain ... : s.\n"; 32 : // 33 : // Region labels. 34 : // 35 : int inner = 2; 36 : int outer = 1; 37 : // 38 : // Define the border. 39 : // 40 : border a ( t = 1, 2 ) { x = t; y = 0; label = outer; }; 41 : border b ( t = 0, 1 ) { x = 2; y = t; label = outer; }; 42 : border c ( t = 2, 0 ) { x = t; y = 1; label = outer; }; 43 : border d ( t = 1, 0 ) { x = 1-t; y = t; label = inner; }; 44 : border e ( t = 0, pi/2 ) { x = cos ( t ); y = sin ( t ); label = inner; }; 45 : border e1 ( t = pi/2, 2*pi ) { x = cos ( t ); y = sin ( t ); label = outer; }; 46 : 47 : int n = 4; 48 : mesh Th1 = buildmesh ( a ( 5 * n ) + b ( 5 * n ) + c ( 10 * n ) + d ( 5 * n ) ); 49 : mesh Th2 = buildmesh ( e ( 5 * n ) + e1 ( 25 * n ) ); 50 : // 51 : // Plot the mesh. 52 : // 53 : plot ( Th1, Th2, wait = true, ps = "schwarz_overlap_mesh.eps" ); 54 : // 55 : // Define the finite element spaces. 56 : // 57 : int i = 0; 58 : 59 : fespace Vh1 ( Th1, P1 ); 60 : Vh1 u1 = 0.0; 61 : Vh1 v1; 62 : 63 : fespace Vh2 ( Th2, P1 ); 64 : Vh2 u2 = 0.0; 65 : Vh2 v2; 66 : 67 : problem pb1 ( u1, v1, init = i, solver = Cholesky ) = 68 : int2d ( Th1 ) ( dx ( u1 ) * dx ( v1 ) + dy ( u1 ) * dy ( v1 ) ) 69 : + int2d ( Th1 ) ( -v1 ) 70 : + on ( inner, u1 = u2 ) 71 : + on ( outer, u1 = 0.0 ); 72 : 73 : problem pb2 ( u2, v2, init = i, solver = Cholesky ) = 74 : int2d ( Th2 ) ( dx ( u2 ) * dx ( v2 ) + dy ( u2 ) * dy ( v2 ) ) 75 : + int2d ( Th2 ) ( -v2 ) 76 : + on ( inner, u2 = u1 ) 77 : + on ( outer, u2 = 0.0 ) ; 78 : 79 : for ( i = 0; i < 10; i++ ) 80 : { 81 : pb1; 82 : pb2; 83 : plot ( u1, u2, wait = true ); 84 : }; 85 : 86 : plot ( u1, u2, ps = "schwarz_overlap_u.eps" ); 87 : // 88 : // Terminate. 89 : // 90 : cout << "\n"; 91 : cout << "schwarz_overlap():\n"; 92 : cout << " Normal end of execution.\n"; 93 : 94 : exit ( 0 ); 95 : 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. current line = 94 exit(0) err code 0 , mpirank 0 CodeAlloc : nb ptr 4131, size :534072 mpirank: 0 Ok: Normal End