Re: [petsc-users] Norm_2 calculation

2020-06-05 Thread Fazlul Huq
Thanks for the hint! I will look at the matrix more closely. For reference: if (!rstart) { rstart = 1; i = 0; col[0] = 0; col[1] = 1; value[0] = 2.0; value[1] = -1.0; ierr = MatSetValues(A,1,&i,2,col,value,INSERT_VALUES);CHKERRQ(ierr); } if (rend == n) { rend = n-1;

Re: [petsc-users] Norm_2 calculation

2020-06-05 Thread Matthew Knepley
On Fri, Jun 5, 2020 at 2:18 PM Fazlul Huq wrote: > The same is happening with "-pc_type hypre -pc_hypre_type boomerang" and > with "-pc_type ilu". > > I tried with, > ierr = > KSPSetTolerances(ksp,1.e-10,PETSC_DEFAULT,PETSC_DEFAULT,PETSC_DEFAULT);CHKERRQ(ierr); > this also. > > Getting higher val

Re: [petsc-users] Norm_2 calculation

2020-06-05 Thread Fazlul Huq
The same is happening with "-pc_type hypre -pc_hypre_type boomerang" and with "-pc_type ilu". I tried with, ierr = KSPSetTolerances(ksp,1.e-10,PETSC_DEFAULT,PETSC_DEFAULT,PETSC_DEFAULT);CHKERRQ(ierr); this also. Getting higher values of error even then. Any suggestion to go over this issue? Shal

Re: [petsc-users] Norm_2 calculation

2020-06-05 Thread Matthew Knepley
On Fri, Jun 5, 2020 at 12:32 PM Fazlul Huq wrote: > Input string: > mpiexec -np 1 ./poisson_m -n 1000 -pc_type cholesky -ksp_view > -ksp_converged_reason -ksp_monitor_true_residual > > Output is attached herewith. > Solving the problem... 0 KSP preconditioned resid norm 9.741453255800e+0

Re: [petsc-users] Norm_2 calculation

2020-06-05 Thread Fazlul Huq
Input string: mpiexec -np 1 ./poisson_m -n 1000 -pc_type cholesky -ksp_view -ksp_converged_reason -ksp_monitor_true_residual Output is attached herewith. Thank you. Sincerely, Huq On Fri, Jun 5, 2020 at 10:16 AM Matthew Knepley wrote: > On Fri, Jun 5, 2020 at 11:04 AM Fazlul Huq wrote: >

Re: [petsc-users] Norm_2 calculation

2020-06-05 Thread Matthew Knepley
On Fri, Jun 5, 2020 at 11:04 AM Fazlul Huq wrote: > Hello All, > I'm trying to calculate the norm_2 error of a solution. > Here, vector s: Analytical solution > vector x: Numerical solution > > ierr = VecView(s,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr); > ierr = VecView(x,PETSC_VIEWER_ST

[petsc-users] Norm_2 calculation

2020-06-05 Thread Fazlul Huq
Hello All, I'm trying to calculate the norm_2 error of a solution. Here, vector s: Analytical solution vector x: Numerical solution ierr = VecView(s,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr); ierr = VecView(x,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr); ierr = VecAXPY(x,-1.0,s);CHKERRQ(ier