00001 //*****************************************************************// 00002 // Albany 2.0: Copyright 2012 Sandia Corporation // 00003 // This Software is released under the BSD license detailed // 00004 // in the file "license.txt" in the top-level Albany directory // 00005 //*****************************************************************// 00006 #ifndef MOR_REDUCEDJACOBIANFACTORY_HPP 00007 #define MOR_REDUCEDJACOBIANFACTORY_HPP 00008 00009 #include "Epetra_CrsGraph.h" 00010 00011 class Epetra_Operator; 00012 class Epetra_CrsMatrix; 00013 class Epetra_MultiVector; 00014 00015 #include "Teuchos_RCP.hpp" 00016 00017 namespace MOR { 00018 00019 class ReducedJacobianFactory { 00020 public: 00021 explicit ReducedJacobianFactory(const Teuchos::RCP<const Epetra_MultiVector> &rightProjector); 00022 00023 Teuchos::RCP<const Epetra_MultiVector> rightProjector() const { return rightProjector_; } 00024 Teuchos::RCP<const Epetra_MultiVector> premultipliedRightProjector() const { return premultipliedRightProjector_; } 00025 00026 void fullJacobianIs(const Epetra_Operator &op); 00027 00028 Teuchos::RCP<Epetra_CrsMatrix> reducedMatrixNew() const; 00029 const Epetra_CrsMatrix &reducedMatrix(const Epetra_MultiVector &leftProjector, Epetra_CrsMatrix &result) const; 00030 00031 private: 00032 Teuchos::RCP<const Epetra_MultiVector> rightProjector_; 00033 Teuchos::RCP<Epetra_MultiVector> premultipliedRightProjector_; 00034 00035 Epetra_CrsGraph reducedGraph_; 00036 00037 bool isMasterProcess() const; 00038 }; 00039 00040 } // namespace MOR 00041 00042 #endif /* MOR_REDUCEDJACOBIANFACTORY_HPP */