Skip to content
Snippets Groups Projects
Select Git revision
  • 03c4ceb15fe301b9c0fae88aa8f2ad48e9d34dff
  • master default protected
  • dof-renumbering
  • gdemesy-master-patch-30528
  • eval-space-time
  • oscillating_multiharm
  • MH_movement
  • axisqu
  • write_vtu_and_ensight_formats
  • movingband
  • CP_1972_add_vtu_file_writing
  • mortar
  • fast_freq_sweep_Resolution
  • applyresolvent_again
  • marteaua-master-patch-54323
  • patch-1
  • binde-master-patch-08072
  • binde-master-patch-52461
  • BCGSL
  • resolvent
  • TreeElementsOf
  • getdp_3_5_0
  • getdp_3_4_0
  • getdp_3_3_0
  • getdp_3_2_0
  • getdp_3_1_0
  • getdp_3_0_4
  • getdp_3_0_3
  • getdp_3_0_2
  • getdp_3_0_1
  • getdp_3_0_0
  • onelab_mobile_2.1.0
  • getdp_2_11_3 protected
  • getdp_2_11_2 protected
  • getdp_2_11_1 protected
  • getdp_2_11_0 protected
  • getdp_2_10_0 protected
  • getdp_2_9_2 protected
  • getdp_2_9_1 protected
  • getdp_2_9_0 protected
  • getdp_2_8_0 protected
41 results

EigenSolve.cpp

Blame
  • EigenSolve.cpp 1.78 KiB
    // GetDP - Copyright (C) 1997-2018 P. Dular and C. Geuzaine, University of Liege
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to the public mailing list <getdp@onelab.info>.
    
    #include "GetDPConfig.h"
    #include "Message.h"
    #include "EigenSolve.h"
    
    #if ((PETSC_VERSION_RELEASE == 0) || ((PETSC_VERSION_MAJOR == 3) && (PETSC_VERSION_MINOR >= 7)))
    #define PetscTruth PetscBool
    #define PetscOptionsGetTruth(A, B, C, D) PetscOptionsGetBool(A, NULL, B, C, D)
    #elif ((PETSC_VERSION_MAJOR == 3) && (PETSC_VERSION_MINOR >= 2))
    #define PetscTruth PetscBool
    #define PetscOptionsGetTruth PetscOptionsGetBool
    #endif
    
    void EigenSolve(struct DofData * DofData_P, int NumEigenvalues,
    		double shift_r, double shift_i, int FilterExpressionIndex,
                    List_T *RationalCoefsNum, List_T *RationalCoefsDen)
    {
    #if defined(HAVE_ARPACK) && defined(HAVE_SLEPC)
      // if both Arpack and SLEPC are available, use Arpack by default
      // (set "-slepc" on the command line to force SLEPC)
      PetscTruth slepc = PETSC_FALSE, set;
      PetscOptionsGetTruth(PETSC_NULL, "-slepc", &slepc, &set);
      if(slepc)
        EigenSolve_SLEPC(DofData_P, NumEigenvalues, shift_r, shift_i,
                         FilterExpressionIndex,
                         RationalCoefsNum, RationalCoefsDen);
      else
        EigenSolve_ARPACK(DofData_P, NumEigenvalues, shift_r, shift_i,
                          FilterExpressionIndex);
    #elif defined(HAVE_ARPACK)
      EigenSolve_ARPACK(DofData_P, NumEigenvalues, shift_r, shift_i,
                        FilterExpressionIndex);
    #elif defined(HAVE_SLEPC)
      EigenSolve_SLEPC(DofData_P, NumEigenvalues, shift_r, shift_i,
                       FilterExpressionIndex,
                       RationalCoefsNum, RationalCoefsDen);
    #else
      Message::Error("EigenSolve not available without SLEPC or ARPACK");
    #endif
    }