[petsc-users] AMG preconditioners
Manav Bhatia
bhatiamanav at gmail.com
Wed Mar 9 10:32:40 CST 2016
> On Mar 9, 2016, at 10:19 AM, Jed Brown <jed at jedbrown.org> wrote:
>
> Manav Bhatia <bhatiamanav at gmail.com> writes:
>
>> Thanks!
>>
>> I am intrigued by this.
>>
>> I am solving a system of equations where the natural block size is
>> 2x2. This is obtained by rewriting a complex linear system of
>> equations in real numbers.
>
> What equations are you solving? Is this system a leading cost in your
> application? (Using complex scalars is another option. Yes, it's lame
> that PETSc can't currently use both in the same library.)
>
The application is that of small-disturbance frequency domain analysis about a steady-state.
This needs a mix of linear solves for system of equations in real numbers and complex numbers.
I was able to setup the complex solves using real numbers with a relatively small piece of code. It is working very well for the most part, except that I got some errors while trying to use the AMG preconditioners with it.
Making the code generic for BAIJ or AIJ, I think, will be a very small fix in comparison with recompiling PETSC with complex scalars, since a lot of my application code assumes that the underlying libraries (libMesh, PETSC, SLEPC) are compiled for real scalars.
-Manav
>> I use MatSetValuesBlocked to set the values of each 2x2 block in my
>> matrix. I am assuming that this method works only for blocked matrix.
>
> No, just call MatSetBlockSize and MatSetValuesBlocked (and variants)
> will work for any matrix type.
More information about the petsc-users
mailing list