Actual source code: test4.c

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain

      6:    This file is part of SLEPc.
      7:    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
      8:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      9: */

     11: static char help[] = "Test setting FN parameters from the command line.\n\n";

     13: #include <slepcfn.h>

     15: int main(int argc,char **argv)
     16: {
     17:   FN             fn1,fn2;

     19:   PetscFunctionBeginUser;
     20:   PetscCall(SlepcInitialize(&argc,&argv,NULL,help));
     21:   PetscCall(FNCreate(PETSC_COMM_WORLD,&fn1));
     22:   PetscCall(FNSetOptionsPrefix(fn1,"f1_"));
     23:   PetscCall(FNSetFromOptions(fn1));
     24:   PetscCall(FNView(fn1,NULL));
     25:   PetscCall(FNDestroy(&fn1));
     26:   PetscCall(FNCreate(PETSC_COMM_WORLD,&fn2));
     27:   PetscCall(FNSetOptionsPrefix(fn2,"f2_"));
     28:   PetscCall(FNSetFromOptions(fn2));
     29:   PetscCall(FNView(fn2,NULL));
     30:   PetscCall(FNDestroy(&fn2));
     31:   PetscCall(SlepcFinalize());
     32:   return 0;
     33: }

     35: /*TEST

     37:    test:
     38:       suffix: 1
     39:       nsize: 1
     40:       args: -f1_fn_type exp -f1_fn_scale -2.5 -f2_fn_type rational -f2_fn_rational_numerator -1,1 -f2_fn_rational_denominator 1,-6,4

     42: TEST*/