Re: [petsc-users] SNESDMDASNESSetFunctionLocal in Fortran

2023-05-16 Thread Matthew Knepley
On Tue, May 16, 2023 at 8:07 PM Khaled Nabil Shar Abdelaziz < kabde...@purdue.edu> wrote: > This is very useful! I was more focused on my search for an example with > DMDASNES example instead of ctx. > > > > I guess from the looks of it, I can pass it directly in the ctx argument > or I can pass t

Re: [petsc-users] SNESDMDASNESSetFunctionLocal in Fortran

2023-05-16 Thread Khaled Nabil Shar Abdelaziz
This is very useful! I was more focused on my search for an example with DMDASNES example instead of ctx. I guess from the looks of it, I can pass it directly in the ctx argument or I can pass the pointer using the interfaces defined in the referenced code you provided, correct? Another questi

Re: [petsc-users] Interpolation between nodal and elemental field

2023-05-16 Thread K. Wu
Got it, thanks Matt! Matthew Knepley 于2023年5月16日周二 17:28写道: > On Tue, May 16, 2023 at 11:12 AM K. Wu wrote: > >> Hi Matt, >> >> >> >> I am using two PETSc DM, one for vertices (nodes), and one for cells >> (elements). >> > > I assume you mean DMDA. > > >> I want to do the following operation: >

Re: [petsc-users] Interpolation between nodal and elemental field

2023-05-16 Thread Matthew Knepley
On Tue, May 16, 2023 at 11:12 AM K. Wu wrote: > Hi Matt, > > > > I am using two PETSc DM, one for vertices (nodes), and one for cells > (elements). > I assume you mean DMDA. > I want to do the following operation: > > x is a global vector generated from DM vertices, with length Nn. y is a > gl

Re: [petsc-users] Interpolation between nodal and elemental field

2023-05-16 Thread K. Wu
Hi Matt, I am using two PETSc DM, one for vertices (nodes), and one for cells (elements). I want to do the following operation: x is a global vector generated from DM vertices, with length Nn. y is a global vector generated from DM cells, with length Ne. I want to generate a sparse matrix A wi

Re: [petsc-users] Interpolation between nodal and elemental field

2023-05-16 Thread Matthew Knepley
On Tue, May 16, 2023 at 10:27 AM K. Wu wrote: > Hi all, > > Good day! > > I am currently working on interploating the nodal field vector I obtained > to its corresponding elemental field vector. I am doing it in a simple way > by using structured mesh, the element value is just the average of its

[petsc-users] Interpolation between nodal and elemental field

2023-05-16 Thread K. Wu
Hi all, Good day! I am currently working on interploating the nodal field vector I obtained to its corresponding elemental field vector. I am doing it in a simple way by using structured mesh, the element value is just the average of its corresponding nodal values. Is it possible to generate a c