Re: [petsc-users] dmplex normal vector incorrect for periodic gmsh grids

2022-12-18 Thread Matthew Knepley
On Sun, Dec 18, 2022 at 9:21 AM Jed Brown  wrote:

> Matthew Knepley  writes:
>
> > On Fri, Dec 16, 2022 at 12:22 AM Praveen C  wrote:
> >
> >> Thank you very much. I do see correct normals now.
> >>
> >> Is there a way to set the option
> >>
> >> -dm_localize_height 1
> >>>
> >>
> >> within the code ?
> >>
> >
> > The problem is that the localization happens within the Gmsh
> construction,
> > so it is difficult to insert an API.
> > We could use a callback, but that rapidly becomes unwieldy. If you want
> to
> > do it programmatically, I would use
> > PetscOptionsSetValue().
>
> Can it not be created explicitly later?
>
> This kind of thing isn't really a run-time choice, but rather a statement
> about the way the calling code has been written.
>

You could tear down the localization, then set the height, and recreate the
localization.

  Thanks,

 Matt

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ 


Re: [petsc-users] dmplex normal vector incorrect for periodic gmsh grids

2022-12-18 Thread Jed Brown
Matthew Knepley  writes:

> On Fri, Dec 16, 2022 at 12:22 AM Praveen C  wrote:
>
>> Thank you very much. I do see correct normals now.
>>
>> Is there a way to set the option
>>
>> -dm_localize_height 1
>>>
>>
>> within the code ?
>>
>
> The problem is that the localization happens within the Gmsh construction,
> so it is difficult to insert an API.
> We could use a callback, but that rapidly becomes unwieldy. If you want to
> do it programmatically, I would use
> PetscOptionsSetValue().

Can it not be created explicitly later?

This kind of thing isn't really a run-time choice, but rather a statement about 
the way the calling code has been written.


Re: [petsc-users] dmplex normal vector incorrect for periodic gmsh grids

2022-12-16 Thread Matthew Knepley
On Fri, Dec 16, 2022 at 12:22 AM Praveen C  wrote:

> Thank you very much. I do see correct normals now.
>
> Is there a way to set the option
>
> -dm_localize_height 1
>>
>
> within the code ?
>

The problem is that the localization happens within the Gmsh construction,
so it is difficult to insert an API.
We could use a callback, but that rapidly becomes unwieldy. If you want to
do it programmatically, I would use
PetscOptionsSetValue().

  Thanks,

  Matt


> best
> praveen
>
> On 15-Dec-2022, at 9:53 PM, Matthew Knepley  wrote:
>
> On Wed, Dec 14, 2022 at 9:20 AM Praveen C  wrote:
>
>> Hello
>>
>> I tried this with the attached code but I still get wrong normals.
>>
>> ./dmplex -dm_plex_filename ug_periodic.msh -dm_localize_height 1
>>
>> Code and grid file are attached
>>
>
> I have fixed the code. The above options should now work for you.
>
>   Thanks,
>
>   Matt
>
>
>> Thank you
>> praveen
>>
>>
>>
>> On 14-Dec-2022, at 6:40 PM, Matthew Knepley  wrote:
>>
>> On Wed, Dec 14, 2022 at 2:38 AM Praveen C  wrote:
>>
>>> Thank you, this MR works if I generate the mesh within the code.
>>>
>>> But using a mesh made in gmsh, I see the same issue.
>>>
>>
>> Because the operations happen in a different order. If you read in your
>> mesh with
>>
>>   -dm_plex_filename mymesh.gmsh -dm_localize_height 1
>>
>> then it should work.
>>
>>   Thanks,
>>
>>  Matt
>>
>>
>>> Thanks
>>> praveen
>>>
>>> On 14-Dec-2022, at 12:51 AM, Matthew Knepley  wrote:
>>>
>>> On Tue, Dec 13, 2022 at 10:57 AM Matthew Knepley 
>>> wrote:
>>>
 On Tue, Dec 13, 2022 at 6:11 AM Praveen C  wrote:

> Hello
>
> In the attached test, I read a small grid made in gmsh with periodic
> bc.
>
> This is a 2d mesh.
>
> The cell numbers are shown in the figure.
>
> All faces have length = 2.5
>
> But using PetscFVFaceGeom I am getting length of 7.5 for some faces.
> E.g.,
>
> face: 59, centroid = 3.75, 2.50, normal = 0.00, -7.50
> ===> Face length incorrect = 7.50, should be 2.5
> support[0] = 11, cent = 8.75, 3.75, area = 6.25
> support[1] = 15, cent = 8.75, 1.25, area = 6.25
>
> There are also errors in the orientation of normal.
>
> If we disable periodicity in geo file, this error goes away.
>

 Yes, by default we only localize coordinates for cells. I can put in
 code to localize faces.

>>>
>>> Okay, I now have a MR for this:
>>> https://gitlab.com/petsc/petsc/-/merge_requests/5917
>>>
>>> I am attaching your code, slightly modified. You can run
>>>
>>>   ./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces
>>> 4,4 -dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3
>>> -dm_plex_box_bd periodic,periodic -dm_localize_height 0
>>>
>>> which shows incorrect edges and
>>>
>>> ./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces 4,4
>>> -dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3
>>> -dm_plex_box_bd periodic,periodic -dm_localize_height 1
>>>
>>> which is correct. If you want to control things yourself, instead of
>>> using the option you can call DMPlexSetMaxProjectionHeight() on the
>>> coordinate DM yourself.
>>>
>>>   Thanks,
>>>
>>>  Matt
>>>
>>>
   Thanks,

 Matt


> Thanks
> praveen
>
 --


>>>
>>
>> --
>> What most experimenters take for granted before they begin their
>> experiments is infinitely more interesting than any results to which their
>> experiments lead.
>> -- Norbert Wiener
>>
>> https://www.cse.buffalo.edu/~knepley/
>> 
>>
>>
>>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> 
>
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ 


Re: [petsc-users] dmplex normal vector incorrect for periodic gmsh grids

2022-12-15 Thread Praveen C
Thank you very much. I do see correct normals now.

Is there a way to set the option

>> -dm_localize_height 1

within the code ?

best
praveen

> On 15-Dec-2022, at 9:53 PM, Matthew Knepley  wrote:
> 
> On Wed, Dec 14, 2022 at 9:20 AM Praveen C  > wrote:
>> Hello
>> 
>> I tried this with the attached code but I still get wrong normals.
>> 
>> ./dmplex -dm_plex_filename ug_periodic.msh -dm_localize_height 1
>> 
>> Code and grid file are attached
> 
> I have fixed the code. The above options should now work for you.
> 
>   Thanks,
> 
>   Matt
>  
>> Thank you
>> praveen
>> 
>> 
>> 
>>> On 14-Dec-2022, at 6:40 PM, Matthew Knepley >> > wrote:
>>> 
>>> On Wed, Dec 14, 2022 at 2:38 AM Praveen C >> > wrote:
 Thank you, this MR works if I generate the mesh within the code.
 
 But using a mesh made in gmsh, I see the same issue.
>>> 
>>> Because the operations happen in a different order. If you read in your 
>>> mesh with
>>> 
>>>   -dm_plex_filename mymesh.gmsh -dm_localize_height 1
>>> 
>>> then it should work.
>>> 
>>>   Thanks,
>>> 
>>>  Matt
>>>  
 Thanks
 praveen
 
