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

Gauss-Legendre points in a Lagrangian element #114

Closed
b-fg opened this issue Dec 23, 2022 · 3 comments
Closed

Gauss-Legendre points in a Lagrangian element #114

b-fg opened this issue Dec 23, 2022 · 3 comments

Comments

@b-fg
Copy link

b-fg commented Dec 23, 2022

My flux reconstruction high-order solver uses Lagrangian-basis elements which store the solution at the Gauss-Legendre quadrature points of the element. For example:

where the blue circles are the location of the solution points, and the red circles are the vertices defining the quad.
Would the VTKCellTypes.VTK_LAGRANGE_QUADRILATERAL suit this arrangement?
I have the connectivity of inner solution points per element and vertices of each element (which are only useful to define the quad, but do not store the solution data).
I am unsure on how to define such cells and the connectivity that needs to be passed for to the cell creation (as in the documentation):

  MeshCell(VTKCellTypes.VTK_LAGRANGE_QUADRILATERAL, [
    1, 3, 12, 10, 2, 6, 9, 11, 4, 7, 5, 8
  ]),

Any tips on this would be appreciated. Thanks!

@jipolanco
Copy link
Member

Hi, sorry for the late reply. I'm personally not very experienced with high-order Lagrange cells.

If it is of any help, this thread in the ParaView forums seems to be relevant. If I understand correctly, the VTK_LAGRANGE_QUADRILATERAL assumes equidistant nodes, so you would need to evaluate/interpolate your solution from your quadrature points onto a grid of equidistant points. I take the liberty of pinging @sloede (who started the linked thread) in case he has found a solution for this.

@sloede
Copy link
Member

sloede commented Jan 12, 2023

@jipolanco is correct: You need to provide equidistant nodes to VTK_LAGRANGE_QUADRILATERAL and VTK_LAGRANGE_HEXAHEDRON to make it work, and you need to interpolate your solution to these nodes. Please also note that you have to specify the points in a particular order, and the VTK documentation has errors on that part for 3D (or at least used to have, I haven't checked for a while now).

You can find the code we use to specify the (equidistant) points in our package Trixi2Vtk.jl, specifically for 2D here:
https://github.com/trixi-framework/Trixi2Vtk.jl/blob/2170dee6f1b464853ee41f4898ac6786138582fa/src/vtktools.jl#L587-L602
and for 3D here:
https://github.com/trixi-framework/Trixi2Vtk.jl/blob/2170dee6f1b464853ee41f4898ac6786138582fa/src/vtktools.jl#L621-L660

All credit for implementing goes to @efaulhaber, @bennibolm, and @NichtLucas.

@b-fg
Copy link
Author

b-fg commented Jan 13, 2023

Okay, thanks both for the input. I will carefully look at Trixi's VTK package then. Closing this for the moment :)

@b-fg b-fg closed this as completed Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants