-- 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 example reads pre-existing mesh files. 4 : // 5 : // Location: 6 : // 7 : // http://people.sc.fsu.edu/~jburkardt/freefem_src/read_mesh/read_mesh.edp 8 : // 9 : // Licensing: 10 : // 11 : // This code is distributed under the GNU LGPL license. 12 : // 13 : // Modified: 14 : // 15 : // 18 February 2015 16 : // 17 : // Author: 18 : // 19 : // John Burkardt 20 : // 21 : // Reference: 22 : // 23 : // Frederic Hecht, 24 : // Freefem++, 25 : // Third Edition, version 3.22 26 : // 27 : cout << "\n"; 28 : cout << "read_mesh:\n"; 29 : cout << " FreeFem++ version.\n"; 30 : cout << " Read meshes defined by BAMG, GMSH, MEDIT, MESH2 ... : D, SAVEMESH.\n"; 31 : // 32 : // Read a mesh that was created by FreeFem++'s SAVEMESH. 33 : // 34 : cout << "\n"; 35 : cout << " Read savemesh.msh, created by FreeFem++ savemes ... : h() command.\n"; 36 : 37 : mesh Th1 = readmesh ( "savemesh.msh" ); 38 : plot ( Th1, wait = 1, ps = "savemesh.ps" ); 39 : // 40 : // Read a mesh that was created by BAMG and saved in MSH format. 41 : // The BAMG mesh includes two parts, bamg_g.msh and bamg_o.msh. 42 : // 43 : cout << " Read bamg_o.msh + bamg_g.msh, created by the ba ... : mg program.\n"; 44 : 45 : mesh Th2 = readmesh ( "bamg_o.msh" ); 46 : plot ( Th2, wait = 1, ps = "bamg.ps" ); 47 : // 48 : // Read a mesh that was created by MEDIT and saved in MESH format. 49 : // 50 : cout << " Read medit.mesh, created by the medit program.\n"; 51 : 52 : mesh Th3 = readmesh ( "medit.mesh" ); 53 : plot ( Th3, wait = 1, ps = "medit.ps" ); 54 : // 55 : // Read a mesh that was created by GMSH and saved in MESH format. 56 : // 57 : // This has been surprisingly miserably difficult. 58 : // For one thing, GMSH seems to assume you want a 3D mesh. 59 : // If you save your data as an INRIA MESH file, it will internally 60 : // list dimension 3, and have a bogus 0 Z coordinate, AND all the 61 : // triangles may have negative area, requiring a reordering of the 62 : // indices. NOT CONVENIENT is hardly the description. 63 : // 64 : cout << " Read gmsh.mesh, created by the gmsh program.\n"; 65 : 66 : mesh Th4 = readmesh ( "gmsh.mesh" ); 67 : plot ( Th4, wait = 1, ps = "gmsh.ps" ); 68 : // 69 : // Read a mesh that was created by MESH2D, 70 : // converted by MESH2D_TO_MEDIT and saved in MESH format. 71 : // 72 : cout << " Read mesh2d.mesh, created by mesh2d\n"; 73 : cout << " and converted by mesh2d_to_medit.\n"; 74 : 75 : mesh Th5 = readmesh ( "mesh2d.mesh" ); 76 : plot ( Th5, wait = 1, ps = "mesh2d.ps" ); 77 : // 78 : // Terminate. 79 : // 80 : cout << "\n"; 81 : cout << "read_mesh:\n"; 82 : cout << " FreeFem++ version.\n"; 83 : 84 : sizestack + 1024 =1992 ( 968 ) read_mesh: FreeFem++ version. Read meshes defined by BAMG, GMSH, MEDIT, MESH2D, SAVEMESH. Read savemesh.msh, created by FreeFem++ savemesh() command. -- mesh: Nb of Triangles = 18, Nb of Vertices 15 Read bamg_o.msh + bamg_g.msh, created by the bamg program. -- mesh: Nb of Triangles = 1799, Nb of Vertices 966 Read medit.mesh, created by the medit program. ## Warning: Mesh without geometry we construct a geometry (theta =-57.2958 degres ) -- mesh: Nb of Triangles = 96, Nb of Vertices 65 Read gmsh.mesh, created by the gmsh program. ## Warning: Mesh without geometry we construct a geometry (theta =-57.2958 degres ) -- mesh: Nb of Triangles = 605, Nb of Vertices 367 Read mesh2d.mesh, created by mesh2d and converted by mesh2d_to_medit. ## Warning: Mesh without geometry we construct a geometry (theta =-57.2958 degres ) -- mesh: Nb of Triangles = 384, Nb of Vertices 225 read_mesh: FreeFem++ version. times: compile 0.003564s, execution 0.012713s, mpirank:0 CodeAlloc : nb ptr 3508, size :470728 mpirank: 0 Ok: Normal End