Neko  0.8.1
A portable framework for high-order spectral element flow simulations
csv_file Module Reference

File format for .csv files, used for any read/write operations involving floating point data. More...

Data Types

type  csv_file_t
 

Functions/Subroutines

subroutine csv_file_write (this, data, t)
 Writes data to an output file. More...
 
subroutine csv_file_write_vector (f, data, t)
 Writes a vector_t object to an output file, in a row format. If the parameter t is present, it will be appended at the start of the row, followed by the contents of the vector. More...
 
subroutine csv_file_write_matrix (f, data, t)
 Writes a matrix_t object to an output file. If the parameter t is present, it will be appended at the start of each row. More...
 
subroutine csv_file_read (this, data)
 Reads data from an input file. More...
 
subroutine csv_file_read_vector (f, vec)
 Read a vector (i.e. data on a single row) from a csv file. More...
 
subroutine csv_file_read_matrix (f, mat)
 Read a matrix from a csv file. More...
 
subroutine csv_file_set_header (this, hd)
 Sets the header for a csv file. For example: hd = "u,v,w,p". More...
 
integer function csv_file_count_lines (this)
 Count the number of lines in a file by going through it entirely until the end is reached. More...
 

Detailed Description

File format for .csv files, used for any read/write operations involving floating point data.

Function/Subroutine Documentation

◆ csv_file_count_lines()

integer function csv_file::csv_file_count_lines ( class(csv_file_t), intent(in)  this)

Count the number of lines in a file by going through it entirely until the end is reached.

Definition at line 307 of file csv_file.f90.

◆ csv_file_read()

subroutine csv_file::csv_file_read ( class(csv_file_t this,
class(*), intent(inout), target  data 
)

Reads data from an input file.

Parameters
thiscsv file in which to read.
datamatrix_t or vector_t, will contain the read data.

Definition at line 183 of file csv_file.f90.

Here is the call graph for this function:

◆ csv_file_read_matrix()

subroutine csv_file::csv_file_read_matrix ( type(csv_file_t), intent(inout)  f,
type(matrix_t), intent(inout)  mat 
)

Read a matrix from a csv file.

Parameters
dcsv file from which to read.
vecMatrix object in which to store the file contents.
Note
If the number of lines in the file is larger than the number of rows of mat, it will be assumed that a one-line header is present.

Definition at line 267 of file csv_file.f90.

Here is the caller graph for this function:

◆ csv_file_read_vector()

subroutine csv_file::csv_file_read_vector ( type(csv_file_t), intent(inout)  f,
type(vector_t), intent(inout)  vec 
)

Read a vector (i.e. data on a single row) from a csv file.

Parameters
dcsv file from which to read.
vecVector object in which to store the file contents.
Note
- Equivalent to reading a matrix with nrows = 1 and ncols = N. To read a vector in a column format, use a matrix_t with ncols = 1.
- If the number of lines in the file is larger than 1, it will be assumed that a one-line header is present.

Definition at line 238 of file csv_file.f90.

Here is the caller graph for this function:

◆ csv_file_set_header()

subroutine csv_file::csv_file_set_header ( class(csv_file_t), intent(inout)  this,
character(len=*), intent(in)  hd 
)

Sets the header for a csv file. For example: hd = "u,v,w,p".

Parameters
hdHeader.
Note
The header will be written "as is", meaning there will be no checks performed on the header separators, number of columns, etc.

Definition at line 297 of file csv_file.f90.

◆ csv_file_write()

subroutine csv_file::csv_file_write ( class (csv_file_t), intent(inout)  this,
class(*), intent(in), target  data,
real(kind=rp), intent(in), optional  t 
)

Writes data to an output file.

Parameters
thiscsv file to write in.
dataData to write, can be vector_t or matrix_t.
tTime.

Definition at line 65 of file csv_file.f90.

Here is the call graph for this function:

◆ csv_file_write_matrix()

subroutine csv_file::csv_file_write_matrix ( class(csv_file_t), intent(inout)  f,
type(matrix_t), intent(in)  data,
real(kind=rp), intent(in), optional  t 
)

Writes a matrix_t object to an output file. If the parameter t is present, it will be appended at the start of each row.

Parameters
fcsv file in which to write.
dataMatrix to write.
Time.

Definition at line 153 of file csv_file.f90.

Here is the caller graph for this function:

◆ csv_file_write_vector()

subroutine csv_file::csv_file_write_vector ( class(csv_file_t), intent(inout)  f,
type(vector_t), intent(in)  data,
real(kind=rp), intent(in), optional  t 
)

Writes a vector_t object to an output file, in a row format. If the parameter t is present, it will be appended at the start of the row, followed by the contents of the vector.

Parameters
fcsv file in which to write.
dataVector to write.
Time.
Note
Equivalent to writing a matrix with nrows = 1 and ncols = N. To write a vector in a column format, use a matrix_t with ncols = 1.

Definition at line 121 of file csv_file.f90.

Here is the caller graph for this function: