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
 
76
    Level: advanced
77
 
78
.seealso: PSGetArray(), PSGetArrayReal(), PSComputeVector()
79
E*/
80
typedef enum { PS_MAT_A,
81
               PS_MAT_B,
82
               PS_MAT_C,
83
               PS_MAT_Q,
84
               PS_MAT_X,
85
               PS_MAT_Y,
86
               PS_MAT_U,
87
               PS_MAT_VT,
88
               PS_NUM_MAT } PSMatType;
89
 
90
extern PetscErrorCode PSCreate(MPI_Comm,PS*);
91
extern PetscErrorCode PSSetType(PS,const PSType);
92
extern PetscErrorCode PSGetType(PS,const PSType*);
93
extern PetscErrorCode PSSetOptionsPrefix(PS,const char *);
94
extern PetscErrorCode PSAppendOptionsPrefix(PS,const char *);
95
extern PetscErrorCode PSGetOptionsPrefix(PS,const char *[]);
96
extern PetscErrorCode PSSetFromOptions(PS);
97
extern PetscErrorCode PSView(PS,PetscViewer);
98
extern PetscErrorCode PSDestroy(PS*);
99
extern PetscErrorCode PSReset(PS);
100
 
101
extern PetscErrorCode PSAllocate(PS,PetscInt);
2758 jroman 102
extern PetscErrorCode PSGetLeadingDimension(PS,PetscInt*);
2757 jroman 103
extern PetscErrorCode PSSetState(PS,PSStateType);
104
extern PetscErrorCode PSGetState(PS,PSStateType*);
105
extern PetscErrorCode PSSetDimensions(PS,PetscInt,PetscInt,PetscInt);
106
extern PetscErrorCode PSGetDimensions(PS,PetscInt*,PetscInt*,PetscInt*);
107
extern PetscErrorCode PSGetArray(PS,PSMatType,PetscScalar *a[]);
108
extern PetscErrorCode PSRestoreArray(PS,PSMatType,PetscScalar *a[]);
109
extern PetscErrorCode PSGetArrayReal(PS,PSMatType,PetscReal *a[]);
110
extern PetscErrorCode PSRestoreArrayReal(PS,PSMatType,PetscReal *a[]);
111
extern PetscErrorCode PSComputeVector(PS,PetscInt,PSMatType,PetscBool*);
2759 jroman 112
extern PetscErrorCode PSSolve(PS,PetscScalar*,PetscScalar*);
113
extern PetscErrorCode PSSort(PS,PetscScalar*,PetscScalar*);
2757 jroman 114
 
115
extern PetscFList PSList;
116
extern PetscBool  PSRegisterAllCalled;
117
extern PetscErrorCode PSRegisterAll(const char[]);
118
extern PetscErrorCode PSRegister(const char[],const char[],const char[],PetscErrorCode(*)(PS));
119
extern PetscErrorCode PSRegisterDestroy(void);
120
 
121
/*MC
122
   PSRegisterDynamic - Adds a projected system to the PS package.
123
 
124
   Synopsis:
125
   PetscErrorCode PSRegisterDynamic(const char *name,const char *path,const char *name_create,PetscErrorCode (*routine_create)(PS))
126
 
127
   Not collective
128
 
129
   Input Parameters:
130
+  name - name of a new user-defined PS
131
.  path - path (either absolute or relative) the library containing this solver
132
.  name_create - name of routine to create context
133
-  routine_create - routine to create context
134
 
135
   Notes:
136
   PSRegisterDynamic() may be called multiple times to add several user-defined
137
   projected systems.
138
 
139
   If dynamic libraries are used, then the fourth input argument (routine_create)
140
   is ignored.
141
 
142
   Level: advanced
143
 
144
.seealso: PSRegisterDestroy(), PSRegisterAll()
145
M*/
146
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
147
#define PSRegisterDynamic(a,b,c,d) PSRegister(a,b,c,0)
148
#else
149
#define PSRegisterDynamic(a,b,c,d) PSRegister(a,b,c,d)
150
#endif
151
 
152
PETSC_EXTERN_CXX_END
153
#endif