[petsc-users] DMPlex export to hdf5/vtk for triangle/prism mesh
Matthew Knepley
knepley at gmail.com
Mon May 29 19:25:59 CDT 2017
On Mon, May 29, 2017 at 5:13 PM, Adrian Croucher <a.croucher at auckland.ac.nz>
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 <knepley at gmail.com>
>> To: "Fabian.Jakub" <Fabian.Jakub at physik.uni-muenchen.de>
>> Cc: PETSc <petsc-users at mcs.anl.gov>
>> Subject: Re: [petsc-users] DMPlex export to hdf5/vtk for
>> triangle/prism mesh
>> Message-ID:
>> <CAMYG4GkVOTtFL_OBpUBPGEcBTikMbLOb5ruz=VU7tVTO6JQHTQ at mail.
>> gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>>
>> On Fri, May 26, 2017 at 12:27 PM, Fabian.Jakub <
>> Fabian.Jakub at physik.uni-muenchen.de> 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: a.croucher at auckland.ac.nz
> 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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170529/f2699824/attachment-0001.html>
More information about the petsc-users
mailing list