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 "libmesh/auto_ptr.h" 25 #include "petscsnes.h" 32 namespace SlepcSupport
40 MooseEnum solve_type(
"POWER ARNOLDI KRYLOVSCHUR JACOBI_DAVIDSON " 41 "NONLINEAR_POWER NEWTON PJFNK PJFNKMO JFNK",
46 "POWER: Power / Inverse / RQI " 48 "KRYLOVSCHUR: Krylov-Schur " 49 "JACOBI_DAVIDSON: Jacobi-Davidson " 50 "NONLINEAR_POWER: Nonlinear Power " 52 "PJFNK: Preconditioned Jacobian-free Newton-Kyrlov" 53 "JFNK: Jacobian-free Newton-Kyrlov" 54 "PJFNKMO: Preconditioned Jacobian-free Newton-Kyrlov with Matrix Only");
61 params.
set<
Real>(
"l_tol") = 1e-2;
72 MooseEnum eigen_problem_type(
"HERMITIAN NON_HERMITIAN GEN_HERMITIAN GEN_NON_HERMITIAN " 73 "GEN_INDEFINITE POS_GEN_NON_HERMITIAN SLEPC_DEFAULT",
78 "Type of the eigenvalue problem we are solving " 79 "HERMITIAN: Hermitian " 80 "NON_HERMITIAN: Non-Hermitian " 81 "GEN_HERMITIAN: Generalized Hermitian " 82 "GEN_NON_HERMITIAN: Generalized Non-Hermitian " 83 "GEN_INDEFINITE: Generalized indefinite Hermitian " 84 "POS_GEN_NON_HERMITIAN: Generalized Non-Hermitian with positive (semi-)definite B " 85 "SLEPC_DEFAULT: Use whatever SLEPC has by default ");
88 MooseEnum which_eigen_pairs(
"LARGEST_MAGNITUDE SMALLEST_MAGNITUDE LARGEST_REAL SMALLEST_REAL " 89 "LARGEST_IMAGINARY SMALLEST_IMAGINARY TARGET_MAGNITUDE TARGET_REAL " 90 "TARGET_IMAGINARY ALL_EIGENVALUES SLEPC_DEFAULT");
93 "Which eigenvalue pairs to obtain from the solution " 106 params.
addParam<
unsigned int>(
"n_eigen_pairs", 1,
"The number of eigen pairs");
107 params.
addParam<
unsigned int>(
"n_basis_vectors", 3,
"The dimension of eigen subspaces");
109 params.
addParam<
Real>(
"eigen_tol", 1.0e-4,
"Relative Tolerance for Eigen Solver");
110 params.
addParam<
unsigned int>(
"eigen_max_its", 10000,
"Max Iterations for Eigen Solver");
112 params.
addParam<
Real>(
"l_abs_tol", 1e-50,
"Absolute Tolerances for Linear Solver");
114 params.
addParam<
unsigned int>(
"free_power_iterations", 4,
"The number of free power iterations");
117 "extra_power_iterations", 0,
"The number of extra free power iterations");
120 "eigen_problem_type which_eigen_pairs n_eigen_pairs n_basis_vectors eigen_tol eigen_max_its " 121 "free_power_iterations extra_power_iterations",
134 const auto prefix_with_dash =
'-' + solver_params.
_prefix;
137 "The solver system number must be initialized");
140 prefix_with_dash +
"eps_tol",
144 dont_add_these_options,
145 prefix_with_dash +
"eps_max_it",
154 dont_add_these_options,
155 prefix_with_dash +
"snes_max_it",
159 dont_add_these_options,
160 prefix_with_dash +
"snes_max_funcs",
164 dont_add_these_options,
165 prefix_with_dash +
"snes_atol",
169 dont_add_these_options,
170 prefix_with_dash +
"snes_rtol",
174 dont_add_these_options,
175 prefix_with_dash +
"snes_stol",
180 dont_add_these_options,
181 prefix_with_dash +
"ksp_max_it",
185 prefix_with_dash +
"ksp_rtol",
189 dont_add_these_options,
190 prefix_with_dash +
"ksp_atol",
197 dont_add_these_options,
198 prefix_with_dash +
"st_ksp_max_it",
202 prefix_with_dash +
"st_ksp_rtol",
206 dont_add_these_options,
207 prefix_with_dash +
"st_ksp_atol",
217 const std::string & eigen_problem_type = params.
get<
MooseEnum>(
"eigen_problem_type");
218 if (!eigen_problem_type.empty())
220 Moose::stringToEnum<Moose::EigenProblemType>(eigen_problem_type);
222 mooseError(
"Have to specify a valid eigen problem type");
224 const std::string & which_eigen_pairs = params.
get<
MooseEnum>(
"which_eigen_pairs");
225 if (!which_eigen_pairs.empty())
227 Moose::stringToEnum<Moose::WhichEigenPairs>(which_eigen_pairs);
233 unsigned int n_eigen_pairs = params.
get<
unsigned int>(
"n_eigen_pairs");
234 unsigned int n_basis_vectors = params.
get<
unsigned int>(
"n_basis_vectors");
238 eigen_problem.
es().
parameters.
set<
unsigned int>(
"eigenpairs") = n_eigen_pairs;
245 "Number of subspaces in Eigensolver is changed by moose because the value you set " 249 eigen_problem.
es().
parameters.
set<
unsigned int>(
"basis vectors") = n_basis_vectors;
282 mooseError(
"constant_matrices flag is only valid for solve type: PJFNKMO");
289 if (!(dynamic_cast<EigenProblem *>(&fe_problem)))
295 Moose::stringToEnum<Moose::EigenSolveType>(params.
get<
MooseEnum>(
"solve_type"));
310 "-eps_non_hermitian");
315 "-eps_gen_hermitian");
320 "-eps_gen_indefinite");
325 "-eps_gen_non_hermitian");
330 "-eps_pos_gen_non_hermitian");
349 "-eps_largest_magnitude");
354 "-eps_smallest_magnitude");
359 "-eps_largest_real");
364 "-eps_smallest_real");
369 "-eps_largest_imaginary");
374 "-eps_smallest_imaginary");
379 "-eps_target_magnitude");
389 "-eps_target_imaginary");
400 mooseError(
"Unknown type of WhichEigenPairs \n");
434 #if !SLEPC_VERSION_LESS_THAN(3, 8, 0) || !PETSC_VERSION_RELEASE 436 bool initial_power = params.
get<
bool>(
"_newton_inverse_power");
449 "-init_eps_max_it",
stringify(params.
get<
unsigned int>(
"free_power_iterations")));
464 #if PETSC_RELEASE_LESS_THAN(3, 13, 0) 470 mooseError(
"Newton-based eigenvalue solver requires SLEPc 3.7.3 or higher");
477 #if !SLEPC_VERSION_LESS_THAN(3, 8, 0) || !PETSC_VERSION_RELEASE 486 #if PETSC_RELEASE_LESS_THAN(3, 13, 0) 490 mooseError(
"Nonlinear Inverse Power requires SLEPc 3.7.3 or higher");
566 dont_add_these_options,
"-eps_power_sign_normalization",
"0", &eigen_problem);
578 PetscBool aisshell, bisshell;
591 auto & sys = eigen_nl.
sys();
592 SNES snes = eigen_nl.
getSNES();
599 if (aisshell || bisshell)
601 SETERRQ(PetscObjectComm((PetscObject)
eps),
602 PETSC_ERR_ARG_INCOMP,
603 "A and B matrices can not be shell matrices when using PJFNKMO \n");
606 std::vector<Mat> mats = {A,
B};
607 std::vector<SparseMatrix<Number> *> libmesh_mats = {&sys.get_matrix_A(), &sys.get_matrix_B()};
623 if (dof_map.n_constrained_dofs())
627 dof_map.enforce_constraints_exactly(sys);
638 X_global.
swap(X_sys);
640 X_global.swap(X_sys);
644 std::unique_ptr<NumericVector<Number>>
649 if (dof_map.n_constrained_dofs())
653 auto R = std::make_unique<PetscVector<Number>>(r, sys.
comm());
663 auto & sys = nl.sys();
666 updateCurrentLocalSolution(sys, x);
667 auto R = createWrappedResidual(sys, r);
673 if (dof_map.n_constrained_dofs())
687 auto & sys = nl.sys();
691 auto & petsc_all_dofs_mat = cast_ref<PetscMatrix<Number> &>(all_dofs_mat);
693 !dof_map.n_constrained_dofs() == (eigen_mat == petsc_all_dofs_mat.mat()),
694 "If we do not have constrained dofs, then eigen_mat and all_dofs_mat should be the same. " 695 "Conversely, if we do have constrained dofs, they must be different");
698 updateCurrentLocalSolution(sys, x);
705 if (dof_map.n_constrained_dofs())
715 std::vector<Mat> & eigen_mats,
718 const std::set<TagID> & tags)
722 auto & sys = nl.sys();
727 mooseAssert(!dof_map.n_constrained_dofs() ==
728 (eigen_mats[i] == cast_ptr<PetscMatrix<Number> *>(all_dofs_mats[i])->mat()),
729 "If we do not have constrained dofs, then mat and libmesh_mat should be the same. " 730 "Conversely, if we do have constrained dofs, they must be different");
733 updateCurrentLocalSolution(sys, x);
735 for (
auto *
const all_dofs_mat : all_dofs_mats)
737 all_dofs_mat->zero();
741 if (dof_map.n_constrained_dofs())
752 PetscErrorCode (*func)(SNES, Vec, Vec,
void *);
758 SNES snes = eigen_nl.
getSNES();
766 PetscObjectComm((PetscObject)snes), PETSC_ERR_ARG_INCOMP,
"Contexts are not consistent \n");
778 PetscBool jisshell, pisshell;
785 auto & sys = eigen_nl.
sys();
789 LibmeshPetscCallQ(PetscObjectTypeCompare((PetscObject)jac, MATSHELL, &jisshell));
792 if (jismffd && eigen_problem->
solverParams(eigen_nl.
number())._eigen_matrix_vector_mult)
810 if ((jisshell || jismffd) && pisshell)
832 if (!jisshell && !jismffd && !pisshell)
834 std::vector<Mat> mats = {jac, pc};
835 std::vector<SparseMatrix<Number> *> libmesh_mats = {&sys.
get_matrix_A(),
849 if (!jisshell && !jismffd)
864 PetscBool jshell, pshell;
871 auto & sys = eigen_nl.
sys();
878 if ((jshell || jismffd) && pshell)
889 if (jac != pc && (!jshell && !jshell))
890 SETERRQ(PetscObjectComm((PetscObject)snes),
891 PETSC_ERR_ARG_INCOMP,
892 "Jacobian and precond matrices should be the same for eigen kernels \n");
908 evaluateResidual(*eigen_problem, x, r, tag);
970 updateCurrentLocalSolution(eigen_nl.
sys(), x);
992 auto & sys = eigen_nl.
sys();
1019 updateCurrentLocalSolution(sys, x);
1026 updateCurrentLocalSolution(sys, x);
1027 auto AX = createWrappedResidual(sys, Ax);
1028 auto BX = createWrappedResidual(sys, Bx);
1039 if (dof_map.n_constrained_dofs())
1078 PetscObjectComposeFunction((PetscObject)mat,
1088 PetscObjectComposeFunction((PetscObject)mat,
1094 LibmeshPetscCallA(eigen_problem.
comm().
get(),
1095 PetscObjectComposeFunction((PetscObject)mat,
1101 LibmeshPetscCallA(eigen_problem.
comm().
get(),
1102 PetscObjectComposeFunction((PetscObject)mat,
1108 PetscContainer container;
1109 LibmeshPetscCallA(eigen_problem.
comm().
get(),
1110 PetscContainerCreate(eigen_problem.
comm().
get(), &container));
1111 LibmeshPetscCallA(eigen_problem.
comm().
get(),
1112 PetscContainerSetPointer(container, &eigen_problem));
1115 PetscObjectCompose((PetscObject)mat,
"formJacobianCtx", (PetscObject)container));
1118 PetscObjectCompose((PetscObject)mat,
"formFunctionCtx", (PetscObject)container));
1120 LibmeshPetscCallA(eigen_problem.
comm().
get(),
1121 PetscObjectCompose((PetscObject)mat,
"formNormCtx", (PetscObject)container));
1123 LibmeshPetscCallA(eigen_problem.
comm().
get(), PetscContainerDestroy(&container));
1130 void *
ctx =
nullptr;
1134 mooseError(
"No context is set for shell matrix ");
1139 evaluateResidual(*eigen_problem, x, r, eigen_nl.
eigenVectorTag());
1151 void *
ctx =
nullptr;
1155 mooseError(
"No context is set for shell matrix ");
1168 LibmeshPetscCallA(eigen_problem.
comm().
get(), MatShellSetContext(mat, &eigen_problem));
1169 LibmeshPetscCallA(eigen_problem.
comm().
get(),
1170 MatShellSetOperation(mat,
1176 PETSC_EXTERN PetscErrorCode
1186 PETSC_EXTERN PetscErrorCode
1214 LibmeshPetscCallQ(PetscObjectTypeCompare((PetscObject)viewer, PETSCVIEWERASCII, &iascii));
1226 PetscContainer container;
1231 PetscObjectQuery((PetscObject)Pmat,
"formFunctionCtx", (PetscObject *)&container));
1241 if (!preconditioner)
1242 mooseError(
"There is no moose preconditioner in nonlinear eigen system \n");
1247 preconditioner->apply(x_vec, y_vec);
1257 PetscContainer container;
1262 PetscObjectQuery((PetscObject)Pmat,
"formFunctionCtx", (PetscObject *)&container));
1272 if (!preconditioner)
1273 mooseError(
"There is no moose preconditioner in nonlinear eigen system \n");
1276 preconditioner->
init();
1278 preconditioner->
setup();
1289 EPSConvergedReason * reason,
1305 *reason = EPS_CONVERGED_USER;
1314 PetscBool same, nonlinear;
1320 mooseError(
"It is not eps power, and there is no snes");
1325 mooseError(
"It is not a nonlinear eigen solver");
1336 const char * prefix =
nullptr;
1398 PetscScalar eigenr, eigeni;
1402 auto & console = eigen_problem->
console();
1411 auto eigenvalue =
inverse ? 1.0 / eigenr : eigenr;
1414 console <<
" Iteration " << its << std::setprecision(10) << std::fixed
1415 << (
inverse ?
" k-eigenvalue = " :
" eigenvalue = ") << eigenvalue << std::endl;
1423 #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.