Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VTK xml file support with high order lagrange elements #64

Closed
martinvandriel opened this issue Jul 13, 2018 · 14 comments
Closed

VTK xml file support with high order lagrange elements #64

martinvandriel opened this issue Jul 13, 2018 · 14 comments
Assignees

Comments

@martinvandriel
Copy link

Hi,
I am wondering if the VTK xlm file are supported at all (I get an error when I try to open them) or only the legacy format? How about chances to use their recently added support for high order Lagrange elements.

BTW: this statement on http://glvis.org/curvilinear-vtk-meshes/ is a bit misleading, as it is true for the legacy format only: 'Currently VTK does not support cubic, and higher-order meshes.' The XML format can now handle arbitrary order.

thanks for your time and providing a very useful tool,
Martin

@v-dobrev
Copy link
Member

Hi Martin,

MFEM (and therefore GLVis) does not support VTK XML files at this time. Of course, adding support for that will be great, however it is currently not a priority for us.

On this note, as part of the CEED ECP project, http://ceed.exascaleproject.org/, we are developing a new mesh and field specification, called FMS, http://github.com/CEED/FMS which includes support for more types of finite element fields of arbitrary orders. Currently, if you export (in memory) your mesh and fields to FMS, we can convert them to MFEM representation and send them to GLVis for visualization - this is illustrated in the "PUMI + MFEM demo" in the examples/ directory.

-Veselin

@martinvandriel
Copy link
Author

Hi Veselin,

thanks for the link to FMS, I'll definitely take a closer look. For now I am not sure if there is an easy path to writing these files for me as I do all the mesh handling in python.

As for VTK, I figured that the legacy files also support the high order elements with element types defined here: https://www.vtk.org/doc/nightly/html/vtkCellType_8h_source.html
Maybe this is easier for you to work with than xml.

Thanks,
Martin

@tzanio
Copy link
Member

tzanio commented Jul 18, 2018

Hi Martin,

Can you post a link to the description of the nodes of VTK_HIGHER_ORDER_EDGE or VTK_HIGHER_ORDER_HEXAHEDRON? With high-order, there are many different choices for bases, and in particular one wants to use nodes like Gauss-Lobatto instead of uniform points.

Tzanio

@martinvandriel
Copy link
Author

Hi Tzanio,

actually I don't know if this is documented anywhere, could not find anything. So I did a bit of reverse engineering: I generated single element hex meshes with paraviews unstructured mesh source (make sure to select the Lagrange element type) and saved that to ascii legacy vtk and sorted out the node ordering for Hexes up to order 10 relative to a lexicographic sorting of the nodes in reference coordinates. I could share this in case that is useful for you. Non-uniform sampling works fine this way - I use Gauss-Lobatto in fact.

Martin

@martinvandriel
Copy link
Author

Just realizing you asked for VTK_HIGHER_ORDER_HEXAHEDRON. I think you want the VTK_LAGRANGE_HEXAHEDRON, my understanding is these are the only ones that support arbitrary order.
Martin

@tzanio
Copy link
Member

tzanio commented Jul 18, 2018

Thanks Martin, can you share the file?

@martinvandriel
Copy link
Author

vtk_node_order.json.zip

@agrayver
Copy link

agrayver commented Jul 25, 2018

We have been looking at Lagrange cells in VTK with @martinvandriel together.

I have extracted the relevant code to generate Lagrange quads/hexes of any degree (up to 10 -- this is limitation of VTK itself) and write the mesh in VTK legacy format. Here is the code.

For other element types, you will find the relevant code here.

BTW, despite the name, this is not limited to Lagrange elements. For RT or ND, you can write cells individually by duplicating the points and writing cell-based solution values at points. You will then be able to visualize discontinuous solution properly, at least Paraview does.

@v-dobrev
Copy link
Member

@agrayver, your last sentence seems to imply that Paraview can read and visualize these high-order VTK meshes and solutions - did I understand that correctly?

@agrayver
Copy link

@v-dobrev, yes, they have added support for this recently.

@tzanio
Copy link
Member

tzanio commented Nov 29, 2018

See also mfem/mfem#678

@tzanio
Copy link
Member

tzanio commented Oct 8, 2020

As discussed at a recent meeting, it will be nice to add a lite XML parser for reading high-order VTK data, cf. the high-order ParaView output in MFEM.

@pazner
Copy link
Contributor

pazner commented Nov 19, 2020

A preliminary version of this feature is now available in a branch (see mfem/mfem#1894). For those interested, could you see if this works as intended?

@tzanio tzanio mentioned this issue Nov 20, 2020
19 tasks
@tzanio
Copy link
Member

tzanio commented Dec 4, 2020

Discussion continued in mfem/mfem#975

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants