Re: [petsc-users] Inquiry regarding DMAdaptLabel function

2023-02-27 Thread Matthew Knepley
On Sat, Feb 18, 2023 at 2:25 AM Zongze Yang wrote: > Dear PETSc Group, > > I am writing to inquire about the function DMAdaptLabel in PETSc. > I am trying to use it coarse a mesh, but the resulting mesh is refined. > > In the following code, all of the `adpat` label values were set to 2 >

Re: [petsc-users] Inquiry regarding DMAdaptLabel function

2023-02-27 Thread Matthew Knepley
On Sat, Feb 18, 2023 at 6:41 AM Zongze Yang wrote: > Another question on mesh coarsening is about `DMCoarsen` which will fail > when running in parallel. > > I generate a mesh in Firedrake, and then create function space and > functions, after that, I get the dmplex and coarsen it. > When

Re: [petsc-users] How to use DM_BOUNDARY_GHOSTED for Dirichlet boundary conditions

2023-02-27 Thread Paul Grosse-Bley
The scaling might be the problem, especially since I don't know what you mean by scaling it according to FE. For reproducing the issue with a smaller problem: Change the ComputeRHS function in ex45.c if (i == 0 || j == 0 || k == 0 || i == mx - 1 || j == my - 1 || k == mz - 1) {  

Re: [petsc-users] How to use DM_BOUNDARY_GHOSTED for Dirichlet boundary conditions

2023-02-27 Thread Barry Smith
I have not seen explicitly including, or excluding, the Dirichlet boundary values in the system having a significant affect on the convergence so long as you SCALE the diagonal rows (of those Dirichlet points) by a value similar to the other entries along the diagonal. If they are scaled

Re: [petsc-users] How to use DM_BOUNDARY_GHOSTED for Dirichlet boundary conditions

