| 1976 |
eromero |
1 |
/*
|
| 2110 |
jroman |
2 |
SLEPc eigensolver: "jd"
|
| 1976 |
eromero |
3 |
|
| 2110 |
jroman |
4 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
5 |
SLEPc - Scalable Library for Eigenvalue Problem Computations
|
| 2116 |
eromero |
6 |
Copyright (c) 2002-2010, Universidad Politecnica de Valencia, Spain
|
| 1976 |
eromero |
7 |
|
| 2110 |
jroman |
8 |
This file is part of SLEPc.
|
|
|
9 |
|
|
|
10 |
SLEPc is free software: you can redistribute it and/or modify it under the
|
|
|
11 |
terms of version 3 of the GNU Lesser General Public License as published by
|
|
|
12 |
the Free Software Foundation.
|
|
|
13 |
|
|
|
14 |
SLEPc is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
15 |
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
16 |
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
|
|
17 |
more details.
|
|
|
18 |
|
|
|
19 |
You should have received a copy of the GNU Lesser General Public License
|
|
|
20 |
along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
|
|
|
21 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
| 1976 |
eromero |
22 |
*/
|
|
|
23 |
|
|
|
24 |
#include "private/epsimpl.h" /*I "slepceps.h" I*/
|
|
|
25 |
#include "private/stimpl.h"
|
| 1985 |
eromero |
26 |
#include "../src/eps/impls/davidson/common/davidson.h"
|
| 1976 |
eromero |
27 |
#include "slepcblaslapack.h"
|
|
|
28 |
|
| 2003 |
eromero |
29 |
PetscErrorCode EPSSetUp_JD(EPS eps);
|
| 1994 |
eromero |
30 |
PetscErrorCode EPSDestroy_JD(EPS eps);
|
| 1976 |
eromero |
31 |
|
|
|
32 |
EXTERN_C_BEGIN
|
|
|
33 |
#undef __FUNCT__
|
| 1994 |
eromero |
34 |
#define __FUNCT__ "EPSSetFromOptions_JD"
|
|
|
35 |
PetscErrorCode EPSSetFromOptions_JD(EPS eps)
|
| 1976 |
eromero |
36 |
{
|
|
|
37 |
PetscErrorCode ierr;
|
| 2216 |
jroman |
38 |
PetscBool flg,op;
|
| 1976 |
eromero |
39 |
PetscInt opi,opi0;
|
| 1994 |
eromero |
40 |
PetscReal opf;
|
| 1976 |
eromero |
41 |
|
|
|
42 |
PetscFunctionBegin;
|
|
|
43 |
|
| 2102 |
eromero |
44 |
ierr = PetscOptionsBegin(((PetscObject)eps)->comm,((PetscObject)eps)->prefix,"JD Options","EPS");CHKERRQ(ierr);
|
| 1976 |
eromero |
45 |
|
| 1994 |
eromero |
46 |
ierr = EPSJDGetKrylovStart(eps, &op); CHKERRQ(ierr);
|
| 2216 |
jroman |
47 |
ierr = PetscOptionsBool("-eps_jd_krylov_start","Start the searching subspace with a krylov basis","EPSJDSetKrylovStart",op,&op,&flg); CHKERRQ(ierr);
|
| 1994 |
eromero |
48 |
if(flg) { ierr = EPSJDSetKrylovStart(eps, op); CHKERRQ(ierr); }
|
| 1976 |
eromero |
49 |
|
| 1994 |
eromero |
50 |
ierr = EPSJDGetBlockSize(eps, &opi); CHKERRQ(ierr);
|
|
|
51 |
ierr = PetscOptionsInt("-eps_jd_blocksize","Number vectors add to the searching subspace (if 0, nev employed)","EPSJDSetBlockSize",opi,&opi,&flg); CHKERRQ(ierr);
|
|
|
52 |
if(flg) { ierr = EPSJDSetBlockSize(eps, opi); CHKERRQ(ierr); }
|
| 1976 |
eromero |
53 |
|
| 1994 |
eromero |
54 |
ierr = EPSJDGetRestart(eps, &opi, &opi0); CHKERRQ(ierr);
|
|
|
55 |
ierr = PetscOptionsInt("-eps_jd_minv","Set the size of the searching subspace after restarting (if 0, eps_jd_bs is employed)","EPSJDSetRestart",opi,&opi,&flg); CHKERRQ(ierr);
|
|
|
56 |
if(flg) { ierr = EPSJDSetRestart(eps, opi, opi0); CHKERRQ(ierr); }
|
| 1976 |
eromero |
57 |
|
| 1994 |
eromero |
58 |
ierr = PetscOptionsInt("-eps_jd_plusk","Set the number of saved eigenvectors from the previous iteration when restarting","EPSJDSetRestart",opi0,&opi0,&flg); CHKERRQ(ierr);
|
|
|
59 |
if(flg) { ierr = EPSJDSetRestart(eps, opi, opi0); CHKERRQ(ierr); }
|
| 1976 |
eromero |
60 |
|
| 1994 |
eromero |
61 |
ierr = EPSJDGetInitialSize(eps, &opi); CHKERRQ(ierr);
|
|
|
62 |
ierr = PetscOptionsInt("-eps_jd_initial_size","Set the initial size of the searching subspace","EPSJDSetInitialSize",opi,&opi,&flg); CHKERRQ(ierr);
|
|
|
63 |
if(flg) { ierr = EPSJDSetInitialSize(eps, opi); CHKERRQ(ierr); }
|
| 1980 |
eromero |
64 |
|
| 1994 |
eromero |
65 |
ierr = EPSJDGetFix(eps, &opf); CHKERRQ(ierr);
|
|
|
66 |
ierr = PetscOptionsReal("-eps_jd_fix","Set the tolerance for changing the target in the correction equation","EPSJDSetFix",opf,&opf,&flg); CHKERRQ(ierr);
|
|
|
67 |
if(flg) { ierr = EPSJDSetFix(eps, opf); CHKERRQ(ierr); }
|
|
|
68 |
|
| 2102 |
eromero |
69 |
ierr = PetscOptionsEnd();CHKERRQ(ierr);
|
| 1976 |
eromero |
70 |
|
|
|
71 |
PetscFunctionReturn(0);
|
|
|
72 |
}
|
|
|
73 |
EXTERN_C_END
|
|
|
74 |
|
|
|
75 |
|
|
|
76 |
#undef __FUNCT__
|
| 2003 |
eromero |
77 |
#define __FUNCT__ "EPSSetUp_JD"
|
|
|
78 |
PetscErrorCode EPSSetUp_JD(EPS eps)
|
|
|
79 |
{
|
|
|
80 |
PetscErrorCode ierr;
|
| 2216 |
jroman |
81 |
PetscBool t;
|
| 2003 |
eromero |
82 |
KSP ksp;
|
|
|
83 |
|
|
|
84 |
PetscFunctionBegin;
|
|
|
85 |
|
| 2104 |
eromero |
86 |
/* Setup common for all davidson solvers */
|
|
|
87 |
ierr = EPSSetUp_DAVIDSON(eps); CHKERRQ(ierr);
|
|
|
88 |
|
| 2003 |
eromero |
89 |
/* Check some constraints */
|
|
|
90 |
ierr = STSetUp(eps->OP); CHKERRQ(ierr);
|
|
|
91 |
ierr = STGetKSP(eps->OP, &ksp); CHKERRQ(ierr);
|
|
|
92 |
ierr = PetscTypeCompare((PetscObject)ksp, KSPPREONLY, &t); CHKERRQ(ierr);
|
| 2214 |
jroman |
93 |
if (t) SETERRQ(((PetscObject)eps)->comm,PETSC_ERR_SUP, "EPSJD does not work with KSPPREONLY");
|
| 2003 |
eromero |
94 |
|
|
|
95 |
PetscFunctionReturn(0);
|
|
|
96 |
}
|
|
|
97 |
|
|
|
98 |
|
|
|
99 |
EXTERN_C_BEGIN
|
|
|
100 |
#undef __FUNCT__
|
| 1994 |
eromero |
101 |
#define __FUNCT__ "EPSCreate_JD"
|
|
|
102 |
PetscErrorCode EPSCreate_JD(EPS eps) {
|
| 1976 |
eromero |
103 |
PetscErrorCode ierr;
|
| 2005 |
eromero |
104 |
KSP ksp;
|
| 1976 |
eromero |
105 |
|
|
|
106 |
PetscFunctionBegin;
|
|
|
107 |
|
| 1982 |
eromero |
108 |
/* Load the DAVIDSON solver */
|
|
|
109 |
ierr = EPSCreate_DAVIDSON(eps); CHKERRQ(ierr);
|
| 1976 |
eromero |
110 |
|
| 2005 |
eromero |
111 |
/* Set the default ksp of the st to gmres */
|
|
|
112 |
ierr = STGetKSP(eps->OP, &ksp); CHKERRQ(ierr);
|
|
|
113 |
ierr = KSPSetType(ksp, KSPGMRES); CHKERRQ(ierr);
|
| 2014 |
eromero |
114 |
ierr = KSPSetTolerances(ksp, 1e-3, 1e-10, PETSC_DEFAULT, 90); CHKERRQ(ierr);
|
| 2005 |
eromero |
115 |
|
| 1994 |
eromero |
116 |
/* Overload the JD properties */
|
|
|
117 |
eps->ops->setfromoptions = EPSSetFromOptions_JD;
|
| 2003 |
eromero |
118 |
eps->ops->setup = EPSSetUp_JD;
|
| 1994 |
eromero |
119 |
eps->ops->destroy = EPSDestroy_JD;
|
| 1976 |
eromero |
120 |
|
| 1994 |
eromero |
121 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetKrylovStart_C","EPSDAVIDSONSetKrylovStart_DAVIDSON",EPSDAVIDSONSetKrylovStart_DAVIDSON);CHKERRQ(ierr);
|
|
|
122 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetKrylovStart_C","EPSDAVIDSONGetKrylovStart_DAVIDSON",EPSDAVIDSONGetKrylovStart_DAVIDSON);CHKERRQ(ierr);
|
|
|
123 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetBlockSize_C","EPSDAVIDSONSetBlockSize_DAVIDSON",EPSDAVIDSONSetBlockSize_DAVIDSON);CHKERRQ(ierr);
|
|
|
124 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetBlockSize_C","EPSDAVIDSONGetBlockSize_DAVIDSON",EPSDAVIDSONGetBlockSize_DAVIDSON);CHKERRQ(ierr);
|
|
|
125 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetRestart_C","EPSDAVIDSONSetRestart_DAVIDSON",EPSDAVIDSONSetRestart_DAVIDSON);CHKERRQ(ierr);
|
|
|
126 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetRestart_C","EPSDAVIDSONGetRestart_DAVIDSON",EPSDAVIDSONGetRestart_DAVIDSON);CHKERRQ(ierr);
|
|
|
127 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetInitialSize_C","EPSDAVIDSONSetInitialSize_DAVIDSON",EPSDAVIDSONSetInitialSize_DAVIDSON);CHKERRQ(ierr);
|
|
|
128 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetInitialSize_C","EPSDAVIDSONGetInitialSize_DAVIDSON",EPSDAVIDSONGetInitialSize_DAVIDSON);CHKERRQ(ierr);
|
| 1995 |
eromero |
129 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetFix_C","EPSDAVIDSONSetFix_DAVIDSON",EPSDAVIDSONSetFix_DAVIDSON);CHKERRQ(ierr);
|
|
|
130 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetFix_C","EPSDAVIDSONGetFix_DAVIDSON",EPSDAVIDSONGetFix_DAVIDSON);CHKERRQ(ierr);
|
| 1976 |
eromero |
131 |
|
|
|
132 |
PetscFunctionReturn(0);
|
|
|
133 |
}
|
|
|
134 |
EXTERN_C_END
|
|
|
135 |
|
| 1980 |
eromero |
136 |
#undef __FUNCT__
|
| 1994 |
eromero |
137 |
#define __FUNCT__ "EPSDestroy_JD"
|
|
|
138 |
PetscErrorCode EPSDestroy_JD(EPS eps)
|
| 1992 |
eromero |
139 |
{
|
| 1980 |
eromero |
140 |
PetscErrorCode ierr;
|
| 1976 |
eromero |
141 |
|
| 1980 |
eromero |
142 |
PetscFunctionBegin;
|
|
|
143 |
|
| 1994 |
eromero |
144 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetKrylovStart_C","",PETSC_NULL);CHKERRQ(ierr);
|
|
|
145 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetKrylovStart_C","",PETSC_NULL);CHKERRQ(ierr);
|
|
|
146 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetBlockSize_C","",PETSC_NULL);CHKERRQ(ierr);
|
|
|
147 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetBlockSize_C","",PETSC_NULL);CHKERRQ(ierr);
|
|
|
148 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetRestart_C","",PETSC_NULL);CHKERRQ(ierr);
|
|
|
149 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetRestart_C","",PETSC_NULL);CHKERRQ(ierr);
|
|
|
150 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetInitialSize_C","",PETSC_NULL);CHKERRQ(ierr);
|
|
|
151 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetInitialSize_C","",PETSC_NULL);CHKERRQ(ierr);
|
|
|
152 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetFix_C","",PETSC_NULL);CHKERRQ(ierr);
|
|
|
153 |
ierr = PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetFix_C","",PETSC_NULL);CHKERRQ(ierr);
|
| 1980 |
eromero |
154 |
|
| 1992 |
eromero |
155 |
ierr = EPSDestroy_DAVIDSON(eps);
|
|
|
156 |
|
| 1980 |
eromero |
157 |
PetscFunctionReturn(0);
|
|
|
158 |
}
|
|
|
159 |
|
|
|
160 |
|
| 1976 |
eromero |
161 |
#undef __FUNCT__
|
| 1994 |
eromero |
162 |
#define __FUNCT__ "EPSJDSetKrylovStart"
|
| 1976 |
eromero |
163 |
/*@
|
| 1994 |
eromero |
164 |
EPSJDSetKrylovStart - Activates or deactivates starting the searching
|
| 1976 |
eromero |
165 |
subspace with a Krylov basis.
|
|
|
166 |
|
|
|
167 |
Collective on EPS
|
|
|
168 |
|
|
|
169 |
Input Parameters:
|
|
|
170 |
+ eps - the eigenproblem solver context
|
|
|
171 |
- krylovstart - boolean flag
|
|
|
172 |
|
|
|
173 |
Options Database Key:
|
| 1994 |
eromero |
174 |
. -eps_jd_krylov_start - Activates starting the searching subspace with a
|
| 1976 |
eromero |
175 |
Krylov basis
|
|
|
176 |
|
|
|
177 |
Level: advanced
|
|
|
178 |
|
| 1994 |
eromero |
179 |
.seealso: EPSJDGetKrylovStart()
|
| 1976 |
eromero |
180 |
@*/
|
| 2216 |
jroman |
181 |
PetscErrorCode EPSJDSetKrylovStart(EPS eps,PetscBool krylovstart)
|
| 1980 |
eromero |
182 |
{
|
| 2221 |
jroman |
183 |
PetscErrorCode ierr;
|
| 1976 |
eromero |
184 |
|
| 1980 |
eromero |
185 |
PetscFunctionBegin;
|
| 2213 |
jroman |
186 |
PetscValidHeaderSpecific(eps,EPS_CLASSID,1);
|
| 2221 |
jroman |
187 |
ierr = PetscTryMethod(eps,"EPSJDSetKrylovStart_C",(EPS,PetscBool),(eps,krylovstart));CHKERRQ(ierr);
|
| 1980 |
eromero |
188 |
PetscFunctionReturn(0);
|
|
|
189 |
}
|
| 1976 |
eromero |
190 |
|
|
|
191 |
#undef __FUNCT__
|
| 1994 |
eromero |
192 |
#define __FUNCT__ "EPSJDGetKrylovStart"
|
| 1985 |
eromero |
193 |
/*@
|
| 1994 |
eromero |
194 |
EPSJDGetKrylovStart - Gets if the searching subspace is started with a
|
| 1976 |
eromero |
195 |
Krylov basis.
|
|
|
196 |
|
|
|
197 |
Collective on EPS
|
|
|
198 |
|
|
|
199 |
Input Parameter:
|
|
|
200 |
. eps - the eigenproblem solver context
|
|
|
201 |
|
| 1994 |
eromero |
202 |
Output Parameters:
|
| 1976 |
eromero |
203 |
. krylovstart - boolean flag indicating if starting the searching subspace
|
|
|
204 |
with a Krylov basis is enabled.
|
|
|
205 |
|
|
|
206 |
Level: advanced
|
|
|
207 |
|
| 1994 |
eromero |
208 |
.seealso: EPSJDGetKrylovStart()
|
| 1976 |
eromero |
209 |
@*/
|
| 2216 |
jroman |
210 |
PetscErrorCode EPSJDGetKrylovStart(EPS eps,PetscBool *krylovstart)
|
| 1980 |
eromero |
211 |
{
|
| 2221 |
jroman |
212 |
PetscErrorCode ierr;
|
| 1976 |
eromero |
213 |
|
| 1980 |
eromero |
214 |
PetscFunctionBegin;
|
| 2213 |
jroman |
215 |
PetscValidHeaderSpecific(eps,EPS_CLASSID,1);
|
| 2221 |
jroman |
216 |
ierr = PetscTryMethod(eps,"EPSJDGetKrylovStart_C",(EPS,PetscBool*),(eps,krylovstart));CHKERRQ(ierr);
|
| 1980 |
eromero |
217 |
PetscFunctionReturn(0);
|
|
|
218 |
}
|
|
|
219 |
|
| 1976 |
eromero |
220 |
#undef __FUNCT__
|
| 1994 |
eromero |
221 |
#define __FUNCT__ "EPSJDSetBlockSize"
|
| 1976 |
eromero |
222 |
/*@
|
| 1994 |
eromero |
223 |
EPSJDSetBlockSize - Sets the number of vectors added to the searching space
|
| 1976 |
eromero |
224 |
every iteration.
|
|
|
225 |
|
|
|
226 |
Collective on EPS
|
|
|
227 |
|
|
|
228 |
Input Parameters:
|
|
|
229 |
+ eps - the eigenproblem solver context
|
|
|
230 |
- blocksize - non-zero positive integer
|
|
|
231 |
|
|
|
232 |
Options Database Key:
|
| 1994 |
eromero |
233 |
. -eps_jd_blocksize - integer indicating the number of vectors added to the
|
| 1976 |
eromero |
234 |
searching space every iteration.
|
|
|
235 |
|
|
|
236 |
Level: advanced
|
|
|
237 |
|
| 1994 |
eromero |
238 |
.seealso: EPSJDSetKrylovStart()
|
| 1976 |
eromero |
239 |
@*/
|
| 1994 |
eromero |
240 |
PetscErrorCode EPSJDSetBlockSize(EPS eps,PetscInt blocksize)
|
| 1980 |
eromero |
241 |
{
|
| 2221 |
jroman |
242 |
PetscErrorCode ierr;
|
| 1976 |
eromero |
243 |
|
| 1980 |
eromero |
244 |
PetscFunctionBegin;
|
| 2213 |
jroman |
245 |
PetscValidHeaderSpecific(eps,EPS_CLASSID,1);
|
| 2221 |
jroman |
246 |
ierr = PetscTryMethod(eps,"EPSJDSetBlockSize_C",(EPS,PetscInt),(eps,blocksize));CHKERRQ(ierr);
|
| 1980 |
eromero |
247 |
PetscFunctionReturn(0);
|
|
|
248 |
}
|
|
|
249 |
|
| 1976 |
eromero |
250 |
#undef __FUNCT__
|
| 1994 |
eromero |
251 |
#define __FUNCT__ "EPSJDGetBlockSize"
|
| 1985 |
eromero |
252 |
/*@
|
| 1994 |
eromero |
253 |
EPSJDGetBlockSize - Gets the number of vectors added to the searching space
|
| 1976 |
eromero |
254 |
every iteration.
|
|
|
255 |
|
|
|
256 |
Collective on EPS
|
|
|
257 |
|
|
|
258 |
Input Parameter:
|
|
|
259 |
. eps - the eigenproblem solver context
|
|
|
260 |
|
| 1994 |
eromero |
261 |
Output Parameter:
|
| 1976 |
eromero |
262 |
. blocksize - integer indicating the number of vectors added to the searching
|
|
|
263 |
space every iteration.
|
|
|
264 |
|
|
|
265 |
Level: advanced
|
|
|
266 |
|
| 1994 |
eromero |
267 |
.seealso: EPSJDSetBlockSize()
|
| 1976 |
eromero |
268 |
@*/
|
| 1994 |
eromero |
269 |
PetscErrorCode EPSJDGetBlockSize(EPS eps,PetscInt *blocksize)
|
| 1980 |
eromero |
270 |
{
|
| 2221 |
jroman |
271 |
PetscErrorCode ierr;
|
| 1976 |
eromero |
272 |
|
| 1980 |
eromero |
273 |
PetscFunctionBegin;
|
| 2213 |
jroman |
274 |
PetscValidHeaderSpecific(eps,EPS_CLASSID,1);
|
| 2221 |
jroman |
275 |
ierr = PetscTryMethod(eps,"EPSJDGetBlockSize_C",(EPS,PetscInt*),(eps,blocksize));CHKERRQ(ierr);
|
| 1980 |
eromero |
276 |
PetscFunctionReturn(0);
|
|
|
277 |
}
|
|
|
278 |
|
| 1976 |
eromero |
279 |
#undef __FUNCT__
|
| 1994 |
eromero |
280 |
#define __FUNCT__ "EPSJDGetRestart"
|
| 1985 |
eromero |
281 |
/*@
|
| 1994 |
eromero |
282 |
EPSJDGetRestart - Gets the number of vectors of the searching space after
|
| 1976 |
eromero |
283 |
restarting and the number of vectors saved from the previous iteration.
|
|
|
284 |
|
|
|
285 |
Collective on EPS
|
|
|
286 |
|
|
|
287 |
Input Parameter:
|
|
|
288 |
. eps - the eigenproblem solver context
|
|
|
289 |
|
| 1994 |
eromero |
290 |
Output Parameter:
|
| 1976 |
eromero |
291 |
+ minv - non-zero positive integer indicating the number of vectors of the
|
|
|
292 |
searching subspace after restarting
|
|
|
293 |
- plusk - positive integer indicating the number of vectors saved from the
|
|
|
294 |
previous iteration
|
|
|
295 |
|
|
|
296 |
Level: advanced
|
|
|
297 |
|
| 1994 |
eromero |
298 |
.seealso: EPSJDSetRestart()
|
| 1976 |
eromero |
299 |
@*/
|
| 1994 |
eromero |
300 |
PetscErrorCode EPSJDGetRestart(EPS eps,PetscInt *minv,PetscInt *plusk)
|
| 1980 |
eromero |
301 |
{
|
| 2221 |
jroman |
302 |
PetscErrorCode ierr;
|
| 1976 |
eromero |
303 |
|
| 1980 |
eromero |
304 |
PetscFunctionBegin;
|
| 2213 |
jroman |
305 |
PetscValidHeaderSpecific(eps,EPS_CLASSID,1);
|
| 2221 |
jroman |
306 |
ierr = PetscTryMethod(eps,"EPSJDGetRestart_C",(EPS,PetscInt*,PetscInt*),(eps,minv,plusk));CHKERRQ(ierr);
|
| 1980 |
eromero |
307 |
PetscFunctionReturn(0);
|
|
|
308 |
}
|
|
|
309 |
|
| 1976 |
eromero |
310 |
#undef __FUNCT__
|
| 1994 |
eromero |
311 |
#define __FUNCT__ "EPSJDSetRestart"
|
| 1976 |
eromero |
312 |
/*@
|
| 1994 |
eromero |
313 |
EPSJDSetRestart - Sets the number of vectors of the searching space after
|
| 1976 |
eromero |
314 |
restarting and the number of vectors saved from the previous iteration.
|
|
|
315 |
|
|
|
316 |
Collective on EPS
|
|
|
317 |
|
|
|
318 |
Input Parameters:
|
|
|
319 |
+ eps - the eigenproblem solver context
|
|
|
320 |
. minv - non-zero positive integer indicating the number of vectors of the
|
|
|
321 |
searching subspace after restarting
|
|
|
322 |
- plusk - positive integer indicating the number of vectors saved from the
|
|
|
323 |
previous iteration
|
|
|
324 |
|
|
|
325 |
Options Database Key:
|
| 1994 |
eromero |
326 |
+ -eps_jd_minv - non-zero positive integer indicating the number of vectors
|
| 1976 |
eromero |
327 |
of the searching subspace after restarting
|
| 1994 |
eromero |
328 |
- -eps_jd_plusk - positive integer indicating the number of vectors saved
|
| 1976 |
eromero |
329 |
from the previous iteration
|
|
|
330 |
|
|
|
331 |
Level: advanced
|
|
|
332 |
|
| 1994 |
eromero |
333 |
.seealso: EPSJDGetRestart()
|
| 1976 |
eromero |
334 |
@*/
|
| 1994 |
eromero |
335 |
PetscErrorCode EPSJDSetRestart(EPS eps,PetscInt minv,PetscInt plusk)
|
| 1980 |
eromero |
336 |
{
|
| 2221 |
jroman |
337 |
PetscErrorCode ierr;
|
| 1976 |
eromero |
338 |
|
| 1980 |
eromero |
339 |
PetscFunctionBegin;
|
| 2213 |
jroman |
340 |
PetscValidHeaderSpecific(eps,EPS_CLASSID,1);
|
| 2221 |
jroman |
341 |
ierr = PetscTryMethod(eps,"EPSJDSetRestart_C",(EPS,PetscInt,PetscInt),(eps,minv,plusk));CHKERRQ(ierr);
|
| 1980 |
eromero |
342 |
PetscFunctionReturn(0);
|
|
|
343 |
}
|
| 1976 |
eromero |
344 |
|
| 1980 |
eromero |
345 |
#undef __FUNCT__
|
| 1994 |
eromero |
346 |
#define __FUNCT__ "EPSJDGetInitialSize"
|
| 1985 |
eromero |
347 |
/*@
|
| 1994 |
eromero |
348 |
EPSJDGetInitialSize - Gets the initial size of the searching space. In the
|
| 2242 |
jroman |
349 |
case of EPSJDGetKrylovStart is PETSC_FALSE and the user provides vectors by
|
| 1980 |
eromero |
350 |
EPSSetInitialSpace, up to initialsize vectors will be used; and if the
|
|
|
351 |
provided vectors are not enough, the solver completes the subspace with
|
| 2242 |
jroman |
352 |
random vectors. In the case of EPSJDGetKrylovStart is PETSC_TRUE, the solver
|
| 1980 |
eromero |
353 |
gets the first vector provided by the user or, if not, a random vector,
|
|
|
354 |
and expands the Krylov basis up to initialsize vectors.
|
|
|
355 |
|
|
|
356 |
Collective on EPS
|
|
|
357 |
|
|
|
358 |
Input Parameter:
|
|
|
359 |
. eps - the eigenproblem solver context
|
|
|
360 |
|
| 1994 |
eromero |
361 |
Output Parameter:
|
| 1980 |
eromero |
362 |
. initialsize - non-zero positive integer indicating the number of vectors of
|
|
|
363 |
the initial searching subspace
|
|
|
364 |
|
|
|
365 |
Level: advanced
|
|
|
366 |
|
| 2242 |
jroman |
367 |
.seealso: EPSJDSetInitialSize(), EPSJDGetKrylovStart()
|
| 1980 |
eromero |
368 |
@*/
|
| 1994 |
eromero |
369 |
PetscErrorCode EPSJDGetInitialSize(EPS eps,PetscInt *initialsize)
|
| 1980 |
eromero |
370 |
{
|
| 2221 |
jroman |
371 |
PetscErrorCode ierr;
|
| 1980 |
eromero |
372 |
|
|
|
373 |
PetscFunctionBegin;
|
| 2213 |
jroman |
374 |
PetscValidHeaderSpecific(eps,EPS_CLASSID,1);
|
| 2221 |
jroman |
375 |
ierr = PetscTryMethod(eps,"EPSJDGetInitialSize_C",(EPS,PetscInt*),(eps,initialsize));CHKERRQ(ierr);
|
| 1980 |
eromero |
376 |
PetscFunctionReturn(0);
|
|
|
377 |
}
|
|
|
378 |
|
|
|
379 |
#undef __FUNCT__
|
| 1994 |
eromero |
380 |
#define __FUNCT__ "EPSJDSetInitialSize"
|
| 1980 |
eromero |
381 |
/*@
|
| 1994 |
eromero |
382 |
EPSJDSetInitialSize - Sets the initial size of the searching space. In the
|
| 2242 |
jroman |
383 |
case of EPSJDGetKrylovStart is PETSC_FALSE and the user provides vectors by
|
| 1980 |
eromero |
384 |
EPSSetInitialSpace, up to initialsize vectors will be used; and if the
|
|
|
385 |
provided vectors are not enough, the solver completes the subspace with
|
| 2242 |
jroman |
386 |
random vectors. In the case of EPSJDGetKrylovStart is PETSC_TRUE, the solver
|
| 1980 |
eromero |
387 |
gets the first vector provided by the user or, if not, a random vector,
|
|
|
388 |
and expands the Krylov basis up to initialsize vectors.
|
|
|
389 |
|
|
|
390 |
Collective on EPS
|
|
|
391 |
|
| 1994 |
eromero |
392 |
Input Parameters:
|
|
|
393 |
+ eps - the eigenproblem solver context
|
|
|
394 |
- initialsize - non-zero positive integer indicating the number of vectors of
|
| 1980 |
eromero |
395 |
the initial searching subspace
|
|
|
396 |
|
|
|
397 |
Options Database Key:
|
| 1994 |
eromero |
398 |
. -eps_jd_initial_size - non-zero positive integer indicating the number of
|
| 1980 |
eromero |
399 |
vectors of the initial searching subspace
|
|
|
400 |
|
|
|
401 |
Level: advanced
|
|
|
402 |
|
| 2242 |
jroman |
403 |
.seealso: EPSJDGetInitialSize(), EPSJDGetKrylovStart()
|
| 1980 |
eromero |
404 |
@*/
|
| 1994 |
eromero |
405 |
PetscErrorCode EPSJDSetInitialSize(EPS eps,PetscInt initialsize)
|
| 1980 |
eromero |
406 |
{
|
| 2221 |
jroman |
407 |
PetscErrorCode ierr;
|
| 1980 |
eromero |
408 |
|
|
|
409 |
PetscFunctionBegin;
|
| 2213 |
jroman |
410 |
PetscValidHeaderSpecific(eps,EPS_CLASSID,1);
|
| 2221 |
jroman |
411 |
ierr = PetscTryMethod(eps,"EPSJDSetInitialSize_C",(EPS,PetscInt),(eps,initialsize));CHKERRQ(ierr);
|
| 1980 |
eromero |
412 |
PetscFunctionReturn(0);
|
|
|
413 |
}
|
|
|
414 |
|
| 1994 |
eromero |
415 |
#undef __FUNCT__
|
|
|
416 |
#define __FUNCT__ "EPSJDGetFix"
|
|
|
417 |
/*@
|
|
|
418 |
EPSJDGetFix - Gets the threshold for changing the target in the correction
|
|
|
419 |
equation. The target in the correction equation is fixed at the first
|
|
|
420 |
iterations. When the norm of the residual vector is lower than this value
|
|
|
421 |
the target is set to the corresponding eigenvalue.
|
|
|
422 |
|
|
|
423 |
Collective on EPS
|
|
|
424 |
|
|
|
425 |
Input Parameters:
|
|
|
426 |
+ eps - the eigenproblem solver context
|
|
|
427 |
- fix - positive float number
|
|
|
428 |
|
|
|
429 |
Level: advanced
|
|
|
430 |
|
|
|
431 |
.seealso: EPSJDSetFix()
|
|
|
432 |
@*/
|
|
|
433 |
PetscErrorCode EPSJDGetFix(EPS eps,PetscReal *fix)
|
|
|
434 |
{
|
| 2221 |
jroman |
435 |
PetscErrorCode ierr;
|
| 1994 |
eromero |
436 |
|
|
|
437 |
PetscFunctionBegin;
|
| 2213 |
jroman |
438 |
PetscValidHeaderSpecific(eps,EPS_CLASSID,1);
|
| 2221 |
jroman |
439 |
ierr = PetscTryMethod(eps,"EPSJDGetFix_C",(EPS,PetscReal*),(eps,fix));CHKERRQ(ierr);
|
| 1994 |
eromero |
440 |
PetscFunctionReturn(0);
|
|
|
441 |
}
|
|
|
442 |
|
|
|
443 |
#undef __FUNCT__
|
|
|
444 |
#define __FUNCT__ "EPSJDSetFix"
|
|
|
445 |
/*@
|
|
|
446 |
EPSJDSetFix - Sets the threshold for changing the target in the correction
|
|
|
447 |
equation. The target in the correction equation is fixed at the first
|
|
|
448 |
iterations. When the norm of the residual vector is lower than this value
|
|
|
449 |
the target is set to the corresponding eigenvalue.
|
|
|
450 |
|
|
|
451 |
Collective on EPS
|
|
|
452 |
|
|
|
453 |
Input Parameter:
|
|
|
454 |
. eps - the eigenproblem solver context
|
|
|
455 |
|
|
|
456 |
Output Parameter:
|
|
|
457 |
. fix - positive float number
|
|
|
458 |
|
|
|
459 |
Options Database Key:
|
|
|
460 |
. -eps_jd_fix
|
|
|
461 |
|
|
|
462 |
Level: advanced
|
|
|
463 |
|
|
|
464 |
.seealso: EPSJDGetFix()
|
|
|
465 |
@*/
|
|
|
466 |
PetscErrorCode EPSJDSetFix(EPS eps,PetscReal fix)
|
|
|
467 |
{
|
| 2221 |
jroman |
468 |
PetscErrorCode ierr;
|
| 1994 |
eromero |
469 |
|
|
|
470 |
PetscFunctionBegin;
|
| 2213 |
jroman |
471 |
PetscValidHeaderSpecific(eps,EPS_CLASSID,1);
|
| 2221 |
jroman |
472 |
ierr = PetscTryMethod(eps,"EPSJDSetFix_C",(EPS,PetscReal),(eps,fix));CHKERRQ(ierr);
|
| 1994 |
eromero |
473 |
PetscFunctionReturn(0);
|
|
|
474 |
}
|