www.mooseframework.org
SlepcSupport.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef SLEPCSUPPORT_H
16 #define SLEPCSUPPORT_H
17 
18 #include "libmesh/libmesh_config.h"
19 
20 #ifdef LIBMESH_HAVE_SLEPC
21 
22 #include "SlepcSupport.h"
23 // MOOSE includes
24 #include "MultiMooseEnum.h"
25 #include "InputParameters.h"
26 #include "EigenProblem.h"
27 #include "Conversion.h"
28 #include "EigenProblem.h"
29 #include "NonlinearSystemBase.h"
30 
31 #include "libmesh/petsc_vector.h"
32 #include "libmesh/petsc_matrix.h"
33 #include "libmesh/slepc_macro.h"
34 
35 namespace Moose
36 {
37 namespace SlepcSupport
38 {
39 
40 const int subspace_factor = 2;
41 
44 {
45  MooseEnum solve_type("POWER ARNOLDI KRYLOVSCHUR JACOBI_DAVIDSON "
46  "NONLINEAR_POWER MF_NONLINEAR_POWER "
47  "MONOLITH_NEWTON MF_MONOLITH_NEWTON");
48  params.set<MooseEnum>("solve_type") = solve_type;
49 
50  params.setDocString("solve_type",
51  "POWER: Power / Inverse / RQI "
52  "ARNOLDI: Arnoldi "
53  "KRYLOVSCHUR: Krylov-Schur "
54  "JACOBI_DAVIDSON: Jacobi-Davidson "
55  "NONLINEAR_POWER: Nonlinear Power "
56  "MF_NONLINEAR_POWER: Matrix-free Nonlinear Power "
57  "MONOLITH_NEWTON: Newton "
58  "MF_MONOLITH_NEWTON: Matrix-free Newton ");
59 
60  // When the eigenvalue problems is reformed as a coupled nonlinear system,
61  // we use part of Jacobian as the preconditioning matrix.
62  // Because the difference between the Jacobian and the preconditioning matrix is not small,
63  // the linear solver KSP can not reduce the residual much. After several tests,
64  // we find 1e-2 is a reasonable choice.
65  params.set<Real>("l_tol") = 1e-2;
66 
67  return params;
68 }
69 
72 {
74 
75  // We are solving a Non-Hermitian eigenvalue problem by default
76  MooseEnum eigen_problem_type("HERMITIAN NON_HERMITIAN GEN_HERMITIAN GEN_NON_HERMITIAN "
77  "GEN_INDEFINITE POS_GEN_NON_HERMITIAN "
78  "NON_HERMITIAN SLEPC_DEFAULT");
79  params.addParam<MooseEnum>(
80  "eigen_problem_type",
81  eigen_problem_type,
82  "Type of the eigenvalue problem we are solving "
83  "HERMITIAN: Hermitian "
84  "NON_HERMITIAN: Non-Hermitian "
85  "GEN_HERMITIAN: Generalized Hermitian "
86  "GEN_NON_HERMITIAN: Generalized Non-Hermitian "
87  "GEN_INDEFINITE: Generalized indefinite Hermitian "
88  "POS_GEN_NON_HERMITIAN: Generalized Non-Hermitian with positive (semi-)definite B "
89  "SLEPC_DEFAULT: Use whatever SLEPC has by default ");
90 
91  // Which eigenvalues are we interested in
92  MooseEnum which_eigen_pairs("LARGEST_MAGNITUDE SMALLEST_MAGNITUDE LARGEST_REAL SMALLEST_REAL "
93  "LARGEST_IMAGINARY SMALLEST_IMAGINARY TARGET_MAGNITUDE TARGET_REAL "
94  "TARGET_IMAGINARY ALL_EIGENVALUES "
95  "SMALLEST_MAGNITUDE SLEPC_DEFAULT");
96  params.addParam<MooseEnum>("which_eigen_pairs",
97  which_eigen_pairs,
98  "Which eigenvalue pairs to obtain from the solution "
99  "LARGEST_MAGNITUDE "
100  "SMALLEST_MAGNITUDE "
101  "LARGEST_REAL "
102  "SMALLEST_REAL "
103  "LARGEST_IMAGINARY "
104  "SMALLEST_IMAGINARY "
105  "TARGET_MAGNITUDE "
106  "TARGET_REAL "
107  "TARGET_IMAGINARY "
108  "ALL_EIGENVALUES "
109  "SLEPC_DEFAULT ");
110 
111  params.addParam<unsigned int>("n_eigen_pairs", 1, "The number of eigen pairs");
112  params.addParam<unsigned int>("n_basis_vectors", 3, "The dimension of eigen subspaces");
113 
114  params.addParam<Real>("eigen_tol", 1.0e-4, "Relative Tolerance for Eigen Solver");
115  params.addParam<unsigned int>("eigen_max_its", 10000, "Max Iterations for Eigen Solver");
116 
117  params.addParam<Real>("l_abs_tol", 1e-50, "Absolute Tolerances for Linear Solver");
118 
119  params.addParam<unsigned int>("free_power_iterations", 4, "The number of free power iterations");
120 
121  return params;
122 }
123 
124 void
126 {
127  Moose::PetscSupport::setSinglePetscOption("-eps_tol", stringify(params.get<Real>("eigen_tol")));
128 
130  stringify(params.get<unsigned int>("eigen_max_its")));
131 
132  // if it is a nonlinear eigenvalue solver, we need to set tolerances for nonlinear solver and
133  // linear solver
134  if (eigen_problem.isNonlinearEigenvalueSolver())
135  {
136  // nonlinear solver tolerances
137  Moose::PetscSupport::setSinglePetscOption("-eps_power_snes_max_it",
138  stringify(params.get<unsigned int>("nl_max_its")));
139 
140  Moose::PetscSupport::setSinglePetscOption("-eps_power_snes_max_funcs",
141  stringify(params.get<unsigned int>("nl_max_funcs")));
142 
143  Moose::PetscSupport::setSinglePetscOption("-eps_power_snes_atol",
144  stringify(params.get<Real>("nl_abs_tol")));
145 
146  Moose::PetscSupport::setSinglePetscOption("-eps_power_snes_rtol",
147  stringify(params.get<Real>("nl_rel_tol")));
148 
149  Moose::PetscSupport::setSinglePetscOption("-eps_power_snes_stol",
150  stringify(params.get<Real>("nl_rel_step_tol")));
151 
152  // linear solver
153  Moose::PetscSupport::setSinglePetscOption("-eps_power_ksp_max_it",
154  stringify(params.get<unsigned int>("l_max_its")));
155 
156  Moose::PetscSupport::setSinglePetscOption("-eps_power_ksp_rtol",
157  stringify(params.get<Real>("l_tol")));
158 
159  Moose::PetscSupport::setSinglePetscOption("-eps_power_ksp_atol",
160  stringify(params.get<Real>("l_abs_tol")));
161  }
162  else
163  { // linear eigenvalue problem
164  // linear solver
166  stringify(params.get<unsigned int>("l_max_its")));
167 
168  Moose::PetscSupport::setSinglePetscOption("-st_ksp_rtol", stringify(params.get<Real>("l_tol")));
169 
171  stringify(params.get<Real>("l_abs_tol")));
172  }
173 }
174 
175 void
177 {
178  const std::string & eigen_problem_type = params.get<MooseEnum>("eigen_problem_type");
179  if (!eigen_problem_type.empty())
180  eigen_problem.solverParams()._eigen_problem_type =
181  Moose::stringToEnum<Moose::EigenProblemType>(eigen_problem_type);
182  else
183  mooseError("Have to specify a valid eigen problem type");
184 
185  const std::string & which_eigen_pairs = params.get<MooseEnum>("which_eigen_pairs");
186  if (!which_eigen_pairs.empty())
187  eigen_problem.solverParams()._which_eigen_pairs =
188  Moose::stringToEnum<Moose::WhichEigenPairs>(which_eigen_pairs);
189 
190  // Set necessary parametrs used in EigenSystem::solve(),
191  // i.e. the number of requested eigenpairs nev and the number
192  // of basis vectors ncv used in the solution algorithm. Note that
193  // ncv >= nev must hold and ncv >= 2*nev is recommended
194  unsigned int n_eigen_pairs = params.get<unsigned int>("n_eigen_pairs");
195  unsigned int n_basis_vectors = params.get<unsigned int>("n_basis_vectors");
196 
197  eigen_problem.setNEigenPairsRequired(n_eigen_pairs);
198 
199  eigen_problem.es().parameters.set<unsigned int>("eigenpairs") = n_eigen_pairs;
200 
201  // If the subspace dimension is too small, we increase it automatically
202  if (subspace_factor * n_eigen_pairs > n_basis_vectors)
203  {
204  n_basis_vectors = subspace_factor * n_eigen_pairs;
205  mooseWarning("Number of subspaces in Eigensolver is changed by moose because the value you set "
206  "is too small");
207  }
208 
209  eigen_problem.es().parameters.set<unsigned int>("basis vectors") = n_basis_vectors;
210 }
211 
212 void
213 storeSlepcOptions(FEProblemBase & fe_problem, const InputParameters & params)
214 {
215  if (!(dynamic_cast<EigenProblem *>(&fe_problem)))
216  return;
217 
218  if (params.isParamValid("solve_type"))
219  {
220  fe_problem.solverParams()._eigen_solve_type =
221  Moose::stringToEnum<Moose::EigenSolveType>(params.get<MooseEnum>("solve_type"));
222  }
223 }
224 
225 void
227 {
228  switch (solver_params._eigen_problem_type)
229  {
232  break;
233 
235  Moose::PetscSupport::setSinglePetscOption("-eps_non_hermitian");
236  break;
237 
239  Moose::PetscSupport::setSinglePetscOption("-eps_gen_hermitian");
240  break;
241 
243  Moose::PetscSupport::setSinglePetscOption("-eps_gen_indefinite");
244  break;
245 
247  Moose::PetscSupport::setSinglePetscOption("-eps_gen_non_hermitian");
248  break;
249 
251  Moose::PetscSupport::setSinglePetscOption("-eps_pos_gen_non_hermitian");
252  break;
253 
255  break;
256 
257  default:
258  mooseError("Unknown eigen solver type \n");
259  }
260 }
261 
262 void
264 {
265  Moose::PetscSupport::setSinglePetscOption("-eps_monitor_conv");
267  switch (eigen_problem.solverParams()._eigen_solve_type)
268  {
271  Moose::PetscSupport::setSinglePetscOption("-eps_power_snes_monitor");
272  Moose::PetscSupport::setSinglePetscOption("-eps_power_ksp_monitor");
273  break;
274 
277  Moose::PetscSupport::setSinglePetscOption("-init_eps_monitor_conv");
278  Moose::PetscSupport::setSinglePetscOption("-init_eps_monitor");
279  Moose::PetscSupport::setSinglePetscOption("-eps_power_snes_monitor");
280  Moose::PetscSupport::setSinglePetscOption("-eps_power_ksp_monitor");
281  Moose::PetscSupport::setSinglePetscOption("-init_eps_power_snes_monitor");
282  Moose::PetscSupport::setSinglePetscOption("-init_eps_power_ksp_monitor");
283  break;
284  case Moose::EST_POWER:
285  break;
286 
287  case Moose::EST_ARNOLDI:
288  break;
289 
291  break;
292 
294  break;
295  }
296 }
297 
298 void
300 {
301  switch (solver_params._which_eigen_pairs)
302  {
304  Moose::PetscSupport::setSinglePetscOption("-eps_largest_magnitude");
305  break;
306 
308  Moose::PetscSupport::setSinglePetscOption("-eps_smallest_magnitude");
309  break;
310 
312  Moose::PetscSupport::setSinglePetscOption("-eps_largest_real");
313  break;
314 
316  Moose::PetscSupport::setSinglePetscOption("-eps_smallest_real");
317  break;
318 
320  Moose::PetscSupport::setSinglePetscOption("-eps_largest_imaginary");
321  break;
322 
324  Moose::PetscSupport::setSinglePetscOption("-eps_smallest_imaginary");
325  break;
326 
328  Moose::PetscSupport::setSinglePetscOption("-eps_target_magnitude");
329  break;
330 
332  Moose::PetscSupport::setSinglePetscOption("-eps_target_real");
333  break;
334 
336  Moose::PetscSupport::setSinglePetscOption("-eps_target_imaginary");
337  break;
338 
341  break;
342 
344  break;
345 
346  default:
347  mooseError("Unknown type of WhichEigenPairs \n");
348  }
349 }
350 
351 void
352 setEigenSolverOptions(SolverParams & solver_params, const InputParameters & params)
353 {
354  // Avoid unused variable warnings when you have SLEPc but not PETSc-dev.
355  libmesh_ignore(params);
356 
357  switch (solver_params._eigen_solve_type)
358  {
359  case Moose::EST_POWER:
360  Moose::PetscSupport::setSinglePetscOption("-eps_type", "power");
361  break;
362 
363  case Moose::EST_ARNOLDI:
364  Moose::PetscSupport::setSinglePetscOption("-eps_type", "arnoldi");
365  break;
366 
368  Moose::PetscSupport::setSinglePetscOption("-eps_type", "krylovschur");
369  break;
370 
373  break;
374 
376 #if !SLEPC_VERSION_LESS_THAN(3, 7, 3) && !PETSC_VERSION_RELEASE
377  Moose::PetscSupport::setSinglePetscOption("-eps_type", "power");
378  Moose::PetscSupport::setSinglePetscOption("-eps_power_nonlinear", "1");
379  Moose::PetscSupport::setSinglePetscOption("-eps_target_magnitude", "");
380  Moose::PetscSupport::setSinglePetscOption("-st_type", "sinvert");
381 #else
382  mooseError("Nonlinear Inverse Power requires SLEPc 3.7.3 or higher");
383 #endif
384  break;
385 
387 #if !SLEPC_VERSION_LESS_THAN(3, 7, 3) && !PETSC_VERSION_RELEASE
388  Moose::PetscSupport::setSinglePetscOption("-eps_type", "power");
389  Moose::PetscSupport::setSinglePetscOption("-eps_power_nonlinear", "1");
390  Moose::PetscSupport::setSinglePetscOption("-eps_power_snes_mf_operator", "1");
391  Moose::PetscSupport::setSinglePetscOption("-eps_target_magnitude", "");
392  Moose::PetscSupport::setSinglePetscOption("-st_type", "sinvert");
393 #else
394  mooseError("Matrix-free nonlinear Inverse Power requires SLEPc 3.7.3 or higher");
395 #endif
396  break;
397 
399 #if !SLEPC_VERSION_LESS_THAN(3, 7, 3) && !PETSC_VERSION_RELEASE
400  Moose::PetscSupport::setSinglePetscOption("-eps_type", "power");
401  Moose::PetscSupport::setSinglePetscOption("-eps_power_nonlinear", "1");
402  Moose::PetscSupport::setSinglePetscOption("-eps_power_update", "1");
403  Moose::PetscSupport::setSinglePetscOption("-init_eps_power_snes_max_it", "1");
404  Moose::PetscSupport::setSinglePetscOption("-init_eps_power_ksp_rtol", "1e-2");
406  "-init_eps_max_it", stringify(params.get<unsigned int>("free_power_iterations")));
407  Moose::PetscSupport::setSinglePetscOption("-eps_target_magnitude", "");
408  Moose::PetscSupport::setSinglePetscOption("-st_type", "sinvert");
409 #else
410  mooseError("Newton-based eigenvalue solver requires SLEPc 3.7.3 or higher");
411 #endif
412  break;
413 
415 #if !SLEPC_VERSION_LESS_THAN(3, 7, 3) && !PETSC_VERSION_RELEASE
416  Moose::PetscSupport::setSinglePetscOption("-eps_type", "power");
417  Moose::PetscSupport::setSinglePetscOption("-eps_power_nonlinear", "1");
418  Moose::PetscSupport::setSinglePetscOption("-eps_power_update", "1");
419  Moose::PetscSupport::setSinglePetscOption("-eps_power_snes_mf_operator", "1");
420  Moose::PetscSupport::setSinglePetscOption("-init_eps_power_snes_mf_operator", "1");
421  Moose::PetscSupport::setSinglePetscOption("-init_eps_power_snes_max_it", "1");
422  Moose::PetscSupport::setSinglePetscOption("-init_eps_power_ksp_rtol", "1e-2");
424  "-init_eps_max_it", stringify(params.get<unsigned int>("free_power_iterations")));
425  Moose::PetscSupport::setSinglePetscOption("-eps_target_magnitude", "");
426  Moose::PetscSupport::setSinglePetscOption("-st_type", "sinvert");
427 #else
428  mooseError("Matrix-free Newton-based eigenvalue solver requires SLEPc 3.7.3 or higher");
429 #endif
430  break;
431 
432  default:
433  mooseError("Unknown eigen solver type \n");
434  }
435 }
436 
437 void
438 slepcSetOptions(EigenProblem & eigen_problem, const InputParameters & params)
439 {
441  setEigenSolverOptions(eigen_problem.solverParams(), params);
442  setEigenProblemOptions(eigen_problem.solverParams());
443  setWhichEigenPairsOptions(eigen_problem.solverParams());
444  setSlepcEigenSolverTolerances(eigen_problem, params);
445  setSlepcOutputOptions(eigen_problem);
447 }
448 
449 void
451  SNES /*snes*/, Vec x, Mat jac, Mat pc, void * ctx, Moose::KernelType type)
452 {
453  EigenProblem * eigen_problem = static_cast<EigenProblem *>(ctx);
454  NonlinearSystemBase & nl = eigen_problem->getNonlinearSystemBase();
455  System & sys = nl.system();
456 
457  PetscVector<Number> X_global(x, sys.comm());
458 
459  // update local solution
460  X_global.localize(*sys.current_local_solution.get());
461 
462  PetscMatrix<Number> PC(pc, sys.comm());
463  PetscMatrix<Number> Jac(jac, sys.comm());
464 
465  // Set the dof maps
466  PC.attach_dof_map(sys.get_dof_map());
467  Jac.attach_dof_map(sys.get_dof_map());
468 
469  PC.zero();
470 
471  eigen_problem->computeJacobian(*sys.current_local_solution.get(), PC, type);
472 
473  PC.close();
474  if (jac != pc)
475  Jac.close();
476 }
477 
478 PetscErrorCode
479 mooseSlepcEigenFormJacobianA(SNES snes, Vec x, Mat jac, Mat pc, void * ctx)
480 {
482 
483  moosePetscSNESFormJacobian(snes, x, jac, pc, ctx, Moose::KT_NONEIGEN);
485 }
486 
487 PetscErrorCode
488 mooseSlepcEigenFormJacobianB(SNES snes, Vec x, Mat jac, Mat pc, void * ctx)
489 {
491 
492  moosePetscSNESFormJacobian(snes, x, jac, pc, ctx, Moose::KT_EIGEN);
494 }
495 
496 void
497 moosePetscSNESFormFunction(SNES /*snes*/, Vec x, Vec r, void * ctx, Moose::KernelType type)
498 {
499  EigenProblem * eigen_problem = static_cast<EigenProblem *>(ctx);
500  NonlinearSystemBase & nl = eigen_problem->getNonlinearSystemBase();
501  System & sys = nl.system();
502 
503  PetscVector<Number> X_global(x, sys.comm()), R(r, sys.comm());
504 
505  // update local solution
506  X_global.localize(*sys.current_local_solution.get());
507 
508  R.zero();
509 
510  eigen_problem->computeResidualType(*sys.current_local_solution.get(), R, type);
511 
512  R.close();
513 }
514 
515 PetscErrorCode
516 mooseSlepcEigenFormFunctionA(SNES snes, Vec x, Vec r, void * ctx)
517 {
519 
522 }
523 
524 PetscErrorCode
525 mooseSlepcEigenFormFunctionB(SNES snes, Vec x, Vec r, void * ctx)
526 {
528 
531 }
532 } // namespace SlepcSupport
533 } // namespace moose
534 
535 #endif // LIBMESH_HAVE_SLEPC
536 
537 #endif // SLEPCSUPPORT_H
Generalized Non-Hermitian.
Definition: MooseTypes.h:278
Newton-based eigen solver.
Definition: MooseTypes.h:265
virtual bool isNonlinearEigenvalueSolver()
Definition: EigenProblem.C:155
Generalized Hermitian indefinite.
Definition: MooseTypes.h:277
void addPetscOptionsFromCommandline()
Definition: PetscSupport.C:217
Moose::EigenSolveType _eigen_solve_type
Definition: SolverParams.h:30
static PetscErrorCode Vec Mat jac
SolverParams & solverParams()
Get the solver parameters.
smallest magnitude
Definition: MooseTypes.h:289
NonlinearSystemBase & getNonlinearSystemBase()
void moosePetscSNESFormFunction(SNES, Vec x, Vec r, void *ctx, Moose::KernelType type)
Definition: SlepcSupport.C:497
void setDocString(const std::string &name, const std::string &doc)
Set the doc string of a parameter.
Matrix-free Newton-based eigen solver.
Definition: MooseTypes.h:266
PetscMatrix< Number > Jac(jac, nl->comm())
void setEigenSolverOptions(SolverParams &solver_params, const InputParameters &params)
Definition: SlepcSupport.C:352
PetscErrorCode mooseSlepcEigenFormJacobianB(SNES snes, Vec x, Mat jac, Mat pc, void *ctx)
Definition: SlepcSupport.C:488
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
PetscFunctionBegin
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Matrix-free nonlinear inverse power.
Definition: MooseTypes.h:264
use whatever SLPEC has by default
Definition: MooseTypes.h:280
target magnitude
Definition: MooseTypes.h:294
static PetscErrorCode Vec Mat Mat pc
PetscErrorCode mooseSlepcEigenFormFunctionA(SNES snes, Vec x, Vec r, void *ctx)
Definition: SlepcSupport.C:516
static PetscErrorCode Vec x
PetscVector< Number > X_global(x, nl->comm())
Generalized Non-Hermitian with positive (semi-)definite B.
Definition: MooseTypes.h:279
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Power / Inverse / RQI.
Definition: MooseTypes.h:259
InputParameters emptyInputParameters()
Krylov-Schur.
Definition: MooseTypes.h:261
virtual EquationSystems & es() override
NonlinearSystemBase * nl
Nonlinear system to be solved.
void setSlepcEigenSolverTolerances(EigenProblem &eigen_problem, const InputParameters &params)
Definition: SlepcSupport.C:125
InputParameters getSlepcValidParams(InputParameters &params)
Definition: SlepcSupport.C:43
virtual void setNEigenPairsRequired(unsigned int n_eigen_pairs)
Definition: EigenProblem.h:44
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
Moose::EigenProblemType _eigen_problem_type
Definition: SolverParams.h:31
void setWhichEigenPairsOptions(SolverParams &solver_params)
Definition: SlepcSupport.C:299
target imaginary
Definition: MooseTypes.h:296
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:37
Moose::WhichEigenPairs _which_eigen_pairs
Definition: SolverParams.h:32
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:66
Nonlinear inverse power.
Definition: MooseTypes.h:263
KernelType
Definition: MooseTypes.h:162
PetscErrorCode mooseSlepcEigenFormJacobianA(SNES snes, Vec x, Mat jac, Mat pc, void *ctx)
Definition: SlepcSupport.C:479
PetscFunctionReturn(0)
PetscErrorCode mooseSlepcEigenFormFunctionB(SNES snes, Vec x, Vec r, void *ctx)
Definition: SlepcSupport.C:525
Jacobi-Davidson.
Definition: MooseTypes.h:262
void moosePetscSNESFormJacobian(SNES, Vec x, Mat jac, Mat pc, void *ctx, Moose::KernelType type)
Definition: SlepcSupport.C:450
MatType type
virtual void computeJacobian(const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian, Moose::KernelType kernel_type) override
Definition: EigenProblem.C:115
void storeSlepcEigenProblemOptions(EigenProblem &eigen_problem, const InputParameters &params)
Definition: SlepcSupport.C:176
smallest imaginary
Definition: MooseTypes.h:293
virtual System & system() override
Get the reference to the libMesh system.
void setSlepcOutputOptions(EigenProblem &eigen_problem)
Definition: SlepcSupport.C:263
void storeSlepcOptions(FEProblemBase &fe_problem, const InputParameters &params)
Definition: SlepcSupport.C:213
largest imaginary
Definition: MooseTypes.h:292
Non-Hermitian.
Definition: MooseTypes.h:275
void computeResidualType(const NumericVector< Number > &soln, NumericVector< Number > &residual, Moose::KernelType type) override
Definition: EigenProblem.C:176
all eigenvalues
Definition: MooseTypes.h:297
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
Definition: Moose.h:84
use whatever we have in SLEPC
Definition: MooseTypes.h:298
const int subspace_factor
Definition: SlepcSupport.C:40
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Definition: EigenProblem.h:32
largest magnitude
Definition: MooseTypes.h:288
void petscSetOptions(FEProblemBase &problem)
A function for setting the PETSc options in PETSc from the options supplied to MOOSE.
Definition: PetscSupport.C:235
static PetscErrorCode Vec Mat Mat void * ctx
void setSinglePetscOption(const std::string &name, const std::string &value="")
A wrapper function for dealing with different versions of PetscOptionsSetValue.
Definition: PetscSupport.C:812
void slepcSetOptions(EigenProblem &eigen_problem, const InputParameters &params)
Definition: SlepcSupport.C:438
Generalized Hermitian.
Definition: MooseTypes.h:276
InputParameters getSlepcEigenProblemValidParams()
Definition: SlepcSupport.C:71
void setEigenProblemOptions(SolverParams &solver_params)
Definition: SlepcSupport.C:226
void mooseWarning(Args &&...args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:194