10 #include "libmesh/libmesh_config.h"    12 #ifdef LIBMESH_HAVE_SLEPC    21 #include "libmesh/petsc_vector.h"    22 #include "libmesh/petsc_matrix.h"    23 #include "libmesh/slepc_macro.h"    24 #include "petscsnes.h"    31 namespace SlepcSupport
    39   MooseEnum solve_type(
"POWER ARNOLDI KRYLOVSCHUR JACOBI_DAVIDSON "    40                        "NONLINEAR_POWER NEWTON PJFNK PJFNKMO JFNK",
    45                       "POWER: Power / Inverse / RQI "    47                       "KRYLOVSCHUR: Krylov-Schur "    48                       "JACOBI_DAVIDSON: Jacobi-Davidson "    49                       "NONLINEAR_POWER: Nonlinear Power "    51                       "PJFNK: Preconditioned Jacobian-free Newton-Kyrlov"    52                       "JFNK: Jacobian-free Newton-Kyrlov"    53                       "PJFNKMO: Preconditioned Jacobian-free Newton-Kyrlov with Matrix Only");
    60   params.
set<
Real>(
"l_tol") = 1e-2;
    71   MooseEnum eigen_problem_type(
"HERMITIAN NON_HERMITIAN GEN_HERMITIAN GEN_NON_HERMITIAN "    72                                "GEN_INDEFINITE POS_GEN_NON_HERMITIAN SLEPC_DEFAULT",
    77       "Type of the eigenvalue problem we are solving "    78       "HERMITIAN: Hermitian "    79       "NON_HERMITIAN: Non-Hermitian "    80       "GEN_HERMITIAN: Generalized Hermitian "    81       "GEN_NON_HERMITIAN: Generalized Non-Hermitian "    82       "GEN_INDEFINITE: Generalized indefinite Hermitian "    83       "POS_GEN_NON_HERMITIAN: Generalized Non-Hermitian with positive (semi-)definite B "    84       "SLEPC_DEFAULT: Use whatever SLEPC has by default ");
    87   MooseEnum which_eigen_pairs(
"LARGEST_MAGNITUDE SMALLEST_MAGNITUDE LARGEST_REAL SMALLEST_REAL "    88                               "LARGEST_IMAGINARY SMALLEST_IMAGINARY TARGET_MAGNITUDE TARGET_REAL "    89                               "TARGET_IMAGINARY ALL_EIGENVALUES SLEPC_DEFAULT");
    92                              "Which eigenvalue pairs to obtain from the solution "   105   params.
addParam<
unsigned int>(
"n_eigen_pairs", 1, 
"The number of eigen pairs");
   106   params.
addParam<
unsigned int>(
"n_basis_vectors", 3, 
"The dimension of eigen subspaces");
   108   params.
addParam<
Real>(
"eigen_tol", 1.0e-4, 
"Relative Tolerance for Eigen Solver");
   109   params.
addParam<
unsigned int>(
"eigen_max_its", 10000, 
"Max Iterations for Eigen Solver");
   111   params.
addParam<
Real>(
"l_abs_tol", 1e-50, 
"Absolute Tolerances for Linear Solver");
   113   params.
addParam<
unsigned int>(
"free_power_iterations", 4, 
"The number of free power iterations");
   116       "extra_power_iterations", 0, 
"The number of extra free power iterations");
   119       "eigen_problem_type which_eigen_pairs n_eigen_pairs n_basis_vectors eigen_tol eigen_max_its "   120       "free_power_iterations extra_power_iterations",
   133   const auto prefix_with_dash = 
'-' + solver_params.
_prefix;
   136               "The solver system number must be initialized");
   139                                                          prefix_with_dash + 
"eps_tol",
   143       dont_add_these_options,
   144       prefix_with_dash + 
"eps_max_it",
   153         dont_add_these_options,
   154         prefix_with_dash + 
"snes_max_it",
   158         dont_add_these_options,
   159         prefix_with_dash + 
