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

not able to import gmsh file in pygimli #197

Closed
nishantra4 opened this issue Sep 19, 2019 · 5 comments
Closed

not able to import gmsh file in pygimli #197

nishantra4 opened this issue Sep 19, 2019 · 5 comments
Assignees

Comments

@nishantra4
Copy link

nishantra4 commented Sep 19, 2019

Problem description

I am new in Pygimli environment, need help. Created .geo file with a cube inside cube meshed it up to 2D. saved it as .msh file. but not able to import in the code. used .geo, .msh and .dat format file. also tried with a rectangle inside the rectangle.

Your environment

Operating system: Linux
Python version: 3.6.7
pyGIMLi version: 1.0.11+0.g9e41a4a3.dirty
Way of installation: e.g. Conda package and a manual compilation from source

Steps to reproduce

File name with geometry only : "cube_frac_elec.geo" RuntimeError: /home/wagner/miniconda3/condabld/pygimli_1554216594442/work/gimli/gimli/src/datacontainer.cpp: 205virtual int GIMLI::DataContainer::load(const string&, bool, bool) cannot determine data format. 10
File name with geometry and mesh: "cube_frac_elec.msh" RuntimeError: cannot determine sensor count $MeshFormat
File name with geometry in dat format: "cube_frac_elec_g.dat" RuntimeError:/home/wagner/miniconda3/condabld/pygimli_1554216594442/work/gimli/gimli/src/datacontainer.cpp: 205virtual int GIMLI::DataContainer::load(const string&, bool, bool) cannot determine data format. 10
File name with geometry and meshing in dat format:"cube_frac_elec_m.dat" RuntimeError: cannot determine sensor count $MeshFormat

import pygimli as pg
import numpy as np
import matplotlib.pyplot as mlt

Expected behavior

there is no output only runtime error i think there is an issue of meshing as with importing meshed files with the extension .msh its showing error as RuntimeError: cannot determine sensor count $MeshFormat
meshed file 2019-09-19 22-48-44

meshed file 2019-09-19 22-48-44

Actual behavior

Tell us what happens instead and/or provide the output of your script.

Paste output here.

if possible please let me know how to convert .geo developed in gmsh to convert into .msh file.

@florian-wagner
Copy link
Member

florian-wagner commented Sep 19, 2019

Hi @nishantra4,

in my mail, I was not aware that your Gmsh model is 3D (cube). Than you have to mesh it in 3d of course. And make sure to save it in the old "msh2" format. This can be chosen when saving the .msh file. A pull request for making the newer msh formats compatible is on the way.

Best wishes
Florian

@florian-wagner florian-wagner self-assigned this Sep 19, 2019
@nishantra4
Copy link
Author

Hello Sir,

With repeated tries, i am not able to import the model. I have tried your suggestion as well as the methods given in gmsh 4.4.1 tutuorials page no. 305-6 point no. 17.

Regards,
Nishant

@halbmy
Copy link
Contributor

halbmy commented Sep 20, 2019

Are you still trying to import the mesh as pg.DataContainer? The data container is made for data only and holds sensor positions as well as arbitrarily called vectors, but NOT meshes. Did you read https://www.pygimli.org/_examples_auto/1_meshing/plot_gmsh-example.html?highlight=gmsh
and did you try the function readGmsh?
https://www.pygimli.org/pygimliapi/_generated/pygimli.meshtools.html?highlight=gmsh#pygimli.meshtools.readGmsh

@florian-wagner
Copy link
Member

More importantly, do you have a valid Mesh in Gmsh? Please post a screenshot of the 3D mesh. The last one I saw had two overlapping regions with overlapping cells (i.e. not connected). You keep saying it does not work, but I am sure that the error is already in Gmsh and not pygimli related. Please clarify or we can close this.

@florian-wagner
Copy link
Member

Closing this due to inactivity.

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

3 participants