Hi there.
I am applying a Schwarz alternating method code to a nonlinear elliptic PDE by splitting its domain into two subdomains.
I am facing a problem of computing the maximum norm error of the approximated solution between two consecutive iterations in each of the two subproblems. Here is the code part I am wrong in.
for (i=0; i<=20; i++){
f1=uold1/(1+0.25uold1^2);
solve Schw1(uh1, vh1)
=int2d(Th1)(dx(uh1)dx(vh1)+dy(uh1)dy(vh1)) //bilinear term
+int2d(Th1)(cuh1vh1)
+int2d(Th1)(f1vh1) //right hand side (nonlinear term )
+on(1,3,4, uh1=g)+on(2, uh1=uold2); //external+internal boundaries
diff1[i]=abs(uh1-uold1); My problem seems to be here
norm1[i]=diff1[i].max;
f2=uold2/(1+0.25*uold2^2);
solve Schw2(uh2, vh2)
=int2d(Th2)(dx(uh2)*dx(vh2)+dy(uh2)*dy(vh2)) //bilinear term
+int2d(Th2)(c*uh2*vh2)
+int2d(Th2)(f2*vh2) //right hand side (nonlinear term)
+on(1,2,3, uh2=g)+on(4, uh2=uh1); //external+internal boundaries
diff2[i]=abs(uh2-uold2);
norm2[i]=diff2[i].max;
uold1=uh1;
uold2=uh2;
Globalnorm=max(norm1[i], norm2[i]);
if (Globalnorm<0.00001) break;
};
cout<<“Error on subdomain 1 at iteration”<<"("<<i<<") ="<<diff1[i]<<endl;
cout<<“Error on subdomain 2 at iteration”<<"("<<i<<") ="<<diff2[i]<<endl;
I think that my problem seems to start from here for both subdomains
diff1[i]=abs(uh1-uold1);
norm1[i]=diff1[i].max;
Can someone check whether the way the maximum error is true or not.
Thank you so much.