[petsc-users] Re-use the matrix in petsc

2017-11-24 Thread Edoardo alinovi
Dear petsc users, I am new to petsc, but I am really enjoying it. I am developing a CFD code in fortran and I have a (newby) question for you. I have a subroutine that assembles the matrices arising from the finite volume method. They are sparse and the coefficients change every time step, but

[petsc-users] Petcs preconditioners

2017-11-27 Thread Edoardo alinovi
Dear users, Since this mailing list has already solved one of my problem, I would like to take advantage of your knowlege one more time (thank you so much!). I am a new user (Fortran) and, as you can imagine, I have a lot of questions. Actually, some of them are about preconditioners. In

[petsc-users] How to disable debugging mode?

2017-12-15 Thread Edoardo alinovi
Dear users, I would like to disable the debugging mode in petsc and turn it on when needed. my actual configure is: --prefix=/home/edo/software/petsc_3.8.1/ --with-mpi-dir=/home/edo/software/openMPI-3.0/ & --download-fblaslapack=1 --download-superlu_dist --download-mumps & --download-hypre

[petsc-users] Advices to decrease bicgstab iterations

2017-12-12 Thread Edoardo alinovi
Dear petsc users, I am doing some calculations to test my code in parallel using petsc. With respect the serial code, which uses an in house bicstab+diagonal ILU preconditioner, I note that petsc's bicgstab+ASM with standard options need a larger number of iterations to converge (order 3 to 5).

[petsc-users] Use 16 decimal digit in petsc

2017-12-01 Thread Edoardo alinovi
Dear user, I am solving the few last issues in interfacing petsc with my code. My code works with 16 decimal digits after the "." , but it seems that petsc keeps up to 10 digits for some reason. Is there a way to fix this? Thank you very much for the help, Edoardo

[petsc-users] Solve a 1d non linear equation in petsc

2018-05-22 Thread Edoardo alinovi
Dear PETSC users, I need to solve a simple equation of the type f(x)=0. f is a non linear operator and I know its analytical form. This operation has to be done locally inside a processor domain. I suppose that petsc provides a very usefull way to carry out this. Would you please suggest me a

[petsc-users] PCHYPRE performance

2018-09-05 Thread Edoardo alinovi
of the problem? Many thanks for the advices, Edo -- Edoardo Alinovi, Ph.D. DICCA, Scuola Politecnica Universita' di Genova 1, via Montallegro 16145 Genova, Italy email: edoardo.alin...@dicca.unige.it Tel: +39 010 353 2540

[petsc-users] Warning at the beginning of compiling

2018-03-12 Thread Edoardo alinovi
Dear users, what does this warning means? * WARNING: Using default FORTRAN optimization flags -g -O You might consider manually setting optimal optimization flags for your system with FOPTFLAGS="optimization flags" see config/examples/arch-*-opt.py for

[petsc-users] Question on assembling matrix in parallel

2018-03-01 Thread Edoardo alinovi
Dear All, thanks to your suggestions and Petsc, I have finished to program my finite volume code for CFD that runs in parallel and this is great. I am now tryig to improve its performace and I have a question on matrix in MPIAij format. Basically after the discetization, I have one matrix for

[petsc-users] KSPsolve performance tuning

2018-09-13 Thread Edoardo alinovi
of pressure. Have you got some hints for me? At this point I am sure I am doing something wrong! I have attached the log of a test simulation. Thank you very much! -- Edoardo Alinovi, Ph.D. DICCA, Scuola Politecnica Universita' di Genova 1, via Montallegro 16145 Genova, Italy email: edoardo.alin

[petsc-users] Correct Usage of MatDiagonalSet

2020-05-25 Thread Edoardo alinovi
Dear Guys, I have quick question for you. Can anyone tell me if MatDiagonalSet needs also MatAssemblyBegin/MatAssemblyEnd to be called afterwards or not? Basically, I am trying to compute: sum (a_nb*\phi_nb), where anb are the off diagonal coeffs of the matrix and phi_nb the corresponding field

Re: [petsc-users] Correct Usage of MatDiagonalSet

2020-05-25 Thread Edoardo alinovi
Cool, thanks a lot! On Mon, 25 May 2020, 18:52 Jed Brown, wrote: > Edoardo alinovi writes: > > > Dear Guys, > > > > I have quick question for you. Can anyone tell me if MatDiagonalSet needs > > also MatAssemblyBegin/MatAssemblyEnd to be called afterwards or not?

[petsc-users] Help and clarification on TS

2020-11-08 Thread Edoardo alinovi
Hello PETSc friend, I hope you are all good and safe! During these few days I have been exploring the possibility to use TS for the time integration of the momentum equation in my finite volume solver. Actually I am doing this job with my own routines, however they are quite limited with respect

[petsc-users] Using parmetis from petsc

2021-02-10 Thread Edoardo alinovi
Hello PETSc friends, I am working on a code to partition a mesh in parallel and I am looking at parmetis. As far as I know petsc is interfaced with metis and parmetis and I have seen people using it within dmplex. Now, I am not using dmplex, but I have petsc compiled along with my code for the

Re: [petsc-users] Using parmetis from petsc

2021-02-10 Thread Edoardo alinovi
do you think about this? Many thanks, Edoardo On Wed, 10 Feb 2021, 13:12 Matthew Knepley, wrote: > On Wed, Feb 10, 2021 at 4:07 AM Edoardo alinovi > wrote: > >> Hello PETSc friends, >> >> I am working on a code to partition a mesh in parallel and I am looking >&

Re: [petsc-users] On MatDestroy() in Fortran

