<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: "Times New Roman", Times, serif, Times, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p>Dear Jed,</p>
<p><br>
</p>
<p>Thank you for your help!</p>
<p>Now I moved the line using "DMViewFromOptions" after the function "PetscDSSetObjective",</p>
<p>and it works for "<span style="font-family: "Times New Roman", Times, serif, Times, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">-dm_coord_petscspace_degree 3 -petscspace_degree
3".</span></p>
<p><br>
</p>
<p>But when I tried degree 4:</p>
<p><span>./ex33 -dm_plex_simplex 0 -dm_plex_box_faces 1,1 -mesh_transform annulus -dm_coord_space 0 -dm_coord_petscspace_degree 4 -petscspace_degree 4 -dm_refine 1 -dm_view cgns:test.cgns</span><br>
</p>
<p>Paraview gives an empty render.</p>
<p><br>
</p>
<p></p>
<p style="font-family: "Times New Roman", Times, serif, Times, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
Using degree 5:</p>
<p style="font-family: "Times New Roman", Times, serif, Times, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
./ex33 -dm_plex_simplex 0 -dm_plex_box_faces 1,1 -mesh_transform annulus -dm_coord_space 0 -dm_coord_petscspace_degree 5 -petscspace_degree 5 -dm_refine 1 -dm_view cgns:test.cgns</p>
<p style="font-family: "Times New Roman", Times, serif, Times, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
it reports:</p>
<p style="font-family: "Times New Roman", Times, serif, Times, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
<br>
</p>
<p style="font-family: "Times New Roman", Times, serif, Times, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
</p>
<div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div>
<div>[0]PETSC ERROR: No support for this operation for this object type</div>
<div>[0]PETSC ERROR: Cell type quadrilateral with closure size 36</div>
<div>[0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.</div>
<div>[0]PETSC ERROR: Petsc Release Version 3.19.2, unknown</div>
<div>[0]PETSC ERROR: ./ex33 on a arch-darwin-c-debug named JunmingMacBook-Pro.local by Junming Mon Jun 12 20:23:04 2023</div>
<div>[0]PETSC ERROR: Configure options --download-cgns --download-hdf5 --download-openmpi --download-triangle --with-fc=0 PETSC_ARCH=arch-darwin-c-debug --download-cgns</div>
<div>[0]PETSC ERROR: #1 DMPlexCGNSGetPermutation_Internal() at /Users/Junming/Packages/petsc/src/dm/impls/plex/cgns/plexcgns2.c:533</div>
<div>[0]PETSC ERROR: #2 DMView_PlexCGNS() at /Users/Junming/Packages/petsc/src/dm/impls/plex/cgns/plexcgns2.c:769</div>
<div>[0]PETSC ERROR: #3 DMView_Plex() at /Users/Junming/Packages/petsc/src/dm/impls/plex/plex.c:1801</div>
<div>[0]PETSC ERROR: #4 DMView() at /Users/Junming/Packages/petsc/src/dm/interface/dm.c:996</div>
<div>[0]PETSC ERROR: #5 PetscObjectView() at /Users/Junming/Packages/petsc/src/sys/objects/destroy.c:78</div>
<div>[0]PETSC ERROR: #6 PetscObjectViewFromOptions() at /Users/Junming/Packages/petsc/src/sys/objects/destroy.c:128</div>
<div>[0]PETSC ERROR: #7 DMViewFromOptions() at /Users/Junming/Packages/petsc/src/dm/interface/dm.c:940</div>
<div>[0]PETSC ERROR: #8 CreateDiscretization() at ex33.c:232</div>
<div>[0]PETSC ERROR: #9 main() at ex33.c:263</div>
<div>[0]PETSC ERROR: PETSc Option Table entries:</div>
<div>[0]PETSC ERROR: -dm_coord_petscspace_degree 5 (source: command line)</div>
<div>[0]PETSC ERROR: -dm_coord_space 0 (source: command line)</div>
<div>[0]PETSC ERROR: -dm_plex_box_faces 1,1 (source: command line)</div>
<div>[0]PETSC ERROR: -dm_plex_simplex 0 (source: command line)</div>
<div>[0]PETSC ERROR: -dm_refine 1 (source: command line)</div>
<div>[0]PETSC ERROR: -dm_view cgns:test.cgns (source: command line)</div>
<div>[0]PETSC ERROR: -mesh_transform annulus (source: command line)</div>
<div>[0]PETSC ERROR: -petscspace_degree 5 (source: command line)</div>
<div>[0]PETSC ERROR: ----------------End of Error Message -------send entire error message to petsc-maint@mcs.anl.gov----------</div>
<div>--------------------------------------------------------------------------</div>
<div>MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_SELF</div>
<div>with errorcode 56.</div>
<p></p>
<br>
<p></p>
<p>Does cgns work for degree >= 4?</p>
<p><br>
</p>
<p>Junming</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Jed Brown <jed@jedbrown.org><br>
<b>Sent:</b> Monday, June 12, 2023 19:07<br>
<b>To:</b> Duan Junming; Matthew Knepley<br>
<b>Cc:</b> petsc-users@mcs.anl.gov<br>
<b>Subject:</b> Re: [petsc-users] dm_view of high-order geometry/solution</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">And here's an MR to do what you want without any code/arg changes.<br>
<br>
<a href="https://gitlab.com/petsc/petsc/-/merge_requests/6588" id="LPlnk620834" previewremoved="true">https://gitlab.com/petsc/petsc/-/merge_requests/6588</a><br>
<br>
Jed Brown <jed@jedbrown.org> writes:<br>
<br>
> Duan Junming <junming.duan@epfl.ch> writes:<br>
><br>
>> Dear Jed,<br>
>><br>
>><br>
>> Thank you for the suggestion.<br>
>><br>
>> When I run tests/ex33.c with<br>
>><br>
>> ./ex33 -dm_plex_simplex 0 -dm_plex_box_faces 1,1 -mesh_transform annulus -dm_coord_space 0 -dm_coord_petscspace_degree 3 -dm_refine 1 -dm_view cgns:test.cgns<br>
>><br>
>> and load it using Paraview,<br>
>><br>
>> the mesh is still with straight lines.<br>
><br>
> Ah, the viewer is keyed on the field (since the CGNS as supported by Paraview specifies coordinates and fields in the same space). That doesn't exist in your case. If you apply this patch and add `-petscspace_degre 3` to your command, you'll see that high
order information is present. Paraview doesn't render as curves in all views, but it has the data.<br>
><br>
> diff --git i/src/dm/impls/plex/tests/ex33.c w/src/dm/impls/plex/tests/ex33.c<br>
> index 803095bc082..590facfa4f4 100644<br>
> --- i/src/dm/impls/plex/tests/ex33.c<br>
> +++ w/src/dm/impls/plex/tests/ex33.c<br>
> @@ -198,7 +198,6 @@ PetscErrorCode CreateMesh(MPI_Comm comm, AppCtx *ctx, DM *dm)<br>
> default:<br>
> SETERRQ(comm, PETSC_ERR_ARG_OUTOFRANGE, "Unknown mesh transform %d", ctx->meshTransform);<br>
> }<br>
> - PetscCall(DMViewFromOptions(*dm, NULL, "-dm_view"));<br>
> PetscFunctionReturn(PETSC_SUCCESS);<br>
> }<br>
> <br>
> @@ -227,6 +226,7 @@ static PetscErrorCode CreateDiscretization(DM dm, AppCtx *ctx)<br>
> PetscCall(DMCreateDS(dm));<br>
> PetscCall(DMGetDS(dm, &ds));<br>
> PetscCall(PetscDSSetObjective(ds, 0, volume));<br>
> + PetscCall(DMViewFromOptions(dm, NULL, "-dm_view"));<br>
> PetscFunctionReturn(PETSC_SUCCESS);<br>
> }<br>
> <br>
><br>
> I can update the viewer to handle the degenerate case of no field (all my models have fields).<br>
</div>
</span></font></div>
</div>
</body>
</html>