"snes_max_funcs",
   163         dont_add_these_options,
   164         prefix_with_dash + 
"snes_atol",
   168         dont_add_these_options,
   169         prefix_with_dash + 
"snes_rtol",
   173         dont_add_these_options,
   174         prefix_with_dash + 
"snes_stol",
   179         dont_add_these_options,
   180         prefix_with_dash + 
"ksp_max_it",
   184                                                            prefix_with_dash + 
"ksp_rtol",
   188         dont_add_these_options,
   189         prefix_with_dash + 
"ksp_atol",
   196         dont_add_these_options,
   197         prefix_with_dash + 
"st_ksp_max_it",
   201                                                            prefix_with_dash + 
"st_ksp_rtol",
   205         dont_add_these_options,
   206         prefix_with_dash + 
"st_ksp_atol",
   216     const std::string & eigen_problem_type = params.
get<
MooseEnum>(
"eigen_problem_type");
   217     if (!eigen_problem_type.empty())
   219           Moose::stringToEnum<Moose::EigenProblemType>(eigen_problem_type);
   221       mooseError(
"Have to specify a valid eigen problem type");
   223     const std::string & which_eigen_pairs = params.
get<
MooseEnum>(
"which_eigen_pairs");
   224     if (!which_eigen_pairs.empty())
   226           Moose::stringToEnum<Moose::WhichEigenPairs>(which_eigen_pairs);
   232     unsigned int n_eigen_pairs = params.
get<
unsigned int>(
"n_eigen_pairs");
   233     unsigned int n_basis_vectors = params.
get<
unsigned int>(
"n_basis_vectors");
   237     eigen_problem.
es().
parameters.
set<
unsigned int>(
"eigenpairs") = n_eigen_pairs;
   244           "Number of subspaces in Eigensolver is changed by moose because the value you set "   248     eigen_problem.
es().
parameters.
set<
unsigned int>(
"basis vectors") = n_basis_vectors;
   281     mooseError(
"constant_matrices flag is only valid for solve type: PJFNKMO");
   288   if (!(dynamic_cast<EigenProblem *>(&fe_problem)))
   294           Moose::stringToEnum<Moose::EigenSolveType>(params.
get<
MooseEnum>(
"solve_type"));
   309                                                              "-eps_non_hermitian");
   314                                                              "-eps_gen_hermitian");
   319                                                              "-eps_gen_indefinite");
   324                                                              "-eps_gen_non_hermitian");
   329                                                              "-eps_pos_gen_non_hermitian");
   348                                                              "-eps_largest_magnitude");
   353                                                              "-eps_smallest_magnitude");
   358                                                              "-eps_largest_real");
   363                                                              "-eps_smallest_real");
   368                                                              "-eps_largest_imaginary");
   373                                                              "-eps_smallest_imaginary");
   378                                                              "-eps_target_magnitude");
   388                                                              "-eps_target_imaginary");
   399       mooseError(
"Unknown type of WhichEigenPairs \n");
   433 #if !SLEPC_VERSION_LESS_THAN(3, 8, 0) || !PETSC_VERSION_RELEASE   435   bool initial_power = params.
get<
bool>(
"_newton_inverse_power");
   448         "-init_eps_max_it", 
stringify(params.
get<
unsigned int>(
"free_power_iterations")));
   463 #if PETSC_RELEASE_LESS_THAN(3, 13, 0)   469   mooseError(
"Newton-based eigenvalue solver requires SLEPc 3.7.3 or higher");
   476 #if !SLEPC_VERSION_LESS_THAN(3, 8, 0) || !PETSC_VERSION_RELEASE   485 #if PETSC_RELEASE_LESS_THAN(3, 13, 0)   489   mooseError(
"Nonlinear Inverse Power requires SLEPc 3.7.3 or higher");
   565         dont_add_these_options, 
"-eps_power_sign_normalization", 
"0", &eigen_problem);
   577   PetscBool aisshell, bisshell;
   590   auto & sys = eigen_nl.