2022-07-30 Thread Edoardo alinovi
Hello Barry, * I assume you are calling KSPSetOperators() before each new KSPSolve() so that it knows to solve a new system?* Yes, I do. This looks like a good trick: KSPSetOperators(ksp,PETSC_NULL_MAT,PETSC_NULL_MAT) So you would do: 1) KSPSetOperators(ksp,A,A) 2) KSPSolve(myksp, myrhs,

[petsc-users] On MatDestroy() in Fortran

2022-07-30 Thread Edoardo alinovi
Hello petsc friends, I have a (silly?) question about matDestroy in Fortran, cause I am not sure I have got 100% clear what it is doing. I am asking this question because I have the feeling that matDestroy(A, ierr) is not returning the memory to the system, but it prevents from memory leaks. Is

Re: [petsc-users] On MatDestroy() in Fortran

2022-07-30 Thread Edoardo alinovi
> > Barry, Jacob, Thank you very much for your clarification, I think the reference counting is what is preventing matDestroy() from releasing the matrix memory. Just to give you a bit of context, in my CFD code I am solving momentum, pressure, plus two more equations for the turbulence model

[petsc-users] Does flagging a matrix as symmetric improving performances?

2022-10-21 Thread Edoardo alinovi
Hi PETSc friends, As per object, do you think that flagging a matrix as symmetric might improve setup times of the preconditioner? Thank you as always.

Re: [petsc-users] Does flagging a matrix as symmetric improving performances?

2022-10-21 Thread Edoardo alinovi
Hi Berry, Thank you for the hints. Actually, I am using MPIAIJ, does this mean I need to change the matrix format? Most of the time I am using CG + boomerAMG, do you think that using a sym matrix can be any good for the performance? Cheers

[petsc-users] Clarification on MatMPIBAIJSetPreallocation (d_nnz and o_nnz)

2022-10-24 Thread Edoardo alinovi
Hello Barry, I am doing some preliminary work to add a coupled solver in my code. I am reading some documentation on MPIBAIJ as the matrix will be composed of blocks of size 3x3 in 2D and 4x4 in 3D for each cell in the domain. I can't quite understand how to set d_nnz and o_nnz. What is their

Re: [petsc-users] Clarification on MatMPIBAIJSetPreallocation (d_nnz and o_nnz)

2022-10-24 Thread Edoardo alinovi
Thank you Jed for the hint. So just to understand it with an example. Say I have this matrix here, which has 4 3x3 blocks 1 2 0 | 0 5 0 | 0 2 3 | 0 0 1 | < Proc 1 0 0 1 | 0 2 2 | || 1 2 0 | 0 5 0 | 0 2 0 | 0 0 1 | < Proc 2 0 0 1 | 0 0 2 | ---|-|

[petsc-users] Question on Hypre customization within a split

2022-11-20 Thread Edoardo alinovi
Hello Barry/Matt/Jed, I am going on with testing and now the field split works great. Thanks a lot for the support! I have a question today about Hypre customization for a target split. let's say that my split 1 use hypre: * -UPfieldsplit_1_pc_type hypre *(this works ok) How can I then

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-11 Thread Edoardo alinovi
Hi guys, anyone with any suggestion to make this thing work? 梁 Il Ven 11 Nov 2022, 10:24 Edoardo alinovi ha scritto: > Hi Barry, > > FYI, in test.F90 I noted that "ui" starts for 1 and not from 0. I fixed it > but the situation does not change much. I attached the ne

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-15 Thread Edoardo alinovi
Thanks, I'll do it then :) Il Mar 15 Nov 2022, 19:25 Jed Brown ha scritto: > You do if preconditioners (like AMG) will use it or if using functions > like MatSetValuesBlocked(). If you have uniform block structure, it doesn't > hurt. > > Edoardo alinovi writes: > > &g

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-15 Thread Edoardo alinovi
Hi Guys, Very quick one. Do I need to set the block size with MPIAIJ?

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-19 Thread Edoardo alinovi
Morning Guys, The good news is that finally fieldsplit is working ok! I have just a simple question about the interaction of MatMPIAIJSetPreallocation with MatSetValuesBlocked. In this simple example I have a 27x27 matrix (9 blocks, each composed by a 3x3 matrix). The only entry I have on each

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-19 Thread Edoardo alinovi
Please ignore me, I was just making a mistake with the number of zeros, with JEd's suggestion to use MatXAIJSetPreallocation I can do a very bespoke code and everything looks good. I'll test the field splitting a bit to see if I can find some performance! Cheers

[petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Edoardo alinovi
Hello Jed/Barry/Petsc friends I am trying to assemble a block matrix with 3x3 in 2D and 4x4 blocks in 3D coming from the fully coupled NS equation. I am not sure I am understanding the example provided here: https://petsc.org/main/docs/manualpages/Mat/MatSetValuesBlocked/ The description says

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Edoardo alinovi
Hello Matt, I see, so from an operation point of view, I should pass a 1D array... How should I unroll my nComp x nComp matrix? by row or by column? e.g. say that my block is: A=[ 1 2 3 4 5 6 7 8 9 ] than v = [1 2 3 4 5 6 7 8 9] or [1 4 7 2 5 8 3 6 9]?

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-05 Thread Edoardo alinovi
Matt, Barry, Should I do any particular trick to solve block matrices in ksp? I am doing a silly 3x3 cavity test case and I am struggling to converge using CG+bjacobi. It might be I have an error in the matrix, but just to be sure I am not missing something fundamental in the setup. This is my

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-05 Thread Edoardo alinovi
Hello Pierre, Thank you for the suggestion. However, this is one of the cases where the error is done by the guy sitting in front of the screen! My matrix is no more symmetric and I was pretending to solve it with CG! At least the theory works! 

[petsc-users] On PCFIELDSPLIT and its implementation

2022-11-08 Thread Edoardo alinovi
Hello Guys, Thanks to your suggestions on the block matrices, my fully coupled solver is proceeding very well! I am now about to take advantage of the block structure of the matrix using PCFIELDSPLIT. I have learned a bit from the user manual and followed with interest this discussion in the

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-08 Thread Edoardo alinovi
Hello guys, I am getting this error while using fieldsplit: [3]PETSC ERROR: - Error Message -- *[3]PETSC ERROR: Nonconforming object sizes[3]PETSC ERROR: Local column sizes 6132 do not add up to total number of

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-10 Thread Edoardo alinovi
I am sorry Barry, I told you it works, but it is not. I changed to index to integer, but I am still getting this: [0]PETSC ERROR: - Error Message -- [0]PETSC ERROR: Nonconforming object sizes [0]PETSC ERROR: Local

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-10 Thread Edoardo alinovi
The thing is, even I pass the following options: -UPeqn_pc_type fieldsplit -UPeqn_pc_fieldsplit_0_fields 0,1 -UPeqn_pc_fieldsplit_1_fields 2 -UPeqn_pc_fieldsplit_type SCHUR -UPeqn_pc_fieldsplit_block_size 3 I am getting the same issue, so there must be something fundamental in the way I am

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-10 Thread Edoardo alinovi
True, Maybe somebody merged it already? I have attached my silly example. To compile: mpifort -L$PETSC_DIR/$PETSC_ARCH/lib -lpetsc -fdefault-real-8 -o test test.F90 -I$PETSC_DIR/include -I$PETSC_DIR/$PETSC_ARCH/include Do you need the petsc code MAtt did? test.F90 Description: Binary data

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-10 Thread Edoardo alinovi
utomatically match with single or > double precision based on the PETSc configure options. > >What version of PETSc are you using? We don't have Fortran stubs for > the calls to PCFieldSplitSetFields in the latest release. I should add them. > > > > On Nov 9, 2022, at 12:00 PM, Ed

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-10 Thread Edoardo alinovi
Ah I see you have already added the missing interfaces for fortran enthusiasts :) So you likely do not need Matt's hack! [image: image.png]

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-04 Thread Edoardo alinovi
Yes, I did not set the block size for the vector... Missed it! I think I have nailed the way to handle block matrix/vectors, I am moving now on to solve the next facy error which is a ksp_diverged_its  thanks gents for the support with this block madness :)

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Edoardo alinovi
Barry, Can you please provide me with an example on how to use MatSetValuesBlocked? To play it easy, let's say that I want to insert a 3x3 block matrix b into the matrix A, rows 0-2, columns 0-2. Up to what I've understood (very few apparently XD ), I would do like this: b(3,3) = 11.0 call

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Edoardo alinovi
Also, just to be 100% sure, is m and equal to 3 in 2 and 4 in 3D if my blocks are 3x3 and 4x4 respectively?

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Edoardo alinovi
Hi Barry, Thanks for popping in. This is my code: *blockValues = this%getDiagonalBlockValues(iElement=iElement)call MatSetValuesBlocked(this%A, 4-bdim, mesh%cellGlobalAddr(iElement)-1, 4-bdim, mesh%cellGlobalAddr(iElement)-1, blockValues, INSERT_VALUES, ierr)*

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Edoardo alinovi
Yes I am doing: call MatMPIBAIJSetPreallocation(this%A, 4-bdim, flubioSolvers%d_nz, mesh%d_nnz, flubioSolvers%o_nz, mesh%o_nnz, ierr) with d_nnz the number of diagonal blocks and o_nnz the number of off-diagonal blocks. However I am getting this: [0]PETSC ERROR: - Error

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Edoardo alinovi
Just to give a bit more of context I am doing like this: call MatCreate(PETSC_COMM_WORLD, this%A, ierr) call MatSetSizes(this%A, lm, lm, M, M, ierr) ! lm is the local size of the matrix , M the global one call MatSetType(this%A, myType, ierr) ! myType is MATMPIBAIJ

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Edoardo alinovi
Well, definitely using MatsetValuesBlocked in a bad way. Instead if seeing 11 in the first place 3 rows and 3 columns, I see all zeros and random numbers in row 9 10 and 11... [image: image.png]

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Edoardo alinovi
Ah, I was forgetting the most important thing... Are the size of idxm and idxn equal to one if I insert 1 block or should I specify all the rows and columns in the block? I am getting some memory issues with unallocated non zero values so I must have made some mistake here... :( Sorry for the

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-04 Thread Edoardo alinovi
Barry, Thanks, yes, I should pass 1 and not 3 For some reason I have misunderstood the wording in the documentation and I have interpreted m and n as the number of row and columns of the block to insert, while I need to think of everything as divided by bs... Now I am with you!!! Many thanks

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-04 Thread Edoardo alinovi
It is working like a charm now! Is it mandatory to use VecSetValuesBlocked to assemble the rhs? Does the Vec need to be of any other type than VECMPI? I am assembling it like this: brhs(1:3-bdim) = this%Ueqn%bC(iElement,1:3-bdim) brhs(4-bdim) =

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-04 Thread Edoardo alinovi
Thanks Matt, I have found out that setValuesblocked will work if I do: call MatCreateVecs(A, x, y, ierr) call setValuesBlocked(x, nblocks, varray, ierr) However, there is nogetValuesBlocked. Not the end of the world, it is handy to set and get stuff by block and not by single entry :) Cheers

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-09 Thread Edoardo alinovi
Even in the fortran interface? Il Mer 9 Nov 2022, 13:52 Matthew Knepley ha scritto: > Fields are numbered from 0. > > Thanks, > > Matt > > On Wed, Nov 9, 2022 at 2:20 AM Edoardo alinovi > wrote: > >> Hello guys, >> >> I am getting this error

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-09 Thread Edoardo alinovi
To be clear, You are suggesting to use ufields(0)=0, ufields(1)=1 and so on? Il Mer 9 Nov 2022, 13:54 Edoardo alinovi ha scritto: > Even in the fortran interface? > > Il Mer 9 Nov 2022, 13:52 Matthew Knepley ha scritto: > >> Fields are numbered from 0. >> >

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-09 Thread Edoardo alinovi
Sure, I'll try on a 3x3 cavity. How can I print the ISs? Il Mer 9 Nov 2022, 14:07 Matthew Knepley ha scritto: > On Wed, Nov 9, 2022 at 7:57 AM Edoardo alinovi > wrote: > >> To be clear, >> >> You are suggesting to use ufields(0)=0, ufields(1)=1 and so on? >>

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-09 Thread Edoardo alinovi
So my cavity has 3x3=9 cells, each cells as a 3x3 block. I get the same error: [0]PETSC ERROR: Local column sizes 6 do not add up to total number of columns 9 However I do not define any IS, I just pass an array to PCFieldSplitSetFields() and thus I do not know how to plot them...

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-09 Thread Edoardo alinovi
I am copying this example: https://petsc.org/release/src/ksp/ksp/tutorials/ex42.c.html lines 2040'2042

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-09 Thread Edoardo alinovi
Thanks, the stuff I am doing is within my code, so I am not sure you can reproduce it. I am just doing this: call PCSetType(mypc, PCFIELDSPLIT, ierr) call PCFieldSplitSetBlockSize(mypc, 4-bdim, ierr) ufields(1) = 0 ufields(2) = 1

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-09 Thread Edoardo alinovi
The fact it is telling me 6 instead of 9, makes me think it is getting just the first split for "u" and not the second one for "p" that would lead to 9.

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-09 Thread Edoardo alinovi
Hi Matt, it took a bit more than 1s, but I can reproduce the error in the attached file. To compile: *mpifort -L$PETSC_DIR/$PETSC_ARCH/lib -lpetsc -fdefault-real-8 -o test test.F90 -I$PETSC_DIR/include -I$PETSC_DIR/$PETSC_ARCH/include* Please run it in serial as I have hardcoded some dimensions

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-10 Thread Edoardo alinovi
Hello, I have tried a different way to create the splitting: ui(1) = 0 ui(2) = 1 pi(1) = 2 call ISCreateGeneral(PETSC_COMM_WORLD, 2, ui, PETSC_COPY_VALUES, isu, ierr) call ISCreateGeneral(PETSC_COMM_WORLD, 1, pi, PETSC_COPY_VALUES, isp, ierr) call

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-14 Thread Edoardo alinovi
DSPLIT instead of keeping BAIJ. > > > On Nov 14, 2022, at 2:21 PM, Edoardo alinovi > wrote: > > Hi Barry no worries! > > Thanks for letting me know! It is not a problem for me to use MPIAIJ, do > you think field split will be a game changer? > > > > Il Lun 1

