Re: [petsc-users] Near nullspace lost in fieldsplit

2024-02-14 Thread Jeremy Theler (External)
> The new code is in https://gitlab.com/petsc/petsc/-/merge_requests/7293 and > retains the null space on the submatrices for both MatZeroRows() and > MatZeroRowsAndColumns() regardless of changes to the nonzero structure of the > matrix. Thank you very much Barry. It works as expected. -- j

Re: [petsc-users] Near nullspace lost in fieldsplit

2024-02-12 Thread Jeremy Theler (External)
Hi Barry > The bug fix for 2 is availabel in > https://gitlab.com/petsc/petsc/-/merge_requests/7279 Note that our code goes through MatZeroRowsColumns_MPIAIJ() not through MatZeroRows_MPIAIJ() so this fix does not change anything for the case I mentioned. -- jeremy

Re: [petsc-users] Near nullspace lost in fieldsplit

2024-02-09 Thread Jeremy Theler (External)
> > Because of a combination of settings, our code passes through this line: > > > > https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/pc/impls/fieldsplit/fieldsplit.c?ref_type=heads#L692 > > > > i.e. the matrices associated with each of the sub-KSPs of a fieldsplit are > > destroyed and then re-

[petsc-users] Near nullspace lost in fieldsplit

2024-02-09 Thread Jeremy Theler (External)
Hi all Because of a combination of settings, our code passes through this line: https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/pc/impls/fieldsplit/fieldsplit.c?ref_type=heads#L692 i.e. the matrices associated with each of the sub-KSPs of a fieldsplit are destroyed and then re-created later.

Re: [petsc-users] Help for MatNullSpaceCreateRigidBody

2023-12-05 Thread Jeremy Theler (External)
just in case it helps, here's one way I have to create the near nullspace: https://github.com/seamplex/feenox/blob/main/src/pdes/mechanical/init.c#L468 -- jeremy From: petsc-users on behalf of Jordi Manyer Fuertes via petsc-users Sent: Tuesday, December 5, 2023

Re: [petsc-users] Start logging with -info after PetscInitialize()

2023-06-13 Thread Jeremy Theler (External) via petsc-users
Thanks. That worked. -- jeremy From: Jacob Faibussowitsch Sent: Tuesday, June 13, 2023 11:25 AM To: Jeremy Theler (External) Cc: petsc-users Subject: Re: [petsc-users] Start logging with -info after PetscInitialize() [External Sender] Call PetscInfoDestroy

[petsc-users] Start logging with -info after PetscInitialize()

2023-06-13 Thread Jeremy Theler (External) via petsc-users
Hello all. I've asked this question to Satish personally last week at the conference, but I'm stuck so any help would be appreciated. For some reason not worth explaining, I need to activate -info after PetscInitialize() has been already called. I'm trying something like this: PetscOptionsSetVa

Re: [petsc-users] Effect of -pc_gamg_threshold vs PETSc version

2023-04-14 Thread Jeremy Theler
r. > Anyway, sorry for the changes.  > I hate changing GAMG for this reason and I hate AMG for this reason! No need to apologize, I just want to better understand how to better exploit your code! Thanks -- jeremy > > Thanks, > Mark > > > > On Thu, Apr 13, 2023 at 8:17

[petsc-users] Effect of -pc_gamg_threshold vs PETSc version

2023-04-13 Thread Jeremy Theler
the stiffness matrix. It is a refined version of the NAFEMS LE10 benchmark described here: https://seamplex.com/feenox/examples/mechanical.html#nafems-le10-thick-plate-pressure-benchmark If you want, I could dump the matrix, rhs and near nullspace vectors and share them. -- jeremy theler thres

[petsc-users] API cal to set mg_levels_pc_type

2022-05-20 Thread Jeremy Theler
The default smoothing PC changed from sor to jacobi in 3.17. The Changelog says the old behavior can be recovered by using -mg_levels_pc_type sor. 1. Is there a way to set the mg_levels_pc_type via an API call? 2. Are there any changes in efficiency expected with this new PC? Regards -- jeremy

Re: [petsc-users] set MUMPS OOC_TMPDIR

2022-03-01 Thread Jeremy Theler
I've known at least one other person that had this very same confusion. Maybe it's worth adding Barry's explanation to the manual page: This function can be called BEFORE PetscInitialize(), but it does not NEED to be called before PetscInitialize(). You should be able to call PetscOptionsSetValue(

Re: [petsc-users] HDF5 timestepping in PETSc 3.16

2022-02-28 Thread Jeremy Theler
wer_hdf5_default_timestepping > > I think that is what you want. I'd like to rely on PetscViewerHDF5SetDefaultTimestepping() to provide backwards compatibility as well. This branch has been merged into master back in November but never made it to the stable v3.16 releases. Can you guys check please? Thanks -- jeremy theler www.seamplex.com

