#include <BasisReader.h>
Class BasisReader reads the basis vectors from a file written by class BasisWriter.
- See Also
- BasisWriter
CAROM::BasisReader::BasisReader |
( |
const std::string & |
base_file_name, |
|
|
Database::formats |
db_format = Database::HDF5 |
|
) |
| |
The constructor for the BasisReader class takes the base part of the name of the files holding the basis vectors and the file format.
- Precondition
- !base_file_name.empty()
- Parameters
-
[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. |
Vector* CAROM::BasisReader::getSingularValues |
( |
double |
time | ) |
|
Returns the singular values for the requested time.
- Precondition
- 0 < numTimeIntervals()
-
0 <= time
- Parameters
-
[in] | time | Time for which we want the basis vectors. |
- Returns
- The temporal basis vectors for the requested time.
Vector* CAROM::BasisReader::getSingularValues |
( |
double |
time, |
|
|
double |
ef |
|
) |
| |
Returns the largest singular values for the requested time that capture the given energy fraction.
- Precondition
- 0 < numTimeIntervals()
-
0 <= time
-
0 <= ef <= 1.0
- Parameters
-
[in] | time | Time for which we want the basis vectors. |
[in] | ef | The desired energy fraction. |
- Returns
- The temporal basis vectors for the requested time.
Matrix* CAROM::BasisReader::getSnapshotMatrix |
( |
double |
time | ) |
|
Returns the snapshot matrix for the requested time.
- Precondition
- 0 < numTimeIntervals()
-
0 <= time
- Parameters
-
[in] | time | Time for which we want the basis vectors. |
- Returns
- The snapshot matrix for the requested time.
Matrix* CAROM::BasisReader::getSpatialBasis |
( |
double |
time | ) |
|
Returns the spatial basis vectors for the requested time as a Matrix.
- Precondition
- 0 < numTimeIntervals()
-
0 <= time
- Parameters
-
[in] | time | Time for which we want the basis vectors. |
- Returns
- The spatial basis vectors for the requested time.
Matrix* CAROM::BasisReader::getSpatialBasis |
( |
double |
time, |
|
|
int |
n |
|
) |
| |
Returns the first n spatial basis vectors for the requested time as a Matrix.
- Precondition
- 0 < numTimeIntervals()
-
0 <= time
-
0 < n < numColumns()
- Parameters
-
[in] | time | Time for which we want the basis vectors. |
[in] | n | The number of spatial basis vectors desired. |
- Returns
- The spatial basis vectors for the requested time.
Matrix* CAROM::BasisReader::getSpatialBasis |
( |
double |
time, |
|
|
double |
ef |
|
) |
| |
Returns the first n spatial basis vectors for the requested time as a Matrix that capture the given energy fraction.
- Precondition
- 0 < numTimeIntervals()
-
0 <= time
-
0 <= ef <= 1.0
- Parameters
-
[in] | time | Time for which we want the basis vectors. |
[in] | ef | The desired energy fraction. |
- Returns
- The spatial basis vectors for the requested time.
Matrix* CAROM::BasisReader::getTemporalBasis |
( |
double |
time | ) |
|
Returns the temporal basis vectors for the requested time as a Matrix.
- Precondition
- 0 < numTimeIntervals()
-
0 <= time
- Parameters
-
[in] | time | Time for which we want the basis vectors. |
- Returns
- The temporal basis vectors for the requested time.
Matrix* CAROM::BasisReader::getTemporalBasis |
( |
double |
time, |
|
|
int |
n |
|
) |
| |
Returns the first n temporal basis vectors for the requested time as a Matrix.
- Precondition
- 0 < numTimeIntervals()
-
0 <= time
-
0 < n < numColumns()
- Parameters
-
[in] | time | Time for which we want the basis vectors. |
[in] | n | The number of temporal basis vectors desired. |
- Returns
- The temporal basis vectors for the requested time.
Matrix* CAROM::BasisReader::getTemporalBasis |
( |
double |
time, |
|
|
double |
ef |
|
) |
| |
Returns the first n temporal basis vectors for the requested time as a Matrix that capture the given energy fraction.
- Precondition
- 0 < numTimeIntervals()
-
0 <= time
-
0 <= ef <= 1.0
- Parameters
-
[in] | time | Time for which we want the basis vectors. |
[in] | ef | The desired energy fraction. |
- Returns
- The temporal basis vectors for the requested time.
bool CAROM::BasisReader::isNewBasis |
( |
double |
time | ) |
|
|
inline |
Returns true if the basis vectors at requested time are different from the last requested basis vectors.
- Precondition
- 0 < numTimeIntervals()
-
0 <= time
- Parameters
-
[in] | time | Time at which we are interested in the basis vectors. |
- Returns
- True if the basis vectors at the requested time are different from the last requested basis vectors.
The documentation for this class was generated from the following file: