GLVis / glvis

Lightweight OpenGL tool for accurate and flexible finite element visualization
http://glvis.org
BSD 3-Clause "New" or "Revised" License
249 stars 51 forks source link

Visualization of Hexahedra file format #269

Closed altineller closed 2 months ago

altineller commented 7 months ago

Hello,

I would like to visualize the output of a custom made software to show a mesh, and its displacement. Namely I have the following files and formats as input: results file:

MESH board dimension 3 Elemtype Hexahedra Nnode 8 coordinates 1 0.000000e+00 0.000000e+00 0.000000e+00 2 1.000000e+00 0.000000e+00 0.000000e+00 --- end coordinates elements 1 1 60 61 3 270 751 1003 271 2 60 59 62 61 751 760 1174 1003 --- end elements

displacements file:

GaussPoints "element_gp" ElemType Hexahedra Number Of Gauss Points: 1 Natural Coordinates: Internal End gausspoints Result "Displacements" "Load Analysis" 1 Vector OnNodes ComponentNames "u", "v", "w" values 1 0.000000e+00 0.000000e+00 0.000000e+00 2 -2.329461e-06 -7.243679e-06 -7.790406e-08 ... end values

How would I go about visualizing this tru GLVis? Is there any previosly done work, or would I have to write some software to take the results file and convert it into mfem format?

Which modes/features are more suitable for visualizing mesh displacement?

Any ideas/recomendations/help greatly appreciated.

Best Regards, C.

v-dobrev commented 7 months ago

It looks like you need to write a mesh and data (displacement file -> MFEM grid function file) converters. A good starting point about the MFEM mesh formats is here: https://mfem.org/mesh-formats. The vector grid function format is described as part of the description of the nodes section in https://mfem.org/mesh-format-v1.x/#geometry -- e.g. for linear hex elements, one can use the string H1_3D_P1 for the FiniteElementCollection.

Let us know if you need more details about the formats.

altineller commented 7 months ago

It looks like you need to write a mesh and data (displacement file -> MFEM grid function file) converters. A good starting point about the MFEM mesh formats is here: https://mfem.org/mesh-formats. The vector grid function format is described as part of the description of the nodes section in https://mfem.org/mesh-format-v1.x/#geometry -- e.g. for linear hex elements, one can use the string H1_3D_P1 for the FiniteElementCollection.

Let us know if you need more details about the formats.

Never mind my last message. I need more information about H1_3D_P1, H1_3D_P2 and RT_3D_P0 and ND_3D_P1 formats.

I have been googling, experimenting, and even reading your source without success to reverse the H1_3D_P1 format for the coloring of cells. Is H1_3D_P1 9 data points for each element?

Best Regards, Can