43 #ifdef HAVE_STOKHOS_ANASAZI
45 #include "AnasaziBlockKrylovSchurSolMgr.hpp"
46 #include "AnasaziBasicSort.hpp"
48 Stokhos::PCEAnasaziKL::
51 covOp(Teuchos::
rcp(new Stokhos::PCECovarianceOp(X_poly))),
56 Stokhos::PCEAnasaziKL::
60 covOp(Teuchos::
rcp(new Stokhos::PCECovarianceOp(X, basis))),
65 Stokhos::PCEAnasaziKL::
69 covOp(Teuchos::
rcp(new Stokhos::PCECovarianceOp(X, basis))),
75 Stokhos::PCEAnasaziKL::
76 getDefaultParams()
const
80 params.
set(
"Verbosity",
81 Anasazi::FinalSummary +
85 params.
set(
"Which",
"LM");
86 params.
set(
"Block Size", 1);
87 params.
set(
"Num Blocks", 3*num_KL);
88 params.
set(
"Step Size", 5);
89 params.
set(
"Maximum Restarts", 1);
90 params.
set(
"Convergence Tolerance", 1e-12);
96 Stokhos::PCEAnasaziKL::
103 anasazi_params.
get<
int>(
"Block Size")));
109 Teuchos::rcp(
new Anasazi::BasicEigenproblem<ScalarType,MV,OP>(covOp, ivec));
112 anasazi_problem->setHermitian(
true);
115 anasazi_problem->setNEV(num_KL);
118 anasazi_problem->setProblem();
121 Anasazi::BlockKrylovSchurSolMgr<ScalarType,MV,OP> solverMgr(anasazi_problem,
125 Anasazi::ReturnType returnCode = solverMgr.solve();
129 if (returnCode != Anasazi::Converged) {
134 sol = anasazi_problem->getSolution();
140 Stokhos::PCEAnasaziKL::
141 getEigenvalues()
const
144 for (
int i=0; i<num_KL; i++)
145 evals[i] =
std::abs(sol.Evals[i].realpart);
150 Stokhos::PCEAnasaziKL::
151 getEigenvectors()
const
156 #endif // HAVE_STOKHOS_ANASAZI
T & get(ParameterList &l, const std::string &name)
ParameterList & set(std::string const &name, T const &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)