Re: [petsc-users] Question about how to use DS to do the discretization

2024-03-23 Thread Matthew Knepley
On Sat, Mar 23, 2024 at 8:03 AM Gong Yujie wrote: > Dear PETSc group, I'm reading the DS part for the discretization start > from SNES ex17. c which is a demo for solving linear elasticity problem. I > have two questions for the details. The first question is for the residual > function. Is the

Re: [petsc-users] Question about how to use DS to do the discretization

2024-03-23 Thread Stefano Zampini
Take a look at https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/blob/main/src/snes/tutorials/ex11.c?ref_type=heads__;!!G_uCfscf7eWS!er4CI8GIe7OCWvCmRKQpZt6FOz1QYvbuZOdf2Fm7pvMGee3I9M5bhjNytv42F9C17NpBy0i6mTfgEmQfUR_QOqwC7gC6pYk$ and the discussion at the beginning (including the

[petsc-users] Question about how to use DS to do the discretization

2024-03-23 Thread Gong Yujie
Dear PETSc group, I'm reading the DS part for the discretization start from SNES ex17.c which is a demo for solving linear elasticity problem. I have two questions for the details. The first question is for the residual function. Is the residual calculated as this? The dot product is a little

Re: [petsc-users] question on PCLSC with matrix blocks of type MATNEST

2024-02-13 Thread Zhang, Hong via petsc-users
Pierre Jolivet Sent: Tuesday, February 13, 2024 2:48 PM To: Zhang, Hong Cc: petsc-users@mcs.anl.gov ; Hana Honnerová Subject: Re: [petsc-users] question on PCLSC with matrix blocks of type MATNEST On 13 Feb 2024, at 9:21 PM, Zhang, Hong via petsc-users wrote: Pierre, I can repeat your

Re: [petsc-users] question on PCLSC with matrix blocks of type MATNEST

2024-02-13 Thread Pierre Jolivet
TSC ERROR: Unspecified symbolic phase for product AB with A nest, B > nest. Call MatProductSetFromOptions() first or the product is not supported > > If you agree with this fix, I'll create a MR for it. > Hong > > > From: Pierre Jolivet > Sent: Tuesday, February 13, 2024 12:

Re: [petsc-users] question on PCLSC with matrix blocks of type MATNEST

2024-02-13 Thread Zhang, Hong via petsc-users
livet Sent: Tuesday, February 13, 2024 12:08 AM To: Zhang, Hong Cc: Hana Honnerová ; petsc-users@mcs.anl.gov Subject: Re: [petsc-users] question on PCLSC with matrix blocks of type MATNEST On 13 Feb 2024, at 12:33 AM, Zhang, Hong wrote: Pierre, I just modified the error message of MatProduct

Re: [petsc-users] question on PCLSC with matrix blocks of type MATNEST

2024-02-12 Thread Pierre Jolivet
uld do things more elegantly. > > Thanks, > Pierre > > Hong > From: petsc-users on behalf of Hana > Honnerová > Sent: Thursday, February 8, 2024 4:45 AM > To: petsc-users@mcs.anl.gov > Subject: [petsc-users] question on PCLSC with matrix blocks of type

Re: [petsc-users] question on PCLSC with matrix blocks of type MATNEST

2024-02-12 Thread Zhang, Hong via petsc-users
this fix merged to release and main? With latest main and release, I get same previous error message. Hong From: Pierre Jolivet Sent: Sunday, February 11, 2024 7:43 AM To: Zhang, Hong Cc: Hana Honnerová ; petsc-users@mcs.anl.gov Subject: Re: [petsc-users] question

Re: [petsc-users] question on PCLSC with matrix blocks of type MATNEST

2024-02-11 Thread Pierre Jolivet
c85dea29cf?merge_request_iid=7283 (coupled with code refactoring to avoid missing any other operations), but maybe we could do things more elegantly. Thanks, Pierre > Hong > From: petsc-users on behalf of Hana > Honnerová > Sent: Thursday, February 8, 2024 4:45 AM > To: petsc

Re: [petsc-users] question on PCLSC with matrix blocks of type MATNEST

2024-02-08 Thread Zhang, Hong via petsc-users
etsc-users@mcs.anl.gov Subject: [petsc-users] question on PCLSC with matrix blocks of type MATNEST Hi all, I am trying to solve linear systems arising from isogeometric discretization (similar to FEM) of the Navier-Stokes equations in parallel using PETSc. The linear systems are of saddle-point type,

[petsc-users] question on PCLSC with matrix blocks of type MATNEST

2024-02-08 Thread Hana Honnerová
Hi all, I am trying to solve linear systems arising from isogeometric discretization (similar to FEM) of the Navier-Stokes equations in parallel using PETSc. The linear systems are of saddle-point type, so I would like to use the PCFIELDSPLIT preconditioner with the

Re: [petsc-users] Question on using petsc matrix with hip

2024-02-04 Thread Runfeng Jin
Thank you! Junchao Zhang 于2024年2月5日周一 12:30写道: > > > > On Sun, Feb 4, 2024 at 9:57 PM Runfeng Jin wrote: > >> Hi, >> >> I see in document the mat status in hip is still in development, but >> I see some hip interface in MAT. I want to use petsc with primme(eigenvalue >> solver) to

Re: [petsc-users] Question on using petsc matrix with hip

2024-02-04 Thread Junchao Zhang
On Sun, Feb 4, 2024 at 9:57 PM Runfeng Jin wrote: > Hi, > > I see in document the mat status in hip is still in development, but I > see some hip interface in MAT. I want to use petsc with primme(eigenvalue > solver) to diagonalize the matrix in AMD GPU. The primme need user to > provide MV

[petsc-users] Question on using petsc matrix with hip

2024-02-04 Thread Runfeng Jin
Hi, I see in document the mat status in hip is still in development, but I see some hip interface in MAT. I want to use petsc with primme(eigenvalue solver) to diagonalize the matrix in AMD GPU. The primme need user to provide MV (matrix-vector operation in y=AX) in GPU, and I want to use

Re: [petsc-users] Question about a parallel implementation of PCFIELDSPLIT

2024-01-23 Thread Matthew Knepley
ith v. Thanks, Matt > Thanks, > Pantelis > -- > *Από:* Matthew Knepley > *Στάλθηκε:* Τρίτη, 23 Ιανουαρίου 2024 5:21 μμ > *Προς:* Pantelis Moschopoulos > *Κοιν.:* Barry Smith ; petsc-users@mcs.anl.gov < > petsc-users@mcs.anl.gov>

Re: [petsc-users] Question about a parallel implementation of PCFIELDSPLIT

2024-01-23 Thread Matthew Knepley
getting MatLRC to do it. Thanks, Matt > Thanks, > Pantelis > -- > *Από:* Matthew Knepley > *Στάλθηκε:* Τρίτη, 23 Ιανουαρίου 2024 3:20 μμ > *Προς:* Pantelis Moschopoulos > *Κοιν.:* Barry Smith ; petsc-users@mcs.anl.gov < > petsc-users@mcs.anl.gov> > *

Re: [petsc-users] Question about a parallel implementation of PCFIELDSPLIT

2024-01-23 Thread Matthew Knepley
τάλθηκε:* Τρίτη, 23 Ιανουαρίου 2024 2:51 μμ > *Προς:* Pantelis Moschopoulos > *Κοιν.:* Barry Smith ; petsc-users@mcs.anl.gov < > petsc-users@mcs.anl.gov> > *Θέμα:* Re: [petsc-users] Question about a parallel implementation of > PCFIELDSPLIT > > On Tue, Jan 23, 2024 at 4:2

Re: [petsc-users] Question about a parallel implementation of PCFIELDSPLIT

2024-01-23 Thread Matthew Knepley
;, 1, pfields, pfields,ierr) > > Thanks, > Pantelis > > > -- > *Από:* Matthew Knepley > *Στάλθηκε:* Παρασκευή, 19 Ιανουαρίου 2024 11:31 μμ > *Προς:* Barry Smith > *Κοιν.:* Pantelis Moschopoulos ; > petsc-users@mcs.anl.gov > *Θέμα:* Re: [petsc-us

Re: [petsc-users] Question about a parallel implementation of PCFIELDSPLIT

2024-01-19 Thread Matthew Knepley
On Fri, Jan 19, 2024 at 4:25 PM Barry Smith wrote: > >Generally fieldsplit is used on problems that have a natural "split" of > the variables into two or more subsets. For example u0,v0,u1,v1,u2,v2,u3,v4 > This is often indicated in the vectors and matrices with the "blocksize" > argument, 2

Re: [petsc-users] Question about a parallel implementation of PCFIELDSPLIT

2024-01-19 Thread Barry Smith
Generally fieldsplit is used on problems that have a natural "split" of the variables into two or more subsets. For example u0,v0,u1,v1,u2,v2,u3,v4 This is often indicated in the vectors and matrices with the "blocksize" argument, 2 in this case. DM also often provides this information.

[petsc-users] Question about a parallel implementation of PCFIELDSPLIT

2024-01-19 Thread Pantelis Moschopoulos
Dear all, When I am using PCFIELDSPLIT and pc type "schur" in serial mode everything works fine. When I turn now to parallel, I observe that the number of ranks that I can use must divide the number of N without any remainder, where N is the number of unknowns. Otherwise, an error of the

Re: [petsc-users] Question about petsc4py with cuda

2024-01-15 Thread Matthew Knepley
On Mon, Jan 15, 2024 at 11:57 AM MIA via petsc-users < petsc-users@mcs.anl.gov> wrote: > Hi, > > I am trying to solve a large linear equation, which needs a GPU solver as > comparison. I install a CUDA-enabled PETSc and petsc4py from sources using > the release tarball. According to the test

[petsc-users] Question about petsc4py with cuda

2024-01-15 Thread MIA via petsc-users
Hi, I am trying to solve a large linear equation, which needs a GPU solver as comparison. I install a CUDA-enabled PETSc and petsc4py from sources using the release tarball. According to the test results after installation, the PETSc can successfully work with cuda. All my programs are

[petsc-users] Question about petsc4py with cuda

2024-01-15 Thread 1143418754
1143418754 1143418...@qq.com Hi, I am trying to solve a large linear equation, which needs a GPU solver as comparison. I install a CUDA-enabled PETSc and petsc4py from sources using the release tarball. According to the test results after installation, the PETSc can successfully work with

Re: [petsc-users] Question about MATMPIAIJ and column indexes ordering

2024-01-08 Thread Barry Smith
Added clarification to the man pages in https://gitlab.com/petsc/petsc/-/merge_requests/7170 > On Jan 8, 2024, at 4:31 AM, Deuse, Mathieu via petsc-users > wrote: > > Hello, > > I have a piece of code which generates a matrix in CSR format, but the > without sorting the column indexes

Re: [petsc-users] Question about MATMPIAIJ and column indexes ordering

2024-01-08 Thread Barry Smith
> On Jan 8, 2024, at 4:31 AM, Deuse, Mathieu via petsc-users > wrote: > > Hello, > > I have a piece of code which generates a matrix in CSR format, but the > without sorting the column indexes in increasing order within each row. This > seems not to be 100% compatible with the MATMPIAIJ

[petsc-users] Question about MATMPIAIJ and column indexes ordering

2024-01-08 Thread Deuse, Mathieu via petsc-users
Hello, I have a piece of code which generates a matrix in CSR format, but the without sorting the column indexes in increasing order within each row. This seems not to be 100% compatible with the MATMPIAIJ format: the documentation of MatCreateMPIAIJWithArrays indeed mentions 'row-major

Re: [petsc-users] Question on output vector in vtk file

2023-12-11 Thread Matthew Knepley
On Mon, Dec 11, 2023 at 4:32 AM Gong Yujie wrote: > Dear PETSc developers, > > I have a DMPlex DM with 1 field 1dof. I'd like to output a vector with > block size equals to 3. It seems that there is no response using command > line option or using some code about PetscViewer. > I am not sure

[petsc-users] Question on output vector in vtk file

2023-12-11 Thread Gong Yujie
Dear PETSc developers, I have a DMPlex DM with 1 field 1dof. I'd like to output a vector with block size equals to 3. It seems that there is no response using command line option or using some code about PetscViewer. The DM is generated with (note that I'm not using PetscFE for discretization,

Re: [petsc-users] Question about using PETSc to generate matrix preconditioners

2023-07-25 Thread Jed Brown
I think random matrices will produce misleading results. The chance of randomly generating a matrix that resembles an application is effectively zero. I think you'd be better off with some model problems varying parameters that control the physical regime (e.g., shifts to a Laplacian, advection

[petsc-users] Question about using PETSc to generate matrix preconditioners

2023-07-25 Thread Sun, Yixuan via petsc-users
Hello PETSc team, My name is Yixuan, and I am a postdoc at MCS. We are working on a project where we want to predict the preconditioners from the corresponding matrices. For preliminary exploration purposes, we generated random matrices and their preconditioners using PETSc. The current deep

Re: [petsc-users] Question about residue norm in PETSc

2023-07-02 Thread Barry Smith
Also look at https://petsc.org/release/manualpages/KSP/KSPSetPCSide/#kspsetpcside and https://petsc.org/release/manualpages/KSP/KSPSetNormType/#kspsetnormtype in PETSc different Krylov solvers have different default values for this. > On Jul 2, 2023, at 1:47 AM, 王赫萌 wrote: > > Dear

Re: [petsc-users] Question about residue norm in PETSc

2023-07-02 Thread Matthew Knepley
%90%8C=wanghemeng%40163.com=https%3A%2F%2Fmail-online.nosdn.127.net%2Fqiyelogo%2FdefaultAvatar.png=%5B%22wanghemeng%40163.com%22%5D> > ---- Replied Message ---- > From Matthew Knepley > Date 7/2/2023 20:32 > To 王赫萌 > Cc PETSc > Subject Re: [petsc-users] Question about residu

Re: [petsc-users] Question about residue norm in PETSc

2023-07-02 Thread Matthew Knepley
t; Replied Message > From Matthew Knepley > Date 7/2/2023 20:10 > To 王赫萌 > Cc PETSc > Subject Re: [petsc-users] Question about residue norm in PETSc > On Sun, Jul 2, 2023 at 8:05 AM Matthew Knepley wrote: > >> On Sun, Jul 2, 2023 at 7:53 AM 王赫萌 wrote: >&

Re: [petsc-users] Question about residue norm in PETSc

2023-07-02 Thread Matthew Knepley
uilt your code, but you did not send the matrix and rhs. I suggest using PetscCall(VecAXPY(u, -1.0, b)); instead so that you do not change b, and keep the residual in u. Thanks, Matt Thanks, Matt > Thanks, > > Matt > > >> Best regards! >> Hemeng

Re: [petsc-users] Question about residue norm in PETSc

2023-07-02 Thread Matthew Knepley
the output 2) You are asking why you calculate a different residual? I will have to run your code. Thanks, Matt > Best regards! > Hemeng Wang > > > Replied Message > From Matthew Knepley > Date 7/2/2023 18:51 > To 王赫萌 > Cc petsc-users@mcs.anl.gov >

