Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #ifndef MOR_REDUCEDSPACE_HPP
00007 #define MOR_REDUCEDSPACE_HPP
00008
00009 #include "Epetra_Vector.h"
00010 #include "Epetra_LocalMap.h"
00011
00012 #include "Teuchos_RCP.hpp"
00013
00014 namespace MOR {
00015
00016 class ReducedSpace {
00017 public:
00018 int basisSize() const;
00019 const Epetra_Comm &comm() const;
00020 const Epetra_BlockMap &basisMap() const;
00021 const Epetra_LocalMap &componentMap() const { return componentMap_; }
00022
00023 virtual Teuchos::RCP<Epetra_MultiVector> expansion(const Epetra_MultiVector &reducedVector) const = 0;
00024 virtual Teuchos::RCP<Epetra_Vector> expansion(const Epetra_Vector &reducedVector) const = 0;
00025 virtual const Epetra_MultiVector &expansion(const Epetra_MultiVector &reducedVector, Epetra_MultiVector &target) const = 0;
00026
00027 virtual Teuchos::RCP<Epetra_MultiVector> reduction(const Epetra_MultiVector &fullVector) const = 0;
00028 virtual Teuchos::RCP<Epetra_Vector> reduction(const Epetra_Vector &fullVector) const = 0;
00029 virtual const Epetra_MultiVector &reduction(const Epetra_MultiVector &fullVector, Epetra_MultiVector &target) const = 0;
00030
00031 Teuchos::RCP<Epetra_MultiVector> linearExpansion(const Epetra_MultiVector &reducedVector) const;
00032 Teuchos::RCP<Epetra_Vector> linearExpansion(const Epetra_Vector &reducedVector) const;
00033 const Epetra_MultiVector &linearExpansion(const Epetra_MultiVector &reducedVector, Epetra_MultiVector &target) const;
00034
00035 Teuchos::RCP<Epetra_MultiVector> linearReduction(const Epetra_MultiVector &fullVector) const;
00036 Teuchos::RCP<Epetra_Vector> linearReduction(const Epetra_Vector &fullVector) const;
00037 const Epetra_MultiVector &linearReduction(const Epetra_MultiVector &fullVector, Epetra_MultiVector &target) const;
00038
00039 virtual ~ReducedSpace();
00040
00041 protected:
00042 explicit ReducedSpace(const Teuchos::RCP<const Epetra_MultiVector> &orthogonalBasis);
00043 explicit ReducedSpace(const Epetra_MultiVector &orthogonalBasis);
00044
00045 ReducedSpace(
00046 const Teuchos::RCP<const Epetra_MultiVector> &basis,
00047 const Teuchos::RCP<const Epetra_MultiVector> &projector);
00048
00049 const Epetra_MultiVector &basis() const { return *basis_; }
00050 const Epetra_MultiVector &projector() const { return *projector_; }
00051
00052 private:
00053 Teuchos::RCP<const Epetra_MultiVector> basis_;
00054 Teuchos::RCP<const Epetra_MultiVector> projector_;
00055 Epetra_LocalMap componentMap_;
00056
00057
00058 ReducedSpace(const ReducedSpace &);
00059 ReducedSpace &operator=(const ReducedSpace &);
00060 };
00061
00062
00063 class LinearReducedSpace : public ReducedSpace {
00064 public:
00065
00066 virtual Teuchos::RCP<Epetra_MultiVector> expansion(const Epetra_MultiVector &reducedVector) const;
00067 virtual Teuchos::RCP<Epetra_Vector> expansion(const Epetra_Vector &reducedVector) const;
00068 virtual const Epetra_MultiVector &expansion(const Epetra_MultiVector &reducedVector, Epetra_MultiVector &target) const;
00069
00070 virtual Teuchos::RCP<Epetra_MultiVector> reduction(const Epetra_MultiVector &fullVector) const;
00071 virtual Teuchos::RCP<Epetra_Vector> reduction(const Epetra_Vector &fullVector) const;
00072 virtual const Epetra_MultiVector &reduction(const Epetra_MultiVector &fullVector, Epetra_MultiVector &target) const;
00073
00074 explicit LinearReducedSpace(const Teuchos::RCP<const Epetra_MultiVector> &orthogonalBasis);
00075 explicit LinearReducedSpace(const Epetra_MultiVector &orthogonalBasis);
00076
00077 LinearReducedSpace(
00078 const Teuchos::RCP<const Epetra_MultiVector> &basis,
00079 const Teuchos::RCP<const Epetra_MultiVector> &projector);
00080 };
00081
00082
00083 class AffineReducedSpace : public ReducedSpace {
00084 public:
00085
00086 virtual Teuchos::RCP<Epetra_MultiVector> expansion(const Epetra_MultiVector &reducedVector) const;
00087 virtual Teuchos::RCP<Epetra_Vector> expansion(const Epetra_Vector &reducedVector) const;
00088 virtual const Epetra_MultiVector &expansion(const Epetra_MultiVector &reducedVector, Epetra_MultiVector &target) const;
00089
00090 virtual Teuchos::RCP<Epetra_MultiVector> reduction(const Epetra_MultiVector &fullVector) const;
00091 virtual Teuchos::RCP<Epetra_Vector> reduction(const Epetra_Vector &fullVector) const;
00092 virtual const Epetra_MultiVector &reduction(const Epetra_MultiVector &fullVector, Epetra_MultiVector &target) const;
00093
00094 AffineReducedSpace(const Teuchos::RCP<const Epetra_MultiVector> &orthogonalBasis, const Epetra_Vector &origin);
00095 AffineReducedSpace(const Epetra_MultiVector &orthogonalBasis, const Epetra_Vector &origin);
00096
00097 AffineReducedSpace(
00098 const Teuchos::RCP<const Epetra_MultiVector> &basis,
00099 const Teuchos::RCP<const Epetra_MultiVector> &projector,
00100 const Epetra_Vector &origin);
00101
00102 protected:
00103 const Epetra_Vector &origin() const { return origin_; }
00104
00105 private:
00106 Epetra_Vector origin_;
00107
00108 void addLinearExpansion(const Epetra_MultiVector &reducedVector, Epetra_MultiVector &target) const;
00109
00110 template <typename Epetra_MultiVectorT>
00111 void computeReduction(const Epetra_MultiVectorT &fullVector, Epetra_MultiVectorT &target) const;
00112
00113 void substractOrigin(Epetra_MultiVector &target) const;
00114 void substractOrigin(Epetra_Vector &target) const;
00115 };
00116
00117 }
00118
00119 #endif