51 :
public Dune::InverseOperator<LinearProductSpace<typename X::field_type,boost::fusion::vector<X,Y>>,
96 InverseOperatorResult resA;
97 if (verbose>0) printf(
"=== UzawaSolver\n");
100 X& u(at_c<0>(x.
data));
101 X& f(at_c<0>(b.
data));
102 X r(u), h(u), rSave(u);
103 Y& lambda(at_c<1>(x.
data));
104 Y g(at_c<1>(b.
data)), d(g), p(g);
109 opBt.applyscaleadd(-1,lambda,r);
110 solA.apply(u,r,resA);
111 opB.applyscaleadd(-1,u,g);
114 double sigma = spY.dot(g,d);
115 double sigma0 = sigma;
121 for ( ; i<maxit && sigma>reduction*reduction*sigma0; i++) {
127 solA.apply(h,r,resA);
130 double alpha = sigma / spX.dot(h,r);
131 lambda.axpy(-alpha,d);
133 opB.applyscaleadd(-alpha,h,g);
138 double sigmaOld = sigma;
139 sigma = spY.dot(g,p);
140 double beta = sigma / sigmaOld;
143 d *= beta; d.axpy(1,p);
148 std::printf(
"%5s %14s %14s\n",
"Iter",
"Preco. Res.",
"Rate");
149 std::printf(
"%5d %14.4e %14.4e\n",i,std::sqrt(sigma),std::sqrt(beta));
156 res.reduction = std::sqrt(sigma/sigma0);
157 res.converged = res.reduction<=reduction;
158 res.conv_rate = std::pow(res.reduction,1.0/i);
159 res.elapsed = watch.elapsed();
163 printf(
"=== rate=%g, time=%g, time/it=%g, iter=%d\n",res.conv_rate,res.elapsed,res.elapsed/i,i);