[petsc-users] dense matrix problem
Alex Salazar
alejandrocof at gmail.com
Thu Jan 31 11:31:30 CST 2013
Thanks Jed, sorry I new using Petsc.
I am runing my program with default options :
mpirun -np 1 ./a.out
runing the program with a few points (10) the interpolation is aceptable,
using the monitor options ie.
mpirun -np 1 ./a.out -ksp_converged_reason -ksp_monitor_true_residual
the output is the next
0 KSP preconditioned resid norm 7.415666989515e+05 true resid norm
1.510533668194e+04 ||r(i)||/||b|| 1.000000000000e+00
1 KSP preconditioned resid norm 4.935801698308e+02 true resid norm
1.721762948997e+01 ||r(i)||/||b|| 1.139837519183e-03
2 KSP preconditioned resid norm 1.038493428107e-01 true resid norm
9.406615966569e+00 ||r(i)||/||b|| 6.227346112594e-04
Linear solve converged due to CONVERGED_RTOL iterations 2
But if encrease the number of points to interpolate, the result is
incorrect and the time of convergece encrease, the output in this case is:
.....
138 KSP preconditioned resid norm 4.897817095518e-06 true resid norm
5.455886375264e-08 ||r(i)||/||b|| 4.852601039969e-10
139 KSP preconditioned resid norm 3.535973415166e-06 true resid norm
3.717900878947e-08 ||r(i)||/||b|| 3.306793512687e-10
140 KSP preconditioned resid norm 2.450794339359e-06 true resid norm
3.009597005096e-08 ||r(i)||/||b|| 2.676810430480e-10
Linear solve converged due to CONVERGED_RTOL iterations 140
[0] time (sec) 89.940000
the code where the solution is implemented is the next:
KSP ksp;
KSPCreate(PETSC_COMM_WORLD,&ksp);
KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN);
KSPSetTolerances(ksp,1.e-5/(N+nt+1),1.e-50,PETSC_DEFAULT,PETSC_DEFAULT);
KSPSetFromOptions(ksp);
KSPSolve(ksp,b,x);
Let me know if you need another information.
Regard Alex
2013/1/31 Jed Brown <jedbrown at mcs.anl.gov>
> "result is incorrect" is not helpful. Please include diagnostics. Are you
> using an iterative or direct solver? Start here if you don't know what to
> check:
>
>
> http://scicomp.stackexchange.com/questions/513/why-is-my-iterative-linear-solver-not-converging
>
>
>
> On Thu, Jan 31, 2013 at 9:58 AM, Alex Salazar <alejandrocof at gmail.com>wrote:
>
>> Hello, everyone
>>
>> I want to get the solution of algrebraic system (with a dense
>> zero-diagonal simetric matrix) of a interpolation problem (using radial
>> basis functions) with Petsc.
>>
>> For a few points (around 10 elements) using KSP I get the correct
>> solution, however when I increase the number of points, the result is
>> incorrect.
>>
>> Any Idea ?
>>
>> Regards Alejandro.
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130131/6f82da9e/attachment.html>
More information about the petsc-users
mailing list