-- 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 : // Generate meshes using the square() command. 4 : // 5 : // Location: 6 : // 7 : // http://people.sc.fsu.edu/~jburkardt/freefem_src/square_test/square_test.edp 8 : // 9 : // Licensing: 10 : // 11 : // This code is distributed under the GNU LGPL license. 12 : // 13 : // Modified: 14 : // 15 : // 25 May 2020 16 : // 17 : // Author: 18 : // 19 : // John Burkardt 20 : // 21 : // Reference: 22 : // 23 : // John Chrispell, Jason Howell, 24 : // Finite Element Approximation of Partial Differential Equations 25 : // Using FreeFem++, or, How I Learned to Stop Worrying and Love 26 : // Numerical Analysis. 27 : // 28 : // Frederic Hecht, 29 : // New development in FreeFem++, 30 : // Journal of Numerical Mathematics, 31 : // Volume 20, Number 3-4, 2012, pages 251-265. 32 : // 33 : cout << "\n"; 34 : cout << "square_test\n"; 35 : cout << " FreeFem++ version\n"; 36 : cout << " Test the square() function for meshing a square ... : region.\n"; 37 : // 38 : // Mesh a square on [0,1]x[0,1] into 5 by 5 elements. 39 : // 40 : mesh Th1 = square ( 5, 5 ); 41 : plot ( Th1, wait = 1, ps = "square_test1_mesh.ps" ); 42 : // 43 : // Mesh a square on [0,1]x[0,1] into 4 by 5 elements. 44 : // 45 : mesh Th2 = square ( 4, 5 ); 46 : plot ( Th2, wait = 1, ps = "square_test2_mesh.ps" ); 47 : // 48 : // Mesh a square on [4,10]x[5,12] into 5 by 10 elements. 49 : // 50 : mesh Th3 = square ( 5, 10, [4.0+x,10+2*y] ); 51 : plot ( Th3, wait = 1, ps = "square_test3_mesh.ps" ); 52 : // 53 : // Mesh a square on [-1,+1]x[-1,+1] into 10 by 10 elements, 54 : // using a nonlinear transform. 55 : // 56 : mesh Th4 = square ( 10, 10, [ cos(pi*x), cos(pi*y) ] ); 57 : plot ( Th4, wait = 1, ps = "square_test4_mesh.ps" ); 58 : // 59 : // Mesh on the L shaped region [0,1]x[0,1] - [0.5,1.0]x[0.5,1.0]. 60 : // 61 : int n5 = 20; 62 : mesh Th5 = square ( n5, n5 ); 63 : Th5 = trunc ( Th5, x < 0.6 | y < 0.4 ); 64 : plot ( Th5, ps = "square_test5_mesh.ps" ); 65 : // 66 : // Terminate. 67 : // 68 : cout << "\n"; 69 : cout << "square_test:\n"; 70 : cout << " Normal end of execution.\n"; 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. times: compile 0.00428s, execution 0.003077s, mpirank:0 CodeAlloc : nb ptr 3514, size :471088 mpirank: 0 Ok: Normal End