[petsc-users] BCs for a EPS solver

Matthew Knepley knepley at gmail.com
Mon Feb 17 13:20:26 CST 2020


On Mon, Feb 17, 2020 at 1:59 PM Emmanuel Ayala <juaneah at gmail.com> wrote:

> Hi, thanks for the quick answer.
>
> I just did it, and it does not work. My problem is GNHEP and I use the
> default solver (Krylov-Schur). Moreover I run the code with the options:
> -st_ksp_type preonly -st_pc_type lu -st_pc_factor_mat_solver_type mumps
>

I guess a better question is: What do you expect to work?

For a linear solve,

  A x = b

if a row i is 0 except for a one on the diagonal, then I get

  x_i = b_i

so hopefully you put the correct boundary value in b_i. For the generalized
eigenproblem

  A x = \lambda B x

if you set row i to the identity in A, and zero in B, we get

  x_i = 0

and you must put the boundary values into x after you have finished the
solve. Is this what you did?

  Thanks,

     Matt


> Any other suggestions?
> Kind regards.
>
> El lun., 17 de feb. de 2020 a la(s) 12:39, Jeremy Theler (
> jeremy at seamplex.com) escribió:
>
>> The usual trick is to set ones in one matrix and zeros in the other
>> one.
>>
>>
>> On Mon, 2020-02-17 at 12:35 -0600, Emmanuel Ayala wrote:
>> > Hi everyone,
>> >
>> > I have an eigenvalue problem where I need to apply BCs to the
>> > stiffness and mass matrix.
>> >
>> > Usually, for KSP solver, it is enough to set to zero the rows and
>> > columns related to the boundary conditions. I used to apply it with
>> > MatZeroRowsColumns, with a 1s on the diagonal. Then the solver works
>> > well.
>> >
>> > There is something similar to KSP for EPS solver ?
>> >
>> > I already used MatZeroRowsColumns (for EPS solver), with a 1s on the
>> > diagonal, and I got wrong result.
>> >
>> > Kind regards.
>> >
>> >
>> >
>> >
>>
>>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200217/351e3fac/attachment-0001.html>


More information about the petsc-users mailing list