|
libROM
v1.0
Data-driven physical simulation library
|
#include <BasisReader.h>
Public Member Functions | |
| BasisReader (const std::string &base_file_name, Database::formats db_format=Database::formats::HDF5, const int dim=-1, MPI_Comm comm=MPI_COMM_WORLD) | |
| The constructor for the BasisReader class takes the base part of the name of the files holding the basis vectors and the file format. More... | |
| ~BasisReader () | |
| Destructor. | |
| std::unique_ptr< Matrix > | getSpatialBasis () |
| Returns the spatial basis vectors as a Matrix. More... | |
| std::unique_ptr< Matrix > | getSpatialBasis (int n) |
| Returns the first n spatial basis vectors for the requested time as a Matrix. More... | |
| std::unique_ptr< Matrix > | getSpatialBasis (int start_col, int end_col) |
| Returns spatial basis vectors from start_col to end_col for the requested time as a Matrix. More... | |
| std::unique_ptr< Matrix > | getSpatialBasis (double ef) |
| Returns the first n spatial basis vectors for the requested time as a Matrix that capture the given energy fraction. More... | |
| std::unique_ptr< Matrix > | getTemporalBasis () |
| Returns the temporal basis vectors for the requested time as a Matrix. More... | |
| std::unique_ptr< Matrix > | getTemporalBasis (int n) |
| Returns the first n temporal basis vectors for the requested time as a Matrix. More... | |
| std::unique_ptr< Matrix > | getTemporalBasis (int start_col, int end_col) |
| Returns temporal basis vectors from start_col to end_col for the requested time as a Matrix. More... | |
| std::unique_ptr< Matrix > | getTemporalBasis (double ef) |
| Returns the first n temporal basis vectors for the requested time as a Matrix that capture the given energy fraction. More... | |
| std::unique_ptr< Vector > | getSingularValues () |
| Returns the singular values for the requested time. More... | |
| std::unique_ptr< Vector > | getSingularValues (double ef) |
| Returns the largest singular values for the requested time that capture the given energy fraction. More... | |
| int | getDim (const std::string kind) |
| Returns the dimension of the system on this processor. More... | |
| int | getNumSamples (const std::string kind) |
| Returns the number of samples (columns) in file. More... | |
| std::unique_ptr< Matrix > | getSnapshotMatrix () |
| Returns the snapshot matrix for the requested time. More... | |
| std::unique_ptr< Matrix > | getSnapshotMatrix (int n) |
| Returns the first n columns of the snapshot matrix for the requested time. More... | |
| std::unique_ptr< Matrix > | getSnapshotMatrix (int start_col, int end_col) |
| Returns the snapshot matrix from start_col to end_col for the requested time. More... | |
Class BasisReader reads the basis vectors from a file written by class BasisWriter.
Definition at line 34 of file BasisReader.h.
| CAROM::BasisReader::BasisReader | ( | const std::string & | base_file_name, |
| Database::formats | db_format = Database::formats::HDF5, |
||
| const int | dim = -1, |
||
| MPI_Comm | comm = MPI_COMM_WORLD |
||
| ) |
The constructor for the BasisReader class takes the base part of the name of the files holding the basis vectors and the file format.
| [in] | base_file_name | The base part of the name of the files holding the basis vectors. |
| [in] | db_format | Format of the file to read. One of the implemented file formats defined in Database. |
| [in] | dim | Number of rows of basis that will be read from a file. If negative, will use the dimension from the rank-specific local file. |
Definition at line 23 of file BasisReader.cpp.
| int CAROM::BasisReader::getDim | ( | const std::string | kind | ) |
Returns the dimension of the system on this processor.
| [in] | kind | Type of matrix whose row-dimension is returned. "basis" - local dimension of spatial basis "snapshot" - local dimension of snapshot matrix "temporal_basis" - global dimension of temporal basis |
Definition at line 276 of file BasisReader.cpp.
| int CAROM::BasisReader::getNumSamples | ( | const std::string | kind | ) |
Returns the number of samples (columns) in file.
Definition at line 307 of file BasisReader.cpp.
| std::unique_ptr< Vector > CAROM::BasisReader::getSingularValues | ( | ) |
Returns the singular values for the requested time.
Definition at line 226 of file BasisReader.cpp.
| std::unique_ptr< Vector > CAROM::BasisReader::getSingularValues | ( | double | ef | ) |
Returns the largest singular values for the requested time that capture the given energy fraction.
| [in] | ef | The desired energy fraction. |
Definition at line 243 of file BasisReader.cpp.
| std::unique_ptr< Matrix > CAROM::BasisReader::getSnapshotMatrix | ( | ) |
Returns the snapshot matrix for the requested time.
Definition at line 327 of file BasisReader.cpp.
| std::unique_ptr< Matrix > CAROM::BasisReader::getSnapshotMatrix | ( | int | n | ) |
Returns the first n columns of the snapshot matrix for the requested time.
| [in] | n | The number of basis vectors desired. |
Definition at line 343 of file BasisReader.cpp.
| std::unique_ptr< Matrix > CAROM::BasisReader::getSnapshotMatrix | ( | int | start_col, |
| int | end_col | ||
| ) |
Returns the snapshot matrix from start_col to end_col for the requested time.
| [in] | start_col | The starting column desired. |
| [in] | end_col | The final column desired. |
Definition at line 350 of file BasisReader.cpp.
| std::unique_ptr< Matrix > CAROM::BasisReader::getSpatialBasis | ( | ) |
Returns the spatial basis vectors as a Matrix.
Definition at line 79 of file BasisReader.cpp.
| std::unique_ptr< Matrix > CAROM::BasisReader::getSpatialBasis | ( | double | ef | ) |
Returns the first n spatial basis vectors for the requested time as a Matrix that capture the given energy fraction.
| [in] | ef | The desired energy fraction. |
Definition at line 127 of file BasisReader.cpp.
| std::unique_ptr< Matrix > CAROM::BasisReader::getSpatialBasis | ( | int | n | ) |
Returns the first n spatial basis vectors for the requested time as a Matrix.
| [in] | n | The number of spatial basis vectors desired. |
Definition at line 94 of file BasisReader.cpp.
| std::unique_ptr< Matrix > CAROM::BasisReader::getSpatialBasis | ( | int | start_col, |
| int | end_col | ||
| ) |
Returns spatial basis vectors from start_col to end_col for the requested time as a Matrix.
| [in] | start_col | The starting column desired. |
| [in] | end_col | The final column desired. |
Definition at line 101 of file BasisReader.cpp.
| std::unique_ptr< Matrix > CAROM::BasisReader::getTemporalBasis | ( | ) |
Returns the temporal basis vectors for the requested time as a Matrix.
Definition at line 153 of file BasisReader.cpp.
| std::unique_ptr< Matrix > CAROM::BasisReader::getTemporalBasis | ( | double | ef | ) |
Returns the first n temporal basis vectors for the requested time as a Matrix that capture the given energy fraction.
| [in] | ef | The desired energy fraction. |
Definition at line 200 of file BasisReader.cpp.
| std::unique_ptr< Matrix > CAROM::BasisReader::getTemporalBasis | ( | int | n | ) |
Returns the first n temporal basis vectors for the requested time as a Matrix.
| [in] | n | The number of temporal basis vectors desired. |
Definition at line 168 of file BasisReader.cpp.
| std::unique_ptr< Matrix > CAROM::BasisReader::getTemporalBasis | ( | int | start_col, |
| int | end_col | ||
| ) |
Returns temporal basis vectors from start_col to end_col for the requested time as a Matrix.
| [in] | start_col | The starting column desired. |
| [in] | end_col | The final column desired. |
Definition at line 175 of file BasisReader.cpp.