Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::io Namespace Reference

Functions

void loadMatrixFromFile (la::SparseMatrix &result, const std::string &filename)
 Load a PETSc matrix from a binary file and copy it into a SparseMatrix.
void loadVectorFromFile (la::Vector &result, const std::string &filename)
 Load a PETSc vector from a binary file and copy it into a Vector.
Eigen::MatrixXd readCSVToEigenMatrix (const std::string &filename, char delimiter=',')
Eigen::VectorXd readCSVToEigenVector (const std::string &filename, char delimiter=',')

Function Documentation

◆ loadMatrixFromFile()

void vulpes::io::loadMatrixFromFile ( la::SparseMatrix & result,
const std::string & filename )
inline

Load a PETSc matrix from a binary file and copy it into a SparseMatrix.

Parameters
resultThe SparseMatrix to load the data into
filenameThe path to the binary file containing the matrix data

◆ loadVectorFromFile()

void vulpes::io::loadVectorFromFile ( la::Vector & result,
const std::string & filename )
inline

Load a PETSc vector from a binary file and copy it into a Vector.

Parameters
resultThe Vector to load the data into
filenameThe path to the binary file containing the vector data

◆ readCSVToEigenMatrix()

Eigen::MatrixXd vulpes::io::readCSVToEigenMatrix ( const std::string & filename,
char delimiter = ',' )
inline

Reads a CSV file containing a dense matrix and returns an Eigen::MatrixXd.

Parameters
filenamePath to the CSV file to read
delimiterCharacter that separates values in the CSV file (default is comma)
Returns
Eigen::MatrixXd containing the data from the CSV file
Exceptions
std::runtime_errorif the file cannot be opened or has inconsistent row lengths

◆ readCSVToEigenVector()

Eigen::VectorXd vulpes::io::readCSVToEigenVector ( const std::string & filename,
char delimiter = ',' )
inline

Reads a CSV file containing a dense vector and returns an Eigen::VectorXd.

Parameters
filenamePath to the CSV file to read
delimiterCharacter that separates values in the CSV file (default is comma)
Returns
Eigen::VectorXd containing the data from the CSV file
Exceptions
std::runtime_errorif the file cannot be opened or contains invalid data