libROM  v1.0
Data-driven physical simulation library
 All Classes Functions Variables Enumerations
Public Member Functions | List of all members
CAROM::BasisReader Class Reference

#include <BasisReader.h>

Public Member Functions

 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. More...
 
 ~BasisReader ()
 Destructor.
 
bool isNewBasis (double time)
 Returns true if the basis vectors at requested time are different from the last requested basis vectors. More...
 
MatrixgetSpatialBasis (double time)
 Returns the spatial basis vectors for the requested time as a Matrix. More...
 
MatrixgetSpatialBasis (double time, int n)
 Returns the first n spatial basis vectors for the requested time as a Matrix. More...
 
MatrixgetSpatialBasis (double time, double ef)
 Returns the first n spatial basis vectors for the requested time as a Matrix that capture the given energy fraction. More...
 
MatrixgetTemporalBasis (double time)
 Returns the temporal basis vectors for the requested time as a Matrix. More...
 
MatrixgetTemporalBasis (double time, int n)
 Returns the first n temporal basis vectors for the requested time as a Matrix. More...
 
MatrixgetTemporalBasis (double time, double ef)
 Returns the first n temporal basis vectors for the requested time as a Matrix that capture the given energy fraction. More...
 
VectorgetSingularValues (double time)
 Returns the singular values for the requested time. More...
 
VectorgetSingularValues (double time, double ef)
 Returns the largest singular values for the requested time that capture the given energy fraction. More...
 
MatrixgetSnapshotMatrix (double time)
 Returns the snapshot matrix for the requested time. More...
 

Detailed Description

Class BasisReader reads the basis vectors from a file written by class BasisWriter.

See Also
BasisWriter

Constructor & Destructor Documentation

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_nameThe base part of the name of the files holding the basis vectors.
[in]db_formatFormat of the file to read. One of the implemented file formats defined in Database.

Member Function Documentation

Vector* CAROM::BasisReader::getSingularValues ( double  time)

Returns the singular values for the requested time.

Precondition
0 < numTimeIntervals()
0 <= time
Parameters
[in]timeTime 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]timeTime for which we want the basis vectors.
[in]efThe 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]timeTime 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]timeTime 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]timeTime for which we want the basis vectors.
[in]nThe 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]timeTime for which we want the basis vectors.
[in]efThe 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]timeTime 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]timeTime for which we want the basis vectors.
[in]nThe 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]timeTime for which we want the basis vectors.
[in]efThe 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]timeTime 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: