00001 #ifndef QUADRATICEIGSOLVOPERATORS_H 00002 #define QUADRATICEIGSOLVOPERATORS_H 00003 00004 #include <iostream> 00005 #include <fstream> 00006 #include <sstream> 00007 #include <cstdlib> 00008 #include <cassert> 00009 #include <unistd.h> 00010 00011 #ifdef HAVE_MPI 00012 #include "mpi.h" 00013 #include "Epetra_MpiComm.h" 00014 #else 00015 #include "Epetra_SerialComm.h" 00016 #endif 00017 00018 #include "AztecOO.h" 00019 #include "AztecOO_Operator.h" 00020 00021 #include "Epetra_ConfigDefs.h" 00022 #include "Epetra_Operator.h" 00023 #include "Epetra_CrsMatrix.h" 00024 #include "Epetra_Export.h" 00025 #include "Epetra_LinearProblem.h" 00026 #include "Epetra_Map.h" 00027 #include <Teuchos_ParameterList.hpp> 00028 00029 #include "AbstractEigsolvOperators.h" 00030 #include "HierarchicalBasisPrec.h" 00031 00032 #include "debugmeshbuilder.h" 00033 #include "tetmeshbuilder.h" 00034 #include "broadcastmeshbuilder.h" 00035 #include "netgenreader.h" 00036 #include "femaxmesh.h" 00037 #include "nedelecmesh.h" 00038 #include "lagrangemesh.h" 00039 #include "export_Epetra_CrsMatrix.h" 00040 00041 #define USE_PM_MATRIXMATRIX 1 00042 00043 using namespace std; 00044 using namespace mesh; 00045 00046 00047 class QuadraticEigsolvOperators : public AbstractEigsolvOperators { 00048 00049 public: 00050 00051 QuadraticEigsolvOperators(FemaxMesh& mesh_mixed, Teuchos::ParameterList& params, const Epetra_Comm& MyComm); 00052 00053 ~QuadraticEigsolvOperators(); 00054 00055 const Epetra_Operator* getA() const; 00056 const Epetra_Operator* getM() const; 00057 const Epetra_Operator* getAsigmaPrec(double sigma); 00061 const Epetra_Operator* getHSolver(); 00065 const Epetra_Operator* getHPrec(); 00066 Epetra_Operator* getH(); 00067 Epetra_Operator* getY() const; 00068 Epetra_Operator* getC() const; 00069 00070 private: 00071 00072 QuadraticEigsolvOperators(const QuadraticEigsolvOperators& leo); 00073 QuadraticEigsolvOperators& operator=(const QuadraticEigsolvOperators &ref); 00074 00075 int buildPreconditioner(double sigma); 00076 00083 int buildHierarchicalPrec(double sigma); 00084 00085 int buildHierarchicalHPrec(); 00086 00087 Epetra_CrsMatrix* getH11(); 00088 00089 void matrixAssembly(FemaxMesh& mesh_mixed); 00090 00091 const Epetra_Comm& Comm; 00092 Epetra_FECrsMatrix* A; 00093 Epetra_FECrsMatrix* M; 00094 Epetra_CrsMatrix* K; 00095 Epetra_CrsMatrix* K11; 00096 Epetra_CrsMatrix* K12; 00097 Epetra_CrsMatrix* K22; 00098 Epetra_CrsMatrix* H; 00099 Epetra_CrsMatrix* H11; 00100 Epetra_CrsMatrix* H12; 00101 Epetra_CrsMatrix* H22; 00102 Epetra_FECrsMatrix* Y; 00103 Epetra_CrsMatrix* Y11; 00104 Epetra_CrsMatrix* C; 00105 Epetra_Operator* Prec; 00106 Epetra_Operator* h_solver_op_; 00107 Epetra_Operator* HPrec; 00108 00111 double _sigma_K; 00114 Teuchos::ParameterList& params_; 00115 00116 // The next two objects are defined for using 00117 // the Neumann preconditioner from AztecOO. 00118 // They might disappear when ML is operational. 00119 Epetra_LinearProblem* Aprec; 00120 AztecOO* AprecSolver; 00121 00123 int non; 00125 int noe; 00126 }; 00127 00128 #endif