Re: [petsc-users] Help with fieldsplit performance

2023-02-17 Thread Edoardo alinovi
Thanks Matt, That was my thinking. So If I am going to build my own Schur approximation matrix, I guess I can forget about the numbering issue, correct?

[petsc-users] issues with VecSetValues in petsc 3.19

2023-04-17 Thread Edoardo alinovi
Hello Barry, Matt, Jed, I have just installed the latest and greatest version of petsc and I am hitting a problem I did not have in previous releases. Here is the error: *[1]PETSC ERROR: - Error Message

Re: [petsc-users] issues with VecSetValues in petsc 3.19

2023-04-17 Thread Edoardo alinovi
Hey Matt, Thanks for the help. Here is the error: [0]PETSC ERROR: - Error Message -- [0]PETSC ERROR: Object is in wrong state [0]PETSC ERROR: Not for unassembled vector, did you call

Re: [petsc-users] issues with VecSetValues in petsc 3.19

2023-04-17 Thread Edoardo alinovi
Aaah yes you are right. Do not ask me why, but I was not getting this with 3.18.5, odd.

Re: [petsc-users] issues with VecSetValues in petsc 3.19

2023-04-17 Thread Edoardo alinovi
Sure thing, the solver I am working on is this one: https://gitlab.com/alie89/flubio-code-fvm. It is a 3D, collocated, unstructured, finite volume solver for incompressibility NS. I can run steady, unsteady and I can use SIMPLE, PISO and Factional step method (both explicit and fully implicit

