12 #ifdef HAVE_STOKHOS_ML
25 Label_ =
"Stochos::MLPrecOp";
36 ML_Epetra::SetDefaults(
"SA",MLList);
44 MLList.
set(
"ML output", 10);
46 MLList.
set(
"max levels",5);
48 MLList.
set(
"increasing or decreasing",
"increasing");
51 MLList.
set(
"aggregation: type",
"Uncoupled");
57 MLList.
set(
"smoother: type",
"Chebyshev");
58 MLList.
set(
"smoother: sweeps",3);
61 MLList.
set(
"smoother: pre or post",
"both");
66 MLList.
set(
"coarse: type",
"Amesos-KLU");
71 MLList.
set(
"coarse: type",
"Jacobi");
79 MLPrec =
new ML_Epetra::MultiLevelPreconditioner(mean_op, MLList);
83 MLPrec->PrintUnused(0);
95 std::cout <<
"!X.Map().SameAs(OperatorDomainMap())\n";
97 std::cout<<
"!Y.Map().SameAs(OperatorRangeMap())\n";
98 if (Y.NumVectors()!=X.NumVectors())
99 std::cout<<
"Y.NumVectors()!=X.NumVectors()\n";
103 for(
int mm = 0; mm< X.NumVectors(); mm++){
106 int N_xi = norms_.size();
107 int N_x = X.MyLength()/N_xi;
118 int MyLength = xBlock.MyLength();
119 for(
int c=0; c<N_xi ; c++){
120 for(
int i=0; i<MyLength; i++){
121 xBlock[c][i] = (X)[mm][c*N_x + i];
127 MLPrec->ApplyInverse(xBlock, blockProducts);
130 for(
int j = 0;
j<N_xi;
j++){
131 (*yBlock(
j)).Update(1/norms_[
j],*blockProducts(j), 1.0);
134 for(
int c=0; c<N_xi ; c++){
135 for(
int i=0; i<MyLength; i++){
136 (Y)[mm][c*N_x + i] = yBlock[c][i];
bool SameAs(const Epetra_BlockMap &Map) const
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
virtual const Epetra_BlockMap & Map() const =0