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