[petsc-users] Reuse symbolic factorization with petsc - mumps

2022-02-17 Thread 459543524 via petsc-users
Thanks sir. I now modify my code into following. Everything works good. - // stage 1: Vec x1, b2; Vec x1, b2; Mat A, P, F; PC pc; // solve first system MatCreateAIJ(A, ...) MatSetVaules(A, ...) MatAssembleBegin(A, ...) MatAssembleBegin(A, ...)

Re: [petsc-users] Reuse symbolic factorization with petsc - mumps

2022-02-17 Thread Jose E. Roman
simpilfy to enhance a better performance? > > Thanks for your time. > > > > ------ 原始邮件 -- > 发件人: "Jose E. Roman" ; > 发送时间: 2022年2月17日(星期四) 下午5:17 > 收件人: "459543524"<459543...@qq.com>; > 抄送: "petsc-use

Re: [petsc-users] Reuse symbolic factorization with petsc - mumps

2022-02-17 Thread Jose E. Roman
Since version 3.5, KSPSetOperators() will check if the passed matrix has the same sparse pattern as the previously set one, so you don't have to do anything. The list of changes in version 3.5 has this note: "KSPSetOperators() no longer has the MatStructure argument. The Mat objects now track

[petsc-users] Reuse symbolic factorization with petsc - mumps

2022-02-17 Thread 459543524 via petsc-users
Sir, I have a problem when using petsc. I want to solve a series of linear equations. A1*x1=b1, A2*x2=b2, A3*x3=b3 ... The A1,A2,A3 have the same sparstiy pattern. I want to use MUMPS to solve the system. In order to enhance performance, I want to reuse the symbolic factorization. Here

[petsc-users] Reuse symbolic factorization with petsc - mumps

2013-03-14 Thread Thibault Faney
Hi, I am using the cray-petsc implementation on the NERSC system. Specifically, I have implemented a runge kutta solver, and I need to solve a linear system Ax = b several times per time step. I am using PETSC to interface with the MUMPS solver for direct factorization. The matrix A is constant

[petsc-users] Reuse symbolic factorization with petsc - mumps

2013-03-14 Thread Hong Zhang
Tibo: Replace call KSPSetOperators(KSP_A, A, A, DIFFERENT_NONZERO_PATTERN, ierr) with call KSPSetOperators(KSP_A, A, A, SAME_NONZERO_PATTERN, ierr) Run your code with option '-log_summary' to see the number of calling MatLUSymbolic() and MatLUNumeric(). Hong I am using the cray-petsc

[petsc-users] Reuse symbolic factorization with petsc - mumps

2013-03-14 Thread Hong Zhang
On Thu, Mar 14, 2013 at 2:52 PM, Thibault Faney tibo at berkeley.edu wrote: Hong: thank you for your answer. I can replace DIFFERENT_NONZERO_PATTERN by SAME_NONZERO_PATTERN, however this will give me the wrong answer as the zero pattern changes from a time step to another (e.g. the matrix A

[petsc-users] Reuse symbolic factorization with petsc - mumps

2013-03-14 Thread Thibault Faney
Thank you this works perfectly. On Thu, Mar 14, 2013 at 4:20 PM, Hong Zhang hzhang at mcs.anl.gov wrote: On Thu, Mar 14, 2013 at 2:52 PM, Thibault Faney tibo at berkeley.edu wrote: Hong: thank you for your answer. I can replace DIFFERENT_NONZERO_PATTERN by SAME_NONZERO_PATTERN, however