Actual source code: slepcfn.h
slepc-3.10.1 2018-10-23
Report Typos and Errors

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-2018, 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: */
     10: /*
     11:    User interface for the mathematical function object in SLEPc
     12: */

     16:  #include <slepcsys.h>

     18: #define FN_MAX_SOLVE 6

     20: PETSC_EXTERN PetscErrorCode FNInitializePackage(void);
     21: /*S
     22:    FN - Abstraction of a mathematical function.

     24:    Level: beginner

     26: .seealso: FNCreate()
     27: S*/
     28: typedef struct _p_FN* FN;

     30: /*J
     31:    FNType - String with the name of the mathematical function.

     33:    Level: beginner

     35: .seealso: FNSetType(), FN
     36: J*/
     37: typedef const char* FNType;
     38: #define FNCOMBINE  "combine"
     39: #define FNRATIONAL "rational"
     40: #define FNEXP      "exp"
     41: #define FNLOG      "log"
     42: #define FNPHI      "phi"
     43: #define FNSQRT     "sqrt"
     44: #define FNINVSQRT  "invsqrt"

     46: /* Logging support */
     47: PETSC_EXTERN PetscClassId FN_CLASSID;

     49: /*E
     50:     FNCombineType - Determines how two functions are combined

     52:     Level: advanced

     54: .seealso: FNCombineSetChildren()
     55: E*/
     56: typedef enum { FN_COMBINE_ADD,
     57:                FN_COMBINE_MULTIPLY,
     58:                FN_COMBINE_DIVIDE,
     59:                FN_COMBINE_COMPOSE } FNCombineType;

     61: /*E
     62:     FNParallelType - Indicates the parallel mode that will be used for matrix evaluation

     64:     Level: advanced

     66: .seealso: FNSetParallel()
     67: E*/
     68: typedef enum { FN_PARALLEL_REDUNDANT,
     69:                FN_PARALLEL_SYNCHRONIZED } FNParallelType;
     70: PETSC_EXTERN const char *FNParallelTypes[];

     72: PETSC_EXTERN PetscErrorCode FNCreate(MPI_Comm,FN*);
     73: PETSC_EXTERN PetscErrorCode FNSetType(FN,FNType);
     74: PETSC_EXTERN PetscErrorCode FNGetType(FN,FNType*);
     75: PETSC_EXTERN PetscErrorCode FNSetOptionsPrefix(FN,const char *);
     76: PETSC_EXTERN PetscErrorCode FNAppendOptionsPrefix(FN,const char *);
     77: PETSC_EXTERN PetscErrorCode FNGetOptionsPrefix(FN,const char *[]);
     78: PETSC_EXTERN PetscErrorCode FNSetFromOptions(FN);
     79: PETSC_EXTERN PetscErrorCode FNView(FN,PetscViewer);
     80: PETSC_EXTERN PetscErrorCode FNDestroy(FN*);
     81: PETSC_EXTERN PetscErrorCode FNDuplicate(FN,MPI_Comm,FN*);

     83: PETSC_EXTERN PetscErrorCode FNSetScale(FN,PetscScalar,PetscScalar);
     84: PETSC_EXTERN PetscErrorCode FNGetScale(FN,PetscScalar*,PetscScalar*);
     85: PETSC_EXTERN PetscErrorCode FNSetMethod(FN,PetscInt);
     86: PETSC_EXTERN PetscErrorCode FNGetMethod(FN,PetscInt*);
     87: PETSC_EXTERN PetscErrorCode FNSetParallel(FN,FNParallelType);
     88: PETSC_EXTERN PetscErrorCode FNGetParallel(FN,FNParallelType*);

     90: PETSC_EXTERN PetscErrorCode FNEvaluateFunction(FN,PetscScalar,PetscScalar*);
     91: PETSC_EXTERN PetscErrorCode FNEvaluateDerivative(FN,PetscScalar,PetscScalar*);
     92: PETSC_EXTERN PetscErrorCode FNEvaluateFunctionMat(FN,Mat,Mat);
     93: PETSC_EXTERN PetscErrorCode FNEvaluateFunctionMatVec(FN,Mat,Vec);

     95: PETSC_EXTERN PetscFunctionList FNList;
     96: PETSC_EXTERN PetscErrorCode FNRegister(const char[],PetscErrorCode(*)(FN));

     98: /* --------- options specific to particular functions -------- */

    100: PETSC_EXTERN PetscErrorCode FNRationalSetNumerator(FN,PetscInt,PetscScalar*);
    101: PETSC_EXTERN PetscErrorCode FNRationalGetNumerator(FN,PetscInt*,PetscScalar**);
    102: PETSC_EXTERN PetscErrorCode FNRationalSetDenominator(FN,PetscInt,PetscScalar*);
    103: PETSC_EXTERN PetscErrorCode FNRationalGetDenominator(FN,PetscInt*,PetscScalar**);

    105: PETSC_EXTERN PetscErrorCode FNCombineSetChildren(FN,FNCombineType,FN,FN);
    106: PETSC_EXTERN PetscErrorCode FNCombineGetChildren(FN,FNCombineType*,FN*,FN*);

    108: PETSC_EXTERN PetscErrorCode FNPhiSetIndex(FN,PetscInt);
    109: PETSC_EXTERN PetscErrorCode FNPhiGetIndex(FN,PetscInt*);

    111: #endif