-- FreeFem++ v4.14 (mer. 06 mars 2024 16:59:04 CET - git v4.14-1-g2b2052ae) file : square_test.edp Load: lg_fem lg_mesh lg_mesh3 eigenvalue 1 : // square_test.edp 2 : // 3 : // Discussion: 4 : // 5 : // Generate meshes using the square() command. 6 : // 7 : // Licensing: 8 : // 9 : // This code is distributed under the MIT license. 10 : // 11 : // Modified: 12 : // 13 : // 25 May 2020 14 : // 15 : // Author: 16 : // 17 : // John Burkardt 18 : // 19 : // Reference: 20 : // 21 : // John Chrispell, Jason Howell, 22 : // Finite Element Approximation of Partial Differential Equations 23 : // Using FreeFem++, or, How I Learned to Stop Worrying and Love 24 : // Numerical Analysis. 25 : // 26 : // Frederic Hecht, 27 : // New development in FreeFem++, 28 : // Journal of Numerical Mathematics, 29 : // Volume 20, Number 3-4, 2012, pages 251-265. 30 : // 31 : cout << "\n"; 32 : cout << "square_test():\n"; 33 : cout << " FreeFem++ version\n"; 34 : cout << " Test the square() function for meshing a square ... : region.\n"; 35 : // 36 : // Mesh a square on [0,1]x[0,1] into 5 by 5 elements. 37 : // 38 : mesh Th1 = square ( 5, 5 ); 39 : plot ( Th1, wait = true, ps = "square_test1_mesh.ps" ); 40 : // 41 : // Mesh a square on [0,1]x[0,1] into 4 by 5 elements. 42 : // 43 : mesh Th2 = square ( 4, 5 ); 44 : plot ( Th2, wait = true, ps = "square_test2_mesh.ps" ); 45 : // 46 : // Mesh a square on [4,10]x[5,12] into 5 by 10 elements. 47 : // 48 : mesh Th3 = square ( 5, 10, [4.0+x,10+2*y] ); 49 : plot ( Th3, wait = true, ps = "square_test3_mesh.ps" ); 50 : // 51 : // Mesh a square on [-1,+1]x[-1,+1] into 10 by 10 elements, 52 : // using a nonlinear transform. 53 : // 54 : mesh Th4 = square ( 10, 10, [ cos(pi*x), cos(pi*y) ] ); 55 : plot ( Th4, wait = true, ps = "square_test4_mesh.ps" ); 56 : // 57 : // Mesh on the L shaped region [0,1]x[0,1] - [0.5,1.0]x[0.5,1.0]. 58 : // 59 : int n5 = 20; 60 : mesh Th5 = square ( n5, n5 ); 61 : Th5 = trunc ( Th5, x < 0.6 | y < 0.4 ); 62 : plot ( Th5, ps = "square_test5_mesh.ps" ); 63 : // 64 : // Terminate. 65 : // 66 : cout << "\n"; 67 : cout << "square_test():\n"; 68 : cout << " Normal end of execution.\n"; 69 : 70 : exit ( 0 ); 71 : sizestack + 1024 =2000 ( 976 ) square_test(): FreeFem++ version Test the square() function for meshing a square region. -- Square mesh : nb vertices =36 , nb triangles = 50 , nb boundary edges 20 -- Square mesh : nb vertices =30 , nb triangles = 40 , nb boundary edges 18 -- Square mesh : nb vertices =66 , nb triangles = 100 , nb boundary edges 30 -- Square mesh : nb vertices =121 , nb triangles = 200 , nb boundary edges 40 -- Square mesh : nb vertices =441 , nb triangles = 800 , nb boundary edges 80 square_test(): Normal end of execution. current line = 70 exit(0) err code 0 , mpirank 0 CodeAlloc : nb ptr 3878, size :518928 mpirank: 0 Ok: Normal End