<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">You put alpha on the diagonal of A and beta on the diagonal of B to get an eigenvalue lambda=alpha/beta. If you set beta=0 then lambda=Inf. The choice depends on where your wanted eigenvalues are and how you are solving the eigenproblem. The choice of lambda=Inf suggested by Jeremy avoids inserting eigenvalues that may interfere with the problem's eigenvalues, but this is good for shift-and-invert, not for the case where you solve linear systems with B.<div class=""><br class=""></div><div class="">Anyway, this kind of manipulation may have an impact on convergence of the eigensolver or on conditioning of the linear solves. A possibly better approach is just to get rid of the BC unknowns by creating smaller A, B matrices, e.g. with MatGetSubMatrix().</div><div class=""><br class=""></div><div class="">Jose</div><div class=""> <br class=""><div><br class=""><blockquote type="cite" class=""><div class="">El 18 feb 2020, a las 0:41, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> escribió:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Monaco; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div dir="ltr" class="">On Mon, Feb 17, 2020 at 4:33 PM Emmanuel Ayala <<a href="mailto:juaneah@gmail.com" class="">juaneah@gmail.com</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div dir="ltr" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">Thank you for the clarification, now I understand what means change those values, and I tried to do that.<br class=""></div><div class=""><br class=""></div><div class="">But if I put the row i to the identity in A, and zero in B, the solver crash:</div></div></div></blockquote><div class=""><br class=""></div><div class="">So if you need to factor B, maybe reverse it?</div><div class=""><br class=""></div><div class=""> Thanks,</div><div class=""><br class=""></div><div class=""> Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div dir="ltr" class=""><div class="">[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br class="">[0]PETSC ERROR: Error in external library<br class="">[1]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br class="">[1]PETSC ERROR: Error in external library<br class="">[1]PETSC ERROR: Error reported by MUMPS in numerical factorization phase: INFOG(1)=-10, INFO(2)=0<br class=""><br class="">[1]PETSC ERROR: See<span class="Apple-converted-space"> </span><a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank" class="">https://www.mcs.anl.gov/petsc/documentation/faq.html</a><span class="Apple-converted-space"> </span>for trouble shooting.<br class="">[1]PETSC ERROR: Petsc Release Version 3.12.3, Jan, 03, 2020<span class="Apple-converted-space"> </span><br class="">[1]PETSC ERROR: [2]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br class="">[2]PETSC ERROR: Error in external library<br class="">[2]PETSC ERROR: Error reported by MUMPS in numerical factorization phase: INFOG(1)=-10, INFO(2)=0<br class=""><br class="">[2]PETSC ERROR: See<span class="Apple-converted-space"> </span><a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank" class="">https://www.mcs.anl.gov/petsc/documentation/faq.html</a><span class="Apple-converted-space"> </span>for trouble shooting.<br class="">[2]PETSC ERROR: Petsc Release Version 3.12.3, Jan, 03, 2020<span class="Apple-converted-space"> </span><br class="">[2]PETSC ERROR: ./comp on a arch-linux-c-opt-O2-mumps named ayala by ayala Mon Feb 17 15:28:01 2020<br class="">[3]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br class="">[3]PETSC ERROR: Error in external library<br class="">[3]PETSC ERROR: Error reported by MUMPS in numerical factorization phase: INFOG(1)=-10, INFO(2)=0<br class=""><br class="">[3]PETSC ERROR: See<span class="Apple-converted-space"> </span><a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank" class="">https://www.mcs.anl.gov/petsc/documentation/faq.html</a><span class="Apple-converted-space"> </span>for trouble shooting.<br class="">[3]PETSC ERROR: Petsc Release Version 3.12.3, Jan, 03, 2020<span class="Apple-converted-space"> </span><br class="">[3]PETSC ERROR: ./comp on a arch-linux-c-opt-O2-mumps named ayala by ayala Mon Feb 17 15:28:01 2020<br class="">[3]PETSC ERROR: Configure options --with-debugging=0 COPTFLAGS="-O2 -march=native -mtune=native" CXXOPTFLAGS="-O2 -march=native -mtune=native" FOPTFLAGS="-O2 -march=native -mtune=native" --download-mpich --download-mumps --download-scalapack --download-parmetis --download-metis --download-superlu_dist --download-cmake --download-fblaslapack=1 --with-cxx-dialect=C++11<br class="">[3]PETSC ERROR: #1 MatFactorNumeric_MUMPS() line 1365 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/mat/impls/aij/mpi/mumps/mumps.c<br class="">[0]PETSC ERROR: Error reported by MUMPS in numerical factorization phase: INFOG(1)=-10, INFO(2)=33<br class=""><br class="">[0]PETSC ERROR: See<span class="Apple-converted-space"> </span><a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank" class="">https://www.mcs.anl.gov/petsc/documentation/faq.html</a><span class="Apple-converted-space"> </span>for trouble shooting.<br class="">[0]PETSC ERROR: Petsc Release Version 3.12.3, Jan, 03, 2020<span class="Apple-converted-space"> </span><br class="">[0]PETSC ERROR: ./comp on a arch-linux-c-opt-O2-mumps named ayala by ayala Mon Feb 17 15:28:01 2020<br class="">[0]PETSC ERROR: Configure options --with-debugging=0 COPTFLAGS="-O2 -march=native -mtune=native" CXXOPTFLAGS="-O2 -march=native -mtune=native" FOPTFLAGS="-O2 -march=native -mtune=native" --download-mpich --download-mumps --download-scalapack --download-parmetis --download-metis --download-superlu_dist --download-cmake --download-fblaslapack=1 --with-cxx-dialect=C++11<br class="">[0]PETSC ERROR: #1 MatFactorNumeric_MUMPS() line 1365 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/mat/impls/aij/mpi/mumps/mumps.c<br class="">./comp on a arch-linux-c-opt-O2-mumps named ayala by ayala Mon Feb 17 15:28:01 2020<br class="">[1]PETSC ERROR: Configure options --with-debugging=0 COPTFLAGS="-O2 -march=native -mtune=native" CXXOPTFLAGS="-O2 -march=native -mtune=native" FOPTFLAGS="-O2 -march=native -mtune=native" --download-mpich --download-mumps --download-scalapack --download-parmetis --download-metis --download-superlu_dist --download-cmake --download-fblaslapack=1 --with-cxx-dialect=C++11<br class="">[1]PETSC ERROR: #1 MatFactorNumeric_MUMPS() line 1365 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/mat/impls/aij/mpi/mumps/mumps.c<br class="">[1]PETSC ERROR: #2 MatLUFactorNumeric() line 3057 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/mat/interface/matrix.c<br class="">[2]PETSC ERROR: Configure options --with-debugging=0 COPTFLAGS="-O2 -march=native -mtune=native" CXXOPTFLAGS="-O2 -march=native -mtune=native" FOPTFLAGS="-O2 -march=native -mtune=native" --download-mpich --download-mumps --download-scalapack --download-parmetis --download-metis --download-superlu_dist --download-cmake --download-fblaslapack=1 --with-cxx-dialect=C++11<br class="">[2]PETSC ERROR: #1 MatFactorNumeric_MUMPS() line 1365 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/mat/impls/aij/mpi/mumps/mumps.c<br class="">[2]PETSC ERROR: #2 MatLUFactorNumeric() line 3057 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/mat/interface/matrix.c<br class="">[2]PETSC ERROR: [3]PETSC ERROR: #2 MatLUFactorNumeric() line 3057 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/mat/interface/matrix.c<br class="">[3]PETSC ERROR: #3 PCSetUp_LU() line 126 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/ksp/pc/impls/factor/lu/lu.c<br class="">[3]PETSC ERROR: #4 PCSetUp() line 894 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/ksp/pc/interface/precon.c<br class="">[0]PETSC ERROR: #2 MatLUFactorNumeric() line 3057 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/mat/interface/matrix.c<br class="">[0]PETSC ERROR: #3 PCSetUp_LU() line 126 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/ksp/pc/impls/factor/lu/lu.c<br class="">[0]PETSC ERROR: [1]PETSC ERROR: #3 PCSetUp_LU() line 126 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/ksp/pc/impls/factor/lu/lu.c<br class="">[1]PETSC ERROR: #4 PCSetUp() line 894 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/ksp/pc/interface/precon.c<br class="">[1]PETSC ERROR: #3 PCSetUp_LU() line 126 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/ksp/pc/impls/factor/lu/lu.c<br class="">[2]PETSC ERROR: #4 PCSetUp() line 894 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/ksp/pc/interface/precon.c<br class="">[2]PETSC ERROR: #5 KSPSetUp() line 376 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/ksp/ksp/interface/itfunc.c<br class="">[3]PETSC ERROR: #5 KSPSetUp() line 376 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/ksp/ksp/interface/itfunc.c<br class="">[3]PETSC ERROR: #6 STSetUp_Shift() line 120 in /home/ayala/Documents/SLEPc/slepc-3.12.2/src/sys/classes/st/impls/shift/shift.c<br class="">#4 PCSetUp() line 894 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/ksp/pc/interface/precon.c<br class="">[0]PETSC ERROR: #5 KSPSetUp() line 376 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/ksp/ksp/interface/itfunc.c<br class="">[0]PETSC ERROR: #6 STSetUp_Shift() line 120 in /home/ayala/Documents/SLEPc/slepc-3.12.2/src/sys/classes/st/impls/shift/shift.c<br class="">[0]PETSC ERROR: #5 KSPSetUp() line 376 in /home/ayala/Documents/PETSc/petsc-3.12.3/src/ksp/ksp/interface/itfunc.c<br class="">[1]PETSC ERROR: #6 STSetUp_Shift() line 120 in /home/ayala/Documents/SLEPc/slepc-3.12.2/src/sys/classes/st/impls/shift/shift.c<br class="">[1]PETSC ERROR: #7 STSetUp() line 271 in /home/ayala/Documents/SLEPc/slepc-3.12.2/src/sys/classes/st/interface/stsolve.c<br class="">[1]PETSC ERROR: #8 EPSSetUp() line 273 in /home/ayala/Documents/SLEPc/slepc-3.12.2/src/eps/interface/epssetup.c<br class="">[2]PETSC ERROR: #6 STSetUp_Shift() line 120 in /home/ayala/Documents/SLEPc/slepc-3.12.2/src/sys/classes/st/impls/shift/shift.c<br class="">[2]PETSC ERROR: #7 STSetUp() line 271 in /home/ayala/Documents/SLEPc/slepc-3.12.2/src/sys/classes/st/interface/stsolve.c<br class="">[2]PETSC ERROR: #8 EPSSetUp() line 273 in /home/ayala/Documents/SLEPc/slepc-3.12.2/src/eps/interface/epssetup.c<br class="">[2]PETSC ERROR: #9 FourBar_NaturalPulsation() line 3937 in /home/ayala/Nextcloud/cpp_projects/2020-02-13-muboto-balancing-v17-mma/<a href="http://Multibody.cc" class="">Multibody.cc</a></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El lun., 17 de feb. de 2020 a la(s) 13:20, Matthew Knepley (<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>) escribió:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div dir="ltr" class="">On Mon, Feb 17, 2020 at 1:59 PM Emmanuel Ayala <<a href="mailto:juaneah@gmail.com" target="_blank" class="">juaneah@gmail.com</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class="">Hi, thanks for the quick answer.<br class=""><br class="">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</div></blockquote><div class=""><br class=""></div><div class="">I guess a better question is: What do you expect to work?</div><div class=""><br class=""></div><div class="">For a linear solve,</div><div class=""><br class=""></div><div class=""> <span class="Apple-converted-space"> </span>A x = b</div><div class=""><br class=""></div><div class="">if a row i is 0 except for a one on the diagonal, then I get</div><div class=""><br class=""></div><div class=""> <span class="Apple-converted-space"> </span>x_i = b_i</div><div class=""><br class=""></div><div class="">so hopefully you put the correct boundary value in b_i. For the generalized eigenproblem</div><div class=""><br class=""></div><div class=""> <span class="Apple-converted-space"> </span>A x = \lambda B x</div><div class=""><br class=""></div><div class="">if you set row i to the identity in A, and zero in B, we get</div><div class=""><br class=""></div><div class=""> <span class="Apple-converted-space"> </span>x_i = 0</div><div class=""><br class=""></div><div class="">and you must put the boundary values into x after you have finished the solve. Is this what you did?</div><div class=""><br class=""></div><div class=""> <span class="Apple-converted-space"> </span>Thanks,</div><div class=""><br class=""></div><div class=""> Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div class="">Any other suggestions?</div>Kind regards.</div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El lun., 17 de feb. de 2020 a la(s) 12:39, Jeremy Theler (<a href="mailto:jeremy@seamplex.com" target="_blank" class="">jeremy@seamplex.com</a>) escribió:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">The usual trick is to set ones in one matrix and zeros in the other<br class="">one.<br class=""><br class=""><br class="">On Mon, 2020-02-17 at 12:35 -0600, Emmanuel Ayala wrote:<br class="">> Hi everyone,<br class="">><span class="Apple-converted-space"> </span><br class="">> I have an eigenvalue problem where I need to apply BCs to the<br class="">> stiffness and mass matrix.<span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><br class="">> Usually, for KSP solver, it is enough to set to zero the rows and<br class="">> columns related to the boundary conditions. I used to apply it with<br class="">> MatZeroRowsColumns, with a 1s on the diagonal. Then the solver works<br class="">> well.<br class="">><span class="Apple-converted-space"> </span><br class="">> There is something similar to KSP for EPS solver ?<span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><br class="">> I already used MatZeroRowsColumns (for EPS solver), with a 1s on the<br class="">> diagonal, and I got wrong result.<br class="">><span class="Apple-converted-space"> </span><br class="">> Kind regards.<br class="">><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><br class=""><br class=""></blockquote></div></blockquote></div><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class=""></div></div></div></div></div></div></div></div></blockquote></div></div></blockquote></div><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></div><br class=""></div></body></html>