sys();
   591   SNES snes = eigen_nl.
getSNES();
   598   if (aisshell || bisshell)
   600     SETERRQ(PetscObjectComm((PetscObject)
eps),
   601             PETSC_ERR_ARG_INCOMP,
   602             "A and B matrices can not be shell matrices when using PJFNKMO \n");
   605   std::vector<Mat> mats = {A, 
B};
   606   std::vector<SparseMatrix<Number> *> libmesh_mats = {&sys.get_matrix_A(), &sys.get_matrix_B()};
   622   if (dof_map.n_constrained_dofs())
   626     dof_map.enforce_constraints_exactly(sys);
   637     X_global.
swap(X_sys);
   639     X_global.swap(X_sys);
   643 std::unique_ptr<NumericVector<Number>>
   648   if (dof_map.n_constrained_dofs())
   652     auto R = std::make_unique<PetscVector<Number>>(r, sys.
comm());
   662   auto & sys = nl.sys();
   665   updateCurrentLocalSolution(sys, x);
   666   auto R = createWrappedResidual(sys, r);
   672   if (dof_map.n_constrained_dofs())
   686   auto & sys = nl.sys();
   690   auto & petsc_all_dofs_mat = cast_ref<PetscMatrix<Number> &>(all_dofs_mat);
   692       !dof_map.n_constrained_dofs() == (eigen_mat == petsc_all_dofs_mat.mat()),
   693       "If we do not have constrained dofs, then eigen_mat and all_dofs_mat should be the same. "   694       "Conversely, if we do have constrained dofs, they must be different");
   697   updateCurrentLocalSolution(sys, x);
   704   if (dof_map.n_constrained_dofs())
   714                                std::vector<Mat> & eigen_mats,
   717                                const std::set<TagID> & tags)
   721   auto & sys = nl.sys();
   726     mooseAssert(!dof_map.n_constrained_dofs() ==
   727                     (eigen_mats[i] == cast_ptr<PetscMatrix<Number> *>(all_dofs_mats[i])->mat()),
   728                 "If we do not have constrained dofs, then mat and libmesh_mat should be the same. "   729                 "Conversely, if we do have constrained dofs, they must be different");
   732   updateCurrentLocalSolution(sys, x);
   734   for (
auto * 
const all_dofs_mat : all_dofs_mats)
   736       all_dofs_mat->zero();
   740   if (dof_map.n_constrained_dofs())
   751   PetscErrorCode (*func)(SNES, Vec, Vec, 
void *);
   757   SNES snes = eigen_nl.
getSNES();
   765         PetscObjectComm((PetscObject)snes), PETSC_ERR_ARG_INCOMP, 
"Contexts are not consistent \n");
   777   PetscBool jisshell, pisshell;
   784   auto & sys = eigen_nl.
