<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Yes, the file "sami.vtu" is loaded correctly in paraview and I have the good output like you.<div class=""><br class=""></div><div class="">In my code, I tried with the same command given in your last answer and I still have the wrong .vtu file.</div><div class="">I use this:<br class=""><div class="">mpirun -np 1 /home/benelhasa/fox_petsc/build_test/bin/Debug/FoXtroT -snes_test_jacobian_view -snes_converged_reason -snes_monitor -ksp_monitor -ksp_xmonitor -dm_plex_filename cub_2C3D8_msh.msh -dm_view vtk:cub_2C3D8_msh.vtu cub_8C3D8.fxt</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Sami,</div><div class=""><br class=""><div class="">
<meta charset="UTF-8" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">--</div><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Dr. Sami BEN ELHAJ SALAH<br class="">Ingénieur de Recherche (CNRS)<br class="">Institut Pprime - ISAE - ENSMA<br class="">Mobile: 06.62.51.26.74<br class=""><a href="mailto:sami.ben-elhaj-salah@ensma.fr" class="">Email: sami.ben-elhaj-salah@ensma.fr</a></div><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><a href="https://samiben91.github.io/samibenelhajsalah/index.html" class="">www.samibenelhajsalah.com</a><br class=""><br class=""><br class=""></div></div></div></div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">Le 8 juin 2022 à 16:25, Jed Brown <<a href="mailto:jed@jedbrown.org" class="">jed@jedbrown.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; float: none; display: inline !important;" class="">Does the file load in paraview? When I load your *.msh in a tutorial with -dm_plex_filename sami.msh -dm_view vtk:sami.vtu, I get this good output.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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;" class=""><span id="cid:9141E41F-766F-4335-99D2-04F631D6CB6F"><sami.vtu></span><span id="cid:0CECECD3-7616-4FB0-A886-99D8B7F7FC11"><sami.png></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; float: none; display: inline !important;" class="">Sami BEN ELHAJ SALAH <</span><a href="mailto:sami.ben-elhaj-salah@ensma.fr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">sami.ben-elhaj-salah@ensma.fr</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; float: none; display: inline !important;" class="">> writes:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Hi Jed,<br class=""><br class="">Thank you for your answer.<br class=""><br class="">When I use a ‘’solution.vtu'', I obtain a wrong file.<span class="Apple-converted-space"> </span><br class=""><br class=""><?xml version="1.0"?><br class=""><VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian"><br class=""><UnstructuredGrid><br class=""><Piece NumberOfPoints="12" NumberOfCells="2"><br class=""><Points><br class=""><DataArray type="Float64" Name="Position" NumberOfComponents="3" format="appended" offset="0" /><br class=""></Points><br class=""><Cells><br class=""><DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="appended" offset="292" /><br class=""><DataArray type="Int32" Name="offsets" NumberOfComponents="1" format="appended" offset="360" /><br class=""><DataArray type="UInt8" Name="types" NumberOfComponents="1" format="appended" offset="372" /><br class=""></Cells><br class=""><CellData><br class=""><DataArray type="Int32" Name="Rank" NumberOfComponents="1" format="appended" offset="378" /><br class=""></CellData><br class=""><PointData><br class=""><DataArray type="Float64" Name="dU_x(null)" NumberOfComponents="3" format="appended" offset="390" /><br class=""></PointData><br class=""></Piece><br class=""></UnstructuredGrid><br class=""><AppendedData encoding="raw"><br class="">_ $@$@$@$@$@$@$@$@$@$@$@$@4@$@$@4@$@4@4@$@@<span class="Apple-tab-span" style="white-space: pre;"> </span><br class=""> �p�O��=��sT����sT���p�O��=��sT���=��sT���p�O��=��sT���=��sT���=�p�O��=��sT����sT���=o_��?��uP����uP��o_��?��uP�?��uP��o_��?��uP�?��uP�?o_��?��uP����uP�?b#�����?�333����333��_#�����?<span class="Apple-tab-span" style="white-space: pre;"> </span>�333�?��333��b#�����?(�333�?'�333�?a#�����?�333��>�333�?<br class=""></AppendedData><br class=""></VTKFile><br class=""><br class=""><br class="">If I understand your answer, to solve my problem, should just upgrade all my software ?<br class=""><br class="">Thanks,<br class="">Sami,<br class=""><br class=""><br class="">--<br class="">Dr. Sami BEN ELHAJ SALAH<br class="">Ingénieur de Recherche (CNRS)<br class="">Institut Pprime - ISAE - ENSMA<br class="">Mobile: 06.62.51.26.74<br class=""><a href="mailto:sami.ben-elhaj-salah@ensma.fr" class="">Email: sami.ben-elhaj-salah@ensma.fr</a><br class=""><a href="http://www.samibenelhajsalah.com/" class="">www.samibenelhajsalah.com</a><span class="Apple-converted-space"> </span><<a href="https://samiben91.github.io/samibenelhajsalah/index.html" class="">https://samiben91.github.io/samibenelhajsalah/index.html</a>><br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">Le 8 juin 2022 à 15:37, Jed Brown <jed@jedbrown.org> a écrit :<br class=""><br class="">You're using pretty old versions of all software; I'd recommend upgrading. I recommend choosing the file name "solution.vtu" to use the modern (non-legacy) format. Does that work for you?<br class=""><br class="">Sami BEN ELHAJ SALAH <sami.ben-elhaj-salah@ensma.fr> writes:<br class=""><br class=""><blockquote type="cite" class="">Dear Petsc Developer team,<br class=""><br class="">I solved a linear elastic problem in 3D using a DMPLEX. My system is converging, then I would like to write out my solution vector to a vtk file where I use unstructured mesh. Currently, I tried two algorithms and I have the same result.<br class=""><br class="">1) Algorithm 1<span class="Apple-converted-space"> </span><br class="">err = SNESSolve(_snes, bc_vec_test, solution);<br class="">CHKERRABORT(FOX::Parallel::COMM_WORLD,err);<br class="">PetscViewer vtk;<span class="Apple-converted-space"> </span><br class="">PetscViewerVTKOpen(FOX::Parallel::COMM_WORLD,"solution.vtk",FILE_MODE_WRITE,&vtk);<span class="Apple-converted-space"> </span><br class="">VecView(solution,vtk);<br class="">PetscViewerDestroy(&vtk);<br class=""><br class=""><br class="">2) Algorithm 2<br class="">err = SNESSolve(_snes, bc_vec_test, solution);<br class="">CHKERRABORT(FOX::Parallel::COMM_WORLD,err);<br class="">PetscViewer vtk;<span class="Apple-converted-space"> </span><br class="">PetscViewerCreate(FOX::Parallel::COMM_WORLD, &vtk);<span class="Apple-converted-space"> </span><br class="">PetscViewerSetType(vtk, PETSCVIEWERVTK);<span class="Apple-converted-space"> </span><br class="">PetscViewerFileSetName(vtk, "sol.vtk");<span class="Apple-converted-space"> </span><br class="">VecView(solution, vtk);<span class="Apple-converted-space"> </span><br class="">PetscViewerDestroy(&vtk);<br class=""><br class="">The result seems correct except for the rotation order of the nodes (see the red lines on gmsh and vtk file respectively). Then, I visualized my vtk file with paraview, and I remarked that my geometry is not correct and not conserved when comparing it with my gmsh file. So, I didn’t understand why the rotation order of nodes is not conserved when saving my result to a vtk file?<br class=""><br class="">Other information used:<br class="">- gmsh format 2.2<span class="Apple-converted-space"> </span><br class="">- Vtk version: 7.1.1<br class="">- Petsc version: 3.13/opt<span class="Apple-converted-space"> </span><br class=""><br class="">Below my two files gmsh and vtk:<br class=""><br class="">Gmsh file:<br class="">$MeshFormat<br class="">2.2 0 8<br class="">$EndMeshFormat<br class="">$Nodes<br class="">12<br class="">1 0.0 10.0 10.0<br class="">2 0.0 0.0 10.0<br class="">3 0.0 0.0 0.0<br class="">4 0.0 10.0 0.0<br class="">5 10.0 10.0 10.0<br class="">6 10.0 0.0 10.0<br class="">7 10.0 0.0 0.0<br class="">8 10.0 10.0 0.0<br class="">9 20.0 10.0 10.0<br class="">10 20.0 0.0 10.0<br class="">11 20.0 0.0 0.0<br class="">12 20.0 10.0 0.0<br class="">$EndNodes<br class="">$Elements<br class="">2<br class="">1 5 2 68 60 1 2 3 4 5 6 7 8<br class="">2 5 2 68 60 5 6 7 8 9 10 11 12<br class="">$EndElements<br class=""><br class="">Vtk file :<br class=""># vtk DataFile Version 2.0<br class="">Simplicial Mesh Example<br class="">ASCII<br class="">DATASET UNSTRUCTURED_GRID<br class="">POINTS 12 double<br class="">0.000000e+00 1.000000e+01 1.000000e+01<br class="">0.000000e+00 0.000000e+00 1.000000e+01<br class="">0.000000e+00 0.000000e+00 0.000000e+00<br class="">0.000000e+00 1.000000e+01 0.000000e+00<br class="">1.000000e+01 1.000000e+01 1.000000e+01<br class="">1.000000e+01 0.000000e+00 1.000000e+01<br class="">1.000000e+01 0.000000e+00 0.000000e+00<br class="">1.000000e+01 1.000000e+01 0.000000e+00<br class="">2.000000e+01 1.000000e+01 1.000000e+01<br class="">2.000000e+01 0.000000e+00 1.000000e+01<br class="">2.000000e+01 0.000000e+00 0.000000e+00<br class="">2.000000e+01 1.000000e+01 0.000000e+00<br class="">CELLS 2 18<br class="">8 0 3 2 1 4 5 6 7<br class="">8 4 7 6 5 8 9 10 11<br class="">CELL_TYPES 2<br class="">12<br class="">12<br class="">POINT_DATA 12<br class="">VECTORS dU_x double<br class="">2.754808e-10 -8.653846e-11 -8.653846e-11<br class="">2.754808e-10 8.653846e-11 -8.653846e-11<br class="">2.754808e-10 8.653846e-11 8.653846e-11<br class="">2.754808e-10 -8.653846e-11 8.653846e-11<br class="">4.678571e-01 -9.107143e-02 -9.107143e-02<br class="">4.678571e-01 9.107143e-02 -9.107143e-02<br class="">4.678571e-01 9.107143e-02 9.107143e-02<br class="">4.678571e-01 -9.107143e-02 9.107143e-02<br class="">1.000000e+00 -7.500000e-02 -7.500000e-02<br class="">1.000000e+00 7.500000e-02 -7.500000e-02<br class="">1.000000e+00 7.500000e-02 7.500000e-02<br class="">1.000000e+00 -7.500000e-02 7.500000e-02<br class=""><br class="">Thank you in advance and have a good day !<br class=""><br class="">Sami,<br class=""><br class="">--<br class="">Dr. Sami BEN ELHAJ SALAH<br class="">Ingénieur de Recherche (CNRS)<br class="">Institut Pprime - ISAE - ENSMA<br class="">Mobile: 06.62.51.26.74<br class="">Email: sami.ben-elhaj-salah@ensma.fr<br class="">www.samibenelhajsalah.com <https://samiben91.github.io/samibenelhajsalah/index.html></blockquote></blockquote></blockquote></div></blockquote></div><br class=""></div></div></body></html>