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

open_dataset error "conflicting sizes" with gmsh extruded mesh #25

Open
manu0600 opened this issue Apr 26, 2021 · 6 comments
Open

open_dataset error "conflicting sizes" with gmsh extruded mesh #25

manu0600 opened this issue Apr 26, 2021 · 6 comments
Milestone

Comments

@manu0600
Copy link

Hello,

I have experienced an error when loading a Nek5000 output file with a mesh created from GMSH. A similar case with a mesh from genbox works flowlessly.

when running the following command :
open_dataset('channel3D_0.f00001')
I get the following error :
conflicting sizes for dimension 'y': length 8 on 'xmesh' and length 9 on 'y'

Could you help me resolve this issue ?

(Visualizing it with paraview works fine in both cases, as a check)

@ashwinvis
Copy link
Member

ashwinvis commented Apr 26, 2021

open_dataset works only for cubes or cuboids. Is your mesh like that? This is because I have not found a nice way to extract the 1D coordinates from the 3D position arrays. See:

pymech/pymech/dataset.py

Lines 181 to 187 in 3a87b03

def meshgrid_to_dim(self, mesh):
"""Reverse of np.meshgrid. This method extracts one-dimensional
coordinates from a cubical array format for every direction
"""
dim = np.unique(np.round(mesh, 8))
return dim

and

pymech/pymech/dataset.py

Lines 206 to 212 in 3a87b03

data_vars = {
ax[2]: self.meshgrid_to_dim(elem.pos[0]), # x
ax[1]: self.meshgrid_to_dim(elem.pos[1]), # y
ax[0]: self.meshgrid_to_dim(elem.pos[2]), # z
"xmesh": (ax, elem.pos[0]),
"ymesh": (ax, elem.pos[1]),
"zmesh": (ax, elem.pos[2]),

If open_dataset does not work for your case, you can use readnek and exa2vtk to visualize.

@ashwinvis
Copy link
Member

I could help you more if you can generate a minimal example to reproduce.

@ashwinvis
Copy link
Member

See also #13 if you are interested in non-cubical geometries.

@manu0600
Copy link
Author

manu0600 commented May 4, 2021

Here are two similar cases based on the turbChannel example, but with 2 different meshed from GMSH :
https://we.tl/t-iCenFDPVpw

The case turbChannel_GMSH appears to work well, but the other one turbChannel_GMSH_1 gives the error I mentionned. Both are one box, so I am not sure why one works and not the other.

Hope this helps

@ashwinvis ashwinvis added this to the v2.0.0 milestone Oct 16, 2021
@ashwinvis ashwinvis modified the milestones: v2.0.0, v2.1.0 Oct 8, 2024
@ashwinvis
Copy link
Member

We need to check if this was a duplicate of #56 which was fixed

@ashwinvis
Copy link
Member

Some source code to reproduce this exists here, but the field files need to be generated

https://github.com/eX-Mech/pymech-test-data/blob/gmsh-bug

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

2 participants