sys();
   788   LibmeshPetscCallQ(PetscObjectTypeCompare((PetscObject)jac, MATSHELL, &jisshell));
   791   if (jismffd && eigen_problem->
solverParams(eigen_nl.
number())._eigen_matrix_vector_mult)
   809   if ((jisshell || jismffd) && pisshell)
   831     if (!jisshell && !jismffd && !pisshell) 
   833       std::vector<Mat> mats = {jac, pc};
   834       std::vector<SparseMatrix<Number> *> libmesh_mats = {&sys.
get_matrix_A(),
   848     if (!jisshell && !jismffd) 
   863   PetscBool jshell, pshell;
   870   auto & sys = eigen_nl.
sys();
   877   if ((jshell || jismffd) && pshell)
   888   if (jac != pc && (!jshell && !jshell))
   889     SETERRQ(PetscObjectComm((PetscObject)snes),
   890             PETSC_ERR_ARG_INCOMP,
   891             "Jacobian and precond matrices should be the same for eigen kernels \n");
   907   evaluateResidual(*eigen_problem, x, r, tag);
   969       updateCurrentLocalSolution(eigen_nl.
sys(), x);
   991   auto & sys = eigen_nl.
sys();
  1018       updateCurrentLocalSolution(sys, x);
  1025   updateCurrentLocalSolution(sys, x);
  1026   auto AX = createWrappedResidual(sys, Ax);
  1027   auto BX = createWrappedResidual(sys, Bx);
  1038   if (dof_map.n_constrained_dofs())
  1077       PetscObjectComposeFunction((PetscObject)mat,
  1087       PetscObjectComposeFunction((PetscObject)mat,
  1093   LibmeshPetscCallA(eigen_problem.
comm().
get(),
  1094                     PetscObjectComposeFunction((PetscObject)mat,
  1100     LibmeshPetscCallA(eigen_problem.
comm().
get(),
  1101                       PetscObjectComposeFunction((PetscObject)mat,
  1107   PetscContainer container;
  1108   LibmeshPetscCallA(eigen_problem.
comm().
get(),
  1109                     PetscContainerCreate(eigen_problem.
comm().
get(), &container));
  1110   LibmeshPetscCallA(eigen_problem.
comm().
get(),
  1111                     PetscContainerSetPointer(container, &eigen_problem));
  1114       PetscObjectCompose((PetscObject)mat, 
"formJacobianCtx", (PetscObject)container));
  1117       PetscObjectCompose((PetscObject)mat, 
"formFunctionCtx", (PetscObject)container));
  1119     LibmeshPetscCallA(eigen_problem.
comm().
get(),
  1120                       PetscObjectCompose((PetscObject)mat, 
"formNormCtx", (PetscObject)container));
  1122   LibmeshPetscCallA(eigen_problem.
comm().
get(), PetscContainerDestroy(&container));
  1129   void * 
ctx = 
nullptr;
  1133     mooseError(
"No context is set for shell matrix ");
  1138   evaluateResidual(*eigen_problem, x, r, eigen_nl.
eigenVectorTag());
  1150   void * 
ctx = 
nullptr;
  1154     mooseError(
"No context is set for shell matrix ");
  1167   LibmeshPetscCallA(eigen_problem.
comm().
get(), MatShellSetContext(mat, &eigen_problem));
  1168   LibmeshPetscCallA(eigen_problem.
comm().
get(),
  1169                     MatShellSetOperation(mat,
  1175 PETSC_EXTERN PetscErrorCode
  1185 PETSC_EXTERN PetscErrorCode
  1213   LibmeshPetscCallQ(PetscObjectTypeCompare((PetscObject)viewer, PETSCVIEWERASCII, &iascii));
  1225   PetscContainer container;
  1230       PetscObjectQuery((PetscObject)Pmat, 
"formFunctionCtx", (PetscObject *)&container));
  1240   if (!preconditioner)
  1241     mooseError(
"There is no moose preconditioner in nonlinear eigen system \n");
  1246   preconditioner->apply(x_vec, y_vec);
  1256   PetscContainer container;
  1261       PetscObjectQuery((PetscObject)Pmat, 
"formFunctionCtx", (PetscObject *)&container));
  1271   if (!preconditioner)
  1272     mooseError(
"There is no moose preconditioner in nonlinear eigen system \n");
  1275     preconditioner->
init();
  1277   preconditioner->
setup();
  1288                        EPSConvergedReason * reason,
  1304     *reason = EPS_CONVERGED_USER;
  1313   PetscBool same, nonlinear;
  1319     mooseError(
"It is not eps power, and there is no snes");
  1324     mooseError(
"It is not a nonlinear eigen solver");
  1335   const char * prefix = 
nullptr;
  1397   PetscScalar eigenr, eigeni;
  1401   auto & console = eigen_problem->
console();
  1410   auto eigenvalue = 
inverse ? 1.0 / eigenr : eigenr;
  1413   console << 
" Iteration " << its << std::setprecision(10) << std::fixed
  1414           << (
inverse ? 
" k-eigenvalue = " : 
" eigenvalue = ") << eigenvalue << std::endl;
  1422 #endif // LIBMESH_HAVE_SLEPC void setNewtonPetscOptions(SolverParams &solver_params, const InputParameters ¶ms)
Nonlinear eigenvalue system to be solved. 
bool constantMatrices() const
Whether or not matrices are constant. 
bool wereMatricesFormed() const
Whether or not constant matrices were already formed. 
Generalized Non-Hermitian. 
virtual void computeResidualTag(const NumericVector< Number > &soln, NumericVector< Number > &residual, TagID tag) override
Form a vector for all kernels and BCs with a given tag. 
unsigned int _solver_sys_num
Moose::PetscSupport::PetscOptions & getPetscOptions()
Retrieve a writable reference the PETSc options (used by PetscSupport) 
const SparseMatrix< Number > & get_precond_matrix() const
int eps(unsigned int i, unsigned int j)
2D version 
Generalized Hermitian indefinite. 
void addPetscOptionsFromCommandline()
Newton-based eigensolver with an assembled Jacobian matrix (fully coupled by default) ...
Moose::EigenSolveType _eigen_solve_type
const unsigned int invalid_uint
PetscErrorCode mooseSlepcEigenFormFunctionMFFD(void *ctx, Vec x, Vec r)
Function call for MFFD. 
virtual std::size_t numNonlinearSystems() const override
bool outputInverseEigenvalue() const
Whether or not to output eigenvalue inverse. 
const SparseMatrix< Number > & get_matrix_A() const
void moosePetscSNESFormMatricesTags(SNES, Vec x, std::vector< Mat > &eigen_mats, std::vector< SparseMatrix< Number > *> &all_dofs_mats, void *ctx, const std::set< TagID > &tags)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
PetscErrorCode mooseSlepcEPSSNESSetCustomizePC(EPS eps)
Attach a customized PC. 
PetscErrorCode mooseSlepcStoppingTest(EPS eps, PetscInt its, PetscInt max_it, PetscInt nconv, PetscInt nev, EPSConvergedReason *reason, void *ctx)
A customized convergence checker. 
TagID nonEigenVectorTag() const
Vector tag ID of left hand side. 
void setCoupling(Moose::CouplingType type)
Set the coupling between variables TODO: allow user-defined coupling. 
const SparseMatrix< Number > & get_matrix_B() const
void setEigenSolverOptions(SolverParams &solver_params, const InputParameters ¶ms)
PetscErrorCode mooseMatMult_Eigen(Mat mat, Vec x, Vec y)
Implement MatMult via function evaluation for Bx. 
The same as PJFNK except that matrix-vector multiplication is employed to replace residual evaluation...
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args. 
TagID eigenVectorTag() const
Vector tag ID of right hand side. 
PetscErrorCode mooseSlepcEigenFormJacobianB(SNES snes, Vec x, Mat jac, Mat pc, void *ctx)
Form Jacobian matrix B. 
void clearFreeNonlinearPowerIterations(const InputParameters ¶ms)
virtual void execute(const ExecFlagType &exec_type) override
Convenience function for performing execution of MOOSE systems. 
PetscErrorCode mooseSlepcEigenFormFunctionAB(SNES snes, Vec x, Vec Ax, Vec Bx, void *ctx)
Form function residual Ax-Bx. 
bool negativeSignEigenKernel() const
A flag indicates if a negative sign is used in eigen kernels. 
const Parallel::Communicator & comm() const
void petscSetDefaultKSPNormType(FEProblemBase &problem, KSP ksp)
Set norm type. 
PetscErrorCode PCApply_MoosePC(PC pc, Vec x, Vec y)
Preconditioner application. 
use whatever SLPEC has by default 
bool _customized_pc_for_eigen
PetscErrorCode PCDestroy_MoosePC(PC pc)
Destroy preconditioner. 
PetscErrorCode mooseSlepcEigenFormFunctionA(SNES snes, Vec x, Vec r, void *ctx)
Form function residual Ax. 
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
void copy_super_to_sub(NumericVector< Number > &super, NumericVector< Number > &sub)
void setNEigenPairsRequired(unsigned int n_eigen_pairs)
virtual bool initialized() const
Generalized Non-Hermitian with positive (semi-)definite B. 
void setEigenProblemOptions(SolverParams &solver_params, const MultiMooseEnum &dont_add_these_options)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations. 
PetscErrorCode mooseMatMult_NonEigen(Mat mat, Vec x, Vec y)
Implement MatMult via function evaluation for Ax. 
bool isNonlinearEigenvalueSolver(unsigned int eigen_sys_num) const
void setSlepcEigenSolverTolerances(EigenProblem &eigen_problem, const SolverParams &solver_params, const InputParameters ¶ms)
Control eigen solver tolerances via SLEPc options. 
Real formNorm()
Form the Bx norm. 
virtual void swap(NumericVector< T > &v) override
InputParameters getSlepcValidParams(InputParameters ¶ms)
virtual EPS getEPS()
Retrieve EPS (SLEPc eigen solver) 
void libmesh_ignore(const Args &...)
bool _eigen_matrix_vector_mult
Preconditioned Jacobian-free Newton Krylov. 
PetscErrorCode PCSetUp_MoosePC(PC pc)
Setup preconditioner. 
Moose::EigenProblemType _eigen_problem_type
void attachCallbacksToMat(EigenProblem &eigen_problem, Mat mat, bool eigen)
Attach call backs to mat. 
void copy_sub_to_super(const NumericVector< Number > &sub, NumericVector< Number > &super)
void slepcSetOptions(EigenProblem &eigen_problem, SolverParams &solver_params, const InputParameters ¶ms)
Push all SLEPc/PETSc options into SLEPc/PETSc side. 
PETSC_EXTERN PetscErrorCode PCCreate_MoosePC(PC pc)
Create a preconditioner from moose side. 
bool constJacobian() const
Returns _const_jacobian (whether a MOOSE object has specified that the Jacobian is the same as the pr...
PetscErrorCode mooseSlepcEigenFormNorm(SNES, Vec, PetscReal *norm, void *ctx)
virtual libMesh::EquationSystems & es() override
void computeResidualAB(const NumericVector< Number > &soln, NumericVector< Number > &residualA, NumericVector< Number > &residualB, TagID tagA, TagID tagB)
Form two vetors, where each is associated with one tag, through one element-loop. ...
std::unique_ptr< NumericVector< Number > > solution
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
PetscErrorCode PCView_MoosePC(PC pc, PetscViewer viewer)
View preconditioner. 
Moose::WhichEigenPairs _which_eigen_pairs
unsigned int number() const
Gets the number of this system. 
const ExecFlagType EXEC_LINEAR
void setNonlinearPowerOptions(SolverParams &solver_params)
std::string stringify(const T &t)
conversion to string 
void computeMatricesTags(const NumericVector< Number > &soln, const std::vector< SparseMatrix< Number > *> &jacobians, const std::set< TagID > &tags)
Form several matrices simultaneously. 
void petscSetOptions(const PetscOptions &po, const SolverParams &solver_params, FEProblemBase *const problem=nullptr)
A function for setting the PETSc options in PETSc from the options supplied to MOOSE. 
NonlinearEigenSystem & getCurrentNonlinearEigenSystem()
PetscErrorCode mooseSlepcEigenFormJacobianA(SNES snes, Vec x, Mat jac, Mat pc, void *ctx)
Form Jacobian matrix A. 
PetscErrorCode mooseSlepcEigenFormFunctionB(SNES snes, Vec x, Vec r, void *ctx)
Form function residual Bx. 
PetscErrorCode mooseSlepcEPSMonitor(EPS eps, PetscInt its, PetscInt nconv, PetscScalar *eigr, PetscScalar *eigi, PetscReal *errest, PetscInt nest, void *mctx)
A customized solver monitor to print out eigenvalue. 
bool _precond_matrix_free
void moosePetscSNESFormFunction(SNES, Vec x, Vec r, void *ctx, TagID tag)
LibmeshPetscCallQ(DMShellGetContext(dm, &ctx))
const ConsoleStream & console() const
Return console handle. 
void setSinglePetscOption(const std::string &name, const std::string &value="", FEProblemBase *const problem=nullptr)
A wrapper function for dealing with different versions of PetscOptionsSetValue. 
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
PetscErrorCode mooseSlepcEPSGetSNES(EPS eps, SNES *snes)
Retrieve SNES from EPS. 
bool onLinearSolver() const
Whether or not we are in a linear solver iteration. 
void setFreeNonlinearPowerIterations(unsigned int free_power_iterations)
Set SLEPc/PETSc options to trigger free power iteration. 
T & set(const std::string &)
libMesh::CondensedEigenSystem & sys()
Jacobian-free Newton Krylov. 
virtual SNES getSNES() override
Retrieve snes from slepc eigen solver. 
TagID eigenMatrixTag() const
Matrix tag ID of right hand side. 
IntRange< T > make_range(T beg, T end)
PetscErrorCode mooseSlepcEPSSNESKSPSetPCSide(FEProblemBase &problem, EPS eps)
Allow users to specify PC side. 
SolverParams & solverParams(unsigned int solver_sys_num=0)
Get the solver parameters. 
std::unique_ptr< NumericVector< Number > > current_local_solution
void moosePetscSNESFormMatrixTag(SNES, Vec x, Mat eigen_mat, SparseMatrix< Number > &all_dofs_mat, void *ctx, TagID tag)
PetscErrorCode mooseSlepcEPSSNESSetUpOptionPrefix(EPS eps)
Get rid of prefix "-eps_power" for SNES, KSP, PC, etc. 
void setSinglePetscOptionIfAppropriate(const MultiMooseEnum &dont_add_these_options, const std::string &name, const std::string &value="", FEProblemBase *const problem=nullptr)
Same as setSinglePetscOption, but does not set the option if it doesn't make sense for the current si...
void setOperationsForShellMat(EigenProblem &eigen_problem, Mat mat, bool eigen)
Set operations to shell mat. 
void setEigenProblemSolverParams(EigenProblem &eigen_problem, const InputParameters ¶ms)
Retrieve eigen problem params from 'params', and then set these params into SolverParams. 
TagID nonEigenMatrixTag() const
Matrix tag ID of left hand side. 
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
use whatever we have in SLEPC 
const int subspace_factor
PetscErrorCode mooseEPSFormMatrices(EigenProblem &eigen_problem, EPS eps, Vec x, void *ctx)
Problem for solving eigenvalue problems. 
void storeSolveType(FEProblemBase &fe_problem, const InputParameters ¶ms)
Set solve type into eigen problem (solverParams) 
MultiMooseEnum dont_add_these_options
Flags to explicitly not set, even if they are specified programmatically. 
TagID precondMatrixTag() const
PETSC_EXTERN PetscErrorCode registerPCToPETSc()
Let PETSc know there is a preconditioner. 
bool bxNormProvided() const
Whether a Bx norm postprocessor has been provided. 
void setWhichEigenPairsOptions(SolverParams &solver_params, const MultiMooseEnum &dont_add_these_options)
PetscFunctionReturn(LIBMESH_PETSC_SUCCESS)
const DofMap & get_dof_map() const
bool doFreePowerIteration() const
Whether or not we are doing free power iteration. 
libMesh::Preconditioner< Number > * preconditioner() const
auto index_range(const T &sizable)
void petscSetDefaultPCSide(FEProblemBase &problem, KSP ksp)
Setup which side we want to apply preconditioner. 
virtual void computeJacobianTag(const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian, TagID tag) override
Form a Jacobian matrix for all kernels and BCs with a given tag. 
InputParameters getSlepcEigenProblemValidParams()
Retrieve valid params that allow users to specify eigen problem configuration.