have > 27 values in this case and you use it for local operations only
(its communicator is PETSC_COMM_SELF).
Hope this helps,
Mark
On Mon, Mar 11, 2024 at 4:48 AM Yi Hu wrote:
Dear Barry,
Thanks for your response. Now I am doing simple debugging for my
customized mat_mult_op of
: Sunday, March 10, 2024 6:45 PM
To: Yi Hu
Cc: Mark Adams ; petsc-users
Subject: Re: [petsc-users] snes matrix-free jacobian fails with preconditioner
shape mismatch
On Mar 10, 2024, at 10:16 AM, Yi Hu wrote:
This Message Is From an External Sender
This message came from outside your
, 2024 at 7:21 AM Yi Hu wrote:
Dear petsc team, I implemented a matrix-free jacobian, and it can
run sequentially. But running parallel I got the pc error like
this (running with mpirun -np 2, only error from rank1 is
presented here) [1]PETSC ERROR
Dear petsc team, I implemented a matrix-free jacobian, and it can run sequentially. But running parallel I got the pc error like this (running with mpirun -np 2, only error from rank1 is presented here) [1]PETSC ERROR: -
ZjQcmQRYFpfptBannerStart
:29, Barry Smith wrote:
>
>> On Feb 24, 2024, at 10:50 AM, Yi Hu wrote:
>>
>> Dear Barry,
>>
>> Thanks for the hint.
>>
>> This works for my purpose. I did not need to access my form function value, so I did not call SNESGetFunction() in my callback funct
y immediately before each linear solve. Inside your callback use SNESGetFunction(snes,f,NULL,NULL); to access the last computed value of your function, from this you can update your global variable.
>
> Barry
>
>
>> On Feb 14, 2024, at 4:28 PM, Yi Hu wrote:
>>
>> Dear P
Dear PETSc team,
I am using a newtonls snes solver. I know that form residual is invoked
at several locations of the algorithm, first evaluated for the rhs of
ksp solver, then several times for obtaining the optimal step of line
search.
In my problem I have a global variable that is updated
FormJacobShell(). Like
TYPE(MatCtx),POINTER :: ctxF_pt
MatShellGetContext(jac,ctxF_ptr,ierr)
ctxF_pt%Xbase = X
The reason this works is because ctxF_pt%Xbase = X copies the value of
X (the PETSc vector) to Xbase, not the address of X.
Barry
On Feb 5, 2024, at 4:18 PM, Yi Hu
:
Send the entire code.
On Feb 4, 2024, at 4:43 PM, Yi Hu wrote:
Thanks for your response. You are correct. I overlooked this step.
Now I am trying to correct my "shell matrix approach" for ex1f.F90 of
snes solver
(https://github.com/hyharry/small_petsc_test/blob/master/test_shell_ja
Newton step results in sufficient decrease of
the function value.
Barry
On Jan 30, 2024, at 3:19 PM, Yi Hu wrote:
Hello Barry,
Thanks for your reply. The monitor options are fine. I actually meant
my modification of snes tutorial ex1f.F90 does not work and has some
unexpected behavior. I basically
0 KSP Residual norm 1.267482220786e-01
>1 KSP Residual norm 1.498679601680e-17
> Linear solve converged due to CONVERGED_RTOL_NORMAL iterations 1
> 8 SNES Function norm 3.468150619264e-02
>0 KSP Residual norm 3.468150619264e-02
>1 KSP Residual norm 5.944160522951e-18
> Li
Dear PETSc team,
I am still trying to sort out my previous thread
https://lists.mcs.anl.gov/pipermail/petsc-users/2024-January/050079.html using
a minimal working example. However, I encountered another problem. Basically I
combined the basic usage of SNES solver and shell matrix and tried to
end interface MatShellSetContext
interface MatShellGetContext
subroutine MatShellGetContext(mat,ctx_F_base,ierr)
use petscmat
Mat :: mat
Vec :: ctx_F_base
PetscErrorCode :: ierr
end subroutine MatShellGetContext
end interface MatShellGetContext
From: Yi Hu
a valid formJacobian() can lead
to a write to the matrix. My formJacobian maybe not valid (because the output
not gives me print), so the Jac_PETSc is never written for the SNES. Maybe I am
wrong about it.
Best wishes,
Yi
From: Barry Smith
Sent: Thursday, January 11, 2024 4:47 PM
To: Yi Hu
be the same as my shell matrix.
Yi
From: Barry Smith
Sent: Wednesday, January 10, 2024 4:27 PM
To: Yi Hu
Cc: petsc-users
Subject: Re: [petsc-users] SNES seems not use my matrix-free operation
By default if SNESSetJacobian() is not called with a function pointer PETSc
attempts to compute
shes,
Yi
From: Barry Smith
Sent: Tuesday, January 9, 2024 4:49 PM
To: Yi Hu
Cc: petsc-users
Subject: Re: [petsc-users] SNES seems not use my matrix-free operation
However, my GK_op (which is the reloaded MATOP_MULT) gives me some problem. It
is entered but then crashed with Segmentation V
Dear PETSc Experts,
I am implementing a matrix-free jacobian for my SNES solver in Fortran.
(command line option -snes_type newtonls -ksp_type gmres)
In the main program, I define my residual and jacobian and matrix-free jacobian
like the following,
…
call DMDASNESSetFunctionLocal(DM_mech,
Dear Jed,
Thanks for your reply. I have an analytical one to implement.
Best, Yi
-Original Message-
From: Jed Brown
Sent: Wednesday, December 20, 2023 5:40 PM
To: Yi Hu ; petsc-users@mcs.anl.gov
Subject: Re: [petsc-users] fortran interface to snes matrix-free jacobian
Are you wanting
Dear PETSc team,
My solution scheme relies on a matrix-free jacobian in the SNES solver. I saw
the useful C interface like MatCreateSNESMF(), DMSNESCreateJacobianMF(). I am
wondering if you have the fortran equivalence?
I think for my problem in the main program I need to do
19 matches
Mail list logo