In testing the complex number option on FEniCSx, I got an assertion error.
%python3 CmplxPoisson.py
float64
complex128
<class ‘numpy.float64’>****THIS IS SUPPOSED TO BE <class ‘numpy.complex128’>
Traceback (most recent call last):
File “/Users/carlajadamson/Documents/CmplxPoisson.py”, line 16, in
assert np.dtype(PETSc.ScalarType).kind == ‘c’
AssertionError
I assume this means that I did not get the correct version of PETSc downloaded when I downloaded FEniCSx from this site: https://fenicsproject.org/download/. Is there an update I missed?
zsh (not mac-specific, but it is the default shell on macs) expands globs a little differently from bash, you need to put strings with * that aren’t file globs in quotes to prevent glob expansion:
bash has weird but useful glob expansion behavior where if a glob doesn’t match anything it’s replaced by the original pattern, effectively assuming you didn’t mean it as a glob, whereas zsh always treats globs as globs and tells you when they don’t match anything.
used yours and got the complex download:
petsc conda-forge/osx-arm64::petsc-3.20.5-complex_h8e9ca2b_0
petsc4py conda-forge/osx-arm64::petsc4py-3.20.5-complex_h1f0f144_0
However, when I run the program:
python3 CmplxPoisson.py
float64
complex128
<class ‘numpy.float64’>
Traceback (most recent call last):
File “/Users/carlajadamson/Documents/CmplxPoisson.py”, line 16, in
assert np.dtype(PETSc.ScalarType).kind == ‘c’
AssertionError