Subversion Repositories slepc-dev

Rev

Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2757 jroman 1
/*
2
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3
   SLEPc - Scalable Library for Eigenvalue Problem Computations
4
   Copyright (c) 2002-2011, Universitat Politecnica de Valencia, Spain
5
 
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/>.
19
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
20
*/
21
 
22
#if !defined(__SLEPCPS_H)
23
#define __SLEPCPS_H
24
#include "slepcsys.h"
25
PETSC_EXTERN_CXX_BEGIN
26
 
27
extern PetscErrorCode PSInitializePackage(const char[]);
28
/*S
29
    PS - Projected system, to represent low-dimensional eigenproblems that
30
    must be solved within iterative solvers. This is an auxiliary object
31
    and is not normally needed by application programmers.
32
 
33
    Level: advanced
34
 
35
.seealso:  PSCreate()
36
S*/
37
typedef struct _p_PS* PS;
38
 
39
/*E
40
    PSType - String with the name of the type of projected system. Roughly,
41
    there are as many types as problem types are available within SLEPc,
42
    with some specific types for particular matrix structures.
43
 
44
    Level: advanced
45
 
46
.seealso: PSSetType(), PS
47
E*/
48
#define PSType            char*
49
#define PSHEP             "hep"
50
#define PSNHEP            "nhep"
51
#define PSGHEP            "ghep"
52
#define PSGNHEP           "gnhep"
53
#define PSARROWTRIDSYMM   "arrowtridsymm"
54
#define PSARROWTRIDPSEUDO "arrowtridpseudo"
55
#define PSSVD             "svd"
56
#define PSQEP             "qep"
57
 
58
/* Logging support */
59
extern PetscClassId PS_CLASSID;
60
 
61
/*E
62
    PSStateType - to indicate in which state the projected problem is
63
 
64
    Level: advanced
65
 
66
.seealso: PSSetState()
67
E*/
68
typedef enum { PS_STATE_RAW,
69
               PS_STATE_INTERMEDIATE,
70
               PS_STATE_CONDENSED,
71
               PS_STATE_SORTED } PSStateType;
72
 
73
/*E
74
    PSMatType - to refer to one of the matrices stored internally in PS
75
 
2775 jroman 76
    Notes:
77
    The matrices preferently refer to:
78
+   PS_MAT_A  - first matrix of eigenproblem/singular value problem
79
.   PS_MAT_B  - second matrix of a generalized eigenproblem
80
.   PS_MAT_C  - third matrix of a quadratic eigenproblem
81
.   PS_MAT_T  - tridiagonal matrix
82
.   PS_MAT_Q  - orthogonal matrix of Schur vectors
83
.   PS_MAT_X  - right eigenvectors
84
.   PS_MAT_Y  - left eigenvectors
85
.   PS_MAT_U  - left singular vectors
86
.   PS_MAT_VT - right singular vectors
87
-   PS_MAT_W  - workspace matrix
88
 
89
    All matrices can have space to hold ld x ld elements, except for
90
    PS_MAT_T that has space for 3 x ld elements (ld = leading dimension).
91
 
2757 jroman 92
    Level: advanced
93
 
2775 jroman 94
.seealso: PSAllocate(), PSGetArray(), PSGetArrayReal(), PSComputeVector()
2757 jroman 95
E*/
96
typedef enum { PS_MAT_A,
97
               PS_MAT_B,
98
               PS_MAT_C,
2775 jroman 99
               PS_MAT_T,
2757 jroman 100
               PS_MAT_Q,
101
               PS_MAT_X,
102
               PS_MAT_Y,
103
               PS_MAT_U,
104
               PS_MAT_VT,
2766 jroman 105
               PS_MAT_W,
2757 jroman 106
               PS_NUM_MAT } PSMatType;
107
 
108
extern PetscErrorCode PSCreate(MPI_Comm,PS*);
109
extern PetscErrorCode PSSetType(PS,const PSType);
110
extern PetscErrorCode PSGetType(PS,const PSType*);
111
extern PetscErrorCode PSSetOptionsPrefix(PS,const char *);
112
extern PetscErrorCode PSAppendOptionsPrefix(PS,const char *);
113
extern PetscErrorCode PSGetOptionsPrefix(PS,const char *[]);
114
extern PetscErrorCode PSSetFromOptions(PS);
115
extern PetscErrorCode PSView(PS,PetscViewer);
116
extern PetscErrorCode PSDestroy(PS*);
117
extern PetscErrorCode PSReset(PS);
118
 
119
extern PetscErrorCode PSAllocate(PS,PetscInt);
2758 jroman 120
extern PetscErrorCode PSGetLeadingDimension(PS,PetscInt*);
2757 jroman 121
extern PetscErrorCode PSSetState(PS,PSStateType);
122
extern PetscErrorCode PSGetState(PS,PSStateType*);
123
extern PetscErrorCode PSSetDimensions(PS,PetscInt,PetscInt,PetscInt);
124
extern PetscErrorCode PSGetDimensions(PS,PetscInt*,PetscInt*,PetscInt*);
125
extern PetscErrorCode PSGetArray(PS,PSMatType,PetscScalar *a[]);
126
extern PetscErrorCode PSRestoreArray(PS,PSMatType,PetscScalar *a[]);
127
extern PetscErrorCode PSGetArrayReal(PS,PSMatType,PetscReal *a[]);
128
extern PetscErrorCode PSRestoreArrayReal(PS,PSMatType,PetscReal *a[]);
129
extern PetscErrorCode PSComputeVector(PS,PetscInt,PSMatType,PetscBool*);
2759 jroman 130
extern PetscErrorCode PSSolve(PS,PetscScalar*,PetscScalar*);
2763 jroman 131
extern PetscErrorCode PSSort(PS,PetscScalar*,PetscScalar*,PetscErrorCode (*)(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*),void*);
2766 jroman 132
extern PetscErrorCode PSCond(PS,PetscReal*);
2773 jroman 133
extern PetscErrorCode PSTranslateHarmonic(PS,PetscScalar,PetscReal,PetscBool,PetscScalar*,PetscReal*);
2757 jroman 134
 
135
extern PetscFList PSList;
136
extern PetscBool  PSRegisterAllCalled;
137
extern PetscErrorCode PSRegisterAll(const char[]);
138
extern PetscErrorCode PSRegister(const char[],const char[],const char[],PetscErrorCode(*)(PS));
139
extern PetscErrorCode PSRegisterDestroy(void);
140
 
141
/*MC
142
   PSRegisterDynamic - Adds a projected system to the PS package.
143
 
144
   Synopsis:
145
   PetscErrorCode PSRegisterDynamic(const char *name,const char *path,const char *name_create,PetscErrorCode (*routine_create)(PS))
146
 
147
   Not collective
148
 
149
   Input Parameters:
150
+  name - name of a new user-defined PS
151
.  path - path (either absolute or relative) the library containing this solver
152
.  name_create - name of routine to create context
153
-  routine_create - routine to create context
154
 
155
   Notes:
156
   PSRegisterDynamic() may be called multiple times to add several user-defined
157
   projected systems.
158
 
159
   If dynamic libraries are used, then the fourth input argument (routine_create)
160
   is ignored.
161
 
162
   Level: advanced
163
 
164
.seealso: PSRegisterDestroy(), PSRegisterAll()
165
M*/
166
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
167
#define PSRegisterDynamic(a,b,c,d) PSRegister(a,b,c,0)
168
#else
169
#define PSRegisterDynamic(a,b,c,d) PSRegister(a,b,c,d)
170
#endif
171
 
172
PETSC_EXTERN_CXX_END
173
#endif