triangulation_node_to_element
    
    
    
      triangulation_node_to_element,
      a Fortran90 code which 
      reads datafiles describing a set of nodes, their triangulation, and the
      value of one or more quantities at each node, and outputs a file
      that averages the quantities for each element.  This operation 
      in effect creates an order1 finite element model of the data.
    
    
      The program reads three data files:
      
        - 
          a node file, containing 
          X, Y coordinates of points;
        
 
        - 
          an element file, 
          containing a list of sets of three points making up each 
          triangular element;  (if this file does not exist, the
          program will generate the element data automatically).
        
 
        - 
          a node values file, 
          containing the values of one or more data items
          at each node.
        
 
      
      and creates
      
        - 
          an element values file, 
          containing the values of the data, averaged over 
          the nodes in each element.
        
 
      
    
    
      Usage:
    
    
      
        triangulation_node_to_element prefix
      
      where
      
        - 
          prefix_nodes.txt, lists the node coordinates;
        
 
        - 
          prefix_elements.txt lists the indices of nodes that form elements
          (this file is optional, and if not supplied, the information will
          be generated internally);
        
 
        - 
          prefix_values.txt contains the value assigned to each node.
        
 
        - 
          prefix_element_values.txt will contain the values averaged
          over the nodes in each element.
        
 
      
    
    
      Licensing:
    
 
    
      The information on this web page is distributed under the MIT license.
    
    
      Languages:
    
    
      triangulation_node_to_element is available in
      a C version and
      a C++ version and
      a Fortran90 version and
      a MATLAB version and
      an Octave version.
    
    
      Related Data and Programs:
    
    
      
      MESH_TO_XML,
      a Fortran90 program which
      reads information defining a 1D, 2D or 3D mesh, namely
      a file of node coordinates and a file of elements defined by
      node indices, and creates a corresponding XML file for input
      to DOLFIN or FENICS.
    
    
      
      TRIANGULATION, 
      a Fortran90 library which
      carries out various operations on order 3 ("linear") or order 6 
      ("quadratic") triangulations.
    
    
      
      TRIANGULATION_L2Q,
      a Fortran90 program which
      reads information about a 3-node (linear) triangulation and creates data
      defining a corresponding 6-node (quadratic) triangulation;
    
    
      
      TRIANGULATION_Q2L,
      a Fortran90 program which
      reads information about a 6-node (quadratic) triangulation 
      and creates data defining a corresponding 3-node (linear) triangulation;
    
    
      Source Code:
    
    
      
    
    
      Examples and Tests:
    
    
      
    
    
      List of Routines:
    
    
      
        - 
          MAIN is the main program for TRIANGULATION_NODE_TO_ELEMENT.
        
 
        - 
          CH_CAP capitalizes a single character.
        
 
        - 
          CH_EQI is a case insensitive comparison of two characters for equality.
        
 
        - 
          CH_TO_DIGIT returns the integer value of a base 10 digit.
        
 
        - 
          FILE_COLUMN_COUNT counts the number of columns in the first line of a file.
        
 
        - 
          FILE_ROW_COUNT counts the number of row records in a file.
        
 
        - 
          GET_UNIT returns a free Fortran unit number.
        
 
        - 
          I4MAT_DATA_READ reads data from an I4MAT file.
        
 
        - 
          I4MAT_HEADER_READ reads the header from an I4MAT.
        
 
        - 
          I4MAT_TRANSPOSE_PRINT_SOME prints some of the transpose of an I4MAT.
        
 
        - 
          I4MAT_WRITE writes an I4MAT file.
        
 
        - 
          MESH_BASE_ONE ensures that the element definition is one-based.
        
 
        - 
          R8MAT_DATA_READ reads data from an R8MAT file.
        
 
        - 
          R8MAT_HEADER_READ reads the header from an R8MAT file.
        
 
        - 
          R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.
        
 
        - 
          R8MAT_WRITE writes an R8MAT file.
        
 
        - 
          S_TO_I4 reads an I4 from a string.
        
 
        - 
          S_TO_I4VEC reads an I4VEC from a string.
        
 
        - 
          S_TO_R8 reads an R8 from a string.
        
 
        - 
          S_TO_R8VEC reads an R8VEC from a string.
        
 
        - 
          S_WORD_COUNT counts the number of "words" in a string.
        
 
        - 
          TIMESTAMP prints the current YMDHMS date as a time stamp.
        
 
      
    
    
    
      Last revised on 18 March 2014.