Actual source code: slepcfn.h
slepc-3.7.1 2016-05-27
1: /*
2: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3: SLEPc - Scalable Library for Eigenvalue Problem Computations
4: Copyright (c) 2002-2016, Universitat Politecnica de Valencia, Spain
6: This file is part of SLEPc.
8: SLEPc is free software: you can redistribute it and/or modify it under the
9: terms of version 3 of the GNU Lesser General Public License as published by
10: the Free Software Foundation.
12: SLEPc is distributed in the hope that it will be useful, but WITHOUT ANY
13: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14: FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15: more details.
17: You should have received a copy of the GNU Lesser General Public License
18: along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
19: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
20: */
24: #include <slepcsys.h>
26: PETSC_EXTERN PetscErrorCode FNInitializePackage(void);
27: /*S
28: FN - Abstraction of a mathematical function.
30: Level: beginner
32: .seealso: FNCreate()
33: S*/
34: typedef struct _p_FN* FN;
36: /*J
37: FNType - String with the name of the mathematical function.
39: Level: beginner
41: .seealso: FNSetType(), FN
42: J*/
43: typedef const char* FNType;
44: #define FNCOMBINE "combine"
45: #define FNRATIONAL "rational"
46: #define FNEXP "exp"
47: #define FNLOG "log"
48: #define FNPHI "phi"
49: #define FNSQRT "sqrt"
50: #define FNINVSQRT "invsqrt"
52: /* Logging support */
53: PETSC_EXTERN PetscClassId FN_CLASSID;
55: /*E
56: FNCombineType - Determines how two functions are combined
58: Level: advanced
60: .seealso: FNCombineSetChildren()
61: E*/
62: typedef enum { FN_COMBINE_ADD,
63: FN_COMBINE_MULTIPLY,
64: FN_COMBINE_DIVIDE,
65: FN_COMBINE_COMPOSE } FNCombineType;
67: PETSC_EXTERN PetscErrorCode FNCreate(MPI_Comm,FN*);
68: PETSC_EXTERN PetscErrorCode FNSetType(FN,FNType);
69: PETSC_EXTERN PetscErrorCode FNGetType(FN,FNType*);
70: PETSC_EXTERN PetscErrorCode FNSetOptionsPrefix(FN,const char *);
71: PETSC_EXTERN PetscErrorCode FNAppendOptionsPrefix(FN,const char *);
72: PETSC_EXTERN PetscErrorCode FNGetOptionsPrefix(FN,const char *[]);
73: PETSC_EXTERN PetscErrorCode FNSetFromOptions(FN);
74: PETSC_EXTERN PetscErrorCode FNView(FN,PetscViewer);
75: PETSC_EXTERN PetscErrorCode FNDestroy(FN*);
76: PETSC_EXTERN PetscErrorCode FNDuplicate(FN,MPI_Comm,FN*);
78: PETSC_EXTERN PetscErrorCode FNSetScale(FN,PetscScalar,PetscScalar);
79: PETSC_EXTERN PetscErrorCode FNGetScale(FN,PetscScalar*,PetscScalar*);
81: PETSC_EXTERN PetscErrorCode FNEvaluateFunction(FN,PetscScalar,PetscScalar*);
82: PETSC_EXTERN PetscErrorCode FNEvaluateDerivative(FN,PetscScalar,PetscScalar*);
83: PETSC_EXTERN PetscErrorCode FNEvaluateFunctionMat(FN,Mat,Mat);
84: PETSC_EXTERN PetscErrorCode FNEvaluateFunctionMatVec(FN,Mat,Vec);
86: PETSC_EXTERN PetscFunctionList FNList;
87: PETSC_EXTERN PetscErrorCode FNRegister(const char[],PetscErrorCode(*)(FN));
89: /* --------- options specific to particular functions -------- */
91: PETSC_EXTERN PetscErrorCode FNRationalSetNumerator(FN,PetscInt,PetscScalar*);
92: PETSC_EXTERN PetscErrorCode FNRationalGetNumerator(FN,PetscInt*,PetscScalar**);
93: PETSC_EXTERN PetscErrorCode FNRationalSetDenominator(FN,PetscInt,PetscScalar*);
94: PETSC_EXTERN PetscErrorCode FNRationalGetDenominator(FN,PetscInt*,PetscScalar**);
96: PETSC_EXTERN PetscErrorCode FNCombineSetChildren(FN,FNCombineType,FN,FN);
97: PETSC_EXTERN PetscErrorCode FNCombineGetChildren(FN,FNCombineType*,FN*,FN*);
99: PETSC_EXTERN PetscErrorCode FNPhiSetIndex(FN,PetscInt);
100: PETSC_EXTERN PetscErrorCode FNPhiGetIndex(FN,PetscInt*);
102: #endif