Re: [petsc-users] Question about residue norm in PETSc

2023-07-02 Thread Matthew Knepley
On Sun, Jul 2, 2023 at 2:24 AM 王赫萌 wrote: > Dear PETSc Team, > > Sorry to bother! My name is Hemeng Wang, and I am currently learning the > use of PETSc software package. I am confused while calculating the norm of > residue. > > I calculated residue norm by myself with: > ``` >

[petsc-users] Question about residue norm in PETSc

2023-07-02 Thread 王赫萌
Dear PETSc Team, Sorry to bother! My name is Hemeng Wang, and I am currently learning the use of PETSc software package. I am confused while calculating the norm of residue. I calculated residue norm by myself with: ``` PetscCall(VecNorm(b, NORM_2, _b)); // (main.c, line 74)

Re: [petsc-users] Question about using MatCreateAIJ

2023-06-18 Thread Barry Smith
I am concerned this is not good advice being provided. Let's back up and look more closely at your use case. * What is the ratio of new nonzero locations added compared to the initial number of nonzeros for your code, for each of your iterations? * Is it possible for many iterations,

Re: [petsc-users] Question about using MatCreateAIJ

2023-06-15 Thread Matthew Knepley
On Thu, Jun 15, 2023 at 8:32 AM Karsten Lettmann < karsten.lettm...@uni-oldenburg.de> wrote: > Dear all, > > > I'm quite new to PETSC. So I hope the following questions are not too > stupid. > > > 1) We have a (Fortran) code, that we want to update from an older PETSC > version (petsc.2.3.3-p16)

