function nodes3_write ( file_name, node_num, node_xy, node_type ) %% NODES3_WRITE writes the pressure nodes to a file. % % Modified: % % 22 June 2005 % % Author: % % John Burkardt % % Parameters: % % Input, integer NODE_NUM, the number of nodes. % % Input, real NODE_XY(2,NODE_NUM), the coordinates of nodes. % % Input, integer NODE_TYPE(NODE_NUM), determines if the node is a % vertex or midside node. % 1, the node is a vertex (P, U, V variables are associated with it). % 2, the node is a midside node (only U and V variables are associated.) % file_unit = fopen ( file_name, 'wt'); if ( file_unit < 0 ) fprintf ( 1, '\n' ); fprintf ( 1, 'NODES3_WRITE - Warning!\n' ); fprintf ( 1, ' Could not write the file "%s".\n', file_name ); return; end for node = 1 : node_num if ( node_type(node) == 1 ) fprintf ( file_unit, '%8f %8f\n', node_xy(1:2,node) ); end end fclose ( file_unit );