00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef NOX_EPETRA_SCALING_H
00040 #define NOX_EPETRA_SCALING_H
00041
00042 #include "NOX_Common.H"
00043 #include "NOX_Abstract_Vector.H"
00044 #include "Teuchos_RCP.hpp"
00045
00046
00047 class Epetra_Vector;
00048 class Epetra_RowMatrix;
00049 class Epetra_LinearProblem;
00050 namespace NOX {
00051 class Utils;
00052 }
00053
00054 namespace NOX {
00055
00056 namespace Epetra {
00057
00064 class Scaling {
00065
00066 public:
00067
00069 enum SourceType {None, RowSum, ColSum, UserDefined};
00070
00072 enum ScaleType {Left, Right};
00073
00075 Scaling();
00076
00078 virtual ~Scaling();
00079
00081 virtual void addUserScaling(ScaleType type, const Teuchos::RCP<Epetra_Vector>& D);
00082
00084 virtual void addRowSumScaling(ScaleType type, const Teuchos::RCP<Epetra_Vector>& D);
00085
00087 virtual void addColSumScaling(ScaleType type, const Teuchos::RCP<Epetra_Vector>& D);
00088
00090 virtual void computeScaling(const Epetra_LinearProblem& problem);
00091
00093 virtual void scaleLinearSystem(Epetra_LinearProblem& problem);
00094
00096 virtual void unscaleLinearSystem(Epetra_LinearProblem& problem);
00097
00099 virtual void applyRightScaling(const Epetra_Vector& input,
00100 Epetra_Vector& result);
00101
00103 virtual void applyLeftScaling(const Epetra_Vector& input,
00104 Epetra_Vector& result);
00105
00107 virtual void print(ostream& os);
00108
00109 private:
00110
00112 vector<ScaleType> scaleType;
00113
00115 vector<SourceType> sourceType;
00116
00118 vector< Teuchos::RCP<Epetra_Vector> > scaleVector;
00119
00121 Teuchos::RCP<Epetra_Vector> tmpVectorPtr;
00122
00123 };
00124 }
00125 }
00126
00127 ostream& operator<<(ostream& os, NOX::Epetra::Scaling& scalingObject);
00128
00129 #endif