Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #include "MOR_PetrovGalerkinOperatorFactory.hpp"
00007
00008 #include "MOR_BasisOps.hpp"
00009
00010 #include "Epetra_Operator.h"
00011
00012 namespace MOR {
00013
00014 using Teuchos::RCP;
00015
00016 PetrovGalerkinOperatorFactory::PetrovGalerkinOperatorFactory(const RCP<const Epetra_MultiVector> &reducedBasis) :
00017 reducedBasis_(reducedBasis),
00018 projectionBasis_(reducedBasis),
00019 jacobianFactory_(reducedBasis_)
00020 {
00021
00022 }
00023
00024 PetrovGalerkinOperatorFactory::PetrovGalerkinOperatorFactory(const RCP<const Epetra_MultiVector> &reducedBasis,
00025 const RCP<const Epetra_MultiVector> &projectionBasis) :
00026 reducedBasis_(reducedBasis),
00027 projectionBasis_(projectionBasis),
00028 jacobianFactory_(reducedBasis_)
00029 {
00030
00031 }
00032
00033 bool PetrovGalerkinOperatorFactory::fullJacobianRequired(bool , bool jacobianRequested) const {
00034 return jacobianRequested;
00035 }
00036
00037 const Epetra_MultiVector & PetrovGalerkinOperatorFactory::leftProjection(const Epetra_MultiVector &fullVec, Epetra_MultiVector &result) const {
00038 const int err = reduce(*projectionBasis_, fullVec, result);
00039 TEUCHOS_TEST_FOR_EXCEPT(err != 0);
00040 return result;
00041 }
00042
00043 RCP<Epetra_CrsMatrix> PetrovGalerkinOperatorFactory::reducedJacobianNew() {
00044 return jacobianFactory_.reducedMatrixNew();
00045 }
00046
00047 const Epetra_CrsMatrix & PetrovGalerkinOperatorFactory::reducedJacobian(Epetra_CrsMatrix &result) const {
00048 return jacobianFactory_.reducedMatrix(*projectionBasis_, result);
00049 }
00050
00051 void PetrovGalerkinOperatorFactory::fullJacobianIs(const Epetra_Operator &op) {
00052 jacobianFactory_.fullJacobianIs(op);
00053 }
00054
00055 }