<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Thank you very much. I do see correct normals now.<div><br></div><div>Is there a way to set the option</div><div><br></div><div><blockquote type="cite"><div dir="ltr" style="font-family: HelveticaNeue;"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;">-dm_localize_height 1</span></div></blockquote></div></div></blockquote><div><br></div>within the code ?</div><div><br></div><div>best</div><div>praveen<br><div><br><blockquote type="cite"><div>On 15-Dec-2022, at 9:53 PM, Matthew Knepley <knepley@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div dir="ltr">On Wed, Dec 14, 2022 at 9:20 AM Praveen C <<a href="mailto:praveen@gmx.net">praveen@gmx.net</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div>Hello<div><br></div><div>I tried this with the attached code but I still get wrong normals.</div><div><br></div><div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;">./dmplex -dm_plex_filename ug_periodic.msh -dm_localize_height 1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;"><br></span></div></div><div>Code and grid file are attached</div></div></blockquote><div><br></div><div>I have fixed the code. The above options should now work for you.</div><div><br></div><div>  Thanks,</div><div><br></div><div>      Matt</div><div> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div><div>Thank you</div><div>praveen</div><div><br></div><div></div></div><div><div></div></div><div><div><br><div><br><blockquote type="cite"><div>On 14-Dec-2022, at 6:40 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br><div><div dir="ltr" style="font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><div dir="ltr">On Wed, Dec 14, 2022 at 2:38 AM Praveen C <<a href="mailto:praveen@gmx.net" target="_blank">praveen@gmx.net</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div>Thank you, this MR works if I generate the mesh within the code.<div><br></div><div>But using a mesh made in gmsh, I see the same issue.</div></div></blockquote><div><br></div><div>Because the operations happen in a different order. If you read in your mesh with</div><div><br></div><div> <span class="Apple-converted-space"> </span>-dm_plex_filename mymesh.gmsh <span style="font-family: HelveticaNeue; font-size: 14px;">-dm_localize_height 1</span></div><div><br></div><div>then it should work.</div><div><br></div><div> <span> </span>Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div><div>Thanks</div><div>praveen</div><div><br><blockquote type="cite"><div>On 14-Dec-2022, at 12:51 AM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br><div><div dir="ltr" style="font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><div dir="ltr">On Tue, Dec 13, 2022 at 10:57 AM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr"><div dir="ltr">On Tue, Dec 13, 2022 at 6:11 AM Praveen C <<a href="mailto:praveen@gmx.net" target="_blank">praveen@gmx.net</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div>Hello<div><br></div><div>In the attached test, I read a small grid made in gmsh with periodic bc.</div><div><br></div><div>This is a 2d mesh.</div><div><br></div><div>The cell numbers are shown in the figure.</div><div><br></div><div>All faces have length = 2.5</div><div><br></div><div>But using <span style="font-family: Menlo; font-size: 15px;">PetscFVFaceGeom </span>I am getting length of 7.5 for some faces. E.g.,</div><div><br></div><div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;">face: 59, centroid = 3.750000, 2.500000, normal = 0.000000, -7.500000</span></div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;"><font color="#ff2600">===> Face length incorrect = 7.500000, should be 2.5</font></span></div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;">support[0] = 11, cent = 8.750000, 3.750000, area = 6.250000</span></div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;">support[1] = 15, cent = 8.750000, 1.250000, area = 6.250000</span></div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo;"><br></div><div>There are also errors in the orientation of normal.</div></div><div><br></div><div>If we disable periodicity in geo file, this error goes away.</div></div></blockquote><div><br></div><div>Yes, by default we only localize coordinates for cells. I can put in code to localize faces.</div></div></div></blockquote><div><br></div><div>Okay, I now have a MR for this: <a href="https://gitlab.com/petsc/petsc/-/merge_requests/5917" target="_blank">https://gitlab.com/petsc/petsc/-/merge_requests/5917</a></div><div><br></div><div>I am attaching your code, slightly modified. You can run</div><div><br></div><div>  ./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</div><div><br></div><div>which shows incorrect edges and</div><div><br></div><div>./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<br></div><div><br></div><div>which is correct. If you want to control things yourself, instead of using the option you can call DMPlexSetMaxProjectionHeight() on the coordinate DM yourself.</div><div><br></div><div> <span> </span>Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr"><div class="gmail_quote"><div> <span> </span>Thanks,</div><div><br></div><div>   <span> </span>Matt</div><div> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div><div>Thanks</div><div>praveen</div></div></blockquote></div>--<span> </span><br><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div></div></div></div></div></blockquote></div></div></div></blockquote></div><br></div></blockquote></div><br clear="all"><div><br></div>--<span> </span><br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></div><br></div></div></blockquote></div><br clear="all"><div><br></div>--<span class="Apple-converted-space"> </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></div><br></div></body></html>