[petsc-users] Binary format in real vs. complex scalar type configurations

Frederico Teixeira teixeira at zmt.swiss
Tue May 11 15:03:39 CDT 2021


Hi Mark, 

I think so. The complex-valued linear system Ax = b, with A=T+Wi, u=x+yi, b=p+qi (i is the unit complex) can be transformed into a 2x2 real-valued system: 
[ T -W ] (x) = (p) 
[ W T ] (y) (q) 

Perhaps a bit more background can clarify things. System A stems from a Poisson equation with complex coefficients. There are ~130 piecewise constant coefficients ranging across 5 orders of magnitude. Most of the KSPs and PCs I managed to test take between 6000-9000 iterations to reach 10^-9. I hope to get some speed up with preconditioners that exploit the structure above. 

Regards, 
Frederico. 

Dr. Frederico Teixeira 
Computational Modeler and Software Developer, [ http://www.itis.swiss/ | ZMT ] (member of [ https://www.z43.swiss/ | Zurich43 ] ) 



P +41 44 245 9698 
Zeughausstrasse 43, 8004 Zurich, Switzerland 


From: "Mark Adams" <mfadams at lbl.gov> 
To: "Frederico Teixeira" <teixeira at zmt.swiss> 
Cc: "petsc-users" <petsc-users at mcs.anl.gov> 
Sent: Tuesday, May 11, 2021 5:16:35 PM 
Subject: Re: [petsc-users] Binary format in real vs. complex scalar type configurations 



On Tue, May 11, 2021 at 9:30 AM Frederico Teixeira <teixeira at zmt.swiss> wrote: 



Dear fellows, 

I hope this message finds you safe and well. 

I have a complex-valued matrix and its real/imaginary components in binary format . They were extracted from a solver that only works with "scalar-type=complex" configuration. 
I am getting weird results when I load them into a small test program that's configured with "scalar-type=real", but I believe this is expected. 
At the end of the day, I would like to have both real and imaginary components as real-valued matrices. 
Is it possible to do it? I want to test preconditioners that are tailored for this sort of problem. 



Do you mean you want what is called "equivalent real form" where the real and complex parts are stored as type 'double' for example and operations like multiply take two pairs of doubles, do a complex multiply manually, and return a real/complex pair of doubles? 

BQ_BEGIN


Regards, 
Frederico. 

BQ_END


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210511/113c56e1/attachment.html>


More information about the petsc-users mailing list