function nhba = bandwidth ( element_num, element_node ) %% BANDWIDTH determines the bandwidth of the coefficient matrix. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 30 July 2005 % % Author: % % John Burkardt % % Parameters: % % Input, integer ELEMENT_NUM, the number of elements. % % Input, integer ELEMENT_NODE(3,ELEMENT_NUM); % ELEMENT_NODE(I,J) is the global index of local node I in element J. % % Output, integer NHBA, the half bandwidth of the matrix. % nhba = 0; for element = 1 : element_num for local_i = 1 : 3 global_i = element_node(local_i,element); for local_j = 1 : 3 global_j = element_node(local_j,element); nhba = max ( nhba, abs ( global_j - global_i ) ); end end end return end