1 // GetDP - Copyright (C) 1997-2021 P. Dular and C. Geuzaine, University of Liege
2 //
3 // See the LICENSE.txt file for license information. Please report all
4 // issues on https://gitlab.onelab.info/getdp/getdp/issues.
5
6 #include "GetDPConfig.h"
7 #include "Message.h"
8 #include "EigenSolve.h"
9
10 extern int Flag_SLEPC;
11
EigenSolve(struct DofData * DofData_P,int NumEigenvalues,double shift_r,double shift_i,int FilterExpressionIndex,List_T * RationalCoefsNum,List_T * RationalCoefsDen,List_T * ApplyResolventRealFreqs,struct DofData * DofData_P2)12 void EigenSolve(struct DofData * DofData_P, int NumEigenvalues,
13 double shift_r, double shift_i, int FilterExpressionIndex,
14 List_T *RationalCoefsNum, List_T *RationalCoefsDen ,
15 List_T *ApplyResolventRealFreqs, struct DofData * DofData_P2)
16 {
17 #if defined(HAVE_ARPACK) && defined(HAVE_SLEPC)
18 // if both Arpack and SLEPC are available, use Arpack by default
19 // (set "-slepc" on the command line to force SLEPC)
20 if(Flag_SLEPC)
21 EigenSolve_SLEPC(DofData_P, NumEigenvalues, shift_r, shift_i,
22 FilterExpressionIndex,
23 RationalCoefsNum, RationalCoefsDen,
24 ApplyResolventRealFreqs, DofData_P2);
25 else
26 EigenSolve_ARPACK(DofData_P, NumEigenvalues, shift_r, shift_i,
27 FilterExpressionIndex);
28 #elif defined(HAVE_ARPACK)
29 EigenSolve_ARPACK(DofData_P, NumEigenvalues, shift_r, shift_i,
30 FilterExpressionIndex);
31 #elif defined(HAVE_SLEPC)
32 EigenSolve_SLEPC(DofData_P, NumEigenvalues, shift_r, shift_i,
33 FilterExpressionIndex,
34 RationalCoefsNum, RationalCoefsDen,
35 ApplyResolventRealFreqs, DofData_P2);
36 #else
37 Message::Error("EigenSolve not available without SLEPC or ARPACK");
38 #endif
39 }
40