Hello Lucas,
Supposedly (I haven’t tried this myself for a while), HYPRE supports real-only 
complex-stored matrices.
So as long as you assemble a complex Mat with a zero imaginary part, e.g., 
MatRealPart(Pmat), you could feed that to PCHYPRE.
If you really want to use a real-only build of HYPRE, there could be a strategy 
using a PCSHELL, but it would require you to assemble all the HYPRE objects 
yourself, so I would first try the first strategy.

Thanks,
Pierre

> On 29 Sep 2022, at 2:48 AM, Lucas Banting <banti...@myumanitoba.ca> wrote:
> 
> 
> Hello,
> 
> My application involves the complex-valued curl-curl equation. 
> I use the complex build of PETSc, but would like to try HYPRE AMS as a real 
> preconditioner, in the same way as this paper 
> describes:https://www.research-collection.ethz.ch/bitstream/handle/20.500.11850/103394/geo2015-0013.1.pdf?sequence=2
>  
> <https://www.research-collection.ethz.ch/bitstream/handle/20.500.11850/103394/geo2015-0013.1.pdf?sequence=2>
> My understanding of PETSc is that I can not mix complex and real scalars. Is 
> there a way I can assemble a parallel, real valued matrix, from my complex 
> PETSc matrix and use it with HYPRE? 
> 
> I understand that I can do this by using a real build of PETSc (like MFEM 
> does), but would prefer to keep using the complex build of PETSc as that is 
> what the rest of my application uses.
> 
> Thanks,
> Lucas
> 

Reply via email to