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

Eigenvalue selection from inverse vector-iteration spectrum #118

Closed
nicolasbrughmans opened this issue Jan 27, 2023 · 1 comment · Fixed by #119 or #139
Closed

Eigenvalue selection from inverse vector-iteration spectrum #118

nicolasbrughmans opened this issue Jan 27, 2023 · 1 comment · Fixed by #119 or #139
Assignees
Labels
bug Something isn't working pylbo Affects the post-processing framework Pylbo

Comments

@nicolasbrughmans
Copy link
Contributor

Issue description

Bug report: after running inverse vector-iteration, the result is one eigenmode. When selecting this one eigenmode, an error is thrown because eigenfunc_interface._get_clicked_point_data tries to apply an index to something that is no list.

Bug report

Minimal example for reproduction

#Parfile:
&gridlist
  gridpoints = 100
/

&equilibriumlist
  equilibrium_type = "MRI_accretion"
  use_defaults = .false.
/

&savelist
  write_eigenfunctions = .true.
  write_derived_eigenfunctions = .false.
  show_results = .true.
  basename_datfile = "sari_GK2022_quasi_continuum_test"
/

&physicslist
  flow = .true.
  external_gravity = .true.
  incompressible = .false.
/

&paramlist
  k2 = 1.0d0
  k3 = 50.0d0
  delta = 0.28862653d0 ! for most unstable mode
  beta = 10.0d0
  tau = 10.0d0     !fixes mu1 parameter
  nu = 0.045d0    !fixes epsilon parameter
/

&solvelist
  solver = "inverse-iteration"
  sigma = (0.59639333d0, 0.17629975d0)
  maxiter = 20000
  tolerance = 1.d-7
/

Actual result

  File "/users/cpa/nicolasb/codes/legolas/post_processing/pylbo/visualisation/eigenfunctions/eigfunc_interface.py", line 262, in on_left_click
    idx, xdata, ydata = self._get_clicked_point_data(event)
  File "/users/cpa/nicolasb/codes/legolas/post_processing/pylbo/visualisation/eigenfunctions/eigfunc_interface.py", line 345, in _get_clicked_point_data
    return idx, xdata[idx], ydata[idx]
  File "/users/cpa/nicolasb/Documents/no_backup/miniconda3/envs/legolasenv/lib/python3.9/site-packages/numpy/ma/core.py", line 3224, in __getitem__
    dout = self.data[indx]
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed

Expected result

The eigenvalue is selected and everyone lives happily ever after.

When selecting xdata, ydata from the artist in _get_cicked_point_data, the result is probably a float instead of a list now if the spectrum consists of only one point.

Version info

  • Legolas version: develop branch, b7dbd98
@n-claes n-claes self-assigned this Jan 27, 2023
@n-claes n-claes added bug Something isn't working pylbo Affects the post-processing framework Pylbo labels Jan 27, 2023
@n-claes n-claes linked a pull request Jan 30, 2023 that will close this issue
@n-claes
Copy link
Owner

n-claes commented Jan 30, 2023

Just fixed this in develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pylbo Affects the post-processing framework Pylbo
Projects
None yet
2 participants