2023-02-27 Thread Paul Grosse-Bley
Hi Barry, the reason why I wanted to change to ghost boundaries is that I was worrying about the effect of PCMGs coarsening on these boundary values. As mentioned before, I am trying to reproduce results from the hpgmg-cuda benchmark (a modified version of it, e.g. using 2nd order instead of

Re: [petsc-users] Inquiry regarding DMAdaptLabel function

2023-02-27 Thread Zongze Yang
Hi, Matt Thanks for your clarification. Can I change the type of DMPlex to DMForest? Best wishes, Zongze On Mon, 27 Feb 2023 at 20:18, Matthew Knepley wrote: > On Sat, Feb 18, 2023 at 2:25 AM Zongze Yang wrote: > >> Dear PETSc Group, >> >> I am writing to inquire about the function

Re: [petsc-users] Inquiry regarding DMAdaptLabel function

2023-02-27 Thread Pierre Jolivet
> On 27 Feb 2023, at 3:59 PM, Matthew Knepley wrote: > > On Mon, Feb 27, 2023 at 9:53 AM Zongze Yang > wrote: >> Hi, Matt, >> >> I tested coarsening a mesh by using ParMMg without firedrake, and found some >> issues: >> see the code and results here:

Re: [petsc-users] petsc compiled without MPI

2023-02-27 Thread Long, Jianbo
Thanks for the explanations ! It turns out the issue of running sequentially compiled petsc is PetscFinalize() function. Since my subroutine involving petsc functions needs to be called multiple times in the program, I have to comment out PetscFinalize() at the end of the subroutine, otherwise at

Re: [petsc-users] petsc compiled without MPI

2023-02-27 Thread Matthew Knepley
On Mon, Feb 27, 2023 at 8:41 AM Long, Jianbo wrote: > Thanks for the explanations ! It turns out the issue of running > sequentially compiled petsc is PetscFinalize() function. Since my > subroutine involving petsc functions needs to be called multiple times in > the program, I have to comment

Re: [petsc-users] Inquiry regarding DMAdaptLabel function

2023-02-27 Thread Matthew Knepley
On Mon, Feb 27, 2023 at 9:45 AM Zongze Yang wrote: > Hi, Matt > > Thanks for your clarification. Can I change the type of DMPlex to DMForest? > You can, however DMForest is for structured adaptive meshes using quadtrees, and I do not believe Firedrake works with that. Thanks, Matt >

Re: [petsc-users] Inquiry regarding DMAdaptLabel function

2023-02-27 Thread Zongze Yang
Hi, Matt, I tested coarsening a mesh by using ParMMg without firedrake, and found some issues: see the code and results here: https://gitlab.com/petsc/petsc/-/issues/1331 Could you have a look and give some comments or suggestions? Best wishes, Zongze On Mon, 27 Feb 2023 at 20:19, Matthew

Re: [petsc-users] Inquiry regarding DMAdaptLabel function

2023-02-27 Thread Matthew Knepley
On Mon, Feb 27, 2023 at 9:53 AM Zongze Yang wrote: > Hi, Matt, > > I tested coarsening a mesh by using ParMMg without firedrake, and found > some issues: > see the code and results here: > https://gitlab.com/petsc/petsc/-/issues/1331 > > Could you have a look and give some comments or

Re: [petsc-users] Inquiry regarding DMAdaptLabel function

2023-02-27 Thread Matthew Knepley
On Mon, Feb 27, 2023 at 10:13 AM Pierre Jolivet wrote: > On 27 Feb 2023, at 3:59 PM, Matthew Knepley wrote: > > On Mon, Feb 27, 2023 at 9:53 AM Zongze Yang wrote: > >> Hi, Matt, >> >> I tested coarsening a mesh by using ParMMg without firedrake, and found >> some issues: >> see the code and

Re: [petsc-users] Inquiry regarding DMAdaptLabel function

2023-02-27 Thread Pierre Jolivet
> On 27 Feb 2023, at 4:16 PM, Matthew Knepley wrote: > > On Mon, Feb 27, 2023 at 10:13 AM Pierre Jolivet > wrote: >>> On 27 Feb 2023, at 3:59 PM, Matthew Knepley >> > wrote: >>> >>> On Mon, Feb 27, 2023 at 9:53 AM Zongze Yang >>

[petsc-users] How to use DM_BOUNDARY_GHOSTED for Dirichlet boundary conditions

2023-02-27 Thread Paul Grosse-Bley
Hi, I would like to modify src/ksp/ksp/tutorials/ex45.c to implement Dirichlet boundary conditions using DM_BOUNDARY_GHOSTED instead of using DM_BOUNDARY_NONE and explicitly implementing the boundary by adding diagnonal-only rows. My assumption was that with DM_BOUNDARY_GHOSTED all vectors

Re: [petsc-users] How to use DM_BOUNDARY_GHOSTED for Dirichlet boundary conditions

2023-02-27 Thread Barry Smith
Paul, DM_BOUNDARY_GHOSTED would result in the extra ghost locations in the local vectors (obtained with DMCreateLocalVector() but they will not appear in the global vectors obtained with DMCreateGlobalVector(); perhaps this is the issue? Since they do not appear in the global vector they will

Re: [petsc-users] Inquiry regarding DMAdaptLabel function

2023-02-27 Thread Zongze Yang
Yes, It seems that firedrake only works with DMPlex. Thanks. Best wishes, Zongze On Mon, 27 Feb 2023 at 22:53, Matthew Knepley wrote: > On Mon, Feb 27, 2023 at 9:45 AM Zongze Yang wrote: > >> Hi, Matt >> >> Thanks for your clarification. Can I change the type of DMPlex to >> DMForest? >> > >

Re: [petsc-users] Inquiry regarding DMAdaptLabel function

2023-02-27 Thread Matthew Knepley
On Mon, Feb 27, 2023 at 10:26 AM Pierre Jolivet wrote: > On 27 Feb 2023, at 4:16 PM, Matthew Knepley wrote: > > On Mon, Feb 27, 2023 at 10:13 AM Pierre Jolivet wrote: > >> On 27 Feb 2023, at 3:59 PM, Matthew Knepley wrote: >> >> On Mon, Feb 27, 2023 at 9:53 AM Zongze Yang wrote: >> >>> Hi,

Re: [petsc-users] Inquiry regarding DMAdaptLabel function

2023-02-27 Thread Pierre Jolivet
> On 27 Feb 2023, at 4:42 PM, Matthew Knepley wrote: > > On Mon, Feb 27, 2023 at 10:26 AM Pierre Jolivet > wrote: >>> On 27 Feb 2023, at 4:16 PM, Matthew Knepley >> > wrote: >>> >>> On Mon, Feb 27, 2023 at 10:13 AM Pierre Jolivet >>