> On 14-Dec-2022, at 12:51 AM, Matthew Knepley  > wrote:
> 
> On Tue, Dec 13, 2022 at 10:57 AM Matthew Knepley  > wrote:
>> On Tue, Dec 13, 2022 at 6:11 AM Praveen C > > wrote:
>>> Hello
>>> 
>>> In the attached test, I read a small grid made in gmsh with periodic bc.
>>> 
>>> This is a 2d mesh.
>>> 
>>> The cell numbers are shown in the figure.
>>> 
>>> All faces have length = 2.5
>>> 
>>> But using PetscFVFaceGeom I am getting length of 7.5 for some faces. 
>>> E.g.,
>>> 
>>> face: 59, centroid = 3.75, 2.50, normal = 0.00, -7.50
>>> ===> Face length incorrect = 7.50, should be 2.5
>>> support[0] = 11, cent = 8.75, 3.75, area = 6.25
>>> support[1] = 15, cent = 8.75, 1.25, area = 6.25
>>> 
>>> There are also errors in the orientation of normal.
>>> 
>>> If we disable periodicity in geo file, this error goes away.
>> 
>> Yes, by default we only localize coordinates for cells. I can put in 
>> code to localize faces.
> 
> Okay, I now have a MR for this: 
> https://gitlab.com/petsc/petsc/-/merge_requests/5917
> 
> I am attaching your code, slightly modified. You can run
> 
>   ./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces 
> 4,4 -dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3 
> -dm_plex_box_bd periodic,periodic -dm_localize_height 0
> 
> which shows incorrect edges and
> 
> ./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces 4,4 
> -dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3 
> -dm_plex_box_bd periodic,periodic -dm_localize_height 1
> 
> which is correct. If you want to control things yourself, instead of 
> using the option you can call DMPlexSetMaxProjectionHeight() on the 
> coordinate DM yourself.
> 
>   Thanks,
> 
>  Matt
>  
>>   Thanks,
>> 
>> Matt
>>  
>>> Thanks
>>> praveen
>> -- 
>> 
 
>>> 
>>> 
>>> -- 
>>> What most experimenters take for granted before they begin their 
>>> experiments is infinitely more interesting than any results to which their 
>>> experiments lead.
>>> -- Norbert Wiener
>>> 
>>> https://www.cse.buffalo.edu/~knepley/ 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments 
> is infinitely more interesting than any results to which their experiments 
> lead.
> -- Norbert Wiener
> 
> https://www.cse.buffalo.edu/~knepley/ 


Re: [petsc-users] dmplex normal vector incorrect for periodic gmsh grids

2022-12-15 Thread Matthew Knepley
On Wed, Dec 14, 2022 at 9:20 AM Praveen C  wrote:

> Hello
>
> I tried this with the attached code but I still get wrong normals.
>
> ./dmplex -dm_plex_filename ug_periodic.msh -dm_localize_height 1
>
>
> Code and grid file are attached
>

I have fixed the code. The above options should now work for you.

  Thanks,

  Matt


> Thank you
> praveen
>
>
>
> On 14-Dec-2022, at 6:40 PM, Matthew Knepley  wrote:
>
> On Wed, Dec 14, 2022 at 2:38 AM Praveen C  wrote:
>
>> Thank you, this MR works if I generate the mesh within the code.
>>
>> But using a mesh made in gmsh, I see the same issue.
>>
>
> Because the operations happen in a different order. If you read in your
> mesh with
>
>   -dm_plex_filename mymesh.gmsh -dm_localize_height 1
>
> then it should work.
>
>   Thanks,
>
>  Matt
>
>
>> Thanks
>> praveen
>>
>> On 14-Dec-2022, at 12:51 AM, Matthew Knepley  wrote:
>>
>> On Tue, Dec 13, 2022 at 10:57 AM Matthew Knepley 
>> wrote:
>>
>>> On Tue, Dec 13, 2022 at 6:11 AM Praveen C  wrote:
>>>
 Hello

 In the attached test, I read a small grid made in gmsh with periodic bc.

 This is a 2d mesh.

 The cell numbers are shown in the figure.

 All faces have length = 2.5

 But using PetscFVFaceGeom I am getting length of 7.5 for some faces.
 E.g.,

 face: 59, centroid = 3.75, 2.50, normal = 0.00, -7.50
 ===> Face length incorrect = 7.50, should be 2.5
 support[0] = 11, cent = 8.75, 3.75, area = 6.25
 support[1] = 15, cent = 8.75, 1.25, area = 6.25

 There are also errors in the orientation of normal.

 If we disable periodicity in geo file, this error goes away.

