ZTRSV/ZGEMV parameters had illegal values

35 views
Skip to first unread message

Duc Nguyen

unread,
Jun 17, 2024, 11:09:27 AMJun 17
to Dedalus Users
Dear Dedalus developers,

Thanks for building this fantastic framework. I'm a newbie here. Currently, I want to learn and use Dedalus3 version in my future work. Now, I'm trying to reproduce this work, eq. 2.7 (https://doi.org/10.1017/jfm.2022.865) with the IVP problem.

Capture.PNG
The system is 1D (z-axis), so I used a Chebyshev zbasis with data type of np.complex128. Based on the second summarizing note (https://dedalus-project.readthedocs.io/en/latest/pages/tau_method.html#systems-in-first-order-form), I also created two tau fields for each variable. This did not work, so I then made Tau polynomials (as indicated in https://dedalus-project.readthedocs.io/en/latest/notebooks/dedalus_tutorial_3.html#3.1:-Problems). A Python file is also attached to this email, so you can see my code. And, I received the following errors:
==============================
python3 Salt-finger_convection_using_single-mode_equations.py
/home/ducubuntu/miniforge-pypy3/envs/dedalus3/lib/python3.12/site-packages/numpy/core/getlimits.py:542: UserWarning: Signature b'\x00\xd0\xcc\xcc\xcc\xcc\xcc\xcc\xfb\xbf\x00\x00\x00\x00\x00\x00' for <class 'numpy.longdouble'> does not match any known type: falling back to type probe function.
This warnings indicates broken support for the dtype!
  machar = _get_machar(dtype)
2024-06-17 21:18:22,182 subsystems 0/1 INFO :: Building subproblem matrices 1/1 (~100%) Elapsed: 0s, Remaining: 0s, Rate: 1.1e+01/s
Starting main loop
 ** On entry to ZTRSV  parameter number  6 had an illegal value
 ** On entry to ZGEMV  parameter number  2 had an illegal value
Traceback (most recent call last):
  File "/mnt/d/ChangLiuLab_UConn/Double_diffusive_convection_using_Dedalus3/Salt-finger_convection/Horizontal-periodic/Salt-finger_convection_using_single-mode_equations.py", line 419, in <module>
    solver.step(timestep)
  File "/home/ducubuntu/miniforge-pypy3/envs/dedalus3/lib/python3.12/site-packages/dedalus/core/solvers.py", line 654, in step
    self.timestepper.step(dt, wall_time)
  File "/home/ducubuntu/miniforge-pypy3/envs/dedalus3/lib/python3.12/site-packages/dedalus/core/timesteppers.py", line 627,
in step
    sp.LHS_solvers[i] = solver.matsolver(sp.LHS, solver)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ducubuntu/miniforge-pypy3/envs/dedalus3/lib/python3.12/site-packages/dedalus/libraries/matsolvers.py", line 141, in __init__
    self.LU = spla.splu(matrix.tocsc(),
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ducubuntu/miniforge-pypy3/envs/dedalus3/lib/python3.12/site-packages/scipy/sparse/linalg/_dsolve/linsolve.py", line 438, in splu
    return _superlu.gstrf(N, A.nnz, A.data, indices, indptr,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Factor is exactly singular
make: *** [Makefile:17: run_SME] Error 1
==============================

I think the issue relates to building equations with tau fields to fit boundary conditions. I may have created and implemented tau fields incorrectly. I hope someone can help me and find points I did not understand accurately in Dedalus3.

Best,
Duc
Salt-finger_convection_using_single-mode_equations.py

Daniel Lecoanet

unread,
Jun 17, 2024, 12:44:16 PMJun 17
to dedalu...@googlegroups.com
Hi Duc,

In general, when dealing with issues like this I would suggest that you try to simplify your equations to figure out which equation is producing the problem. For example, in your problem you could have tried eliminating the temperature & salinity equations, the equations for the background fields, etc. This increases the chance of you figuring out what is going on, and if not, makes it much easier for someone on the mailing list to help you out if you have a much simpler problem.

That said, I took a look at your script, and I think the issue is that you have only 2 tau terms in your 4th order equation for w. In particular, tau_hatu_1 and tau_hatu_2 do not appear anywhere in the equations. That makes for a singular matrix. I would recommend defining 4 new tau polynomials for your w equation where you use the 4th derivative basis, instead of the 2nd derivative equation as you use for the other variables.

Let me know if that solves the singular matrix issue.

Daniel

On Jun 17, 2024, at 10:51 AM, Duc Nguyen <ducn...@gmail.com> wrote:

Dear Dedalus developers,

Thanks for building this fantastic framework. I'm a newbie here. Currently, I want to learn and use Dedalus3 version in my future work. Now, I'm trying to reproduce this work, eq. 2.7 (https://doi.org/10.1017/jfm.2022.865) with the IVP problem.

<Capture.PNG>
--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/d77d5e37-23ca-47c4-9bb4-f7cc910d7953n%40googlegroups.com.
<Salt-finger_convection_using_single-mode_equations.py><Capture.PNG>

Duc Nguyen

unread,
Jun 18, 2024, 7:19:46 AMJun 18
to Dedalus Users
Hi Daniel,

Thanks for your suggestions. Following those points, I tried to isolate and eliminate all temperature + salinity equations. Now, I have equation 2.7a, b, and h
(only for variables hatw, hatzeta, and hatu). I also defined 4 new tau for 4th derivative basis. For tau_hatu, I removed it from IVP because hatu is a sub-variable and doesn't have corresponding boundary conditions. This worked, and I then restored other equations. Finally, the system has worked with great results.

Thank you so much once again.

Best,
Duc
Reply all
Reply to author
Forward
0 new messages