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

Segmentation fault when implementing the example #16

Closed
zhang-rite opened this issue Jun 15, 2021 · 3 comments
Closed

Segmentation fault when implementing the example #16

zhang-rite opened this issue Jun 15, 2021 · 3 comments

Comments

@zhang-rite
Copy link

zhang-rite commented Jun 15, 2021

Hi,

I encountered a segmentation fault error when implementing AdFem's first example as follows.

using AdFem
using PyPlot 

# forward computation
mmesh = Mesh(joinpath(PDATA, "twoholes_large.stl"))

=> the error

signal (11): Segmentation fault
in expression starting at REPL[10]:1
PyObject_IsInstance at $HOME/.julia/adcme/lib/libpython3.7m.so.1.0 (unknown line)
unknown function (ip: 0x151e1e3cc72f)
Allocations: 31306926 (Pool: 31296122; Big: 10804); GC: 37
Segmentation fault (core dumped)

Any suggestion to fix this?
I use Redhat 8.2.
Thank you.


(v1.6) pkg> status
      Status `$HOME/.julia/environments/v1.6/Project.toml`
  [07b341a0] ADCME v0.7.3
  [c10abcb9] AdFem v0.1.3 `https://github.com/kailaix/AdFem.jl#master`
  [d330b81b] PyPlot v2.9.0
@zhang-rite
Copy link
Author

There is no error when I run the poisson2d example which does not contain mesh reading. So is there something unfunctional in Mesh.

@kailaix
Copy link
Owner

kailaix commented Jun 18, 2021

Hi,

The problem is that returned values from meshio.mesh have a different data structure from v4.0.0. See this link for details. I pushed a fix to the master branch of AdFem. You can install it and try again.

julia> ]
pkg> add AdFem#master

Let me know if you encounter any problems.

Here is the expected output:

using AdFem
using PyPlot 

mmesh = Mesh(joinpath(PDATA, "twoholes_large.stl"))
visualize_mesh(mmesh)

image

@zhang-rite
Copy link
Author

The fix does work!
Many thanks!

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