-- FreeFem++ v4.6 (Thu Apr 2 15:47:38 CEST 2020 - git v4.6) Load: lg_fem lg_mesh lg_mesh3 eigenvalue 1 : // Location: 2 : // 3 : // http://people.sc.fsu.edu/~jburkardt/freefem_src/mesh_adaptive/mesh_adaptive.edp 4 : // 5 : // Discussion: 6 : // 7 : // Demonstrate the adaptmesh facility. 8 : // 9 : // Licensing: 10 : // 11 : // This code is distributed under the GNU LGPL license. 12 : // 13 : // Modified: 14 : // 15 : // 26 January 2015 16 : // 17 : // Reference: 18 : // 19 : // John Chrispell, Jason Howell, 20 : // Finite Element Approximation of Partial Differential Equations 21 : // Using FreeFem++, or, How I Learned to Stop Worrying and Love 22 : // Numerical Analysis. 23 : // 24 : // Frederic Hecht, 25 : // New development in FreeFem++, 26 : // Journal of Numerical Mathematics, 27 : // Volume 20, Number 3-4, 2012, pages 251-265. 28 : // 29 : cout << "\n"; 30 : cout << "mesh_adaptive\n"; 31 : cout << " FreeFem++ version\n"; 32 : cout << " Repeatedly adapt a mesh according to some error ... : indicator.\n"; 33 : // 34 : // Define Th, a mesh on the square [-1,+1]x[-1,+1]. 35 : // 36 : mesh Th = square ( 5, 5, [2*x-1, 2*y-1] ); 37 : // 38 : // Define F, a mesh weight function. 39 : // 40 : func f = 10.0 * x^3 + y^3 + atan2 ( 0.0001, sin(5.0*y)-2.0*x ); 41 : // 42 : // Define Vh, a piecewise linear finite element space. 43 : // 44 : fespace Vh ( Th, P1 ); 45 : // 46 : // Define fh to be the interpolant in Vh of the function f. 47 : // 48 : Vh fh = f; 49 : // 50 : // Make a variable to hold the plotfile names. 51 : // 52 : string plotfile; 53 : // 54 : // Display the initial mesh. 55 : // 56 : int i = 0; 57 : plotfile = "mesh_adaptive_" + i + ".ps"; 58 : plot ( Th, fh, wait = 1, ps = plotfile ); 59 : // 60 : // Repeatedly adapt the mesh. 61 : // 62 : for ( int i = 1; i <= 3; i++ ) 63 : { 64 : Th = adaptmesh ( Th, fh ); 65 : // 66 : // Update fh to the new mesh. 67 : // 68 : fh = f; 69 : // 70 : // Plot this mesh. 71 : // 72 : plotfile = "mesh_adaptive_" + i + ".ps"; 73 : plot ( Th, fh, wait = 1, ps = plotfile ); 74 : } 75 : // 76 : // Terminate. 77 : // 78 : cout << "\n"; 79 : cout << "mesh_adaptive\n"; 80 : cout << " Normal end of execution.\n"; 81 : 82 : sizestack + 1024 =4264 ( 3240 ) mesh_adaptive FreeFem++ version Repeatedly adapt a mesh according to some error indicator. -- Square mesh : nb vertices =36 , nb triangles = 50 , nb boundary edges 20 number of required edges : 0 -- adaptmesh Regulary: Nb triangles 444 , h min 0.0663407 , h max 0.376102 area = 4 , M area = 195.428 , M area/( |Khat| nt) 1.01649 infiny-regularity: min 0.444279 max 1.72497 anisomax 5.08481, beta max = 1.29734 min 0.803083 -- mesh: Nb of Triangles = 444, Nb of Vertices 248 number of required edges : 0 -- adaptmesh Regulary: Nb triangles 1469 , h min 0.0163435 , h max 0.477631 area = 4 , M area = 650.76 , M area/( |Khat| nt) 1.02305 infiny-regularity: min 0.402473 max 2.30065 anisomax 8.76522, beta max = 1.35313 min 0.719642 -- mesh: Nb of Triangles = 1469, Nb of Vertices 771 number of required edges : 0 -- adaptmesh Regulary: Nb triangles 3507 , h min 0.0044415 , h max 0.477527 area = 4 , M area = 1572.18 , M area/( |Khat| nt) 1.0353 infiny-regularity: min 0.318597 max 2.43404 anisomax 11.7696, beta max = 1.36266 min 0.736808 -- mesh: Nb of Triangles = 3507, Nb of Vertices 1792 mesh_adaptive Normal end of execution. times: compile 0.004664s, execution 0.113563s, mpirank:0 CodeAlloc : nb ptr 3548, size :472120 mpirank: 0 Ok: Normal End