45 #include "Stokhos_Ifpack2.hpp"
58 #include "Ifpack2_Factory.hpp"
59 #include "BelosLinearProblem.hpp"
60 #include "kokkos_pce_specializations.hpp"
61 #include "BelosPseudoBlockCGSolMgr.hpp"
62 #include "BelosPseudoBlockGmresSolMgr.hpp"
63 #include "MatrixMarket_Tpetra.hpp"
64 #include "BelosBlockGmresSolMgr.hpp"
74 #include "Stokhos_MueLu.hpp"
75 #include "Stokhos_MueLu_QR_Interface_decl.hpp"
76 #include "Stokhos_MueLu_QR_Interface_def.hpp"
77 #include "MueLu_SmootherFactory.hpp"
78 #include "MueLu_TrilinosSmoother.hpp"
79 typedef KokkosClassic::DefaultNode::DefaultNodeType
Node;
82 #include <BelosXpetraAdapter.hpp>
83 #include <BelosMueLuAdapter.hpp>
85 #include "Xpetra_MultiVectorFactory.hpp"
86 #include "Xpetra_Matrix.hpp"
87 #include "Xpetra_Map.hpp"
88 #include "MueLu_Level.hpp"
89 #include "MueLu_CoupledAggregationFactory.hpp"
90 #include "MueLu_SaPFactory.hpp"
154 template<
typename ordinal_type,
typename value_type,
typename Storage>
165 denseEntry->putScalar(0.0);
166 typename Cijk_type::k_iterator k_begin = Cijk->k_begin();
167 typename Cijk_type::k_iterator k_end = Cijk->k_end();
168 if (pb < Cijk->num_k())
169 k_end = Cijk->find_k(pb);
172 for (
typename Cijk_type::k_iterator k_it=k_begin; k_it!=k_end; ++k_it) {
174 for (
typename Cijk_type::kj_iterator j_it = Cijk->j_begin(k_it); j_it != Cijk->j_end(k_it); ++j_it) {
176 for (
typename Cijk_type::kji_iterator i_it = Cijk->i_begin(j_it); i_it != Cijk->i_end(j_it); ++i_it) {
179 (*denseEntry)(i,
j) += cijk*cv[k];
185 typedef Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>
Xpetra_Matrix;
186 typedef Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>
Xpetra_Map;
188 template<
typename ordinal_type,
typename value_type>
196 size_t maxLength = A->getNodeMaxNumRowEntries();
202 for (
ordinal_type i = 0 ; i < Teuchos::as<ordinal_type>(A->getNodeNumRows()); ++i) {
203 A->getLocalRowCopy(i, Indices(), Values(), NumEntries);
204 fos <<
"++++++++++++++" << std::endl <<
"row " << A->getRowMap()->getGlobalElement(i) <<
": ";
206 for (
size_t ii=0; ii<NumEntries; ++ii) fos << colMap->getGlobalElement(Indices[ii]) <<
" ";
207 fos << std::endl <<
"++++++++++++++" << std::endl;
208 for (
size_t k=0; k< NumEntries; ++k) {
211 fos << std::endl <<
"col " << colMap->getGlobalElement(Indices[k]) << std::endl;
215 denseEntry->print(fos);
221 typedef double MeshScalar;
222 typedef double BasisScalar;
235 MPI_Init(&argc,&argv);
243 RCP<const Epetra_Comm> globalComm;
249 MyPID = globalComm->MyPID();
254 "This example runs an interlaced stochastic Galerkin solvers.\n");
257 CLP.
setOption(
"num_mesh", &n,
"Number of mesh points in each direction");
261 CLP.
setOption(
"min_agg_size", &minAggSize,
"multigrid aggregate size");
263 CLP.
setOption(
"smoother_type", &smoother_type,
265 "Multigrid smoother types");
266 int smootherSweeps = 3;
267 CLP.
setOption(
"smoother_sweeps", &smootherSweeps,
"# multigrid smoother sweeps");
269 CLP.
setOption(
"plain_aggregation",
"smoothed_aggregation", &plainAgg,
"multigrid prolongator smoothing");
271 CLP.
setOption(
"nullspace_size", &nsSize,
"multigrid nullspace dimension");
273 CLP.
setOption(
"max_multigrid_levels", &maxAMGLevels,
"maximum # levels in multigrid preconditioner");
275 bool printTimings=
true;
276 CLP.
setOption(
"timings",
"notimings", &printTimings,
"print timing summary");
279 bool symmetric =
false;
280 CLP.
setOption(
"symmetric",
"unsymmetric", &symmetric,
"Symmetric discretization");
282 int num_spatial_procs = -1;
283 CLP.
setOption(
"num_spatial_procs", &num_spatial_procs,
"Number of spatial processors (set -1 for all available procs)");
288 "Random field type");
294 CLP.
setOption(
"std_dev", &s,
"Standard deviation");
297 CLP.
setOption(
"num_kl", &num_KL,
"Number of KL terms");
300 CLP.
setOption(
"order", &order,
"Polynomial order");
302 bool normalize_basis =
true;
303 CLP.
setOption(
"normalize",
"unnormalize", &normalize_basis,
304 "Normalize PC basis");
307 CLP.
setOption(
"solver_method", &solver_method,
309 "Krylov solver method");
312 CLP.
setOption(
"prec_method", &prec_method,
314 "Preconditioner method");
317 CLP.
setOption(
"division_method", &division_method,
319 "Stochastic division method");
322 CLP.
setOption(
"divprec_method", &divprec_method,
324 "Preconditioner for division method");
326 CLP.
setOption(
"schur_option", &schur_option,
330 CLP.
setOption(
"prec_option", &prec_option,
335 double solver_tol = 1e-12;
336 CLP.
setOption(
"solver_tol", &solver_tol,
"Outer solver tolerance");
338 double div_tol = 1e-6;
339 CLP.
setOption(
"div_tol", &div_tol,
"Tolerance in Iterative Solver");
342 CLP.
setOption(
"prec_level", &prec_level,
"Level in Schur Complement Prec 0->Solve A0u0=g0 with division; 1->Form 1x1 Schur Complement");
345 CLP.
setOption(
"max_it_div", &max_it_div,
"Maximum # of Iterations in Iterative Solver for Division");
347 bool equilibrate =
true;
348 CLP.
setOption(
"equilibrate",
"noequilibrate", &equilibrate,
349 "Equilibrate the linear system");
351 bool printHierarchy =
false;
352 CLP.
setOption(
"print_hierarchy",
"noprint_Hierarchy", &printHierarchy,
353 "Print matrices in multigrid hierarchy");
356 CLP.
parse( argc, argv );
359 std::cout <<
"Summary of command line options:" << std::endl
360 <<
"\tnum_mesh = " << n << std::endl
361 <<
"\tsymmetric = " << symmetric << std::endl
362 <<
"\tnum_spatial_procs = " << num_spatial_procs << std::endl
365 <<
"\tmean = " << mu << std::endl
366 <<
"\tstd_dev = " << s << std::endl
367 <<
"\tnum_kl = " << num_KL << std::endl
368 <<
"\torder = " << order << std::endl
369 <<
"\tnormalize_basis = " << normalize_basis << std::endl
371 <<
"\tprec_method = " <<
sg_prec_names[prec_method] << std::endl
372 <<
"\tdivision_method = " <<
sg_div_names[division_method] << std::endl
373 <<
"\tdiv_tol = " << div_tol << std::endl
375 <<
"\tprec_level = " << prec_level << std::endl
376 <<
"\tmax_it_div = " << max_it_div << std::endl
377 <<
"\t~~~ multigrid options ~~~" << std::endl
379 <<
"\tsmoother_sweeps = " << smootherSweeps << std::endl
380 <<
"\tplain_aggregation = " << plainAgg << std::endl
381 <<
"\tmax_multigrid_levels = " << maxAMGLevels << std::endl
382 <<
"\tnullspace_size = " << nsSize << std::endl
383 <<
"\tmin_agg_size = " << minAggSize << std::endl;
385 bool nonlinear_expansion =
false;
387 nonlinear_expansion =
false;
389 nonlinear_expansion =
true;
401 RCP<const Stokhos::CompletePolynomialBasis<LocalOrdinal,BasisScalar> > basis =
404 RCP<Stokhos::Sparse3Tensor<LocalOrdinal,BasisScalar> > Cijk =
405 basis->computeTripleProductTensor();
406 RCP<const Stokhos::Quadrature<int,double> > quad =
408 RCP<ParameterList> expn_params =
Teuchos::rcp(
new ParameterList);
410 expn_params->set(
"Division Strategy",
"Mean-Based");
411 expn_params->set(
"Use Quadrature for Division",
false);
413 else if (division_method ==
DIRECT) {
414 expn_params->set(
"Division Strategy",
"Dense Direct");
415 expn_params->set(
"Use Quadrature for Division",
false);
418 expn_params->set(
"Division Strategy",
"SPD Dense Direct");
419 expn_params->set(
"Use Quadrature for Division",
false);
421 else if (division_method ==
CGD) {
422 expn_params->set(
"Division Strategy",
"CG");
423 expn_params->set(
"Use Quadrature for Division",
false);
426 else if (division_method ==
QUAD) {
427 expn_params->set(
"Use Quadrature for Division",
true);
430 if (divprec_method ==
NO)
431 expn_params->set(
"Prec Strategy",
"None");
432 else if (divprec_method ==
DIAG)
433 expn_params->set(
"Prec Strategy",
"Diag");
434 else if (divprec_method ==
JACOBI)
435 expn_params->set(
"Prec Strategy",
"Jacobi");
436 else if (divprec_method ==
GS)
437 expn_params->set(
"Prec Strategy",
"GS");
438 else if (divprec_method ==
SCHUR)
439 expn_params->set(
"Prec Strategy",
"Schur");
441 if (schur_option ==
diag)
442 expn_params->set(
"Schur option",
"diag");
444 expn_params->set(
"Schur option",
"full");
445 if (prec_option ==
linear)
446 expn_params->set(
"Prec option",
"linear");
450 expn_params->set(
"Equilibrate", 1);
452 expn_params->set(
"Equilibrate", 0);
453 expn_params->set(
"Division Tolerance", div_tol);
454 expn_params->set(
"prec_iter", prec_level);
455 expn_params->set(
"max_it_div", max_it_div);
457 RCP<Stokhos::OrthogPolyExpansion<LocalOrdinal,BasisScalar> > expansion =
459 basis, Cijk, quad, expn_params));
462 std::cout <<
"Stochastic Galerkin expansion size = " << sz << std::endl;
465 ParameterList parallelParams;
466 parallelParams.set(
"Number of Spatial Processors", num_spatial_procs);
471 RCP<Stokhos::ParallelData> sg_parallel_data =
473 RCP<const EpetraExt::MultiComm> sg_comm =
474 sg_parallel_data->getMultiComm();
475 RCP<const Epetra_Comm> app_comm =
476 sg_parallel_data->getSpatialComm();
479 RCP< Teuchos::Comm<int> > teuchos_app_comm;
481 RCP<const Epetra_MpiComm> app_mpi_comm =
483 RCP<const Teuchos::OpaqueWrapper<MPI_Comm> > raw_mpi_comm =
484 Teuchos::opaqueWrapper(app_mpi_comm->Comm());
485 teuchos_app_comm =
rcp(
new Teuchos::MpiComm<int>(raw_mpi_comm));
492 RCP<problem_type> model =
493 rcp(
new problem_type(teuchos_app_comm, n, num_KL, s, mu,
494 nonlinear_expansion, symmetric));
497 typedef problem_type::Tpetra_Vector Tpetra_Vector;
498 typedef problem_type::Tpetra_CrsMatrix Tpetra_CrsMatrix;
499 typedef Tpetra::MatrixMarket::Writer<Tpetra_CrsMatrix> Writer;
501 typedef Xpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> Xpetra_CrsMatrix;
502 typedef Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> Xpetra_MultiVector;
503 typedef Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node> Xpetra_MultiVectorFactory;
504 typedef Xpetra::TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> Xpetra_TpetraCrsMatrix;
505 typedef Xpetra::CrsMatrixWrap<Scalar, LocalOrdinal, GlobalOrdinal, Node> Xpetra_CrsMatrixWrap;
506 typedef Belos::MueLuOp<Scalar, LocalOrdinal, GlobalOrdinal, Node> Belos_MueLuOperator;
508 typedef MueLu::Hierarchy<Scalar, LocalOrdinal, GlobalOrdinal, Node> MueLu_Hierarchy;
509 typedef MueLu::SmootherPrototype<Scalar,LocalOrdinal,GlobalOrdinal,Node> SmootherPrototype;
510 typedef MueLu::TrilinosSmoother<Scalar,LocalOrdinal,GlobalOrdinal,Node> TrilinosSmoother;
511 typedef MueLu::SmootherFactory<Scalar,LocalOrdinal,GlobalOrdinal,Node> SmootherFactory;
512 typedef MueLu::FactoryManager<Scalar,LocalOrdinal,GlobalOrdinal,Node> FactoryManager;
517 RCP<Tpetra_Vector> p = Tpetra::createVector<Scalar>(model->get_p_map(0));
518 RCP<Tpetra_Vector> x = Tpetra::createVector<Scalar>(model->get_x_map());
520 RCP<Tpetra_Vector>
f = Tpetra::createVector<Scalar>(model->get_f_map());
521 RCP<Tpetra_Vector>
dx = Tpetra::createVector<Scalar>(model->get_x_map());
522 RCP<Tpetra_CrsMatrix> J = model->create_W();
523 RCP<Tpetra_CrsMatrix> J0;
524 if (prec_method ==
MEAN)
525 J0 = model->create_W();
529 ArrayRCP<Scalar> p_view = p->get1dViewNonConst();
530 for (ArrayRCP<Scalar>::size_type i=0; i<p_view.size(); i++) {
531 p_view[i].reset(expansion);
532 p_view[i].copyForWrite();
534 Array<double> point(num_KL, 1.0);
535 Array<double> basis_vals(sz);
536 basis->evaluateBases(point, basis_vals);
538 for (
int i=0; i<num_KL; i++) {
539 p_view[i].term(i,1) = 1.0 / basis_vals[i+1];
544 typedef Ifpack2::Preconditioner<Scalar,LocalOrdinal,GlobalOrdinal,Node> Tprec;
545 RCP<Belos_MueLuOperator> M;
546 RCP<MueLu_Hierarchy> H;
547 RCP<Xpetra_CrsMatrix> xcrsJ =
rcp(
new Xpetra_TpetraCrsMatrix(J));
548 RCP<Xpetra_Matrix> xopJ =
rcp(
new Xpetra_CrsMatrixWrap(xcrsJ));
549 RCP<Xpetra_Matrix> xopJ0;
550 if (prec_method !=
NONE) {
551 ParameterList precParams;
552 std::string prec_name =
"RILUK";
553 precParams.set(
"fact: iluk level-of-fill", 1);
554 precParams.set(
"fact: iluk level-of-overlap", 0);
556 if (prec_method ==
MEAN) {
557 RCP<Xpetra_CrsMatrix> xcrsJ0 =
rcp(
new Xpetra_TpetraCrsMatrix(J0));
558 xopJ0 =
rcp(
new Xpetra_CrsMatrixWrap(xcrsJ0));
564 H =
rcp(
new MueLu_Hierarchy(xopJ0));
565 M =
rcp(
new Belos_MueLuOperator(H));
567 if (nsSize==-1) nsSize=sz;
568 RCP<Xpetra_MultiVector> Z = Xpetra_MultiVectorFactory::Build(xcrsJ->getDomainMap(), nsSize);
569 size_t n = Z->getLocalLength();
571 ArrayRCP<Scalar> col = Z->getDataNonConst(
j);
572 for (
size_t i=0; i<n; ++i) {
573 col[i].reset(expansion);
574 col[i].copyForWrite();
575 col[i].fastAccessCoeff(
j) = 1.0;
578 H->GetLevel(0)->Set(
"Nullspace", Z);
585 model->computeResidual(*x, *p, *f);
586 model->computeJacobian(*x, *p, *J);
590 if (prec_method ==
MEAN) {
591 size_t nrows = J->getNodeNumRows();
592 ArrayView<const LocalOrdinal> indices;
593 ArrayView<const Scalar> values;
595 for (
size_t i=0; i<nrows; i++) {
596 J->getLocalRowView(i, indices, values);
597 Array<Scalar> values0(values.size());
599 values0[
j] = values[
j].coeff(0);
600 J0->replaceLocalValues(i, indices, values0);
607 if (prec_method !=
NONE) {
612 RCP<FactoryManager> fm =
rcp(
new FactoryManager() );;
615 ParameterList smootherParamList;
616 RCP<SmootherPrototype> smooPrototype;
617 switch(smoother_type) {
619 smootherParamList.set(
"chebyshev: degree", smootherSweeps);
620 smootherParamList.set(
"chebyshev: ratio eigenvalue", (
double) 20);
622 smootherParamList.set(
"chebyshev: max eigenvalue", minusOne);
623 smootherParamList.set(
"chebyshev: min eigenvalue", (
double) 1.0);
624 smootherParamList.set(
"chebyshev: zero starting solution",
true);
625 smooPrototype =
rcp(
new TrilinosSmoother(
"CHEBYSHEV", smootherParamList) );
631 smootherParamList.set(
"relaxation: sweeps", smootherSweeps);
632 smootherParamList.set(
"relaxation: type",
"Symmetric Gauss-Seidel");
633 smooPrototype =
rcp(
new TrilinosSmoother(
"RELAXATION", smootherParamList) );
637 RCP<SmootherFactory> smooFact =
rcp(
new SmootherFactory(smooPrototype) );
638 fm->SetFactory(
"Smoother", smooFact);
642 ParameterList coarseParamList;
643 coarseParamList.set(
"fact: level-of-fill", 0);
644 RCP<SmootherPrototype> coarsePrototype =
rcp(
new TrilinosSmoother(
"ILUT", coarseParamList) );
646 RCP<SmootherFactory> coarseSolverFact =
rcp(
new SmootherFactory(coarsePrototype,
Teuchos::null) );
647 fm->SetFactory(
"CoarseSolver", coarseSolverFact);
651 typedef MueLu::CoupledAggregationFactory<LocalOrdinal,GlobalOrdinal,Node>
652 MueLu_CoupledAggregationFactory;
653 RCP<MueLu_CoupledAggregationFactory> aggFact =
rcp(
new MueLu_CoupledAggregationFactory());
654 aggFact->SetMinNodesPerAggregate(minAggSize);
655 fm->SetFactory(
"Aggregates", aggFact);
658 typedef MueLu::SaPFactory<Scalar,LocalOrdinal,GlobalOrdinal,Node> MueLu_SaPFactory;
660 RCP<MueLu_SaPFactory> sapFactory =
rcp(
new MueLu_SaPFactory);
661 sapFactory->SetDampingFactor( (
Scalar) 0.0 );
662 fm->SetFactory(
"P", sapFactory);
665 H->Setup(*fm,0,maxAMGLevels);
670 RCP<Teuchos::FancyOStream> fos = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
671 int numLevels = H->GetNumLevels();
672 for (
int i=0; i<numLevels; ++i) {
673 RCP<Xpetra_Matrix>
A = H->GetLevel(i)->Get<RCP<Xpetra_Matrix> >(
"A");
674 *fos <<
"================\n" <<
"matrix A, multigrid level " << i <<
"\n================" << std::endl;
675 PrintMatrix<LocalOrdinal,BasisScalar>(*fos,A,Cijk,basis);
681 RCP<ParameterList> belosParams =
rcp(
new ParameterList);
682 belosParams->set(
"Flexible Gmres",
false);
683 belosParams->set(
"Num Blocks", 500);
684 belosParams->set(
"Convergence Tolerance", solver_tol);
685 belosParams->set(
"Maximum Iterations", 1000);
686 belosParams->set(
"Verbosity", 33);
687 belosParams->set(
"Output Style", 1);
688 belosParams->set(
"Output Frequency", 1);
689 typedef Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> MV;
690 typedef Belos::OperatorT<Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > OP;
691 typedef Belos::OperatorTraits<Scalar,MV,OP> BOPT;
692 typedef Belos::MultiVecTraits<Scalar,MV> BMVT;
693 typedef Belos::MultiVecTraits<double,MV> BTMVT;
694 typedef Belos::LinearProblem<double,MV,OP> BLinProb;
695 typedef Belos::XpetraOp<Scalar, LocalOrdinal, GlobalOrdinal, Node> BXpetraOp;
696 RCP<OP> belosJ =
rcp(
new BXpetraOp(xopJ));
697 RCP< BLinProb > problem =
rcp(
new BLinProb(belosJ, dx, f));
698 if (prec_method !=
NONE)
699 problem->setRightPrec(M);
700 problem->setProblem();
701 RCP<Belos::SolverManager<double,MV,OP> > solver;
702 if (solver_method ==
CG)
703 solver =
rcp(
new Belos::PseudoBlockCGSolMgr<double,MV,OP>(problem, belosParams));
704 else if (solver_method ==
GMRES)
705 solver =
rcp(
new Belos::BlockGmresSolMgr<double,MV,OP>(problem, belosParams));
708 std::vector<double> norm_f(1);
710 BTMVT::MvNorm(*f, norm_f);
712 std::cout <<
"\nInitial residual norm = " << norm_f[0] << std::endl;
715 Belos::ReturnType ret = solver->solve();
718 if (ret == Belos::Converged)
719 std::cout <<
"Solver converged!" << std::endl;
721 std::cout <<
"Solver failed to converge!" << std::endl;
725 x->update(-1.0, *dx, 1.0);
726 Writer::writeDenseFile(
"stochastic_solution.mm", x);
729 RCP<Tpetra_Vector>
g = Tpetra::createVector<Scalar>(model->get_g_map(0));
731 model->computeResidual(*x, *p, *f);
732 model->computeResponse(*x, *p, *g);
736 BTMVT::MvNorm(*f, norm_f);
738 std::cout <<
"\nFinal residual norm = " << norm_f[0] << std::endl;
741 double g_mean_exp = 0.172988;
742 double g_std_dev_exp = 0.0380007;
745 g_mean_exp = 1.327563e-01;
746 g_std_dev_exp = 2.949064e-02;
749 double g_mean = g->get1dView()[0].mean();
750 double g_std_dev = g->get1dView()[0].standard_deviation();
751 std::cout << std::endl;
752 std::cout <<
"Response Mean = " << g_mean << std::endl;
753 std::cout <<
"Response Std. Dev. = " << g_std_dev << std::endl;
755 if (norm_f[0] < 1.0e-10 &&
756 std::abs(g_mean-g_mean_exp) < g_tol &&
757 std::abs(g_std_dev - g_std_dev_exp) < g_tol)
761 std::cout <<
"Example Passed!" << std::endl;
763 std::cout <<
"Example Failed!" << std::endl;
764 std::cout <<
"Expected Response Mean = "<< g_mean_exp << std::endl;
765 std::cout <<
"Expected Response Std. Dev. = "<< g_std_dev_exp << std::endl;
778 catch (std::exception& e) {
779 std::cout << e.what() << std::endl;
782 std::cout << s << std::endl;
785 std::cout << s << std::endl;
788 std::cout <<
"Caught unknown exception!" <<std:: endl;
const char * multigrid_smoother_names[]
#define TEUCHOS_FUNC_TIME_MONITOR(FUNCNAME)
const char * sg_divprec_names[]
const Prec_option Prec_option_values[]
Hermite polynomial basis.
const Krylov_Method krylov_method_values[]
SparseArrayIterator< index_iterator, value_iterator >::value_type index(const SparseArrayIterator< index_iterator, value_iterator > &it)
Data structure storing a sparse 3-tensor C(i,j,k) in a a compressed format.
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > Xpetra_Matrix
const char * schur_option_names[]
const int num_multigrid_smoother
const char * prec_option_names[]
const SG_Prec sg_prec_values[]
pointer coeff()
Return coefficient array.
const SG_DivPrec sg_divprec_values[]
const Schur_option Schur_option_values[]
const SG_Div sg_div_values[]
Abstract base class for multivariate orthogonal polynomials.
const Multigrid_Smoother multigrid_smoother_values[]
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
const int num_krylov_method
static void summarize(Ptr< const Comm< int > > comm, std::ostream &out=std::cout, const bool alwaysWriteLocal=false, const bool writeGlobalStats=true, const bool writeZeroTimers=true, const ECounterSetOp setOp=Intersection, const std::string &filter="", const bool ignoreZeroTimers=false)
void setOption(const char option_true[], const char option_false[], bool *option_val, const char documentation[]=NULL)
const SG_RF sg_rf_values[]
KokkosClassic::DefaultNode::DefaultNodeType Node
Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > Xpetra_Map
EParseCommandLineReturn parse(int argc, char *argv[], std::ostream *errout=&std::cerr) const
KOKKOS_INLINE_FUNCTION PCE< Storage > abs(const PCE< Storage > &a)
Multivariate orthogonal polynomial basis generated from a total-order complete-polynomial tensor prod...
const int num_schur_option
void PrintMatrix(Teuchos::FancyOStream &fos, Teuchos::RCP< Xpetra_Matrix > const &A, Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > const &Cijk, Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > const &basis)
KOKKOS_INLINE_FUNCTION constexpr std::enable_if< is_view_uq_pce< view_type >::value, typename CijkType< view_type >::type >::type cijk(const view_type &view)
Legendre polynomial basis.
Stokhos::Sparse3Tensor< int, double > Cijk_type
int main(int argc, char **argv)
const char * sg_rf_names[]
ScalarType f(const Teuchos::Array< ScalarType > &x, double a, double b)
void setDocString(const char doc_string[])
SparseArrayIterator< index_iterator, value_iterator >::value_reference value(const SparseArrayIterator< index_iterator, value_iterator > &it)
const char * sg_prec_names[]
ordinal_type size() const
Return size.
const char * sg_div_names[]
Orthogonal polynomial expansions based on numerical quadrature.
const int num_prec_option
Defines quadrature for a tensor product basis by tensor products of 1-D quadrature rules...
ScalarType g(const Teuchos::Array< ScalarType > &x, const ScalarType &y)
static void zeroOutTimers()
void returnScalarAsDenseMatrix(Sacado::PCE::OrthogPoly< value_type, Storage > const &inval, Teuchos::RCP< Teuchos::SerialDenseMatrix< ordinal_type, value_type > > &denseEntry, Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > const &Cijk)
A linear 2-D diffusion problem.
const char * krylov_method_names[]