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

Write high-order elements to VTK files #41

Open
markstock opened this issue Aug 6, 2020 · 4 comments
Open

Write high-order elements to VTK files #41

markstock opened this issue Aug 6, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@markstock
Copy link
Collaborator

Omega2D will soon support volumetric computational elements, and ultimately high-order elements. VTK has supported biquadratic quads in the past, which aid visualization in ParaView, but not smooth contours. Since 5.5.0, ParaView has supported additional high-order elements. Here are some links pertaining to the support and definition of these elements.

Arbitrary order Lagrange finite element support in PV 5.5
Detailed discussion and node ordering of Lagrange elements in VTK from Kitware
Discussion and links from GLVis issue
Code specifying VTK element IDs and node order from MFEM - shows VTK_QUAD is 9 and HO Quad is 70
List of standard VTK element types
C++ code to create quad and hex meshes in legacy VTK format
FMS as an interchange format for HO elements

Also, look at Process_Results.f90 for quick-and-dirty node ordering (not sure where this is).

@markstock markstock added the enhancement New feature or request label Aug 6, 2020
@markstock
Copy link
Collaborator Author

After generating test files for Lagrange elements of order 2 and 3 (9 and 16 points, respectively), I learned that ParaView 5.5.0 and 5.8.0 can read them. The elements can be automatically subdivided for smoother surface rendering as well. This looks nice. But contours are still terrible. In fact, they are even worse for these Lagrangian HO elements than for the standard bicubic quads! The contour lines are still jagged, and do not even fall onto the non-subdivided surface (i.e. some run beneath the surface and some above). It is essentially unusable.

<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian" header_type="UInt32">
    <UnstructuredGrid>
        <Piece NumberOfPoints="16" NumberOfCells="1">
            <Points>
                <DataArray NumberOfComponents="3" Name="position" type="Float32" format="ascii"> 0.15 0.1 0.0 0.85 0.1 0.0 0.95 0.9 0.0 0.05 0.9 0.0 0.35 0.11 0.0 0.55 0.11 0.0 0.88 0.35 0.0 0.92 0.65 0.0 0.35 0.92 0.0 0.65 0.92 0.0 0.12 0.35 0.0 0.08 0.65 0.0 0.35 0.36 0.05 0.58 0.36 0.05 0.35 0.67 0.05 0.62 0.67 0.05 </DataArray>
            </Points>
            <Cells>
                <DataArray Name="connectivity" type="Int32" format="ascii"> 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 </DataArray>
                <DataArray Name="offsets" type="Int32" format="ascii"> 16 </DataArray>
                <DataArray Name="types" type="UInt8" format="ascii"> 70 </DataArray>
            </Cells>
            <PointData Scalars="density">
                <DataArray Name="density" type="Float32" format="ascii"> 0.2 0.3 0.7 0.5 0.23 0.27 0.4 0.5 0.57 0.62 0.3 0.4 0.4 0.45 0.45 0.5 </DataArray>
            </PointData>
        </Piece>
    </UnstructuredGrid>
</VTKFile>```

@markstock
Copy link
Collaborator Author

My conclusion is that, given the current state, we should internally subdivide our HO elements into linear quads at higher resolution than the Legendre or Lagrange points themselves, and just write a larger number of VTK_QUAD elements into our vtu files.

@markstock
Copy link
Collaborator Author

AH! I spoke/wrote too soon. These higher-order elements are useful, but one must first "Tesselate" the elements, then apply Contour.
image

@BHill96 BHill96 added this to New in Task Priorities via automation Sep 19, 2020
@markstock
Copy link
Collaborator Author

Old-style bicubic quads are now supported as measurement features and writing to vtu with 4ad8bae
Not closing this issue because we still do not support the arbitrary-order Lagrange elements (but is that necessary?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant