%% TEST11 tests HEX_GRID_APPROXIMATE_N. % test_num = 4; n_goal_test = [ 100, 200, 500, 10000 ]; fprintf ( 1, '\n' ); fprintf ( 1, 'TEST11\n' ); fprintf ( 1, ' For a hexagonal grid of points in a coordinate box,\n' ); fprintf ( 1, ' HEX_GRID_APPROXIMATE_N seeks the value of\n' ); fprintf ( 1, ' NODES_PER_LAYER that produces a mesh of about N points.\n' ); box(1:2,1:2) = [ 1.0, 2.0; ... 4.0, 7.0]; box_print_2d ( box ) fprintf ( 1, '\n' ); fprintf ( 1, ' N_GOAL NODES_PER_LAYER N\n' ); fprintf ( 1, '\n' ); for test = 1 : test_num n_goal = n_goal_test ( test ); [ nodes_per_layer, n ] = hex_grid_approximate_n ( box, n_goal ); fprintf ( 1, ' %6d %6d %6d\n', ... n_goal, nodes_per_layer, n ); end