function nhba = bandwidth ( element_order, element_num, element_node ) %% BANDWIDTH determines the bandwidth of the coefficient matrix. % % Modified: % % 28 August 2006 % % Author: % % John Burkardt % % Parameters: % % Input, integer ELEMENT_ORDER, the order of the elements. % % Input, integer ELEMENT_NUM, the number of elements. % % Input, integer ELEMENT_NODE(ELEMENT_ORDER,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 : element_order global_i = element_node(local_i,element); for local_j = 1 : element_order global_j = element_node(local_j,element); nhba = max ( nhba, abs ( global_j - global_i ) ); end end end