On Thu, Oct 27, 2022 at 12:00 PM 赵刚 <zha...@lsec.cc.ac.cn> wrote:
> Thank you Sherry for the triangular matrices extraction ways, it's very > useful, I'll try to do this in SuperLU_DIST. > > In addition, Matthew, is it possible for PETSc to write interfaces that > support printing `L` and `U` for SuperLU_DIST? Because it is very useful in > some industrial application scenarios (store `L` and `U` in advance). > I think the way to do it would be to add support for this as the ASCII Mat Viewer for that type. It would be a good contribution I think. Thanks, Matt > Best Regards, > > Gang > > > -----原始邮件----- > *发件人:*"Xiaoye S. Li" <x...@lbl.gov> > *发送时间:*2022-10-25 05:47:15 (星期二) > *收件人:* "Matthew Knepley" <knep...@gmail.com> > *抄送:* "赵刚" <zha...@lsec.cc.ac.cn>, petsc-users@mcs.anl.gov > *主题:* Re: [petsc-users] An issue of extraction of factorization matrices > in sparse direct solver > > There are some utility routines for printing L\U in superlu_dist: > SRC/dutil_dist.c > > 1. You can output the L factor to a file with the triplet format by > using > > > https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L675 > but use line 755 instead of line 753. > 2. You can convert the L factor to CSR or triplet using > > https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L815 > > > https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L1075 > but need to make sure you only use 1 MPI to call superlu_dist > 3. You can modify > > > https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L1229 > to generate CSR/triplet for the U factor as well. > > > Sherry Li > > On Sun, Oct 23, 2022 at 3:38 AM Matthew Knepley <knep...@gmail.com> wrote: > >> On Sun, Oct 23, 2022 at 2:58 AM 赵刚 <zha...@lsec.cc.ac.cn> wrote: >> >>> Dear developers, >>> >>> I have another question. How can I get the L and U matrices and store >>> them in a file when I call SuperLU through PETSc? Thanks. >> >> >> SuperLU stores these matrices in its own format. If you want to do I/O >> with them, you would probably have to >> extract them from the Petsc Mat and call SuperLU I/O functions, if they >> exist. >> >> Thanks, >> >> Matt >> >> >>> Best Regards, >>> Gang >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> >> https://www.cse.buffalo.edu/~knepley/ >> <http://www.cse.buffalo.edu/~knepley/> >> > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>