[petsc-users] Question about using MatCreateAIJ

2023-06-15 Thread Karsten Lettmann
Dear all, I'm quite new to PETSC. So I hope the following questions are not too stupid. 1) We have a (Fortran) code, that we want to update from an older PETSC version (petsc.2.3.3-p16) to a newer version. Inside the old code, for creating matrices A, there are function calls of the

Re: [petsc-users] Question on ISLocalToGlobalMappingGetIndices Fortran Interface

2023-05-08 Thread Danyang Su
Thanks, Mark. Yes, it actually works when I update to ISLocalToGlobalMappingGetIndicesF90. I made a mistake reporting this does not work. Danyang From: Mark Adams Date: Monday, May 8, 2023 at 7:22 PM To: Danyang Su Cc: petsc-users Subject: Re: [petsc-users] Question

Re: [petsc-users] Question on ISLocalToGlobalMappingGetIndices Fortran Interface

2023-05-08 Thread Mark Adams
On Mon, May 8, 2023 at 6:50 PM Danyang Su wrote: > Dear PETSc-Users, > > > > Is there any changes in ISLocalToGlobalMappingGetIndices function after > PETSc 3.17? > > > > In the previous PETSc version (<= 3.17), the function > ‘ISLocalToGlobalMappingGetIndices(ltogm,ltog,idltog,ierr)’ works