>>>
>>> Yes, by default we only localize coordinates for cells. I can put in
>>> code to localize faces.
>>>
>>
>> Okay, I now have a MR for this:
>> https://gitlab.com/petsc/petsc/-/merge_requests/5917
>>
>> I am attaching your code, slightly modified. You can run
>>
>>   ./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces
>> 4,4 -dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3
>> -dm_plex_box_bd periodic,periodic -dm_localize_height 0
>>
>> which shows incorrect edges and
>>
>> ./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces 4,4
>> -dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3
>> -dm_plex_box_bd periodic,periodic -dm_localize_height 1
>>
>> which is correct. If you want to control things yourself, instead of
>> using the option you can call DMPlexSetMaxProjectionHeight() on the
>> coordinate DM yourself.
>>
>>   Thanks,
>>
>>  Matt
>>
>>
>>>   Thanks,
>>>
>>> Matt
>>>
>>>
 Thanks
 praveen

>>> --
>>>
>>>
>>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> 
>
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ 


Re: [petsc-users] dmplex normal vector incorrect for periodic gmsh grids

2022-12-14 Thread Praveen C
HelloI tried this with the attached code but I still get wrong normals../dmplex -dm_plex_filename ug_periodic.msh -dm_localize_height 1Code and grid file are attachedThank youpraveen

dmplex.c
Description: Binary data


ug_periodic.msh
Description: Binary data
On 14-Dec-2022, at 6:40 PM, Matthew Knepley  wrote:On Wed, Dec 14, 2022 at 2:38 AM Praveen C  wrote:Thank you, this MR works if I generate the mesh within the code.But using a mesh made in gmsh, I see the same issue.Because the operations happen in a different order. If you read in your mesh with  -dm_plex_filename mymesh.gmsh -dm_localize_height 1then it should work.  Thanks,     Matt ThankspraveenOn 14-Dec-2022, at 12:51 AM, Matthew Knepley  wrote:On Tue, Dec 13, 2022 at 10:57 AM Matthew Knepley  wrote:On Tue, Dec 13, 2022 at 6:11 AM Praveen C  wrote:HelloIn the attached test, I read a small grid made in gmsh with periodic bc.This is a 2d mesh.The cell numbers are shown in the figure.All faces have length = 2.5But using PetscFVFaceGeom I am getting length of 7.5 for some faces. E.g.,face: 59, centroid = 3.75, 2.50, normal = 0.00, -7.50===> Face length incorrect = 7.50, should be 2.5support[0] = 11, cent = 8.75, 3.75, area = 6.25support[1] = 15, cent = 8.75, 1.25, area = 6.25There are also errors in the orientation of normal.If we disable periodicity in geo file, this error goes away.Yes, by default we only localize coordinates for cells. I can put in code to localize faces.Okay, I now have a MR for this: https://gitlab.com/petsc/petsc/-/merge_requests/5917I am attaching your code, slightly modified. You can run  ./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces 4,4 -dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3 -dm_plex_box_bd periodic,periodic -dm_localize_height 0which shows incorrect edges and./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces 4,4 -dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3 -dm_plex_box_bd periodic,periodic -dm_localize_height 1which is correct. If you want to control things yourself, instead of using the option you can call DMPlexSetMaxProjectionHeight() on the coordinate DM yourself.  Thanks,     Matt   Thanks,    Matt Thankspraveen-- -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.-- Norbert Wienerhttps://www.cse.buffalo.edu/~knepley/

Re: [petsc-users] dmplex normal vector incorrect for periodic gmsh grids

2022-12-14 Thread Matthew Knepley
On Wed, Dec 14, 2022 at 2:38 AM Praveen C  wrote:

