00001 #ifndef LINEAREIGSOLVOPERATORS_H 00002 #define LINEAREIGSOLVOPERATORS_H 00003 00004 #include "AbstractEigsolvOperators.h" 00005 00006 #ifdef HAVE_MPI 00007 #include "mpi.h" 00008 #include "Epetra_MpiComm.h" 00009 #else 00010 #include "Epetra_SerialComm.h" 00011 #endif 00012 00013 #include "AztecOO.h" 00014 #include "AztecOO_Operator.h" 00015 00016 #include "Epetra_ConfigDefs.h" 00017 #include "Epetra_Operator.h" 00018 #include "Epetra_CrsMatrix.h" 00019 #include "Epetra_FECrsMatrix.h" 00020 #include "Epetra_Export.h" 00021 #include "Epetra_LinearProblem.h" 00022 #include "Epetra_Map.h" 00023 #include "Teuchos_ParameterList.hpp" 00024 00025 #include <iostream> 00026 #include <fstream> 00027 #include <sstream> 00028 #include <cstdlib> 00029 #include <cassert> 00030 #include <unistd.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 LinearEigsolvOperators : public AbstractEigsolvOperators { 00048 00049 public: 00050 00051 LinearEigsolvOperators(FemaxMesh& mesh_mixed, Teuchos::ParameterList& params, const Epetra_Comm& MyComm); 00052 ~LinearEigsolvOperators(); 00053 00054 const Epetra_Operator* getA() const; 00055 const Epetra_Operator* getM() const; 00056 const Epetra_Operator* getAsigmaPrec(double sigma); 00060 const Epetra_Operator* getHSolver(); 00064 const Epetra_Operator* getHPrec(); 00065 Epetra_Operator* getH(); 00066 Epetra_Operator* getY() const; 00067 Epetra_Operator* getC() const; 00068 00069 private: 00074 LinearEigsolvOperators(const LinearEigsolvOperators& leo); 00080 LinearEigsolvOperators& operator=(const LinearEigsolvOperators &ref); 00089 int buildPreconditioner(double sigma); 00094 void matrixAssembly(FemaxMesh& mesh_mixed); 00095 00096 FemaxMesh& mesh_mixed_; 00097 const Epetra_Comm& Comm; 00098 Epetra_FECrsMatrix* A; 00099 Epetra_FECrsMatrix* M; 00100 Epetra_CrsMatrix* K; 00101 Epetra_CrsMatrix* H; 00102 Epetra_FECrsMatrix* Y; 00103 Epetra_CrsMatrix* C; 00104 Epetra_Operator* Prec; 00105 00108 Epetra_Operator* h_solver_op_; 00111 Epetra_Operator* HPrec; 00114 double _sigma_K; 00117 Teuchos::ParameterList& params_; 00118 00119 // The next two objects are defined for using 00120 // the Neumann preconditioner from AztecOO. 00121 // They might disappear when ML is operational. 00122 Epetra_LinearProblem* Aprec; 00123 AztecOO* AprecSolver; 00124 00125 }; 00126 00127 #endif