Re: [petsc-users] issues with VecSetValues in petsc 3.19

2023-04-17 Thread Edoardo alinovi
Do you mean the solver I am messing around? XD

Re: [petsc-users] issues with VecSetValues in petsc 3.19

2023-04-17 Thread Edoardo alinovi
Thanks Matt, your always there when you need <3

Re: [petsc-users] issues with VecSetValues in petsc 3.19

2023-04-20 Thread Edoardo alinovi
2023, 13:50 Matthew Knepley ha scritto: > On Mon, Apr 17, 2023 at 6:37 AM Edoardo alinovi > wrote: > >> Sure thing, the solver I am working on is this one: >> https://gitlab.com/alie89/flubio-code-fvm. >> >> It is a 3D, collocated, unstructured, finite volume solv

Re: [petsc-users] Help with fieldsplit performance

2023-02-05 Thread Edoardo alinovi
Hi Matt, Thanks for your feedback! Would you suggest me the command line to get the number of sub iterations? Il Dom 5 Feb 2023, 20:14 Matthew Knepley ha scritto: > On Sun, Feb 5, 2023 at 1:26 PM Edoardo alinovi > wrote: > >> Hello Petsc's crew, >> >> I would l

Re: [petsc-users] Help with fieldsplit performance

2023-02-05 Thread Edoardo alinovi
Maybe I managed to find out the number of iters of the field split by adding: fieldsplit_u_ksp_converged_reason. This gets printed 268 times: Linear UPeqn_fieldsplit_u_ solve converged due to CONVERGED_ITS iterations 1 1. You are using A11 as the preconditioning matrix for the Schur

