and what I did at the subsequent steps is:
do II=1,total call MatSetValues(A_semi_x,1,II,1,II,new_value,INSERT_VALUES,ierr)
end do
call MatAssemblyBegin(A_semi_x,MAT_FINAL_ASSEMBLY,ierr)
call MatAssemblyEnd(A_semi_x,MAT_FINAL_ASSEMBLY,ierr)
Barry
call KSPSolve(ksp_semi_x,b_rhs_semi_x,xx_semi_x,ierr)
I realise that the answers are slightly different as compared to calling all the options such as KSPSetType, KSPSetFromOptions, KSPSetTolerances at every time step. Should that be so? Is this the best way?
Also, I can let the matrix be equal at every time step by fixing the delta_time. However, it may give stability problems. I wonder how expensive is these type of value changing and assembly for a matrix?
Thank you very much.
Regards.