[petsc-users] Question on ISLocalToGlobalMappingGetIndices Fortran Interface

2023-05-08 Thread Danyang Su
Dear PETSc-Users, Is there any changes in ISLocalToGlobalMappingGetIndices function after PETSc 3.17? In the previous PETSc version (<= 3.17), the function ‘ISLocalToGlobalMappingGetIndices(ltogm,ltog,idltog,ierr)’ works fine, even though the value of idltog looks out of bound

Re: [petsc-users] question about leap-frog for wave equation in petsc

2023-05-06 Thread Matthew Knepley
On Sat, May 6, 2023 at 11:47 AM Huidong Yang wrote: > Hi Petsc developer. > > may I ask if there is any available implementations in petsc > using leap-frog scheme? > I don't think we have leapfrog, but we do have Stormer-Verlet, which is also a 2nd order symplectic method. Thanks,

[petsc-users] question about leap-frog for wave equation in petsc

2023-05-06 Thread Huidong Yang
Hi Petsc developer. may I ask if there is any available implementations in petsc using leap-frog scheme? Thanks.

Re: [petsc-users] Question about linking LAPACK library

2023-04-25 Thread Barry Smith
LAPACK is always linked with PETSc so you can always make direct calls to LAPACK routines from PETSc code.. Barry > On Apr 25, 2023, at 6:03 AM, ­권승리 / 학생 / 항공우주공학과 wrote: > > Thank you for your reply. > > I think I gave an example of an unrealistic problem. > > I just wanted to

Re: [petsc-users] Question about linking LAPACK library

2023-04-25 Thread Satish Balay via petsc-users
On Tue, 25 Apr 2023, Matthew Knepley wrote: > On Tue, Apr 25, 2023 at 6:03 AM ­권승리 / 학생 / 항공우주공학과 > wrote: > > > Thank you for your reply. > > > > I think I gave an example of an unrealistic problem. > > > > I just wanted to know how to compute the inverse matrix, so I was > > wondering if

Re: [petsc-users] Question about linking LAPACK library

2023-04-25 Thread Matthew Knepley
On Tue, Apr 25, 2023 at 6:03 AM ­권승리 / 학생 / 항공우주공학과 wrote: > Thank you for your reply. > > I think I gave an example of an unrealistic problem. > > I just wanted to know how to compute the inverse matrix, so I was > wondering if there is an example of computing the inverse matrix in PETSc. >

