| 1376 |
slepc |
1 |
/*
|
|
|
2 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
| 1672 |
slepc |
3 |
SLEPc - Scalable Library for Eigenvalue Problem Computations
|
| 2575 |
eromero |
4 |
Copyright (c) 2002-2011, Universitat Politecnica de Valencia, Spain
|
| 1376 |
slepc |
5 |
|
| 1672 |
slepc |
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.
|
|
|
11 |
|
|
|
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.
|
|
|
16 |
|
|
|
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/>.
|
| 1376 |
slepc |
19 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
20 |
*/
|
|
|
21 |
|
| 1302 |
slepc |
22 |
#if !defined(__SLEPCIP_H)
|
|
|
23 |
#define __SLEPCIP_H
|
| 1885 |
jroman |
24 |
#include "slepcsys.h"
|
| 1302 |
slepc |
25 |
PETSC_EXTERN_CXX_BEGIN
|
|
|
26 |
|
| 2375 |
jroman |
27 |
extern PetscErrorCode IPInitializePackage(const char[]);
|
| 2373 |
jroman |
28 |
/*S
|
|
|
29 |
IP - Abstraction of a vector inner product, that can be defined
|
|
|
30 |
in different ways. Using this object is not required for application
|
|
|
31 |
programmers.
|
|
|
32 |
|
|
|
33 |
Level: beginner
|
|
|
34 |
|
|
|
35 |
.seealso: IPCreate()
|
|
|
36 |
S*/
|
|
|
37 |
typedef struct _p_IP* IP;
|
|
|
38 |
|
| 1364 |
slepc |
39 |
/*E
|
| 2373 |
jroman |
40 |
IPType - String with the name of the inner product. For complex scalars,
|
|
|
41 |
it is possible to choose between a sesquilinear form (x,y)=x^H*M*y (the default)
|
|
|
42 |
or a bilinear form (x,y)=x^T*M*y (without complex conjugation). In the case
|
|
|
43 |
of real scalars, only the bilinear form (x,y)=x^T*M*y is available.
|
|
|
44 |
|
|
|
45 |
Level: advanced
|
|
|
46 |
|
|
|
47 |
.seealso: IPSetType(), IP
|
|
|
48 |
E*/
|
|
|
49 |
#define IPType char*
|
|
|
50 |
#define IPBILINEAR "bilinear"
|
|
|
51 |
#define IPSESQUILINEAR "sesquilinear"
|
|
|
52 |
|
| 2375 |
jroman |
53 |
/* Logging support */
|
|
|
54 |
extern PetscClassId IP_CLASSID;
|
|
|
55 |
|
| 2373 |
jroman |
56 |
/*E
|
| 2370 |
jroman |
57 |
IPOrthogType - determines what type of orthogonalization to use
|
| 1364 |
slepc |
58 |
|
|
|
59 |
Level: advanced
|
|
|
60 |
|
|
|
61 |
.seealso: IPSetOrthogonalization(), IPGetOrthogonalization(), IPOrthogonalize()
|
|
|
62 |
E*/
|
| 2370 |
jroman |
63 |
typedef enum { IP_ORTHOG_MGS,
|
|
|
64 |
IP_ORTHOG_CGS } IPOrthogType;
|
| 1364 |
slepc |
65 |
|
|
|
66 |
/*E
|
| 2370 |
jroman |
67 |
IPOrthogRefineType - determines what type of refinement
|
| 1364 |
slepc |
68 |
to use during orthogonalization
|
|
|
69 |
|
|
|
70 |
Level: advanced
|
|
|
71 |
|
|
|
72 |
.seealso: IPSetOrthogonalization(), IPGetOrthogonalization(), IPOrthogonalize()
|
|
|
73 |
E*/
|
| 2370 |
jroman |
74 |
typedef enum { IP_ORTHOG_REFINE_NEVER,
|
|
|
75 |
IP_ORTHOG_REFINE_IFNEEDED,
|
|
|
76 |
IP_ORTHOG_REFINE_ALWAYS } IPOrthogRefineType;
|
| 1302 |
slepc |
77 |
|
| 2240 |
jroman |
78 |
extern PetscErrorCode IPCreate(MPI_Comm,IP*);
|
| 2373 |
jroman |
79 |
extern PetscErrorCode IPSetType(IP,const IPType);
|
|
|
80 |
extern PetscErrorCode IPGetType(IP,const IPType*);
|
| 2240 |
jroman |
81 |
extern PetscErrorCode IPSetOptionsPrefix(IP,const char *);
|
|
|
82 |
extern PetscErrorCode IPAppendOptionsPrefix(IP,const char *);
|
|
|
83 |
extern PetscErrorCode IPGetOptionsPrefix(IP,const char *[]);
|
|
|
84 |
extern PetscErrorCode IPSetFromOptions(IP);
|
| 2370 |
jroman |
85 |
extern PetscErrorCode IPSetOrthogonalization(IP,IPOrthogType,IPOrthogRefineType,PetscReal);
|
|
|
86 |
extern PetscErrorCode IPGetOrthogonalization(IP,IPOrthogType*,IPOrthogRefineType*,PetscReal*);
|
| 2240 |
jroman |
87 |
extern PetscErrorCode IPView(IP,PetscViewer);
|
| 2312 |
jroman |
88 |
extern PetscErrorCode IPDestroy(IP*);
|
| 2348 |
jroman |
89 |
extern PetscErrorCode IPReset(IP);
|
| 1302 |
slepc |
90 |
|
| 2240 |
jroman |
91 |
extern PetscErrorCode IPOrthogonalize(IP,PetscInt,Vec*,PetscInt,PetscBool*,Vec*,Vec,PetscScalar*,PetscReal*,PetscBool*);
|
| 2779 |
eromero |
92 |
extern PetscErrorCode IPBOrthogonalize(IP ip,PetscInt nds,Vec *DS, Vec *BDS,PetscReal *BDSnorms,PetscInt n,PetscBool *which,Vec *V,Vec *BV,PetscReal *BVnorms,Vec v,Vec Bv,PetscScalar *H,PetscReal *norm,PetscBool *lindep);
|
| 2240 |
jroman |
93 |
extern PetscErrorCode IPBiOrthogonalize(IP,PetscInt,Vec*,Vec*,Vec,PetscScalar*,PetscReal*);
|
|
|
94 |
extern PetscErrorCode IPQRDecomposition(IP,Vec*,PetscInt,PetscInt,PetscScalar*,PetscInt);
|
| 1302 |
slepc |
95 |
|
| 2380 |
jroman |
96 |
extern PetscErrorCode IPSetMatrix(IP,Mat);
|
|
|
97 |
extern PetscErrorCode IPGetMatrix(IP,Mat*);
|
| 2240 |
jroman |
98 |
extern PetscErrorCode IPApplyMatrix(IP,Vec,Vec);
|
| 1302 |
slepc |
99 |
|
| 2240 |
jroman |
100 |
extern PetscErrorCode IPInnerProduct(IP ip,Vec,Vec,PetscScalar*);
|
|
|
101 |
extern PetscErrorCode IPInnerProductBegin(IP ip,Vec,Vec,PetscScalar*);
|
|
|
102 |
extern PetscErrorCode IPInnerProductEnd(IP ip,Vec,Vec,PetscScalar*);
|
|
|
103 |
extern PetscErrorCode IPMInnerProduct(IP ip,Vec,PetscInt,const Vec[],PetscScalar*);
|
|
|
104 |
extern PetscErrorCode IPMInnerProductBegin(IP ip,Vec,PetscInt,const Vec[],PetscScalar*);
|
|
|
105 |
extern PetscErrorCode IPMInnerProductEnd(IP ip,Vec,PetscInt,const Vec[],PetscScalar*);
|
|
|
106 |
extern PetscErrorCode IPNorm(IP ip,Vec,PetscReal*);
|
|
|
107 |
extern PetscErrorCode IPNormBegin(IP ip,Vec,PetscReal*);
|
|
|
108 |
extern PetscErrorCode IPNormEnd(IP ip,Vec,PetscReal*);
|
| 1302 |
slepc |
109 |
|
| 2375 |
jroman |
110 |
extern PetscFList IPList;
|
|
|
111 |
extern PetscBool IPRegisterAllCalled;
|
|
|
112 |
extern PetscErrorCode IPRegisterAll(const char[]);
|
|
|
113 |
extern PetscErrorCode IPRegister(const char[],const char[],const char[],PetscErrorCode(*)(IP));
|
|
|
114 |
extern PetscErrorCode IPRegisterDestroy(void);
|
|
|
115 |
|
|
|
116 |
/*MC
|
|
|
117 |
IPRegisterDynamic - Adds an inner product to the IP package.
|
|
|
118 |
|
|
|
119 |
Synopsis:
|
|
|
120 |
PetscErrorCode IPRegisterDynamic(const char *name,const char *path,const char *name_create,PetscErrorCode (*routine_create)(IP))
|
|
|
121 |
|
|
|
122 |
Not collective
|
|
|
123 |
|
|
|
124 |
Input Parameters:
|
|
|
125 |
+ name - name of a new user-defined IP
|
|
|
126 |
. path - path (either absolute or relative) the library containing this solver
|
|
|
127 |
. name_create - name of routine to create context
|
|
|
128 |
- routine_create - routine to create context
|
|
|
129 |
|
|
|
130 |
Notes:
|
|
|
131 |
IPRegisterDynamic() may be called multiple times to add several user-defined inner products.
|
|
|
132 |
|
|
|
133 |
If dynamic libraries are used, then the fourth input argument (routine_create)
|
|
|
134 |
is ignored.
|
|
|
135 |
|
|
|
136 |
Level: advanced
|
|
|
137 |
|
|
|
138 |
.seealso: IPRegisterDestroy(), IPRegisterAll()
|
|
|
139 |
M*/
|
| 2373 |
jroman |
140 |
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
|
|
|
141 |
#define IPRegisterDynamic(a,b,c,d) IPRegister(a,b,c,0)
|
|
|
142 |
#else
|
|
|
143 |
#define IPRegisterDynamic(a,b,c,d) IPRegister(a,b,c,d)
|
|
|
144 |
#endif
|
|
|
145 |
|
| 2240 |
jroman |
146 |
extern PetscErrorCode IPGetOperationCounters(IP,PetscInt*);
|
|
|
147 |
extern PetscErrorCode IPResetOperationCounters(IP);
|
| 1329 |
slepc |
148 |
|
| 1302 |
slepc |
149 |
PETSC_EXTERN_CXX_END
|
|
|
150 |
#endif
|