Actual source code: slepcip.h

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

  6:    This file is part of SLEPc.
  7:       
  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 IPInitializePackage(const char[]);
 27: /*S
 28:     IP - Abstraction of a vector inner product, that can be defined
 29:     in different ways. Using this object is not required for application
 30:     programmers.

 32:     Level: beginner

 34: .seealso:  IPCreate()
 35: S*/
 36: typedef struct _p_IP* IP;

 38: /*E
 39:     IPType - String with the name of the inner product. For complex scalars,
 40:     it is possible to choose between a sesquilinear form (x,y)=x^H*M*y (the default)
 41:     or a bilinear form (x,y)=x^T*M*y (without complex conjugation). In the case
 42:     of real scalars, only the bilinear form (x,y)=x^T*M*y is available.
 43:     Apart form these, there is also an indefinite inner product, defined by
 44:     and indefinite matrix M.

 46:     Level: advanced

 48: .seealso: IPSetType(), IP
 49: E*/
 50: #define IPType         char*
 51: #define IPBILINEAR     "bilinear"
 52: #define IPSESQUILINEAR "sesquilinear"
 53: #define IPINDEFINITE   "indefinite"

 55: /* Logging support */
 56: PETSC_EXTERN PetscClassId IP_CLASSID;

 58: /*E
 59:     IPOrthogType - determines what type of orthogonalization to use

 61:     Level: advanced

 63: .seealso: IPSetOrthogonalization(), IPGetOrthogonalization(), IPOrthogonalize()
 64: E*/
 65: typedef enum { IP_ORTHOG_MGS,
 66:                IP_ORTHOG_CGS } IPOrthogType;

 68: /*E
 69:     IPOrthogRefineType - determines what type of refinement
 70:     to use during orthogonalization

 72:     Level: advanced

 74: .seealso: IPSetOrthogonalization(), IPGetOrthogonalization(), IPOrthogonalize()
 75: E*/
 76: typedef enum { IP_ORTHOG_REFINE_NEVER,
 77:                IP_ORTHOG_REFINE_IFNEEDED,
 78:                IP_ORTHOG_REFINE_ALWAYS } IPOrthogRefineType;

 80: PETSC_EXTERN PetscErrorCode IPCreate(MPI_Comm,IP*);
 81: PETSC_EXTERN PetscErrorCode IPSetType(IP,const IPType);
 82: PETSC_EXTERN PetscErrorCode IPGetType(IP,const IPType*);
 83: PETSC_EXTERN PetscErrorCode IPSetOptionsPrefix(IP,const char *);
 84: PETSC_EXTERN PetscErrorCode IPAppendOptionsPrefix(IP,const char *);
 85: PETSC_EXTERN PetscErrorCode IPGetOptionsPrefix(IP,const char *[]);
 86: PETSC_EXTERN PetscErrorCode IPSetFromOptions(IP);
 87: PETSC_EXTERN PetscErrorCode IPSetOrthogonalization(IP,IPOrthogType,IPOrthogRefineType,PetscReal);
 88: PETSC_EXTERN PetscErrorCode IPGetOrthogonalization(IP,IPOrthogType*,IPOrthogRefineType*,PetscReal*);
 89: PETSC_EXTERN PetscErrorCode IPView(IP,PetscViewer);
 90: PETSC_EXTERN PetscErrorCode IPDestroy(IP*);
 91: PETSC_EXTERN PetscErrorCode IPReset(IP);

 93: PETSC_EXTERN PetscErrorCode IPOrthogonalize(IP,PetscInt,Vec*,PetscInt,PetscBool*,Vec*,Vec,PetscScalar*,PetscReal*,PetscBool*);
 94: PETSC_EXTERN PetscErrorCode IPBOrthogonalize(IP,PetscInt,Vec*,Vec*,PetscReal*,PetscInt,PetscBool*,Vec*,Vec*,PetscReal*,Vec,Vec,PetscScalar*,PetscReal*,PetscBool*);
 95: PETSC_EXTERN PetscErrorCode IPBiOrthogonalize(IP,PetscInt,Vec*,Vec*,Vec,PetscScalar*,PetscReal*);
 96: PETSC_EXTERN PetscErrorCode IPPseudoOrthogonalize(IP,PetscInt,Vec*,PetscReal*,Vec,PetscScalar*,PetscReal*,PetscBool*);
 97: PETSC_EXTERN PetscErrorCode IPQRDecomposition(IP,Vec*,PetscInt,PetscInt,PetscScalar*,PetscInt);

 99: PETSC_EXTERN PetscErrorCode IPSetMatrix(IP,Mat);
100: PETSC_EXTERN PetscErrorCode IPGetMatrix(IP,Mat*);
101: PETSC_EXTERN PetscErrorCode IPApplyMatrix(IP,Vec,Vec);

103: PETSC_EXTERN PetscErrorCode IPInnerProduct(IP ip,Vec,Vec,PetscScalar*);
104: PETSC_EXTERN PetscErrorCode IPInnerProductBegin(IP ip,Vec,Vec,PetscScalar*);
105: PETSC_EXTERN PetscErrorCode IPInnerProductEnd(IP ip,Vec,Vec,PetscScalar*);
106: PETSC_EXTERN PetscErrorCode IPMInnerProduct(IP ip,Vec,PetscInt,const Vec[],PetscScalar*);
107: PETSC_EXTERN PetscErrorCode IPMInnerProductBegin(IP ip,Vec,PetscInt,const Vec[],PetscScalar*);
108: PETSC_EXTERN PetscErrorCode IPMInnerProductEnd(IP ip,Vec,PetscInt,const Vec[],PetscScalar*);
109: PETSC_EXTERN PetscErrorCode IPNorm(IP ip,Vec,PetscReal*);
110: PETSC_EXTERN PetscErrorCode IPNormBegin(IP ip,Vec,PetscReal*);
111: PETSC_EXTERN PetscErrorCode IPNormEnd(IP ip,Vec,PetscReal*);

113: PETSC_EXTERN PetscFList IPList;
114: PETSC_EXTERN PetscBool  IPRegisterAllCalled;
115: PETSC_EXTERN PetscErrorCode IPRegisterAll(const char[]);
116: PETSC_EXTERN PetscErrorCode IPRegister(const char[],const char[],const char[],PetscErrorCode(*)(IP));
117: PETSC_EXTERN PetscErrorCode IPRegisterDestroy(void);

119: /*MC
120:    IPRegisterDynamic - Adds an inner product to the IP package.

122:    Synopsis:
123:    PetscErrorCode IPRegisterDynamic(const char *name,const char *path,const char *name_create,PetscErrorCode (*routine_create)(IP))

125:    Not collective

127:    Input Parameters:
128: +  name - name of a new user-defined IP
129: .  path - path (either absolute or relative) the library containing this solver
130: .  name_create - name of routine to create context
131: -  routine_create - routine to create context

133:    Notes:
134:    IPRegisterDynamic() may be called multiple times to add several user-defined inner products.

136:    If dynamic libraries are used, then the fourth input argument (routine_create)
137:    is ignored.

139:    Level: advanced

141: .seealso: IPRegisterDestroy(), IPRegisterAll()
142: M*/
143: #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
144: #define IPRegisterDynamic(a,b,c,d) IPRegister(a,b,c,0)
145: #else
146: #define IPRegisterDynamic(a,b,c,d) IPRegister(a,b,c,d)
147: #endif

149: PETSC_EXTERN PetscErrorCode IPGetOperationCounters(IP,PetscInt*);
150: PETSC_EXTERN PetscErrorCode IPResetOperationCounters(IP);

152: #endif