19 #include "libmesh/petsc_solver_exception.h" 30 "Solve object for a standard/generalized linear or nonlinear eigenvalue problem");
37 "Whether or not to use a matrix free fashion to form operators. " 38 "If true, shell matrices will be used and meanwhile a preconditioning matrix" 39 "may be formed as well.");
42 "precond_matrix_free",
44 "Whether or not to use a matrix free fashion for forming the preconditioning matrix. " 45 "If true, a shell matrix will be used for preconditioner.");
47 params.
addParam<
bool>(
"constant_matrices",
49 "Whether or not to use constant matrices so that we can use them to form " 50 "residuals on both linear and " 51 "nonlinear iterations");
54 "precond_matrix_includes_eigen",
56 "Whether or not to include eigen kernels in the preconditioning matrix. " 57 "If true, the preconditioning matrix could be singular with the converged eigenvalue if the " 58 "full matrix is assembled and the derivative of eigenvalue with respect to the solution " 59 "vector is not considered.");
63 params.
addParam<
Real>(
"initial_eigenvalue", 1,
"Initial eigenvalue");
65 "normalization",
"Postprocessor evaluating norm of eigenvector for normalization");
67 "Normalize eigenvector to make a defined norm equal to this factor");
69 params.
addParam<
bool>(
"auto_initialization",
71 "If true, we will set an initial eigen vector in moose, otherwise EPS " 72 "solver will initialize eigen vector");
75 "precond_matrix_includes_eigen",
76 "Matrix and Matrix-Free");
78 "Eigenvector and eigenvalue initialization");
85 #ifdef LIBMESH_HAVE_SLEPC 96 "_eigen_problem",
"This might happen if you don't have a mesh")),
97 _normalization(isParamValid(
"normalization") ? &getPostprocessorValue(
"normalization")
101 #ifdef LIBMESH_HAVE_SLEPC 103 "The Eigenvalue executioner only currently supports a single solver system.");
114 getParam<unsigned int>(
"free_power_iterations");
116 getParam<unsigned int>(
"extra_power_iterations");
120 "Cannot set scaling factor without defining normalization postprocessor.");
124 const auto & normpp = getParam<PostprocessorName>(
"normalization");
137 mooseError(
"SLEPc is required to use Eigenvalue executioner, please use '--download-slepc in " 138 "PETSc configuration'");
142 #if PETSC_RELEASE_LESS_THAN(3, 13, 0) 144 "Please use SLEPc-3.13.0 or higher. Old versions of SLEPc likely produce bad convergence");
163 const auto & normpp = getParam<PostprocessorName>(
"normalization");
166 mooseError(
"Normalization postprocessor ", normpp,
" requires execute_on = 'linear'");
169 #ifdef LIBMESH_HAVE_SLEPC 179 LibmeshPetscCall(PetscOptionsPop());
FEProblemBase & _problem
Reference to FEProblem.
Moose::PetscSupport::PetscOptions & getPetscOptions()
Retrieve a writable reference the PETSc options (used by PetscSupport)
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
const InputParameters & _pars
The object's parameters.
T & getUserObject(const std::string &name, unsigned int tid=0) const
Get the user object by its name.
void precondMatrixIncludesEigenKernels(bool precond_matrix_includes_eigen)
If the preconditioning matrix includes eigen kernels.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
virtual void initialSetup() override
Method that should be executed once, before any solve calls.
const InputParameters & parameters() const
Get the parameters of the object.
static InputParameters validParams()
bool & petscOptionsInserted()
If PETSc options are already inserted.
InputParameters getSlepcValidParams(InputParameters ¶ms)
void setNormalization(const PostprocessorName &pp, const Real value=std::numeric_limits< Real >::max())
Set postprocessor and normalization factor 'Postprocessor' is often used to compute an integral of ph...
Moose::EigenProblemType _eigen_problem_type
static InputParameters validParams()
void slepcSetOptions(EigenProblem &eigen_problem, SolverParams &solver_params, const InputParameters ¶ms)
Push all SLEPc/PETSc options into SLEPc/PETSc side.
void dontAddPetscFlag(const std::string &flag, PetscOptions &petsc_options)
Function to ensure that a particular petsc option is not added to the PetscOptions storage object to ...
Executioners are objects that do the actual work of solving your problem.
MooseApp & _app
The MOOSE application this is associated with.
const ExecFlagType EXEC_LINEAR
static InputParameters validParams()
NonlinearEigenSystem & getNonlinearEigenSystem(const unsigned int nl_sys_num)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
PetscOptions & petscOptionsDatabase()
void dontAddNonlinearConvergedReason(FEProblemBase &fe_problem)
Function to ensure that -snes_converged_reason is not added to the PetscOptions storage object to be ...
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
unsigned int _free_power_iterations
SolverParams & solverParams(unsigned int solver_sys_num=0)
Get the solver parameters.
void dontAddLinearConvergedReason(FEProblemBase &fe_problem)
Function to ensure that -ksp_converged_reason is not added to the PetscOptions storage object to be l...
void setInitialEigenvalue(const Real initial_eigenvalue)
Set an initial eigenvalue for initial normalization.
void setEigenProblemSolverParams(EigenProblem &eigen_problem, const InputParameters ¶ms)
Retrieve eigen problem params from 'params', and then set these params into SolverParams.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
unsigned int _extra_power_iterations
Problem for solving eigenvalue problems.
void storeSolveType(FEProblemBase &fe_problem, const InputParameters ¶ms)
Set solve type into eigen problem (solverParams)
EigenProblem & _eigen_problem
virtual std::size_t numSolverSystems() const override
void setEigenproblemType(Moose::EigenProblemType eigen_problem_type)
Set eigen problem type.
Base class for user-specific data.
InputParameters getSlepcEigenProblemValidParams()
Retrieve valid params that allow users to specify eigen problem configuration.
EigenProblemSolve(Executioner &ex)