11 #ifdef HAVE_STOKHOS_ANASAZI
13 #include "AnasaziBlockKrylovSchurSolMgr.hpp"
14 #include "AnasaziBasicSort.hpp"
16 Stokhos::PCEAnasaziKL::
19 covOp(Teuchos::
rcp(new Stokhos::PCECovarianceOp(X_poly))),
24 Stokhos::PCEAnasaziKL::
28 covOp(Teuchos::
rcp(new Stokhos::PCECovarianceOp(X, basis))),
33 Stokhos::PCEAnasaziKL::
37 covOp(Teuchos::
rcp(new Stokhos::PCECovarianceOp(X, basis))),
43 Stokhos::PCEAnasaziKL::
44 getDefaultParams()
const
48 params.
set(
"Verbosity",
49 Anasazi::FinalSummary +
53 params.
set(
"Which",
"LM");
54 params.
set(
"Block Size", 1);
55 params.
set(
"Num Blocks", 3*num_KL);
56 params.
set(
"Step Size", 5);
57 params.
set(
"Maximum Restarts", 1);
58 params.
set(
"Convergence Tolerance", 1e-12);
64 Stokhos::PCEAnasaziKL::
71 anasazi_params.
get<
int>(
"Block Size")));
77 Teuchos::rcp(
new Anasazi::BasicEigenproblem<ScalarType,MV,OP>(covOp, ivec));
80 anasazi_problem->setHermitian(
true);
83 anasazi_problem->setNEV(num_KL);
86 anasazi_problem->setProblem();
89 Anasazi::BlockKrylovSchurSolMgr<ScalarType,MV,OP> solverMgr(anasazi_problem,
93 Anasazi::ReturnType returnCode = solverMgr.solve();
97 if (returnCode != Anasazi::Converged) {
102 sol = anasazi_problem->getSolution();
108 Stokhos::PCEAnasaziKL::
109 getEigenvalues()
const
112 for (
int i=0; i<num_KL; i++)
113 evals[i] =
std::abs(sol.Evals[i].realpart);
118 Stokhos::PCEAnasaziKL::
119 getEigenvectors()
const
124 #endif // HAVE_STOKHOS_ANASAZI
T & get(ParameterList &l, const std::string &name)
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
KOKKOS_INLINE_FUNCTION PCE< Storage > abs(const PCE< Storage > &a)