Dominant Eigen Value Computation

For eigen value computation in FreeFem++, some guess shift eigen value needs to be specified.

If I am working with a system, where there is no idea about dominant eigen value, what shift eigen value should be used for calculation of dominant eigen values?

You don’t need a shift.

Say, I have already computed the base flow solution.

Then, I am trying to use the following code for dominant eigen value computation: FreeFem-sources/navier-stokes-2d-SLEPc-complex.edp at develop · FreeFem/FreeFem-sources · GitHub.

To run the above code without a complex shift value, the code should be run without line no-47 (as no shift value needs to be specified) and line no-50.

So, string params (as defined in lines 48 & 49) should be:
string params = "-eps_tol 1.0e-6 -eps_nev " + nev + " " +
"-eps_type krylovschur -st_type sinvert -eps_monitor_all ";

Am I correct?

You don’t need -st_type sinvert if you are looking for the dominant eigenmode (-eps_largest_magnitude). If you use -st_type sinvert, then you must use as a shift something that is close to what you believe is the dominant eigenmode (-eps_target_magnitude).

1 Like

I used the following statement:

string params = "-eps_tol 1.0e-6 -eps_nev " + nev + " " +
"-eps_type krylovschur -eps_largest_magnitude -eps_monitor_all ";

And got the following error:

You’ll have to read the MUMPS documentation if you don’t understand what this error means.

I still could not figure out why the error is coming.

What options are available for use with “EPSSolve” in FreeFEM? Is there any documentation other than this: Eigen value problems?

The link you mentioned is about ARPACK, not SLEPc. If you want SLEPc documentation, you can go to SLEPc - Documentation :: Manual.

I am going through the documentation.

In the meantime, I tried the following without using any shift value:

string params = "-eps_tol 1.0e-6 -eps_nev " + nev + " " +
"-eps_type krylovschur -st_type sinvert -eps_monitor_all ";

int k = EPSSolve(J,M, vectors = vec, values = val, sparams = params);

This is not giving any error and giving results as before. I do not know as no shift value is being mentioned, if it is taking any default shift value of σ = 0+0i.

Use -eps_view to view what is being used by SLEPc.

For the eigen computation, I am carrying out, “PETSc-complex” is being used.

What parameter options are available for “PETSc-complex” like “-eps_type krylovschur”, “-st_type sinvert”, “-eps_monitor_all”, etc?

To check what parameter options are available in “PETSc-complex”, I tried opening the file “PETSc-complex.dll” in the directory where FreeFEM has been installed. But I could not open the file “PETSc-complex.dll”.

Where can I find what parameter options are available for “PETSc-complex.dll”? Any documentation is available?

Dear @D_N_Sarkar ,

You can use the shift-invert techniquefor hydrodynamic stability problems. You can scan the relevant portion of the spectrum with repeated eigenvalue calculation with different shifts. The shifts (eigenvalue geusses) can be chosen based on literature data on problems that are similar to yours.

You can find the basic options of EPSSolve in the SLEPc users manual.

I am running the given example: FreeFem-sources/navier-stokes-2d-SLEPc-complex.edp at develop · FreeFem/FreeFem-sources · GitHub.
This solved example uses “PETSc-complex”.

This problem works with the following:
string params = "-eps_tol 1.0e-6 -eps_nev " + nev + " " +
"-eps_type krylovschur -st_type sinvert -eps_monitor_all " +
"-eps_target " + real(s) + “+” + imag(s) + “i”;

I followed the given SLEPc documentation: https://slepc.upv.es/documentation/slepc.pdf.

In the SLEPc documentation, there are options like: -eps_largest_magnitude, -eps_smallest_magnitude, -eps_smallest_real, etc. These three are used as follows:

string params = "-eps_tol 1.0e-10 -eps_nev " + nev + " " +
"-eps_type krylovschur -eps_largest_magnitude -eps_monitor_all ";
int k = EPSSolve(J, M, vectors = vec, values = val, sparams = params);
The following error came:

string params = "-eps_tol 1.0e-10 -eps_nev " + nev + " " +
"-eps_type krylovschur -eps_smallest_magnitude -eps_monitor_all ";
int k = EPSSolve(J, M, vectors = vec, values = val, sparams = params);
The following error came:

string params = "-eps_tol 1.0e-10 -eps_nev " + nev + " " +
"-eps_type krylovschur -eps_smallest_real -eps_monitor_all ";
int k = EPSSolve(J, M, vectors = vec, values = val, sparams = params);
The following error came:

I am using FreeFEM version 4.9 on Windows 10. I do not understand if the option “-st_type sinvert” is working successfully, why SLEPc options such as “-eps_largest_magnitude”, “-eps_smallest_magnitude”, and “-eps_smallest_real” are giving error.

I think the reason for this is that in the case of the LNS eigenvalue problem, your B matrix is singular. Therefore, I think you need to use -st_type sinvert -eps_target, and you cannot use options as -eps_smallest_magnitude instead.