// boundary_node_list.edp // // Discussion: // // Produce a list of the nodes along the boundary. // // Location: // // http://people.sc.fsu.edu/~jburkardt/freefem_src/boundary_node_list/boundary_node_list.edp // // Licensing: // // This code is distributed under the MIT license. // // Modified: // // 27 July 2015 // // Author: // // John Burkardt // cout << "\n"; cout << "BOUNDARY_NODE_LIST:\n"; cout << " FreeFem++ version\n"; cout << " For a given mesh, produce a list of indices of nodes\n"; cout << " which lie on the boundary.\n"; // // Create a mesh of 6x3 elements in [2,8] x [10,13]. // mesh Th = square ( 6, 3, [ 6 * x + 2, 3 * y + 10 ] ); // // Plot the mesh. // plot ( Th, wait = false, ps = "boundary_node_list_mesh.ps" ); // // Report. // int trianglenum = Th.nt; cout << "\n"; cout << " Number of triangles = " << trianglenum << "\n"; for ( int i = 0; i < trianglenum; i++ ) { cout << "\n"; cout << " Triangle " << i << "\n"; for ( int j = 0; j < 3; j++ ) { cout << " Node " << j << " (x,y) = ( " << Th[i][j].x << ", " << Th[i][j].y << " )\n"; } } // // Boundary elements? // int triangleboundarynum = Th.nbe; cout << " Number of boundary elements = " << triangleboundarynum << "\n"; for ( int i = 0; i < triangleboundarynum; i++ ) { cout << "\n"; cout << " Boundary element " << i << "\n"; cout << " Mysterious boundary element index = " << Th.be(i) << "\n"; cout << " Vertex 0 = " << Th.be(i)[0] << "\n"; cout << " Vertex 1 = " << Th.be(i)[1] << "\n"; cout << " Element = " << Th.be(i).Element << "\n"; cout << " Element edge = " << Th.be(i).whoinElement << "\n"; } // // Terminate. // cout << "\n"; cout << "boundary_node_list:\n"; cout << " Normal end of execution.\n"; exit ( 0 );