Re: [petsc-users] Question about linking LAPACK library

2023-04-25 Thread ­권승리 / 학생 / 항공우주공학과
Thank you for your reply. I think I gave an example of an unrealistic problem. I just wanted to know how to compute the inverse matrix, so I was wondering if there is an example of computing the inverse matrix in PETSc. Alternatively, I want to know how to link the LAPACK library. best, Seung

Re: [petsc-users] Question about linking LAPACK library

2023-04-25 Thread Pierre Jolivet
> On 25 Apr 2023, at 11:43 AM, Matthew Knepley wrote: > > On Mon, Apr 24, 2023 at 11:47 PM ­권승리 / 학생 / 항공우주공학과 > wrote: >> Dear all >> >> It depends on the problem. It can have hundreds of thousands of degrees of >> freedom. > > Suppose your matrix was dense and

Re: [petsc-users] Question about linking LAPACK library

2023-04-25 Thread Matthew Knepley
On Mon, Apr 24, 2023 at 11:47 PM ­권승리 / 학생 / 항공우주공학과 wrote: > Dear all > > It depends on the problem. It can have hundreds of thousands of degrees of > freedom. > Suppose your matrix was dense and had 1e6 dofs. The work to invert a matrix is O(N^3) with a small constant, so it would take 1e18 =

Re: [petsc-users] Question about linking LAPACK library

2023-04-24 Thread ­권승리 / 학생 / 항공우주공학과
Dear all It depends on the problem. It can have hundreds of thousands of degrees of freedom. best, Seung Lee Kwon 2023년 4월 25일 (화) 오후 12:32, Barry Smith 님이 작성: > > How large are the dense matrices you would like to invert? > > On Apr 24, 2023, at 11:27 PM, ­권승리 / 학생 / 항공우주공학과 > wrote: > >

Re: [petsc-users] Question about linking LAPACK library

2023-04-24 Thread Barry Smith
How large are the dense matrices you would like to invert? > On Apr 24, 2023, at 11:27 PM, ­권승리 / 학생 / 항공우주공학과 wrote: > > Dear all > > Hello. > I want to make an inverse matrix like inv(A) in MATLAB. > > Are there some methods to inverse matrix in petsc? > > If not, I want to use the

[petsc-users] Question about linking LAPACK library

2023-04-24 Thread ­권승리 / 학생 / 항공우주공학과
Dear all Hello. I want to make an inverse matrix like inv(A) in MATLAB. Are there some methods to inverse matrix in petsc? If not, I want to use the inverse function in the LAPACK library. Then, how to use the LAPACK library in petsc? I use the C language. Best, Seung Lee Kwon -- Seung Lee

Re: [petsc-users] question about MatSetLocalToGlobalMapping

2023-04-21 Thread Zhang, Hong via petsc-users
mailto:karthikeyan.chockalin...@stfc.ac.uk>> Cc: petsc-users@mcs.anl.gov<mailto:petsc-users@mcs.anl.gov> mailto:petsc-users@mcs.anl.gov>> Subject: Re: [petsc-users] question about MatSetLocalToGlobalMapping On Thu, Apr 20, 2023 at 6:13 AM Karthikeyan Chockalingam - STFC UKRI v

Re: [petsc-users] question about MatSetLocalToGlobalMapping

2023-04-21 Thread Karthikeyan Chockalingam - STFC UKRI via petsc-users
Thank you Hong. I will look into it. Best, Karthik. From: Zhang, Hong Date: Thursday, 20 April 2023 at 16:47 To: Matthew Knepley , Chockalingam, Karthikeyan (STFC,DL,HC) Cc: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] question about MatSetLocalToGlobalMapping Karthik, We built a KKT

Re: [petsc-users] question about MatSetLocalToGlobalMapping

2023-04-21 Thread Karthikeyan Chockalingam - STFC UKRI via petsc-users
); for (i=0; i Date: Thursday, 20 April 2023 at 11:37 To: Chockalingam, Karthikeyan (STFC,DL,HC) Cc: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] question about MatSetLocalToGlobalMapping On Thu, Apr 20, 2023 at 6:13 AM Karthikeyan Chockalingam - STFC UKRI via petsc-users mailto:petsc-users

Re: [petsc-users] question about MatSetLocalToGlobalMapping

2023-04-20 Thread Pierre Jolivet
; To: Karthikeyan Chockalingam - STFC UKRI >> > <mailto:karthikeyan.chockalin...@stfc.ac.uk>> >> Cc: petsc-users@mcs.anl.gov <mailto:petsc-users@mcs.anl.gov> >> mailto:petsc-users@mcs.anl.gov>> >> Subject: Re: [petsc-users] question about M

Re: [petsc-users] question about MatSetLocalToGlobalMapping

2023-04-20 Thread Zhang, Hong via petsc-users
to insert P and P^T into your K. FYI, I attached our paper. Hong From: petsc-users on behalf of Matthew Knepley Sent: Thursday, April 20, 2023 5:37 AM To: Karthikeyan Chockalingam - STFC UKRI Cc: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] question about

Re: [petsc-users] question about MatSetLocalToGlobalMapping

