RBGen  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RBGen_AnasaziPOD.h
Go to the documentation of this file.
1 #ifndef RBGEN_ANASAZI_POD_H
2 #define RBGEN_ANASAZI_POD_H
3 
4 #include "RBGen_PODMethod.hpp"
5 #include "RBGen_Method.hpp"
6 #include "Epetra_MultiVector.h"
7 #include "Epetra_Operator.h"
9 
14 namespace RBGen {
15 
17  class AnasaziPOD : public virtual Method<Epetra_MultiVector,Epetra_Operator>, public virtual PODMethod<double> {
18 
19  public:
21 
22 
24  AnasaziPOD();
25 
27  virtual ~AnasaziPOD() {};
29 
31 
32 
34 
37  void computeBasis();
38 
40 
43  void updateBasis( const Teuchos::RCP< Epetra_MultiVector >& update_ss ) {};
44 
46 
48 
49 
51 
52  std::vector<double> getSingularValues() const { return sv_; }
53 
54  double getCompTime() const { return comp_time_; }
56 
58 
59 
63  const Teuchos::RCP< RBGen::FileIOHandler< Epetra_Operator > >& fileio = Teuchos::null );
64 
66  void Reset( const Teuchos::RCP<Epetra_MultiVector>& new_ss ) { ss_ = new_ss; }
67 
69  void ResetOp( const Teuchos::RCP<Epetra_Operator>& new_op ) { op_ = new_op; }
70 
72  void ResetInnerProdOp( const Teuchos::RCP<Epetra_Operator>& new_op ) { inner_prod_op_ = new_op; }
73 
75 
77 
78 
79  bool isInitialized() { return isInitialized_; }
80 
82 
83  private:
84 
85  // Is this object initialized.
86  bool isInitialized_;
87 
88  // Is the inner (A^T*A) or outer (A*A^T) product being used for the SVD computation
89  bool isInner_;
90 
91  // Size of the basis that this method will compute.
92  int basis_size_;
93 
94  // Computational time (in seconds, using wall clock).
95  double comp_time_;
96 
97  // Pointers to the snapshots and reduced basis.
100 
101  // Pointer to the SVD weighted operator
103 
104  // Pointer to the inner product operator
105  Teuchos::RCP<Epetra_Operator> inner_prod_op_;
106 
107  // Vector holding singular values.
108  std::vector<double> sv_;
109  };
110 
111 } // end of RBGen namespace
112 
113 #endif // RBGEN_ANASAZI_POD_H
Class for producing a basis using the Anasazi eigensolver.
virtual ~AnasaziPOD()
Destructor.
std::vector< double > getSingularValues() const
Returns the singular values computed corresponding to the reduced basis.
double getCompTime() const
Returns the computational time taken to compute the reduced basis.
void Initialize(const Teuchos::RCP< Teuchos::ParameterList > &params, const Teuchos::RCP< const Epetra_MultiVector > &ss, const Teuchos::RCP< RBGen::FileIOHandler< Epetra_Operator > > &fileio=Teuchos::null)
Initialize the method with the given parameter list and snapshot set.
AnasaziPOD()
Default constructor.
void updateBasis(const Teuchos::RCP< Epetra_MultiVector > &update_ss)
Append new snapshots to the set, and update the basis.
void Reset(const Teuchos::RCP< Epetra_MultiVector > &new_ss)
Reset the snapshot set used to compute the reduced basis.
Abstract base class for reduced basis methods.
Abstract base class for reduced basis POD methods.
Teuchos::RCP< const Epetra_MultiVector > getBasis() const
Get the basis computed by the reduced basis method.
void ResetOp(const Teuchos::RCP< Epetra_Operator > &new_op)
Reset the operator used to weight the Anasazi operator or .
void computeBasis()
Compute a basis for the provided snapshots.
void ResetInnerProdOp(const Teuchos::RCP< Epetra_Operator > &new_op)
Reset the operator used to weight the inner product.