function fem_write ( node_coord_file_name, element_file_name, ... node_data_file_name, dim_num, node_num, element_num, element_order, ... node_data_num, node_coord, element_node, node_data ) %% FEM_WRITE reads data files associated with a finite element solution. % % Discussion: % % This program writes the node, element and data files that define % a finite element geometry and data based on that geometry: % * a set of nodes, % * a set of elements based on those nodes, % * a set of data values associated with each node. % % Modified: % % 25 January 2006 % % Author: % % John Burkardt % % Parameters: % % Input, character NODE_COORD_FILE_NAME(*), the name of the node coordinate % file. If this argument is empty, no node coordinate file will be written. % % Input, character ELEMENT_FILE_NAME(*), the name of the element file. If % this argument is empty, no element file will be written. % % Input, character NODE_DATA_FILE_NAME(*), the name of the node data file. If % this argument is empty, no node data file will be written. % % Input, integer DIM_NUM, the spatial dimension. % % Input, integer NODE_NUM, the number of nodes. % % Input, integer ELEMENT_NUM, the number of elements. % % Input, integer ELEMENT_ORDER, the order of the elements. % % Input, integer NODE_DATA_NUM, the number of data items per node. % % Input, real NODE_COORD(DIM_NUM,NODE_NUM), the coordinates of nodes. % % Input, integer ELEMENT_NODE(ELEMENT_ORDER,ELEMENT_NUM); % the global index of local node I in element J. % % Input, real NODE_DATA(NODE_DATA_NUM,NODE_NUM), the data values associated % with each node. % header = 1; % % Write the node coordinate file. % if ( ~isempty ( node_coord_file_name ) & ... 0 < s_len_trim ( node_coord_file_name ) ) dtable_write ( node_coord_file_name, dim_num, node_num, node_coord, ... header ); end % % Write the element file. % if ( ~isempty ( element_file_name ) & ... 0 < s_len_trim ( element_file_name ) ) itable_write ( element_file_name, element_order, element_num, ... element_node, header ); end % % Write the node data file. % if ( ~isempty ( node_data_file_name ) & ... 0 < s_len_trim ( node_data_file_name ) ) dtable_write ( node_data_file_name, node_data_num, node_num, ... node_data, header ); end