VTK_DAT Function

public function VTK_DAT(NC_NN, var_location) result(E_IO)

This function \MaiuscolettoBS{must} be called before saving the data related to geometric mesh. This function initializes the saving of data variables indicating the \emph{type} of variables that will be saved.

Arguments

Type IntentOptional AttributesName
integer(kind=I4P), intent(in) :: NC_NN
character(len=*), intent(in) :: var_location

Return Value integer(kind=I4P)


Calls

proc~~vtk_dat~~CallsGraph proc~vtk_dat VTK_DAT proc~upper_case Upper_Case proc~vtk_dat->proc~upper_case

Called by

proc~~vtk_dat~~CalledByGraph proc~vtk_dat VTK_DAT proc~save_fe_f_vtk save_fe_f_vtk proc~save_fe_f_vtk->proc~vtk_dat

Contents

Source Code


Source Code

  function VTK_DAT(NC_NN,var_location) result(E_IO)
  !---------------------------------------------------------------------------------------------------------------------------------
  !!This function \MaiuscolettoBS{must} be called before saving the data related to geometric mesh. This function initializes the
  !!saving of data variables indicating the \emph{type} of variables that will be saved.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  implicit none
  integer(I4P), intent(IN):: NC_NN        ! number of cells or nodes of field
  character(*), intent(IN):: var_location ! location of saving variables: cell for cell-centered, node for node-centered
  integer(I4P)::             E_IO         ! Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done
  character(len=maxlen)::    s_buffer     ! buffer string
  !!The VTK\_DAT variables have the following meaning:
  !!
  !!\begin{description}
  !! \item[{\color{RoyalBlue}NC\_NN}] indicates the number of all cells or all nodes according to the value of
  !!                                  {\color{RoyalBlue}tipo}.
  !! \item[{\color{RoyalBlue}var\_location}] contains the location-type of variables that will be saved after VTK\_DAT. It is
  !!                                         a scalar and cab assume the following values:
  !! \begin{enumerateABlu}
  !!  \item \emph{cell} (it is case insensitive) $\rightarrow$ variables will be cell-centered.
  !!  \item \emph{node} (it is case insensitive) $\rightarrow$ variables will be node-centered.
  !! \end{enumerateABlu}
  !! \item[{\color{RoyalBlue}E\_IO}] contains the inquiring integer flag for error handling.
  !!\end{description}
  !!
  !!Of course a single file can contain both cell and node centered variables; in this case the VTK\_DAT function must be
  !!called two times, before saving cell-centered variables and before saving node-centered variables.
  !!
  !!The following is an example of VTK\_DAT calling:
  !!
  !!\begin{boxred}{VTK\_DAT Calling}
  !!\begin{verbatim}
  !!...
  !!E_IO = VTK_DAT(50,'node')
  !!...
  !!\end{verbatim}
  !!\end{boxred}
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  select case(f_out)
  case(f_out_ascii)
    select case(trim(Upper_Case(var_location)))
    case('CELL')
      write(unit=Unit_VTK,fmt='(A,'//FI4P//')',iostat=E_IO)'CELL_DATA ',NC_NN
    case('NODE')
      write(unit=Unit_VTK,fmt='(A,'//FI4P//')',iostat=E_IO)'POINT_DATA ',NC_NN
    endselect
  case(f_out_binary)
    select case(trim(Upper_Case(var_location)))
    case('CELL')
      write(s_buffer,fmt='(A,'//FI4P//')',iostat=E_IO)'CELL_DATA ',NC_NN
      write(unit=Unit_VTK,iostat=E_IO)trim(s_buffer)//end_rec
    case('NODE')
      write(s_buffer,fmt='(A,'//FI4P//')',iostat=E_IO)'POINT_DATA ',NC_NN
      write(unit=Unit_VTK,iostat=E_IO)trim(s_buffer)//end_rec
    endselect
  endselect
  return
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction VTK_DAT