Re: [petsc-users] Help with fieldsplit performance

2023-02-05 Thread Edoardo alinovi
Matt I messed up a bit the things as I sent you the number of sub iters done with preonly. It looks to be faster but outer iters goes up from 4 (with gmres as sub ksp) to 399, while run time goes from 37s to 10s. I manage to drop a bit the run time by dropping the relative tolerance Looking at

Re: [petsc-users] Help with fieldsplit performance

2023-02-05 Thread Edoardo alinovi
PS: can you suggest any example to assemble an approximation for Schur? I am doing incompressible NS here, not really "sure" on how to deal with it and something to start would be useful!

[petsc-users] Help with fieldsplit performance

2023-02-05 Thread Edoardo alinovi
Hello Petsc's crew, I would like to ask for some support in setting up the fieldsplit preconditioner in order to obtain better performance. I have already found some posts on the topic and keep experimenting, but I would like to hear your opinion as experts :) I have my fancy CFD pressure based

Re: [petsc-users] Help with fieldsplit performance

2023-02-14 Thread Edoardo alinovi
Hi Matt, So I have done some research these days and I have found out that I might try to assemble the SIMPLE for Schur approximation (myS = A11 - A10 inv(DIAGFORM(A00)) A01). Reading papers around, I come up with a doubt, which I believe to be a very silly one but worth asking... Is the way