2023-04-20 Thread Pierre Jolivet
rt P and P^T into your K. > FYI, I attached our paper. > Hong > From: petsc-users on behalf of Matthew > Knepley > Sent: Thursday, April 20, 2023 5:37 AM > To: Karthikeyan Chockalingam - STFC UKRI > Cc: petsc-users@mcs.anl.gov > Subject: Re: [petsc-users] question about

Re: [petsc-users] question about MatSetLocalToGlobalMapping

2023-04-20 Thread Matthew Knepley
On Thu, Apr 20, 2023 at 6:13 AM Karthikeyan Chockalingam - STFC UKRI via petsc-users wrote: > Hello, > > > > I created a new thread, thought would it be more appropriate (and is a > continuation of my previous post). I want to construct the below K matrix > (which is composed of submatrices) > >

[petsc-users] question about MatSetLocalToGlobalMapping

2023-04-20 Thread Karthikeyan Chockalingam - STFC UKRI via petsc-users
Hello, I created a new thread, thought would it be more appropriate (and is a continuation of my previous post). I want to construct the below K matrix (which is composed of submatrices) K = [A P^T P 0] Where K is of type MatMPIAIJ. I first constructed the top left [A] using

Re: [petsc-users] Question about -memory_view

2023-04-12 Thread Barry Smith
> On Apr 12, 2023, at 4:08 PM, Jorti, Zakariae via petsc-users > wrote: > > Hello, > > I am running some matrix computations on 64 nodes, using 640 MPI tasks. > And I wanted to check the memory usage with the -memory_view flag. > I get the following output: > > Summary of Memory Usage in

[petsc-users] Question about -memory_view

2023-04-12 Thread Jorti, Zakariae via petsc-users
Hello, I am running some matrix computations on 64 nodes, using 640 MPI tasks. And I wanted to check the memory usage with the -memory_view flag. I get the following output: Summary of Memory Usage in PETSc Maximum (over computational time) process memory:total 3.1056e+11 max

Re: [petsc-users] Question about NASM initialization

2023-04-06 Thread Takahashi, Tadanaga
Ok, thanks for the clarification. On Thu, Apr 6, 2023 at 10:25 AM Matthew Knepley wrote: > On Thu, Apr 6, 2023 at 10:21 AM Takahashi, Tadanaga wrote: > >> I am following up from the last inquiry. I read the source code nasm.c >> and

Re: [petsc-users] Question about NASM initialization

2023-04-06 Thread Matthew Knepley
On Thu, Apr 6, 2023 at 10:21 AM Takahashi, Tadanaga wrote: > I am following up from the last inquiry. I read the source code nasm.c > and it looks > like sub-snes iteration is being initialized with a scatter call from the > previous

Re: [petsc-users] Question about NASM initialization

2023-04-06 Thread Takahashi, Tadanaga
I am following up from the last inquiry. I read the source code nasm.c and it looks like sub-snes iteration is being initialized with a scatter call from the previous solution. In other words, if I use Newton's method for the local

[petsc-users] Question about NASM initialization

2023-04-02 Thread Takahashi, Tadanaga
Hello PETSc devs, I am using SNES NASM with Newton LS on the sub-SNES. I was wondering how the sub-SNES chooses the initial guess during each NASM iteration. Is it using the previously computed solution or is it restarting from zero?

Re: [petsc-users] Question about MatView

2023-03-17 Thread Barry Smith
src/mat/tests/ex9.c and other examples in that directory use it. > On Mar 17, 2023, at 11:05 AM, user_gong Kim wrote: > > PETSC_COMM_SELF generates an error in more than 2 processes. It should not > > I would like to use the other method you said, matcreateredundantmatrix. > However,

Re: [petsc-users] Question about MatView

2023-03-17 Thread user_gong Kim
PETSC_COMM_SELF generates an error in more than 2 processes. I would like to use the other method you said, matcreateredundantmatrix. However, there is no example in the manual. Can you give an example using this function? 2023년 3월 17일 (금) 오후 11:53, Barry Smith 님이 작성: > >Use > >

Re: [petsc-users] Question about MatView

2023-03-17 Thread Barry Smith
Use >> MatCreate(PETSC_COMM_SELF, ); >> PetscViewerBinaryOpen(PETSC_COMM_SELF, "mat.bin", FILE_MODE_READ, ); If it one program running that both views and loads the matrix you can use MatCreateRedundantMatrix() to reproduce the entire matrix on each MPI rank. It is better than using

Re: [petsc-users] Question about MatView

2023-03-17 Thread user_gong Kim
Following your comments, I did an test. However, if I run the application in parallel. In all processes, it is not possible to obtain values at all positions in the matrix through MatGetValue. As in the previous case of saving in binary, it is read in parallel divided form. Is it impossible to

Re: [petsc-users] Question about MatView

2023-03-17 Thread Matthew Knepley
On Fri, Mar 17, 2023 at 5:51 AM user_gong Kim wrote: > Hello, > > > > I have 2 questions about MatView. > > > > 1.I would like to ask if the process below is possible. > When running in parallel, is it possible to make the matrix of the mpiaij > format into a txt file, output it, and read it

[petsc-users] Question about MatView

