Re: [petsc-users] Finding nonzero indices

2019-02-25 Thread Eda Oktay via petsc-users
Okay, but here is another silly question: >From MatGetRow(), I get number of nonzeros in row, column indices and values right? Also, PetscBinaryWrite() needs a buffer p and the number of items to write n. I need both row,column indices and values. So, what should I write into PetscBinaryWrite? Do

Re: [petsc-users] Nonconforming object sizes in axpy

2019-02-25 Thread Marius Buerkle via petsc-users
Please find attached the error output from petsc and the valgrind output. I could not reporduce the actual error in an MWE as it stops before calling MatLUFactorNumeric with the error at MatAXPY complaining that Mat type elemental is not supported, why it continues in my original code despite a non

Re: [petsc-users] Nonconforming object sizes in axpy

2019-02-25 Thread Marius Buerkle via petsc-users
I checked the problem further. I am not sure if this is the cause but what happens is that I use MatAXPY with Y = MATELEMENTAL and X= MATMPIAIJ before calling MatLUFactorNumeric, it turns out that MatAXPY fails but did not raise an exception and I did not check the error code returned from MatAXPY.

Re: [petsc-users] Error Norm_2

2019-02-25 Thread Smith, Barry F. via petsc-users
How are you computing the error norm? You need to use the L2 norm in the computations, not the l2 norm. Also you need to make sure the convergence criteria you use for the algebraic system is smaller than the descritzation error Barry > On Feb 25, 2019, at 1:55 PM, Fazlul Hu

[petsc-users] Kronecker product

2019-02-25 Thread Yuyun Yang via petsc-users
Hello team, I'd like to ask whether PETSc has a function to compute the Kronecker product of a sparse matrix with an identity matrix? A Google search didn't lead me to a manual page (like most of the other PETSc functions), so I'm wondering if this has been implemented yet. Thanks very much!

Re: [petsc-users] Kronecker product

2019-02-25 Thread Jed Brown via petsc-users
MatCreateMAIJ does that (implicitly). https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateMAIJ.html If you want a Kronecker product with a non-identity matrix, this PR may be of interest. https://bitbucket.org/petsc/petsc/pull-requests/1334/rmills-mat-kaij/diff Yuyun Yang

Re: [petsc-users] Wrong Global Vector size when default section is built after dmdistribute?

2019-02-25 Thread Blaise A Bourdin via petsc-users
Of course, you are right. In retrospect, trying to create the natural to global SF during distribution does not seem to be the smartest idea… Would you have time to take a pass at distributing the constrains? On our side, we will work on patch that separates the creation of the Naturaltoglobal SF

Re: [petsc-users] Nonconforming object sizes in axpy

2019-02-25 Thread Marius Buerkle via petsc-users
Yes, I recompiled petsc. I will try to get a MWE. I am using ELEMENTAL mattype if this may cause the problem. I will try to run it through valgrind and report back.   I don't see any issue with the commit. Did you recompile petsc ? Can you send us a MWE to reproduce the error? Have you checked u

Re: [petsc-users] Finding nonzero indices

2019-02-25 Thread Eda Oktay via petsc-users
> > Thank you for your answer Matt, but I have some questions about > PetscBinaryWrite() since I am a new user. > > Since I am going to use this function, I guess I have to open a new binary > file with PetscViewerBinaryOpen >

Re: [petsc-users] Nonconforming object sizes in axpy

2019-02-25 Thread Marius Buerkle via petsc-users
No excatly same source on my side. It works with commits prior to 646531bb84  and fails starting from 646531bb84.     On Mon, Feb 25, 2019 at 9:00 AM Marius Buerkle via petsc-users wrote: Hi,   After commit 646531bb84 I get the following error message when cal

[petsc-users] Nonconforming object sizes in axpy

2019-02-25 Thread Marius Buerkle via petsc-users
Hi,   After commit 646531bb84 I get the following error message when calling MatLUFactorNumeric. It worked without a problem before.   [6]PETSC ERROR: - Error Message -- [6]PETSC ERROR: Nonconforming object sizes [6

Re: [petsc-users] About DMDA (and extracting its ordering)

2019-02-25 Thread Thibaut Appel via petsc-users
Hi Matthew, The file in the link you sent does not call DMGetLocalToGlobalMapping nor ISLocalToGlobalMappingGetIndicesF90 though? Anyway, everything you wanted is there: https://bitbucket.org/petsc/petsc/issues/262/fortran-unassociated-pointer-with Thibaut On 25/02/2019 12:03, Matthew Knep

Re: [petsc-users] About DMDA (and extracting its ordering)

2019-02-25 Thread Matthew Knepley via petsc-users
On Mon, Feb 25, 2019 at 3:19 AM Appel, Thibaut wrote: > Hi Matthew, > > Yes I need F90 and the syntax in the file / yours > > PetscInt, pointer :: id_ltog(:) > > > Is the exact same as > > PetscInt, dimension(:), pointer :: id_ltog > > > They’re both modern fortran ”correct” > > Anyways I tried b

[petsc-users] Finding nonzero indices

2019-02-25 Thread Eda Oktay via petsc-users
Hello, I am trying to find the indices (both row and column separately) of nonzero entries of a sparse matrix in Petsc Binary Format. I found MatGetSeqNonzeroStructure but it gives me a struct and I don't know whether this is what I want or not. Best regards, Eda

Re: [petsc-users] About DMDA (and extracting its ordering)

2019-02-25 Thread Appel, Thibaut via petsc-users
Hi Matthew, Yes I need F90 and the syntax in the file / yours PetscInt, pointer :: id_ltog(:) Is the exact same as PetscInt, dimension(:), pointer :: id_ltog They’re both modern fortran ”correct” Anyways I tried both and I still get the same error message. Thibaut On 24 Feb 2019, at 23:38, Ma