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

Paraview export: VTU output format and support for second-order mixed meshes #121

Merged
merged 152 commits into from
Sep 12, 2023

Conversation

ac1512
Copy link
Collaborator

@ac1512 ac1512 commented Mar 24, 2023

Brief summary (for future reference) what the different flags do that we now have in the paraview module and what kind of meshes they can support:

logical :: VIS_VTU = .false. ! output mesh and solution in XDMF/.h5
logical :: VIS_VTU = .true.  ! output mesh and solution in VTU format

XDMF/.h5

  • Supports linear (hybrid) meshes; can be "upscaled" with VLEVEL
  • If SECOND_ORDER_VIS = .true., uses second-order shape functions for geometry and solution
    • This can not be upscaled with VLEVEL (--> displays user warning, sets VLEVEL='0')
    • This does not support hybrid meshes (--> displays user warning, sets output format to VTU)
  • Supports reusing previously exported mesh data via PARAVIEW_DUMP_GEOM=.false.

VTU

  • Supports linear (hybrid) meshes; can be "upscaled" with VLEVEL
  • If SECOND_ORDER_VIS = .true., uses second-order shape functions for geometry and solution
    • This can not be upscaled with VLEVEL (--> displays user warning)
    • This does support hybrid meshes.
  • This does not support PARAVIEW_DUMP_GEOM=.false. because the geometry data is always written together with the solution field in one file, thus can't reuse previously exported mesh data (--> displays user warning, sets PARAVIEW_DUMP_GEOM=.true.).

A new paraview_check routine which is by default called in paraview_initialize (first call of paraview_driver) checks the compatibility of the flags above and resolves conflicts as noted above, letting the user know if a conflict had to be resolved.

Generally, support for hybrid meshes includes hexahedra, prisms, and tets; but not pyramids.

Issues concerning pyramids are moved to #135


This PR also refactors the paraview_driver routine and introduces new variables in the paraview module:

!..Advanced control over exporting variables
!     PARAVIEW_LOAD enables/disables writing specific solution vectors
!     PARAVIEW_ATTR enables/disables writing specific physics variables
!     PARAVIEW_COMP_REAL enables/disables writing real part of specific components
!     PARAVIEW_COMP_REAL enables/disables writing imag part of specific components
   logical, allocatable :: PARAVIEW_LOAD(:)      ! 1...NRCOMS
   logical, allocatable :: PARAVIEW_ATTR(:)      ! 1...NR_PHYSA
   logical, allocatable :: PARAVIEW_COMP_REAL(:) ! 1...NRINDEX
   logical, allocatable :: PARAVIEW_COMP_IMAG(:) ! 1...NRINDEX

The user can set these variables to control which loads, variables, or components are exported by Paraview's XDMF and VTU outputs by calling the following routines in the paraview module:

subroutine paraview_select_load
subroutine paraview_select_attr
subroutine paraview_select_comp_real
subroutine paraview_select_comp_imag

All of these things should go into the user guide, together with a remark on how to visualize the high-order elements in ParaView: By default, ParaView uses linear interpolation between the Lagrange points. To enable the high-order interpolation in ParaView, the user needs to set the "Nonlinear Subdivision Level" to a value greater than 1.

jbadger95 and others added 30 commits March 11, 2023 17:40
@stefanhenneking stefanhenneking changed the title with VTU output format with support for second-order mixed meshes Paraview export: VTU output format and support for second-order mixed meshes Sep 11, 2023
@stefanhenneking
Copy link
Contributor

@ac1512 @jbadger95 From my point of view, this is ready to be merged except for potentially adding support for writing a time value in the VTU output format.

Copy link
Contributor

@jbadger95 jbadger95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, clean implementation and overall a great job @ac1512 and @stefanhenneking!

I'm looking forward to higher-order vis next!

@stefanhenneking
Copy link
Contributor

Looks great, clean implementation and overall a great job @ac1512 and @stefanhenneking!

I'm looking forward to higher-order vis next!

thanks for reviewing!

@stefanhenneking stefanhenneking merged commit 7e5bb01 into master Sep 12, 2023
@stefanhenneking stefanhenneking deleted the VTU_output branch September 12, 2023 23:34
@stefanhenneking stefanhenneking self-assigned this Sep 12, 2023
stefanhenneking added a commit that referenced this pull request Sep 12, 2023
stefanhenneking added a commit that referenced this pull request Sep 12, 2023
… meshes (#121)

* Refactored ParaView module to enable exporting specific loads, variables, or components
* New VTU output format supports 2nd-order mixed meshes
* Old XDMF output format supports 2nd-order meshes with one element type

---------

Co-authored-by: stefanhenneking <[email protected]>
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
None yet
Development

Successfully merging this pull request may close these issues.

Higher-order paraview/vtk output
3 participants