Re: [petsc-users] DM misuse causes massive memory leak?

2021-12-30 Thread Jeremy Theler
Hola Jesús You were lucky you got 20x. See https://petsc.org/release/docs/manualpages/Mat/MatSeqAIJSetPreallocation.html https://petsc.org/release/docs/manualpages/Mat/MatMPIAIJSetPreallocation.html Quote: "For large problems you MUST preallocate memory or you will get TERRIBLE performance, see

Re: [petsc-users] How to read/write a HDF5 file using petsc4py ?

2021-12-10 Thread Jeremy Theler
On Fri, 2021-12-10 at 10:02 +0100, Quentin Chevalier wrote: > root@container:/home/shared# echo $PETSCH_ARCH $PETSCH_DIR PETSCH_ARCH -> PETSC_ARCH PETSCH_DIR -> PETSC_DIR

Re: [petsc-users] Finding which cell an arbitrary point belongs to in DMPlex

2020-09-25 Thread Jeremy Theler
On Thu, 2020-09-24 at 18:30 -0400, Matthew Knepley wrote: > > There is also DMPlexFindVertices() which finds the nearest vertex > > to > > > the given coords in the given radius. > > > > At first I had understood that this function performed a nearest- > > neighbor search but after a closer look i

Re: [petsc-users] Finding which cell an arbitrary point belongs to in DMPlex

2020-09-24 Thread Jeremy Theler
n a full sweep over the DM. Thanks -- jeremy > > Thanks, > > Vaclav > > > On 16 Sep 2020, at 01:44, Matthew Knepley > > wrote: > > > > On Tue, Sep 15, 2020 at 6:18 PM Jeremy Theler > > wrote: > > > On Mon, 2020-09-14 at 20:28 -0400,

Re: [petsc-users] Finding which cell an arbitrary point belongs to in DMPlex

2020-09-15 Thread Jeremy Theler
On Mon, 2020-09-14 at 20:28 -0400, Matthew Knepley wrote: > On Mon, Sep 14, 2020 at 6:15 PM Jeremy Theler > wrote: > > Hello all > > > > Say I have a fully-interpolated 3D DMPlex and a point with > > arbitrary > > coordinates x,y,z. What's the most effici

[petsc-users] Finding which cell an arbitrary point belongs to in DMPlex

2020-09-14 Thread Jeremy Theler
Hello all Say I have a fully-interpolated 3D DMPlex and a point with arbitrary coordinates x,y,z. What's the most efficient way to know which cell this point belongs to in parallel? Cells can be either tets or hexes. Regards -- jeremy theler www.seamplex.com

Re: [petsc-users] BCs for a EPS solver

2020-02-17 Thread Jeremy Theler
The usual trick is to set ones in one matrix and zeros in the other one. On Mon, 2020-02-17 at 12:35 -0600, Emmanuel Ayala wrote: > Hi everyone, > > I have an eigenvalue problem where I need to apply BCs to the > stiffness and mass matrix. > > Usually, for KSP solver, it is enough to set to ze

Re: [petsc-users] Product of matrix row times a vector

2020-01-31 Thread Jeremy Theler
On Thu, 2020-01-30 at 18:05 -0500, Matthew Knepley wrote: > On Thu, Jan 30, 2020 at 6:04 PM Jeremy Theler > wrote: > > On Thu, 2020-01-30 at 21:10 +, Smith, Barry F. wrote: > > > > > MatGetSubMatrix() and then do the product on the sub matrix > > then &

Re: [petsc-users] Product of matrix row times a vector

2020-01-30 Thread Jeremy Theler
On Thu, 2020-01-30 at 21:10 +, Smith, Barry F. wrote: > MatGetSubMatrix() and then do the product on the sub matrix then > VecSum > Ok, I have it working in a single-processor and throws the expected value. Yet I have a segfault in parallel when I ask for the IS corresponding to the rows

[petsc-users] Product of matrix row times a vector

2020-01-30 Thread Jeremy Theler
tiply each of them by the vector and then add the scalars up. Or, conversely, sum all the rows colmunwise and then multiply the sum by a vector. How can I do this? Regards -- jeremy theler www.seamplex.com

[petsc-users] Internal product through a matrix norm

2020-01-22 Thread Jeremy Theler
? PetscScalar e; Vec Kx; VecDuplicate(x, &Kx); MatMult(K, x, Kx); VecDot(x, Kx, &e); -- jeremy theler www.seamplex.com

Re: [petsc-users] error handling

2020-01-21 Thread Jeremy Theler
, if memory is used until just before a process exits, don’t free it simply to silence such a tool. Regards -- jeremy theler www.seamplex.com On Tue, 2020-01-21 at 08:49 -0800, Sam Guo wrote: > I use PETSc from my application. Sounds you are saying I just treat > ierr!=0 as an system err

Re: [petsc-users] pc_gamg_threshol

2017-01-05 Thread Jeremy Theler
describes the methods and not just the implementation as the source code at gamg/util.c so I can better understand what is going on. Thanks -- Jeremy Theler www.seamplex.com On Thu, 2017-01-05 at 09:18 -0500, Mark Adams wrote: > You want the bottom of page 84 in the manual. > > On W

Re: [petsc-users] pc_gamg_threshol

2017-01-04 Thread Jeremy Theler
* Any reference to what pc_gamg_treshold means and/or does? On Wed, 2017-01-04 at 18:13 -0300, Jeremy Theler wrote: > Hi! Any reference to what does -pc_gamg_threshold mean and/or? >

[petsc-users] pc_gamg_threshol

2017-01-04 Thread Jeremy Theler
Hi! Any reference to what does -pc_gamg_threshold mean and/or? -- Jeremy Theler www.seamplex.com

[petsc-users] getting the near nullspace from PCSetCoordinates

2017-01-02 Thread Jeremy Theler
when I ask MatGetNearNullSpace(matrix) passing the problem matrix after setting PCSetCoordinates(pc) I get: error: PETSc error 85-0 'Null Object: Parameter # 1' in /home/gtheler/libs/petsc-3.7.4/src/mat/interface/matnull.c MatNullSpaceGetVecs:64 thanks -- Jeremy Theler www.seamplex.com

Re: [petsc-users] GAMG

2016-10-31 Thread Jeremy Theler
On Mon, 2016-10-31 at 08:44 -0600, Jed Brown wrote: > > After understanding Matt's point about the near nullspace (and reading > > some interesting comments from Jed on scicomp stackexchange) I did built > > my own vectors (I had to take a look at MatNullSpaceCreateRigidBody() > > because I found

Re: [petsc-users] GAMG

2016-10-28 Thread jeremy theler
stretched? > > Do this again with these parameters: > > -mg_levels_ksp_type chebyshev > -mg_levels_esteig_ksp_type cg > -mg_levels_esteig_ksp_max_it 10 > ​​ > -mg_levels_ksp_chebyshev_esteig 0,.1,0,1.05 > -gamg_est_ksp_type cg > > > On Fri, Oct 28, 2016 at 9:48 AM, Jeremy Theler >

Re: [petsc-users] GAMG

2016-10-28 Thread Jeremy Theler
On Fri, 2016-10-28 at 09:46 -0400, Mark Adams wrote: > Please run with -info and grep on GAMG. > [0] PCSetUp_GAMG(): level 0) N=120726, n data rows=3, n data cols=6, nnz/row (ave)=41, np=1 [0] PCGAMGFilterGraph(): 99.904% nnz after filtering, with threshold 0., 13.7468 nnz ave. (N=40242) [

Re: [petsc-users] GAMG

2016-10-28 Thread Jeremy Theler
> > If I do not call PCSetCoordinates() the error goes away but > convergence > is slow. > Is it possible that your coordinates lie on a 2D surface? All this > does is make the 6 basis vectors > for translations and rotations. You can just make these yourself and >

Re: [petsc-users] GAMG

2016-10-28 Thread Jeremy Theler
think there is something wrong with your matrix. Use any solver and > verify that you like the solution first. > > On Fri, Oct 28, 2016 at 9:13 AM, Jeremy Theler > wrote: > Hi! I want to use PCGAMG as a preconditioner for a 3D linear > elasticity > proble

[petsc-users] GAMG

2016-10-28 Thread Jeremy Theler
Hi! I want to use PCGAMG as a preconditioner for a 3D linear elasticity problem (displacement-based FEM formulation) over an unstructured grid. I am not using DMPlex, I just build the stiffness matrix myself and pass it to PETSc. I set MatSetBlockSize() to 3 and pass the node coordinates through P

Re: [petsc-users] Equivalent to MatGetColumnVector for rows?

2016-10-20 Thread Jeremy Theler
multiply this matrix by > the solution vector you will get a "short" vector that on each process > contains the "reaction" for each each of the "removed row" on that process. > >Easy to implement. > >Barry > > > On Oct 19, 2016,

[petsc-users] Equivalent to MatGetColumnVector for rows?

2016-10-19 Thread Jeremy Theler
thing with MatGetRow() that seems to work but it is some lame I am even embarrased of sharing with the list what I have done. Any suggestion is welcome. Thanks -- jeremy theler www.seamplex.com

Re: [petsc-users] Autoconf tests

2016-10-12 Thread jeremy theler
I once made a quick hack, maybe you can start your dirty work from here https://bitbucket.org/wasora/wasora/src/5a88abbac1a846f2a6ed0b4e585f6f3c0fedf2e7/m4/petsc.m4?at=default&fileviewer=file-view-default -- jeremy On Tue, Oct 11, 2016 at 5:31 PM Barry Smith wrote: > >You don't want to get