Re: [petsc-users] Questions on CPR preconditioner

2023-06-25 Thread Edoardo alinovi
Thanks Matt, This approach looks interesting, It would be great for me to have a look at a minimal example and try it out. Barry, are you there?  Cheers

[petsc-users] Questions on CPR preconditioner

2023-06-25 Thread Edoardo alinovi
Hello petsc's friends I have a curiosity about a sentence in the user guide about CPR preconditioner: *"**The Constrained Pressure Preconditioner (CPR) can be implemented using PCCOMPOSITE with PCGALERKIN

Re: [petsc-users] Questions on CPR preconditioner

2023-06-25 Thread Edoardo alinovi
Hi Barry, thanks for pointing me out to that discussion! Unfortunately I am getting issues with this link: http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20190302/b0c1ad29/attachment.mht , any chance it is a dead one? Cheers

Re: [petsc-users] issues with VecSetValues in petsc 3.19

2023-05-05 Thread Edoardo alinovi
Hello Barry, Welcome to the party! Thank you guys for your precious suggestions, they are really helpful! It's been a while since I am messing around and I have tested many combinations. Schur + selfp is the best preconditioner, it converges within 5 iters using gmres for inner solvers but it is

Re: [petsc-users] Help with KSPSetConvergenceTest

2023-05-13 Thread Edoardo alinovi
Hello Barry, I have seen you guys merged in main the minimum tolerance stuff. After compiling that branch, I have tried to call KSPSetMinimumIterations(this%ksp, this%minIter, ierr), but the compiler cannot find the function. I have included this module as standard practice: #include

Re: [petsc-users] Help with KSPSetConvergenceTest

2023-05-07 Thread Edoardo alinovi
Hi Matt, h, what if I do: KSPConvergedDefault(ksp, n, rnorm, flag, PETSC_NULL_FUNCTION, ierr) That looks to behave OK, but I am not sure about what I am doing -.- Cheers

[petsc-users] Help with KSPSetConvergenceTest

2023-05-07 Thread Edoardo alinovi
Hello guys, Today I am about to write a custom convergence test for KSP doing the following job: - if the number of ksp iterations is less than a given threshold, iterate until that threshold is met - if the number of ksp iterations is bigger than the threshold, use the standard convergence

Re: [petsc-users] Help with KSPSetConvergenceTest

2023-05-07 Thread Edoardo alinovi
Thanks, Is this a reasonable thing to do if I want to replicate what KSP is doing by default?