> Thank you, this MR works if I generate the mesh within the code.
>
> But using a mesh made in gmsh, I see the same issue.
>

Because the operations happen in a different order. If you read in your
mesh with

  -dm_plex_filename mymesh.gmsh -dm_localize_height 1

then it should work.

  Thanks,

 Matt


> Thanks
> praveen
>
> On 14-Dec-2022, at 12:51 AM, Matthew Knepley  wrote:
>
> On Tue, Dec 13, 2022 at 10:57 AM Matthew Knepley 
> wrote:
>
>> On Tue, Dec 13, 2022 at 6:11 AM Praveen C  wrote:
>>
>>> Hello
>>>
>>> In the attached test, I read a small grid made in gmsh with periodic bc.
>>>
>>> This is a 2d mesh.
>>>
>>> The cell numbers are shown in the figure.
>>>
>>> All faces have length = 2.5
>>>
>>> But using PetscFVFaceGeom I am getting length of 7.5 for some faces.
>>> E.g.,
>>>
>>> face: 59, centroid = 3.75, 2.50, normal = 0.00, -7.50
>>> ===> Face length incorrect = 7.50, should be 2.5
>>> support[0] = 11, cent = 8.75, 3.75, area = 6.25
>>> support[1] = 15, cent = 8.75, 1.25, area = 6.25
>>>
>>> There are also errors in the orientation of normal.
>>>
>>> If we disable periodicity in geo file, this error goes away.
>>>
>>
>> Yes, by default we only localize coordinates for cells. I can put in code
>> to localize faces.
>>
>
> Okay, I now have a MR for this:
> https://gitlab.com/petsc/petsc/-/merge_requests/5917
>
> I am attaching your code, slightly modified. You can run
>
>   ./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces 4,4
> -dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3
> -dm_plex_box_bd periodic,periodic -dm_localize_height 0
>
> which shows incorrect edges and
>
> ./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces 4,4
> -dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3
> -dm_plex_box_bd periodic,periodic -dm_localize_height 1
>
> which is correct. If you want to control things yourself, instead of using
> the option you can call DMPlexSetMaxProjectionHeight() on the coordinate DM
> yourself.
>
>   Thanks,
>
>  Matt
>
>
>>   Thanks,
>>
>> Matt
>>
>>
>>> Thanks
>>> praveen
>>>
>> --
>>
>>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ 


Re: [petsc-users] dmplex normal vector incorrect for periodic gmsh grids

2022-12-13 Thread Praveen C
Thank you, this MR works if I generate the mesh within the code.

But using a mesh made in gmsh, I see the same issue.

Thanks
praveen

> On 14-Dec-2022, at 12:51 AM, Matthew Knepley  wrote:
> 
> On Tue, Dec 13, 2022 at 10:57 AM Matthew Knepley  > wrote:
>> On Tue, Dec 13, 2022 at 6:11 AM Praveen C > > wrote:
>>> Hello
>>> 
>>> In the attached test, I read a small grid made in gmsh with periodic bc.
>>> 
>>> This is a 2d mesh.
>>> 
>>> The cell numbers are shown in the figure.
>>> 
>>> All faces have length = 2.5
>>> 
>>> But using PetscFVFaceGeom I am getting length of 7.5 for some faces. E.g.,
>>> 
>>> face: 59, centroid = 3.75, 2.50, normal = 0.00, -7.50
>>> ===> Face length incorrect = 7.50, should be 2.5
>>> support[0] = 11, cent = 8.75, 3.75, area = 6.25
>>> support[1] = 15, cent = 8.75, 1.25, area = 6.25
>>> 
>>> There are also errors in the orientation of normal.
>>> 
>>> If we disable periodicity in geo file, this error goes away.
>> 
>> Yes, by default we only localize coordinates for cells. I can put in code to 
>> localize faces.
> 
> Okay, I now have a MR for this: 
> https://gitlab.com/petsc/petsc/-/merge_requests/5917
> 
> I am attaching your code, slightly modified. You can run
> 
>   ./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces 4,4 
> -dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3 -dm_plex_box_bd 
> periodic,periodic -dm_localize_height 0
> 
> which shows incorrect edges and
> 
> ./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces 4,4 
> -dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3 -dm_plex_box_bd 
> periodic,periodic -dm_localize_height 1
> 
> which is correct. If you want to control things yourself, instead of using 
> the option you can call DMPlexSetMaxProjectionHeight() on the coordinate DM 
> yourself.
> 
>   Thanks,
> 
>  Matt
>  
>>   Thanks,
>> 
>> Matt
>>  
>>> Thanks
>>> praveen
>> -- 
>> 



Re: [petsc-users] dmplex normal vector incorrect for periodic gmsh grids

2022-12-13 Thread Matthew Knepley
On Tue, Dec 13, 2022 at 10:57 AM Matthew Knepley  wrote:

> On Tue, Dec 13, 2022 at 6:11 AM Praveen C  wrote:
>
>> Hello
>>
>> In the attached test, I read a small grid made in gmsh with periodic bc.
>>
>> This is a 2d mesh.
>>
>> The cell numbers are shown in the figure.
>>
>> All faces have length = 2.5
>>
>> But using PetscFVFaceGeom I am getting length of 7.5 for some faces.
>> E.g.,
>>
>> face: 59, centroid = 3.75, 2.50, normal = 0.00, -7.50
>>
>> ===> Face length incorrect = 7.50, should be 2.5
>>
>> support[0] = 11, cent = 8.75, 3.75, area = 6.25
>>
>> support[1] = 15, cent = 8.75, 1.25, area = 6.25
>>
>>
>> There are also errors in the orientation of normal.
>>
>> If we disable periodicity in geo file, this error goes away.
>>
>
> Yes, by default we only localize coordinates for cells. I can put in code
> to localize faces.
>

Okay, I now have a MR for this:
https://gitlab.com/petsc/petsc/-/merge_requests/5917

I am attaching your code, slightly modified. You can run

  ./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces 4,4
-dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3
-dm_plex_box_bd periodic,periodic -dm_localize_height 0

which shows incorrect edges and

./dmplex -malloc_debug 0 -dm_plex_box_upper 10,10 -dm_plex_box_faces 4,4
-dm_plex_simplex 0 -dm_view ::ascii_info_detail -draw_pause 3
-dm_plex_box_bd periodic,periodic -dm_localize_height 1

which is correct. If you want to control things yourself, instead of using
the option you can call DMPlexSetMaxProjectionHeight() on the coordinate DM
yourself.

  Thanks,

 Matt


>   Thanks,
>
> Matt
>
>
>> Thanks
>> praveen
>>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> 
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ 


dmplex.c
Description: Binary data


Re: [petsc-users] dmplex normal vector incorrect for periodic gmsh grids

2022-12-13 Thread Matthew Knepley
On Tue, Dec 13, 2022 at 6:11 AM Praveen C  wrote:

> Hello
>
> In the attached test, I read a small grid made in gmsh with periodic bc.
>
> This is a 2d mesh.
>
> The cell numbers are shown in the figure.
>
> All faces have length = 2.5
>
> But using PetscFVFaceGeom I am getting length of 7.5 for some faces. E.g.,
>
> face: 59, centroid = 3.75, 2.50, normal = 0.00, -7.50
>
> ===> Face length incorrect = 7.50, should be 2.5
>
> support[0] = 11, cent = 8.75, 3.75, area = 6.25
>
> support[1] = 15, cent = 8.75, 1.25, area = 6.25
>
>
> There are also errors in the orientation of normal.
>
> If we disable periodicity in geo file, this error goes away.
>

Yes, by default we only localize coordinates for cells. I can put in code
to localize faces.

  Thanks,

Matt


> Thanks
> praveen
>
-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/