2023-03-17 Thread user_gong Kim
Hello, I have 2 questions about MatView. 1.I would like to ask if the process below is possible. When running in parallel, is it possible to make the matrix of the mpiaij format into a txt file, output it, and read it again so that the entire process has the same matrix? 2.If

Re: [petsc-users] Question about time issues in parallel computing

2023-03-15 Thread Mark Adams
Speed up to 4 processors should have at least 40,000 equations for 3D problems and more for 2D. At least for iterative solvers. This is probably a good place to start with direct solvers but you might see benefit with a little less. Mark On Wed, Mar 15, 2023 at 9:09 PM ­권승리 / 학생 / 항공우주공학과

Re: [petsc-users] Question about time issues in parallel computing

2023-03-15 Thread ­권승리 / 학생 / 항공우주공학과
Thank you for your reply. It was a simple problem, but it has more than 1000 degrees of freedom. Is this not enough to check speedup? Best regards Seung Lee Kwon 2023년 3월 15일 (수) 오후 8:50, Matthew Knepley 님이 작성: > On Wed, Mar 15, 2023 at 3:38 AM ­권승리 / 학생 / 항공우주공학과 > wrote: > >> Dear petsc

Re: [petsc-users] Question about time issues in parallel computing

2023-03-15 Thread Matthew Knepley
On Wed, Mar 15, 2023 at 3:38 AM ­권승리 / 학생 / 항공우주공학과 wrote: > Dear petsc developers. > > Hello. > I am trying to solve the structural problem with FEM and test parallel > computing works well. > > However, even if I change the number of cores, the total time is > calculated the same. > > I have

[petsc-users] Question about time issues in parallel computing

2023-03-15 Thread ­권승리 / 학생 / 항공우주공학과
Dear petsc developers. Hello. I am trying to solve the structural problem with FEM and test parallel computing works well. However, even if I change the number of cores, the total time is calculated the same. I have tested on a simple problem using a MUMPS solver using: mpiexec -n 1 mpiexec -n

Re: [petsc-users] Question about rank of matrix

2023-02-17 Thread Barry Smith
> On Feb 17, 2023, at 2:43 AM, user_gong Kim wrote: > > Hello, > > I have a question about rank of matrix. > At the problem > Au = b, > > In my case, sometimes global matrix A is not full rank. > In this case, the global matrix A is more likely to be singular, and if it > becomes

Re: [petsc-users] Question about rank of matrix

2023-02-17 Thread Matthew Knepley
On Fri, Feb 17, 2023 at 2:43 AM user_gong Kim wrote: > Hello, > > I have a question about rank of matrix. > At the problem > Au = b, > > In my case, sometimes global matrix A is not full rank. > In this case, the global matrix A is more likely to be singular, and if it > becomes singular, the

Re: [petsc-users] Question about rank of matrix

2023-02-17 Thread Pierre Jolivet
> On 17 Feb 2023, at 8:56 AM, Stefano Zampini wrote: > > > On Fri, Feb 17, 2023, 10:43 user_gong Kim > wrote: >> Hello, >> >> I have a question about rank of matrix. >> At the problem >> Au = b, >> >> In my case, sometimes global matrix A is not full rank. >> In

Re: [petsc-users] Question about rank of matrix

2023-02-16 Thread Stefano Zampini
On Fri, Feb 17, 2023, 10:43 user_gong Kim wrote: > Hello, > > I have a question about rank of matrix. > At the problem > Au = b, > > In my case, sometimes global matrix A is not full rank. > In this case, the global matrix A is more likely to be singular, and if it > becomes singular, the

[petsc-users] Question about rank of matrix

2023-02-16 Thread user_gong Kim
Hello, I have a question about rank of matrix. At the problem Au = b, In my case, sometimes global matrix A is not full rank. In this case, the global matrix A is more likely to be singular, and if it becomes singular, the problem cannot be solved even in the case of the direct solver. I haven't

Re: [petsc-users] Question for Petsc

2023-02-16 Thread Stefano Zampini
For bddc, you can also take a look at https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/ksp/tutorials/ex71.c On Thu, Feb 16, 2023, 19:41 Matthew Knepley wrote: > On Thu, Feb 16, 2023 at 9:14 AM ziming xiong > wrote: > >> Hello, >> I want to use Petsc to implement high performance computing,

Re: [petsc-users] Question for Petsc

2023-02-16 Thread Matthew Knepley
On Thu, Feb 16, 2023 at 9:14 AM ziming xiong wrote: > Hello, > I want to use Petsc to implement high performance computing, and I mainly > want to apply DDM methods to parallel computing. I have implemented some of > the DDM methods (such as ASM, Bjacobi, etc.), but I don't understand the >

Re: [petsc-users] Question about preconditioner

2023-02-16 Thread Barry Smith
If your matrix has the form ( A B ) ( C 0 ) then often PCFIELDSPLIT can be a useful preconditioner with the option -pc_fieldsplit_detect_saddle_point > On Feb 16, 2023, at 2:42 AM, user_gong Kim wrote: > > > Hello, > > > There are some questions about some

[petsc-users] Question for Petsc

2023-02-16 Thread ziming xiong
Hello, I want to use Petsc to implement high performance computing, and I mainly want to apply DDM methods to parallel computing. I have implemented some of the DDM methods (such as ASM, Bjacobi, etc.), but I don't understand the PCBDDC method. The official example