Re: [petsc-users] Help with KSPSetConvergenceTest

2023-05-07 Thread Edoardo alinovi
Hello Barry, Mega! Thank you Berry much for providing me with a working example! I ended up in writing this: *call KSPConvergedDefault(ksp, n, rnorm, flag, PETSC_NULL_FUNCTION, ierr)if (n

Re: [petsc-users] Help with KSPSetConvergenceTest

2023-05-07 Thread Edoardo alinovi
Thanks Barry, I have fixed the error. Indeed, It's odd it is working. Compiler magic I guess!

Re: [petsc-users] issues with VecSetValues in petsc 3.19

2023-05-05 Thread Edoardo alinovi
Hi Matt, I have some more questions on the fieldsplit saga :) I am running a 1M cell ahmed body case using the following options: "solver": "fgmres", "preconditioner": "fieldsplit", "absTol": 1e-6, "relTol": 0.0, "options":{ "pc_fieldsplit_type": "multiplicative",

Re: [petsc-users] Help with KSPSetConvergenceTest

2023-05-09 Thread Edoardo alinovi
Mega! This is gonna be useful for many people :) Il Mar 9 Mag 2023, 00:54 Barry Smith ha scritto: > > See https://gitlab.com/petsc/petsc/-/merge_requests/6436 with commit > barry/2023-05-08/add-ksp-min-its > > > > On May 7, 2023, at 2:22 PM, Edoardo alinovi >

Re: [petsc-users] [petsc-maint] Correct use of PCFactorSetMatOrderingType

2018-11-08 Thread Edoardo alinovi via petsc-users
the performance, but I am running on a E4 workstation with 16 Intel's Xeon processors (2.3GH/12MB cache) and 128GB of RAM . Thank you very much for your helpful comments, Edoardo -- Edoardo Alinovi, Ph.D. DICCA, Scuola Politecnica Universita' di Genova 1, via Montallegro 16145 Genova, Italy

[petsc-users] Correct use of PCFactorSetMatOrderingType

2018-11-06 Thread Edoardo alinovi via petsc-users
ove option can be useful or not in decreasing the computational time. Any suggestion or tips? Thank you very much for the kind help -- Edoardo Alinovi, Ph.D. DICCA, Scuola Politecnica Universita' di Genova 1, via Montallegro 16145 Genova, Italy email: edoardo.alin...@dicca.unige.it Tel: +

Re: [petsc-users] Correct use of PCFactorSetMatOrderingType

2018-11-06 Thread Edoardo alinovi via petsc-users
PCBJACOBI). Is it normal? However, I guess this is very problem dependent. -- Edoardo Alinovi, Ph.D. DICCA, Scuola Politecnica Universita' di Genova 1, via Montallegro 16145 Genova, Italy email: edoardo.alin...@dicca.unige.it Tel: +39 010 353 2540 Il giorno mar 6 nov 2018 alle ore 16:04 Zhang

Re: [petsc-users] Stop KSP if diverging

2019-05-29 Thread Edoardo alinovi via petsc-users
Thanks Matthew, Yes, I will give it a try thid evening. Thak you very much! On Wed, 29 May 2019, 11:32 Matthew Knepley, wrote: > On Wed, May 29, 2019 at 3:07 AM Edoardo alinovi via petsc-users < > petsc-users@mcs.anl.gov> wrote: > >> Dear PETSc friends, >> >

Re: [petsc-users] DMPlex for cell centred finite volume

2019-08-27 Thread Edoardo alinovi via petsc-users
using a simple two-point flux, > but it may be helpful to look at the setup and residual loop. > > Nate > > > On Tue, Aug 27, 2019 at 6:55 AM Matthew Knepley via petsc-users < > petsc-users@mcs.anl.gov> wrote: > >> On Tue, Aug 27, 2019 at 4:54 AM Edoardo alinovi &l