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 PSSVD             "svd"
54
#define PSQEP             "qep"
55
 
56
/* Logging support */
57
extern PetscClassId PS_CLASSID;
58
 
59
/*E
60
    PSStateType - to indicate in which state the projected problem is
61
 
62
    Level: advanced
63
 
64
.seealso: PSSetState()
65
E*/
66
typedef enum { PS_STATE_RAW,
67
               PS_STATE_INTERMEDIATE,
68
               PS_STATE_CONDENSED,
69
               PS_STATE_SORTED } PSStateType;
70
 
71
/*E
72
    PSMatType - to refer to one of the matrices stored internally in PS
73
 
2775 jroman 74
    Notes:
75
    The matrices preferently refer to:
76
+   PS_MAT_A  - first matrix of eigenproblem/singular value problem
77
.   PS_MAT_B  - second matrix of a generalized eigenproblem
78
.   PS_MAT_C  - third matrix of a quadratic eigenproblem
79
.   PS_MAT_T  - tridiagonal matrix
80
.   PS_MAT_Q  - orthogonal matrix of Schur vectors
81
.   PS_MAT_X  - right eigenvectors
82
.   PS_MAT_Y  - left eigenvectors
83
.   PS_MAT_U  - left singular vectors
84
.   PS_MAT_VT - right singular vectors
85
-   PS_MAT_W  - workspace matrix
86
 
87
    All matrices can have space to hold ld x ld elements, except for
88
    PS_MAT_T that has space for 3 x ld elements (ld = leading dimension).
89
 
2757 jroman 90
    Level: advanced
91
 
2807 jroman 92
.seealso: PSAllocate(), PSGetArray(), PSGetArrayReal(), PSVectors()
2757 jroman 93
E*/
94
typedef enum { PS_MAT_A,
95
               PS_MAT_B,
96
               PS_MAT_C,
2775 jroman 97
               PS_MAT_T,
2757 jroman 98
               PS_MAT_Q,
99
               PS_MAT_X,
100
               PS_MAT_Y,
101
               PS_MAT_U,
102
               PS_MAT_VT,
2766 jroman 103
               PS_MAT_W,
2757 jroman 104
               PS_NUM_MAT } PSMatType;
105
 
106
extern PetscErrorCode PSCreate(MPI_Comm,PS*);
107
extern PetscErrorCode PSSetType(PS,const PSType);
108
extern PetscErrorCode PSGetType(PS,const PSType*);
109
extern PetscErrorCode PSSetOptionsPrefix(PS,const char *);
110
extern PetscErrorCode PSAppendOptionsPrefix(PS,const char *);
111
extern PetscErrorCode PSGetOptionsPrefix(PS,const char *[]);
112
extern PetscErrorCode PSSetFromOptions(PS);
113
extern PetscErrorCode PSView(PS,PetscViewer);
114
extern PetscErrorCode PSDestroy(PS*);
115
extern PetscErrorCode PSReset(PS);
116
 
117
extern PetscErrorCode PSAllocate(PS,PetscInt);
2758 jroman 118
extern PetscErrorCode PSGetLeadingDimension(PS,PetscInt*);
2757 jroman 119
extern PetscErrorCode PSSetState(PS,PSStateType);
120
extern PetscErrorCode PSGetState(PS,PSStateType*);
121
extern PetscErrorCode PSSetDimensions(PS,PetscInt,PetscInt,PetscInt);
122
extern PetscErrorCode PSGetDimensions(PS,PetscInt*,PetscInt*,PetscInt*);
2793 jroman 123
extern PetscErrorCode PSSetMethod(PS,PetscInt);
124
extern PetscErrorCode PSGetMethod(PS,PetscInt*);
2794 jroman 125
extern PetscErrorCode PSSetCompact(PS,PetscBool);
126
extern PetscErrorCode PSGetCompact(PS,PetscBool*);
2757 jroman 127
extern PetscErrorCode PSGetArray(PS,PSMatType,PetscScalar *a[]);
128
extern PetscErrorCode PSRestoreArray(PS,PSMatType,PetscScalar *a[]);
129
extern PetscErrorCode PSGetArrayReal(PS,PSMatType,PetscReal *a[]);
130
extern PetscErrorCode PSRestoreArrayReal(PS,PSMatType,PetscReal *a[]);
2807 jroman 131
extern PetscErrorCode PSVectors(PS,PSMatType,PetscInt*,PetscReal*);
2759 jroman 132
extern PetscErrorCode PSSolve(PS,PetscScalar*,PetscScalar*);
2763 jroman 133
extern PetscErrorCode PSSort(PS,PetscScalar*,PetscScalar*,PetscErrorCode (*)(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*),void*);
2766 jroman 134
extern PetscErrorCode PSCond(PS,PetscReal*);
2773 jroman 135
extern PetscErrorCode PSTranslateHarmonic(PS,PetscScalar,PetscReal,PetscBool,PetscScalar*,PetscReal*);
2757 jroman 136
 
137
extern PetscFList PSList;
138
extern PetscBool  PSRegisterAllCalled;
139
extern PetscErrorCode PSRegisterAll(const char[]);
140
extern PetscErrorCode PSRegister(const char[],const char[],const char[],PetscErrorCode(*)(PS));
141
extern PetscErrorCode PSRegisterDestroy(void);
142
 
143
/*MC
144
   PSRegisterDynamic - Adds a projected system to the PS package.
145
 
146
   Synopsis:
147
   PetscErrorCode PSRegisterDynamic(const char *name,const char *path,const char *name_create,PetscErrorCode (*routine_create)(PS))
148
 
149
   Not collective
150
 
151
   Input Parameters:
152
+  name - name of a new user-defined PS
153
.  path - path (either absolute or relative) the library containing this solver
154
.  name_create - name of routine to create context
155
-  routine_create - routine to create context
156
 
157
   Notes:
158
   PSRegisterDynamic() may be called multiple times to add several user-defined
159
   projected systems.
160
 
161
   If dynamic libraries are used, then the fourth input argument (routine_create)
162
   is ignored.
163
 
164
   Level: advanced
165
 
166
.seealso: PSRegisterDestroy(), PSRegisterAll()
167
M*/
168
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
169
#define PSRegisterDynamic(a,b,c,d) PSRegister(a,b,c,0)
170
#else
171
#define PSRegisterDynamic(a,b,c,d) PSRegister(a,b,c,d)
172
#endif
173
 
174
PETSC_EXTERN_CXX_END
175
#endif