Hi Eduardo,
On 18/11/2018 21:06, Eduardo Ramos Fernandez wrote:
> BTW, I am having trouble getting from the .VTU files the boundary
> elements to do post-processing. I have checked with Paraview and it
> seems there is no information about them inside. I would have expected
> to be able to get them from the "Physical tags" provided in the GMSH
> file. Any advice on this?
In the PyFR mesh format boundaries are defined as a sequence of faces.
For example, consider the couette flow test case which comes as part of
PyFR. After importing the .msh and running h5ls we see:
$ h5ls couette_flow_2d.pyfrm
bcon_bcwalllower_p0 Dataset {8}
bcon_bcwallupper_p0 Dataset {8}
con_p0 Dataset {2, 81}
mesh_uuid Dataset {SCALAR}
spt_quad_p0 Dataset {4, 37, 2}
spt_tri_p0 Dataset {3, 10, 2}
where the relevant boundary regions are given by the bcon_ prefixed
datasets. Inspecting one of these we find:
In []: import h5py
In []: import numpy as np
In []: f = h5py.File('couette_flow_2d.pyfrm')
In []: print(np.array(f['bcon_bcwallupper_p0']))
[(b'quad', 31, 3, 0) (b'quad', 7, 1, 0) (b'quad', 27, 1, 0)
(b'quad', 19, 3, 0) (b'tri', 0, 0, 0) (b'tri', 1, 0, 0)
(b'quad', 17, 0, 0) (b'quad', 32, 2, 0)]
where the tuples are of the form (element type, element number, face
number, unused). So the first member of the 'bcwallupper' boundary is
face 3 of quad 31. From this you can trivially obtain the elements
which border the boundary. Such information, however, is not carried
over to the .VTU file (which only has the concept of sub-divided
elements as opposed to faces).
The best solution depends on exactly what information you want from the
boundary. If it is just the solution (and gradients thereof) then this
is something which is not too difficult (for example the fluidforce
plugin --- which is designed to integrate up forces on boundaries ---
does exactly this with minimum fuss and no subdivision).
Regards, Freddie.