Re: [petsc-users] DMPlex export to hdf5/vtk for triangle/prism mesh
hi, I was asking about support for exactly these 6-node wedge elements in DMPlex back in January. At the time, there was no support for them. Has there been some progress since then? We are going to need them before we can release our software, which we're aiming to do by the end of the year. Cheers, Adrian
Message: 4 Date: Fri, 26 May 2017 22:40:40 -0500 From: Matthew Knepley <[email protected]> To: "Fabian.Jakub" <[email protected]> Cc: PETSc <[email protected]> Subject: Re: [petsc-users] DMPlex export to hdf5/vtk for triangle/prism mesh Message-ID: <CAMYG4GkVOTtFL_OBpUBPGEcBTikMbLOb5ruz=VU7tVTO6JQHTQ@mail.gmail.com> Content-Type: text/plain; charset="utf-8"
On Fri, May 26, 2017 at 12:27 PM, Fabian.Jakub < [email protected]> wrote:
Dear Petsc Team,
I am playing around with DMPlex, using it to generate the Mesh for the ICON weather model(http://doi.org/10.1002/2015MS000431), which employs a triangle mesh horizontally and columns, vertically.
This results in a grid, looking like prisms, where top and bottom faces are triangles and side faces are rectangles.
I was delighted to see that I could export the triangle DMPlex (2d Mesh) to hdf5 and use petsc_gen_xdmf.py to then visualize the mesh in visit/paraview. This is especially nice when exporting petscsections/vectors directly to VTK.
Great.
I then tried the same approach for the prism grid in 3D. I attached the code for one single cell, as well as the output in hdf5.
However, trying to convert the hdf5 output, it fails with:
make prism.xmf
$PETSC_DIR/bin/petsc_gen_xdmf.py prism.h5 Traceback (most recent call last): File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 241, in <module> generateXdmf(f) File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 235, in generateXdmf Xdmf(xdmfFilename).write(hdfFilename, topoPath, numCells, numCorners, cellDim, geomPath, numVertices, spaceDim, time, vfields, cfields) File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 193, in write self.writeSpaceGridHeader(fp, numCells, numCorners, cellDim, spaceDim) File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 75, in writeSpaceGridHeader ''' % (self.cellMap[cellDim][numCorners], numCells, "XYZ" if spaceDim > 2 else "XY")) KeyError: 6
Also, if I try to export a vector directly to vtk, visit and paraview fail to open it.
My question is: Is this a general limitation of these output formats, that I can not mix faces with 3 and 4 vertices or is it a limitation of the petsc_gen_xdmf.py or the VTK Viewer.
petsc_gen_xdmf. Take a look here
https://bitbucket.org/petsc/petsc/src/1731673c3fe570066779d46b51a4aee7a45775...
This is what fails. You need to add something like
6: "Wedge"
in the dictionary. See http://www.xdmf.org/index.php/XDMF_Model_and_Format
I'd also welcome any thoughts on the prism mesh in general. Is it that uncommon to use and do you foresee other complications with it?
You need an element that works with prisms, but it seems you already have one. I know there is good work from here: https://arxiv.org/abs/1411.2940
I fear I cannot change the discretization of the host model but maybe it makes sense to use a different grid for my radiative transfer code?
I do not really do RT, but would be happy to try and think about it.
Thanks,
Matt
Many thanks,
Fabian
-- Dr Adrian Croucher Senior Research Fellow Department of Engineering Science University of Auckland, New Zealand email: [email protected] tel: +64 (0)9 923 4611
Hi, I did just as Matt suggested which works nicely... thanks by the way! Inserted in the petsc_gen_xdmf.py the "6: 'Wedge' " entry . Calling the example with: <example_program> -show_plex hdf5:output.h5 -show_vector hdf5:output.h5::append exports the mesh and a vector to hdf5. Then calling $PETSC_DIR/bin/petsc_gen_xdmf.py output.h5 correctly creates the descriptor file and just loads to visit. Many thanks again to you, Matt :) Fab On 30.05.2017 00:13, Adrian Croucher wrote:
hi,
I was asking about support for exactly these 6-node wedge elements in DMPlex back in January.
At the time, there was no support for them. Has there been some progress since then?
We are going to need them before we can release our software, which we're aiming to do by the end of the year.
Cheers, Adrian
Message: 4 Date: Fri, 26 May 2017 22:40:40 -0500 From: Matthew Knepley <[email protected]> To: "Fabian.Jakub" <[email protected]> Cc: PETSc <[email protected]> Subject: Re: [petsc-users] DMPlex export to hdf5/vtk for triangle/prism mesh Message-ID: <CAMYG4GkVOTtFL_OBpUBPGEcBTikMbLOb5ruz=VU7tVTO6JQHTQ@mail.gmail.com> Content-Type: text/plain; charset="utf-8"
On Fri, May 26, 2017 at 12:27 PM, Fabian.Jakub < [email protected]> wrote:
Dear Petsc Team,
I am playing around with DMPlex, using it to generate the Mesh for the ICON weather model(http://doi.org/10.1002/2015MS000431), which employs a triangle mesh horizontally and columns, vertically.
This results in a grid, looking like prisms, where top and bottom faces are triangles and side faces are rectangles.
I was delighted to see that I could export the triangle DMPlex (2d Mesh) to hdf5 and use petsc_gen_xdmf.py to then visualize the mesh in visit/paraview. This is especially nice when exporting petscsections/vectors directly to VTK.
Great.
I then tried the same approach for the prism grid in 3D. I attached the code for one single cell, as well as the output in hdf5.
However, trying to convert the hdf5 output, it fails with:
make prism.xmf
$PETSC_DIR/bin/petsc_gen_xdmf.py prism.h5 Traceback (most recent call last): File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 241, in <module> generateXdmf(f) File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 235, in generateXdmf Xdmf(xdmfFilename).write(hdfFilename, topoPath, numCells, numCorners, cellDim, geomPath, numVertices, spaceDim, time, vfields, cfields) File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 193, in write self.writeSpaceGridHeader(fp, numCells, numCorners, cellDim, spaceDim) File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 75, in writeSpaceGridHeader ''' % (self.cellMap[cellDim][numCorners], numCells, "XYZ" if spaceDim > 2 else "XY")) KeyError: 6
Also, if I try to export a vector directly to vtk, visit and paraview fail to open it.
My question is: Is this a general limitation of these output formats, that I can not mix faces with 3 and 4 vertices or is it a limitation of the petsc_gen_xdmf.py or the VTK Viewer.
petsc_gen_xdmf. Take a look here
https://bitbucket.org/petsc/petsc/src/1731673c3fe570066779d46b51a4aee7a45775...
This is what fails. You need to add something like
6: "Wedge"
in the dictionary. See http://www.xdmf.org/index.php/XDMF_Model_and_Format
I'd also welcome any thoughts on the prism mesh in general. Is it that uncommon to use and do you foresee other complications with it?
You need an element that works with prisms, but it seems you already have one. I know there is good work from here: https://arxiv.org/abs/1411.2940
I fear I cannot change the discretization of the host model but maybe it makes sense to use a different grid for my radiative transfer code?
I do not really do RT, but would be happy to try and think about it.
Thanks,
Matt
Many thanks,
Fabian
On Mon, May 29, 2017 at 5:43 PM, Fabian Jakub < [email protected]> wrote:
Hi,
I did just as Matt suggested which works nicely... thanks by the way!
Inserted in the petsc_gen_xdmf.py the "6: 'Wedge' " entry .
Calling the example with:
<example_program> -show_plex hdf5:output.h5 -show_vector hdf5:output.h5::append
exports the mesh and a vector to hdf5.
Then calling
$PETSC_DIR/bin/petsc_gen_xdmf.py output.h5
correctly creates the descriptor file and just loads to visit.
Many thanks again to you, Matt :)
Great! I will make a test and push it soon. I'll put you on the ChangeSet. Thanks, Matt
Fab
On 30.05.2017 00:13, Adrian Croucher wrote:
hi,
I was asking about support for exactly these 6-node wedge elements in DMPlex back in January.
At the time, there was no support for them. Has there been some progress since then?
We are going to need them before we can release our software, which we're aiming to do by the end of the year.
Cheers, Adrian
Message: 4
Date: Fri, 26 May 2017 22:40:40 -0500 From: Matthew Knepley <[email protected]> To: "Fabian.Jakub" <[email protected]> Cc: PETSc <[email protected]> Subject: Re: [petsc-users] DMPlex export to hdf5/vtk for triangle/prism mesh Message-ID: <CAMYG4GkVOTtFL_OBpUBPGEcBTikMbLOb5ruz=VU7tVTO6JQHTQ@mail.gmail.com> Content-Type: text/plain; charset="utf-8"
On Fri, May 26, 2017 at 12:27 PM, Fabian.Jakub < [email protected]> wrote:
Dear Petsc Team,
I am playing around with DMPlex, using it to generate the Mesh for the ICON weather model(http://doi.org/10.1002/2015MS000431), which employs a triangle mesh horizontally and columns, vertically.
This results in a grid, looking like prisms, where top and bottom faces are triangles and side faces are rectangles.
I was delighted to see that I could export the triangle DMPlex (2d Mesh) to hdf5 and use petsc_gen_xdmf.py to then visualize the mesh in visit/paraview. This is especially nice when exporting petscsections/vectors directly to VTK.
Great.
I then tried the same approach for the prism grid in 3D. I attached the code for one single cell, as well as the output in hdf5.
However, trying to convert the hdf5 output, it fails with:
make prism.xmf
$PETSC_DIR/bin/petsc_gen_xdmf.py prism.h5 Traceback (most recent call last): File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 241, in <module> generateXdmf(f) File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 235, in generateXdmf Xdmf(xdmfFilename).write(hdfFilename, topoPath, numCells, numCorners, cellDim, geomPath, numVertices, spaceDim, time, vfields, cfields) File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 193, in write self.writeSpaceGridHeader(fp, numCells, numCorners, cellDim, spaceDim) File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 75, in writeSpaceGridHeader ''' % (self.cellMap[cellDim][numCorners], numCells, "XYZ" if spaceDim > 2 else "XY")) KeyError: 6
Also, if I try to export a vector directly to vtk, visit and paraview fail to open it.
My question is: Is this a general limitation of these output formats, that I can not mix faces with 3 and 4 vertices or is it a limitation of the petsc_gen_xdmf.py or the VTK Viewer.
petsc_gen_xdmf. Take a look here
https://bitbucket.org/petsc/petsc/src/1731673c3fe570066779d4 6b51a4aee7a45775ed/bin/petsc_gen_xdmf.py?at=master& fileviewer=file-view-default#petsc_gen_xdmf.py-9
This is what fails. You need to add something like
6: "Wedge"
in the dictionary. See http://www.xdmf.org/index.php/ XDMF_Model_and_Format
I'd also welcome any thoughts on the prism mesh in general. Is it that uncommon to use and do you foresee other complications with it?
You need an element that works with prisms, but it seems you already have one. I know there is good work from here: https://arxiv.org/abs/1411.2940
I fear I cannot change the discretization of the host model but maybe it makes sense to use a different grid for my radiative transfer code?
I do not really do RT, but would be happy to try and think about it.
Thanks,
Matt
Many thanks,
Fabian
-- 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 http://www.caam.rice.edu/~mk51/
On Mon, May 29, 2017 at 5:13 PM, Adrian Croucher <[email protected]> wrote:
hi,
I was asking about support for exactly these 6-node wedge elements in DMPlex back in January.
At the time, there was no support for them. Has there been some progress since then?
We are going to need them before we can release our software, which we're aiming to do by the end of the year.
Sorry about not keeping up to date on that. I had not really thought about it working until Fabian suggested it. So, it looks like XDMF output works. I am making a test now. However, other stuff will not, like refinement, interpolation, cell geometry, and other discretization stuff. What do you need working? Thanks, Matt
Cheers, Adrian
Message: 4
Date: Fri, 26 May 2017 22:40:40 -0500 From: Matthew Knepley <[email protected]> To: "Fabian.Jakub" <[email protected]> Cc: PETSc <[email protected]> Subject: Re: [petsc-users] DMPlex export to hdf5/vtk for triangle/prism mesh Message-ID: <CAMYG4GkVOTtFL_OBpUBPGEcBTikMbLOb5ruz=VU7tVTO6JQHTQ@mail. gmail.com> Content-Type: text/plain; charset="utf-8"
On Fri, May 26, 2017 at 12:27 PM, Fabian.Jakub < [email protected]> wrote:
Dear Petsc Team,
I am playing around with DMPlex, using it to generate the Mesh for the ICON weather model(http://doi.org/10.1002/2015MS000431), which employs a triangle mesh horizontally and columns, vertically.
This results in a grid, looking like prisms, where top and bottom faces are triangles and side faces are rectangles.
I was delighted to see that I could export the triangle DMPlex (2d Mesh) to hdf5 and use petsc_gen_xdmf.py to then visualize the mesh in visit/paraview. This is especially nice when exporting petscsections/vectors directly to VTK.
Great.
I then tried the same approach for the prism grid in 3D. I attached the code for one single cell, as well as the output in hdf5.
However, trying to convert the hdf5 output, it fails with:
make prism.xmf
$PETSC_DIR/bin/petsc_gen_xdmf.py prism.h5 Traceback (most recent call last): File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 241, in <module> generateXdmf(f) File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 235, in generateXdmf Xdmf(xdmfFilename).write(hdfFilename, topoPath, numCells, numCorners, cellDim, geomPath, numVertices, spaceDim, time, vfields, cfields) File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 193, in write self.writeSpaceGridHeader(fp, numCells, numCorners, cellDim, spaceDim) File "/software/meteo/xenial/x86_64/petsc/master/debug_gcc/..// bin/petsc_gen_xdmf.py", line 75, in writeSpaceGridHeader ''' % (self.cellMap[cellDim][numCorners], numCells, "XYZ" if spaceDim > 2 else "XY")) KeyError: 6
Also, if I try to export a vector directly to vtk, visit and paraview fail to open it.
My question is: Is this a general limitation of these output formats, that I can not mix faces with 3 and 4 vertices or is it a limitation of the petsc_gen_xdmf.py or the VTK Viewer.
petsc_gen_xdmf. Take a look here
https://bitbucket.org/petsc/petsc/src/1731673c3fe570066779d4 6b51a4aee7a45775ed/bin/petsc_gen_xdmf.py?at=master& fileviewer=file-view-default#petsc_gen_xdmf.py-9
This is what fails. You need to add something like
6: "Wedge"
in the dictionary. See http://www.xdmf.org/index.php/ XDMF_Model_and_Format
I'd also welcome any thoughts on the prism mesh in general. Is it that uncommon to use and do you foresee other complications with it?
You need an element that works with prisms, but it seems you already have one. I know there is good work from here: https://arxiv.org/abs/1411.2940
I fear I cannot change the discretization of the host model but maybe it makes sense to use a different grid for my radiative transfer code?
I do not really do RT, but would be happy to try and think about it.
Thanks,
Matt
Many thanks,
Fabian
-- Dr Adrian Croucher Senior Research Fellow Department of Engineering Science University of Auckland, New Zealand email: [email protected] tel: +64 (0)9 923 4611
-- 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 http://www.caam.rice.edu/~mk51/
On 30/05/17 12:25, Matthew Knepley wrote:
Sorry about not keeping up to date on that. I had not really thought about it working until Fabian suggested it. So, it looks like XDMF output works. I am making a test now.
However, other stuff will not, like refinement, interpolation, cell geometry, and other discretization stuff.
What do you need working?
We'll definitely need interpolation and cell geometry, but that might be about it. We won't need refinement. - Adrian -- Dr Adrian Croucher Senior Research Fellow Department of Engineering Science University of Auckland, New Zealand email: [email protected] tel: +64 (0)9 923 4611
On Mon, May 29, 2017 at 8:58 PM, Adrian Croucher <[email protected]> wrote:
On 30/05/17 12:25, Matthew Knepley wrote:
Sorry about not keeping up to date on that. I had not really thought about it working until Fabian suggested it. So, it looks like XDMF output works. I am making a test now.
However, other stuff will not, like refinement, interpolation, cell geometry, and other discretization stuff.
What do you need working?
We'll definitely need interpolation and cell geometry, but that might be about it. We won't need refinement.
What kind of basis are you expecting? A tensor product? Thanks, Matt
- Adrian
-- Dr Adrian Croucher Senior Research Fellow Department of Engineering Science University of Auckland, New Zealand email: [email protected] tel: +64 (0)9 923 4611 <+64%209-923%204611>
-- 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 http://www.caam.rice.edu/~mk51/
On 30/05/17 14:45, Matthew Knepley wrote:
What kind of basis are you expecting? A tensor product?
At present we don't even need basis functions, because we're just doing flow simulation and it's all finite volume. However further down the track we will also be doing rock mechanics on the same mesh, using finite elements. For that, tensor product basis would be fine. - Adrian -- Dr Adrian Croucher Senior Research Fellow Department of Engineering Science University of Auckland, New Zealand email: [email protected] tel: +64 (0)9 923 4611
On Mon, May 29, 2017 at 9:52 PM, Adrian Croucher <[email protected]> wrote:
On 30/05/17 14:45, Matthew Knepley wrote:
What kind of basis are you expecting? A tensor product?
At present we don't even need basis functions, because we're just doing flow simulation and it's all finite volume.
Okay good. Now for cell geometry. What kind of deformation do you allow in the wedge? and what do you want to know? For FV, we are providing the centroid and volume. If that is enough, we could be done quickly. Thanks, Matt
However further down the track we will also be doing rock mechanics on the same mesh, using finite elements. For that, tensor product basis would be fine.
- Adrian
-- Dr Adrian Croucher Senior Research Fellow Department of Engineering Science University of Auckland, New Zealand email: [email protected] tel: +64 (0)9 923 4611 <+64%209-923%204611>
-- 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 http://www.caam.rice.edu/~mk51/
On 30/05/17 14:55, Matthew Knepley wrote:
On Mon, May 29, 2017 at 9:52 PM, Adrian Croucher <[email protected] <mailto:[email protected]>> wrote:
On 30/05/17 14:45, Matthew Knepley wrote:
What kind of basis are you expecting? A tensor product?
At present we don't even need basis functions, because we're just doing flow simulation and it's all finite volume.
Okay good. Now for cell geometry. What kind of deformation do you allow in the wedge?
As in Fabian's application, these elements arise from meshes which have a simple layered structure in the vertical, but are unstructured in the horizontal (can be mixtures of quads and triangles in our case- in fact the triangles usually only occur where there is local refinement). So for us these wedges are just horizontal triangles projected downwards in the vertical- not really deformed at all.
and what do you want to know? For FV, we are providing the centroid and volume. If that is enough, we could be done quickly.
Yes, just centroid and volume would be enough. - Adrian -- Dr Adrian Croucher Senior Research Fellow Department of Engineering Science University of Auckland, New Zealand email: [email protected] tel: +64 (0)9 923 4611
participants (3)
-
Adrian Croucher -
Fabian Jakub -
Matthew Knepley