12 Oct
2022
12 Oct
'22
6:13 p.m.
Dear PETSc community, I have a question regarding the single precision complex numbers of petsc4py. I configured PETSc with the “--with-scalar-type=complex --with-precision=single" option before compiling, but all the DA structures I created with petsc4py had double precision. Here is a minimum test code on Python 3.8/PETSc 3.12/petsc4py 3.12: both print commands show data type of complex128. Could anybody please help me? Thanks! import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc da=PETSc.DA().create(sizes=[2,2,2],dof=1,stencil_type=0,stencil_width=1,boundary_type=1) da_1 = da.createGlobalVec() print(petsc4py.PETSc.ComplexType) print(da_1.getArray().dtype) Best regards, Peng Sun