-- FreeFem++ v4.6 (Thu Apr 2 15:47:38 CEST 2020 - git v4.6) Load: lg_fem lg_mesh lg_mesh3 eigenvalue 1 : // boundary_node_list.edp 2 : // 3 : // Discussion: 4 : // 5 : // Produce a list of the nodes along the boundary. 6 : // 7 : // Location: 8 : // 9 : // http://people.sc.fsu.edu/~jburkardt/freefem_src/boundary_node_list/boundary_node_list.edp 10 : // 11 : // Modified: 12 : // 13 : // 27 July 2015 14 : // 15 : // Author: 16 : // 17 : // John Burkardt 18 : // 19 : cout << "\n"; 20 : cout << "BOUNDARY_NODE_LIST:\n"; 21 : cout << " For a given mesh, produce a list of indices of ... : nodes\n"; 22 : cout << " which lie on the boundary.\n"; 23 : // 24 : // Create a mesh of 6x3 elements in [2,8] x [10,13]. 25 : // 26 : mesh Th = square ( 6, 3, [ 6 * x + 2, 3 * y + 10 ] ); 27 : // 28 : // Plot the mesh. 29 : // 30 : plot ( Th, wait = 0, ps = "boundary_node_list_mesh.ps" ); 31 : // 32 : // Report. 33 : // 34 : int trianglenum = Th.nt; 35 : 36 : cout << "\n"; 37 : cout << " Number of triangles = " << trianglenum << "\n"; 38 : 39 : for ( int i = 0; i < trianglenum; i++ ) 40 : { 41 : cout << "\n"; 42 : cout << " Triangle " << i << "\n"; 43 : for ( int j = 0; j < 3; j++ ) 44 : { 45 : cout << " Node " << j << " (x,y) = ( " << Th[i][j].x << ", " << Th[i][j].y << " )\n"; 46 : } 47 : } 48 : // 49 : // Boundary elements? 50 : // 51 : int triangleboundarynum = Th.nbe; 52 : 53 : cout << " Number of boundary elements = " << triangleboundarynum << "\n"; 54 : 55 : for ( int i = 0; i < triangleboundarynum; i++ ) 56 : { 57 : cout << "\n"; 58 : cout << " Boundary element " << i << "\n"; 59 : cout << " Mysterious boundary element index = " << Th.be(i) << "\n"; 60 : cout << " Vertex 0 = " << Th.be(i)[0] << "\n"; 61 : cout << " Vertex 1 = " << Th.be(i)[1] << "\n"; 62 : cout << " Element = " << Th.be(i).Element << "\n"; 63 : cout << " Element edge = " << Th.be(i).whoinElement << "\n"; 64 : } 65 : // 66 : // Terminate. 67 : // 68 : cout << "\n"; 69 : cout << "BOUNDARY_NODE_LIST:\n"; 70 : cout << " Normal end of execution.\n"; 71 : 72 : exit ( 0 ); 73 : 74 : sizestack + 1024 =1296 ( 272 ) BOUNDARY_NODE_LIST: For a given mesh, produce a list of indices of nodes which lie on the boundary. -- Square mesh : nb vertices =28 , nb triangles = 36 , nb boundary edges 18 Number of triangles = 36 Triangle 0 Node 0 (x,y) = ( 2, 10 ) Node 1 (x,y) = ( 3, 10 ) Node 2 (x,y) = ( 3, 11 ) Triangle 1 Node 0 (x,y) = ( 2, 10 ) Node 1 (x,y) = ( 3, 11 ) Node 2 (x,y) = ( 2, 11 ) Triangle 2 Node 0 (x,y) = ( 3, 10 ) Node 1 (x,y) = ( 4, 10 ) Node 2 (x,y) = ( 4, 11 ) Triangle 3 Node 0 (x,y) = ( 3, 10 ) Node 1 (x,y) = ( 4, 11 ) Node 2 (x,y) = ( 3, 11 ) Triangle 4 Node 0 (x,y) = ( 4, 10 ) Node 1 (x,y) = ( 5, 10 ) Node 2 (x,y) = ( 5, 11 ) Triangle 5 Node 0 (x,y) = ( 4, 10 ) Node 1 (x,y) = ( 5, 11 ) Node 2 (x,y) = ( 4, 11 ) Triangle 6 Node 0 (x,y) = ( 5, 10 ) Node 1 (x,y) = ( 6, 10 ) Node 2 (x,y) = ( 6, 11 ) Triangle 7 Node 0 (x,y) = ( 5, 10 ) Node 1 (x,y) = ( 6, 11 ) Node 2 (x,y) = ( 5, 11 ) Triangle 8 Node 0 (x,y) = ( 6, 10 ) Node 1 (x,y) = ( 7, 10 ) Node 2 (x,y) = ( 7, 11 ) Triangle 9 Node 0 (x,y) = ( 6, 10 ) Node 1 (x,y) = ( 7, 11 ) Node 2 (x,y) = ( 6, 11 ) Triangle 10 Node 0 (x,y) = ( 7, 10 ) Node 1 (x,y) = ( 8, 10 ) Node 2 (x,y) = ( 8, 11 ) Triangle 11 Node 0 (x,y) = ( 7, 10 ) Node 1 (x,y) = ( 8, 11 ) Node 2 (x,y) = ( 7, 11 ) Triangle 12 Node 0 (x,y) = ( 2, 11 ) Node 1 (x,y) = ( 3, 11 ) Node 2 (x,y) = ( 3, 12 ) Triangle 13 Node 0 (x,y) = ( 2, 11 ) Node 1 (x,y) = ( 3, 12 ) Node 2 (x,y) = ( 2, 12 ) Triangle 14 Node 0 (x,y) = ( 3, 11 ) Node 1 (x,y) = ( 4, 11 ) Node 2 (x,y) = ( 4, 12 ) Triangle 15 Node 0 (x,y) = ( 3, 11 ) Node 1 (x,y) = ( 4, 12 ) Node 2 (x,y) = ( 3, 12 ) Triangle 16 Node 0 (x,y) = ( 4, 11 ) Node 1 (x,y) = ( 5, 11 ) Node 2 (x,y) = ( 5, 12 ) Triangle 17 Node 0 (x,y) = ( 4, 11 ) Node 1 (x,y) = ( 5, 12 ) Node 2 (x,y) = ( 4, 12 ) Triangle 18 Node 0 (x,y) = ( 5, 11 ) Node 1 (x,y) = ( 6, 11 ) Node 2 (x,y) = ( 6, 12 ) Triangle 19 Node 0 (x,y) = ( 5, 11 ) Node 1 (x,y) = ( 6, 12 ) Node 2 (x,y) = ( 5, 12 ) Triangle 20 Node 0 (x,y) = ( 6, 11 ) Node 1 (x,y) = ( 7, 11 ) Node 2 (x,y) = ( 7, 12 ) Triangle 21 Node 0 (x,y) = ( 6, 11 ) Node 1 (x,y) = ( 7, 12 ) Node 2 (x,y) = ( 6, 12 ) Triangle 22 Node 0 (x,y) = ( 7, 11 ) Node 1 (x,y) = ( 8, 11 ) Node 2 (x,y) = ( 8, 12 ) Triangle 23 Node 0 (x,y) = ( 7, 11 ) Node 1 (x,y) = ( 8, 12 ) Node 2 (x,y) = ( 7, 12 ) Triangle 24 Node 0 (x,y) = ( 2, 12 ) Node 1 (x,y) = ( 3, 12 ) Node 2 (x,y) = ( 3, 13 ) Triangle 25 Node 0 (x,y) = ( 2, 12 ) Node 1 (x,y) = ( 3, 13 ) Node 2 (x,y) = ( 2, 13 ) Triangle 26 Node 0 (x,y) = ( 3, 12 ) Node 1 (x,y) = ( 4, 12 ) Node 2 (x,y) = ( 4, 13 ) Triangle 27 Node 0 (x,y) = ( 3, 12 ) Node 1 (x,y) = ( 4, 13 ) Node 2 (x,y) = ( 3, 13 ) Triangle 28 Node 0 (x,y) = ( 4, 12 ) Node 1 (x,y) = ( 5, 12 ) Node 2 (x,y) = ( 5, 13 ) Triangle 29 Node 0 (x,y) = ( 4, 12 ) Node 1 (x,y) = ( 5, 13 ) Node 2 (x,y) = ( 4, 13 ) Triangle 30 Node 0 (x,y) = ( 5, 12 ) Node 1 (x,y) = ( 6, 12 ) Node 2 (x,y) = ( 6, 13 ) Triangle 31 Node 0 (x,y) = ( 5, 12 ) Node 1 (x,y) = ( 6, 13 ) Node 2 (x,y) = ( 5, 13 ) Triangle 32 Node 0 (x,y) = ( 6, 12 ) Node 1 (x,y) = ( 7, 12 ) Node 2 (x,y) = ( 7, 13 ) Triangle 33 Node 0 (x,y) = ( 6, 12 ) Node 1 (x,y) = ( 7, 13 ) Node 2 (x,y) = ( 6, 13 ) Triangle 34 Node 0 (x,y) = ( 7, 12 ) Node 1 (x,y) = ( 8, 12 ) Node 2 (x,y) = ( 8, 13 ) Triangle 35 Node 0 (x,y) = ( 7, 12 ) Node 1 (x,y) = ( 8, 13 ) Node 2 (x,y) = ( 7, 13 ) Number of boundary elements = 18 Boundary element 0 Mysterious boundary element index = 0 Vertex 0 = 0 Vertex 1 = 1 Element = 0 Element edge = 2 Boundary element 1 Mysterious boundary element index = 1 Vertex 0 = 1 Vertex 1 = 2 Element = 2 Element edge = 2 Boundary element 2 Mysterious boundary element index = 2 Vertex 0 = 2 Vertex 1 = 3 Element = 4 Element edge = 2 Boundary element 3 Mysterious boundary element index = 3 Vertex 0 = 3 Vertex 1 = 4 Element = 6 Element edge = 2 Boundary element 4 Mysterious boundary element index = 4 Vertex 0 = 4 Vertex 1 = 5 Element = 8 Element edge = 2 Boundary element 5 Mysterious boundary element index = 5 Vertex 0 = 5 Vertex 1 = 6 Element = 10 Element edge = 2 Boundary element 6 Mysterious boundary element index = 6 Vertex 0 = 6 Vertex 1 = 13 Element = 10 Element edge = 0 Boundary element 7 Mysterious boundary element index = 7 Vertex 0 = 13 Vertex 1 = 20 Element = 22 Element edge = 0 Boundary element 8 Mysterious boundary element index = 8 Vertex 0 = 20 Vertex 1 = 27 Element = 34 Element edge = 0 Boundary element 9 Mysterious boundary element index = 9 Vertex 0 = 21 Vertex 1 = 22 Element = 25 Element edge = 0 Boundary element 10 Mysterious boundary element index = 10 Vertex 0 = 22 Vertex 1 = 23 Element = 27 Element edge = 0 Boundary element 11 Mysterious boundary element index = 11 Vertex 0 = 23 Vertex 1 = 24 Element = 29 Element edge = 0 Boundary element 12 Mysterious boundary element index = 12 Vertex 0 = 24 Vertex 1 = 25 Element = 31 Element edge = 0 Boundary element 13 Mysterious boundary element index = 13 Vertex 0 = 25 Vertex 1 = 26 Element = 33 Element edge = 0 Boundary element 14 Mysterious boundary element index = 14 Vertex 0 = 26 Vertex 1 = 27 Element = 35 Element edge = 0 Boundary element 15 Mysterious boundary element index = 15 Vertex 0 = 0 Vertex 1 = 7 Element = 1 Element edge = 1 Boundary element 16 Mysterious boundary element index = 16 Vertex 0 = 7 Vertex 1 = 14 Element = 13 Element edge = 1 Boundary element 17 Mysterious boundary element index = 17 Vertex 0 = 14 Vertex 1 = 21 Element = 25 Element edge = 1 BOUNDARY_NODE_LIST: Normal end of execution. current line = 72 exit(0) err code 0 , mpirank 0 CodeAlloc : nb ptr 3621, size :472120 mpirank: 0 Ok: Normal End