Re: [petsc-users] Question about preconditioner

2023-02-16 Thread Matthew Knepley
On Thu, Feb 16, 2023 at 2:43 AM user_gong Kim wrote: > > > Hello, > > > > There are some questions about some preconditioners. > > The questions are from problem Au=b. The global matrix A has zero value > diagonal terms. > > 1. Which preconditioner is preferred for matrix A which has zero >

Re: [petsc-users] Question about preconditioner

2023-02-16 Thread Pierre Jolivet
> On 16 Feb 2023, at 8:43 AM, user_gong Kim wrote: > >  > > > Hello, > > > > There are some questions about some preconditioners. > > The questions are from problem Au=b. The global matrix A has zero value > diagonal terms. > > 1. Which preconditioner is preferred for matrix A

[petsc-users] Question about preconditioner

2023-02-15 Thread user_gong Kim
Hello, There are some questions about some preconditioners. The questions are from problem Au=b. The global matrix A has zero value diagonal terms. 1. Which preconditioner is preferred for matrix A which has zero value in diagonal terms? The most frequently used basic 2 preconditioners

Re: [petsc-users] Question about applying algebraic multigrid (AMG) PC and multilevel Schwarz PC

2023-02-10 Thread Mark Adams
On Fri, Feb 10, 2023 at 9:17 AM ­권승리 wrote: > Dear petsc developers. > > Hello. > While I was applying the preconditioner in contact with the FEM code, I > had some questions. > > How can I apply the AMG PC and the multilevel Schwarz PC in the FEM code? > Purpose is to compare which PC is better

[petsc-users] Question about applying algebraic multigrid (AMG) PC and multilevel Schwarz PC

2023-02-10 Thread ­권승리
Dear petsc developers. Hello. While I was applying the preconditioner in contact with the FEM code, I had some questions. How can I apply the AMG PC and the multilevel Schwarz PC in the FEM code? Purpose is to compare which PC is better in the FEM code with contact situation. In my case, the

Re: [petsc-users] Question about MatGetRow

2023-02-04 Thread Barry Smith
> PETSC_OWN_POINTER, indicates that the IS is to take ownership of the memory in indices, hence you are no longer reasonable for that memory and should not call PetscFree() on it. So the code is running correctly. > On Feb 4, 2023, at 3:24 AM, 김성익 wrote: > > Following your comments, that

Re: [petsc-users] Question about MatGetRow

2023-02-04 Thread 김성익
Following your comments, that works in multi processes. After extracting procedure from 'newmat' which is submatrix. PetscInt *indices; PetscMalloc1(1, ); Indices[0] = 0; ISCreateGenreral(PETSC_COMM_WORLD, 1, indices, PETSC_OWN_POINTER, ); MatCreateSubMatrix(mat,isrow,NULL,MAT_INITIAL_MATRIX,);

Re: [petsc-users] Question about MatGetRow

2023-02-03 Thread Matthew Knepley
On Fri, Feb 3, 2023 at 9:04 AM 김성익 wrote: > Actually in the last mail, below scripts are running in all processes. > > IS isrow; > PetscInt *indices; > PetscMalloc1(1, ); > Indices[0] = 0; > ISCreateGenreral(PETSC_COMM_WORLD, 1, indices, PETSC_OWN_POINTER, ); >

Re: [petsc-users] Question about MatGetRow

2023-02-03 Thread 김성익
Actually in the last mail, below scripts are running in all processes. IS isrow; PetscInt *indices; PetscMalloc1(1, ); Indices[0] = 0; ISCreateGenreral(PETSC_COMM_WORLD, 1, indices, PETSC_OWN_POINTER, ); MatCreateSubMatrix(mat,isrow,NULL,MAT_INITIAL_MATRIX,); (extract from newmat) However, you

Re: [petsc-users] Question about MatGetRow

2023-02-03 Thread Matthew Knepley
On Fri, Feb 3, 2023 at 8:52 AM 김성익 wrote: > I want to extract same row values of global matrix in all processes. > Then how can I do this?? > Create the same IS on each process. THanks, Matt > The case of same problem of vector, I just use vecscattertoall. > However, I can't find same

Re: [petsc-users] Question about MatGetRow

2023-02-03 Thread 김성익
I want to extract same row values of global matrix in all processes. Then how can I do this?? The case of same problem of vector, I just use vecscattertoall. However, I can't find same function for matrix. Hyung Kim 2023년 2월 3일 (금) 오후 10:47, Matthew Knepley 님이 작성: > On Fri, Feb 3, 2023 at 8:45

Re: [petsc-users] Question about MatGetRow

2023-02-03 Thread 김성익
Following your comments, If I extract first row of below matrix. [image: image.png] IS isrow; PetscInt *indices; PetscMalloc1(1, *indices); Indices[0] = 0; ISCreateGenreral(PETSC_COMM_WORLD, 1, indices, PETSC_COPY_VALUES, ); MatCreateSubMatrix(mat,isrow,NULL,MAT_INITIAL_MATRIX,); Then can I get

  1   2   3   4   5   6   7   8   9   10   >