51 "NekLinSysIterEvsDirect solver.");
78 int nNonDir = nGlobal - nDir;
83 for (
int i = 0; i < nNonDir; ++i)
93 Vmath::Vcopy(nNonDir, wk1 + nDir, 1, tmp = Mat + i, nNonDir);
98 std::ofstream mFile(
"Matrix.txt");
100 for (
int j = 0; j < nNonDir; j++)
102 for (
int k = 0; k < nNonDir; k++)
104 if (fabs(Mat[j * nNonDir + k]) < 1e-15)
106 Mat[j * nNonDir + k] = 0.0;
108 mFile << Mat[j * nNonDir + k];
114 char jobvl =
'N', jobvr =
'N';
115 int info = 0, lwork = 3 * nNonDir;
120 Lapack::Dgeev(jobvl, jobvr, nNonDir, Mat.data(), nNonDir, EIG_R.data(),
121 EIG_I.data(), &dum, 1, &dum, 1, &work[0], lwork, info);
125 std::ofstream pFile(
"Eigenvalues.txt");
127 for (
int j = 0; j < nNonDir; j++)
129 pFile << EIG_R[j] <<
" " << EIG_I[j] << std::endl;
133 std::cout << std::endl <<
"Eigenvalues : " << std::endl;
134 for (
int j = 0; j < nNonDir; j++)
136 std::cout << EIG_R[j] <<
"\t" << EIG_I[j] << std::endl;
138 std::cout << std::endl;
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
NekLinSysIterEvsDirect(const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vComm, const int nDimen, const NekSysKey &pKey)
Constructor for full direct matrix solve.
int v_SolveSystem(const int nGlobal, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const int nDir) override
static NekLinSysIterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vComm, const int nDimen, const NekSysKey &pKey)
~NekLinSysIterEvsDirect() override
static std::string className
void v_InitObject() override
void v_InitObject() override
NekSysOperators m_operator
void DoNekSysPrecon(InArrayType &inarray, OutArrayType &outarray, const bool &flag=false) const
void DoNekSysLhsEval(InArrayType &inarray, OutArrayType &outarray, const bool &flag=false) const
static void Dgeev(const char &uplo, const char &lrev, const int &n, const double *a, const int &lda, double *wr, double *wi, double *rev, const int &ldr, double *lev, const int &ldv, double *work, const int &lwork, int &info)
Solve general real matrix eigenproblem.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
NekLinSysIterFactory & GetNekLinSysIterFactory()
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
void Zero(int n, T *x, const int incx)
Zero vector.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)