Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-25 Thread Matthew Knepley
mp; Statistics >> Hamilton Hall room 409B, McMaster University >> 1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada >> EMail: marbo...@mcmaster.ca >> Tel. +1 (905) 525 9140 ext. 27031 >> --- &g

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-20 Thread Bora Jeong
il: marbo...@mcmaster.ca > Tel. +1 (905) 525 9140 ext. 27031 > --- > -------------- > *From:* Matthew Knepley > *Sent:* July 20, 2022 4:24 PM > *To:* Bora Jeong > *Cc:* Alexis Marboeuf ; Blais

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-20 Thread Bora Jeong
e" arrays into the natural vertex index? >>> b) related to item a), DMPlexGetDepthStratum() is saying each processor >>> owns 15 vertex points if np=2 without overlap. But Natural SF gives only 10 >>> roots & leaves for proc=0. Is there anything wrong? or did I misunderstand >>> something? >>> c) iroots pointer from PetscS

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-20 Thread Alexis Marboeuf
s Marboeuf ; Blaise Bourdin ; PETSc Subject: Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index   On Wed, Jul 20, 2022 at 2:27 PM Bora Jeong <boraj1...@gmail.com> wrote: I am not seeing DMPlexDistributeSetDefault(dm,PETSC_FALSE) after you create your DM fr

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-20 Thread Matthew Knepley
reation of the natural SF raises >> an error (duplicate leave entries) when the section includes constraint >> dofs. I will submit a MR very soon about that. But it will be merged to >> main. >> >> Does this help? >> >> Best >> ------------------------------- >> Alexis Marboeuf >> Postdocto

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-20 Thread Bora Jeong
ilton, Ontario L8S 4K1, Canada > EMail: marbo...@mcmaster.ca > Tel. +1 (905) 525 9140 ext. 27031 > ----------------------------------- > -- > *From:* Bora Jeong > *Sent:* July 19, 2022 1:05 PM > *To:* Alexis Marboeu

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-19 Thread Alexis Marboeuf
Sent: July 18, 2022 8:52 PM To: Bora Jeong <boraj1...@gmail.com> Cc: Matthew Knepley <knep...@gmail.com>; PETSc <petsc-users@mcs.anl.gov>; Alexis Marboeuf <marbo...@mcmaster.ca> Subject: Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index   Alexi

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-19 Thread Alexis Marboeuf
: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index   Alexis noticed a problem with the natural SF when constraints are defined. He has a MR coming.  @Alexis: Could it be that what Bora sees is exactly what you fixed? Blaise On Jul 18, 2022, at 8:35 PM, Bora

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-18 Thread Matthew Knepley
On Mon, Jul 18, 2022 at 7:35 PM Bora Jeong wrote: > Thank you for the reply. > > I am actually putting 1dof on the vertex points. > In the attached sample code, from line 63 to line 99, 1dof on all vertex > points is defined for the section. But my problem is, if I print out > Natural SF using th

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-18 Thread Blaise Bourdin
Alexis noticed a problem with the natural SF when constraints are defined. He has a MR coming.  @Alexis: Could it be that what Bora sees is exactly what you fixed? Blaise On Jul 18, 2022, at 8:35 PM, Bora Jeong wrote: Thank you for the reply.  I am act

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-18 Thread Bora Jeong
Thank you for the reply. I am actually putting 1dof on the vertex points. In the attached sample code, from line 63 to line 99, 1dof on all vertex points is defined for the section. But my problem is, if I print out Natural SF using the viewer, I only have 10 vertex points, instead of 15. Here 15

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-18 Thread Matthew Knepley
On Mon, Jul 18, 2022 at 4:30 PM Bora Jeong wrote: > Actually, it seems that my problem is that I do not properly understand > what Natural SF means. > > What I want to achieve is to extract natural vertex index from Natural SF, > and make sure this natural vertex index is the same with what is wr

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-18 Thread Matthew Knepley
On Mon, Jul 18, 2022 at 12:14 PM Bora Jeong wrote: > Thank you for the corrections. It works. > > However, I still have a problem. > I tested zero stratum for DMGetStratumIS() with the default depth label, > since the graph of vertex is needed. Then, PetscSFGetGraph() from the > Natural SF is cra

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-18 Thread Bora Jeong
Thank you for the corrections. It works. However, I still have a problem. I tested zero stratum for DMGetStratumIS() with the default depth label, since the graph of vertex is needed. Then, PetscSFGetGraph() from the Natural SF is crashed. I checked that pBcCompIS contains proper set of integers v

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-17 Thread Matthew Knepley
On Fri, Jul 15, 2022 at 7:05 PM Bora Jeong wrote: > I found that iroots() and ileaves() have size of nleaves and tested > through the attached sample code with the grid previously shared. Then I > get the results written in the attached monitor file. > > It seems ileaves(i)%rank and ileaves(i)%in

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-15 Thread Bora Jeong
I found that iroots() and ileaves() have size of nleaves and tested through the attached sample code with the grid previously shared. Then I get the results written in the attached monitor file. It seems ileaves(i)%rank and ileaves(i)%index at line 127 of the attached code have garbage values, dif

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-15 Thread Bora Jeong
Thank you for the reply. In that example, it seems that the sizes of each array are known values and are provided to PetscSFSetGraph() at line 63. How does it change if those sizes are unknown? When a mesh file is loaded to a dm and define PetscSF, those sizes might be unknown. In my test, If poin

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-15 Thread Matthew Knepley
On Fri, Jul 15, 2022 at 2:25 PM Bora Jeong wrote: > Thank you for the comments. Updated sample code is attached here; > DMPlexDistribute() is explicitly called and by defining a section before > mesh distribution, a Natural SF was able to be defined as found from > PetscSFView(). > > However, I a

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-15 Thread Matthew Knepley
On Fri, Jul 15, 2022 at 8:46 AM Bora Jeong wrote: > Okay, I got it what's happening. First, this very bright functionality of > petsc (the natural-global converting) needs to be documented in a better > way for sure. Currently, it is very difficult to use/follow this features > as an external use

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-15 Thread Bora Jeong
Okay, I got it what's happening. First, this very bright functionality of petsc (the natural-global converting) needs to be documented in a better way for sure. Currently, it is very difficult to use/follow this features as an external user. Hope this will move forward in a better way. Then next q

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-15 Thread Matthew Knepley
On Fri, Jul 15, 2022 at 7:17 AM Bora Jeong wrote: > A sample code for loading dm and declaring Natural SF from a sphere mesh > is attached here. PetscSFView() returns NULL from sf_nat. > The Global-to-Natural mapping relates global dofs to natural dofs. Thus, in order to compute this mapping the

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-15 Thread Bora Jeong
A sample code for loading dm and declaring Natural SF from a sphere mesh is attached here. PetscSFView() returns NULL from sf_nat. Best On Fri, Jul 15, 2022 at 6:39 AM Matthew Knepley wrote: > On Thu, Jul 14, 2022 at 8:25 PM Bora Jeong wrote: > >> Okay, I checked it and you are correct. In my

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-15 Thread Matthew Knepley
On Thu, Jul 14, 2022 at 8:25 PM Bora Jeong wrote: > Okay, I checked it and you are correct. In my case, simply, natural node > index can be identified by stacking all the preceding processor's numbers > of nodes for a particular processor, which is good due to simplicity. > However, one serious q

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-14 Thread Bora Jeong
Okay, I checked it and you are correct. In my case, simply, natural node index can be identified by stacking all the preceding processor's numbers of nodes for a particular processor, which is good due to simplicity. However, one serious question is why this is happening in my code? In other words,

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-14 Thread Matthew Knepley
On Thu, Jul 14, 2022 at 5:47 PM Bora Jeong wrote: > Thank you for the comments. I have these errors when I call PetscSFView() > after DMGetNaturalSF() > > [2]PETSC ERROR: - Error Message > -- > [2]PETSC ERROR: Null ar

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-14 Thread Bora Jeong
Thank you for the comments. I have these errors when I call PetscSFView() after DMGetNaturalSF() [2]PETSC ERROR: - Error Message -- [2]PETSC ERROR: Null argument, when expecting valid pointer [2]PETSC ERROR: Null Point

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-14 Thread Matthew Knepley
On Wed, Jul 13, 2022 at 10:17 PM Bora Jeong wrote: > Dear petsc team, > > I am a user of DMPlex for a finite volume code and there is a necessity to > know global index of each cell. Here the global index means the indexing > that can be found from a mesh file itself without distribution over > p

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-14 Thread Barry Smith
> On Jul 13, 2022, at 9:52 PM, Bora Jeong wrote: > > Dear petsc team, > > I am a user of DMPlex for a finite volume code and there is a necessity to > know global index of each cell. Here the global index means the indexing that > can be found from a mesh file itself without distribution

[petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-13 Thread Bora Jeong
Dear petsc team, I am a user of DMPlex for a finite volume code and there is a necessity to know global index of each cell. Here the global index means the indexing that can be found from a mesh file itself without distribution over processors. It seems petsc community denotes this indexing term a