12 #include "libmesh/libmesh_config.h" 14 #ifdef LIBMESH_HAVE_SLEPC 16 #include "libmesh/petsc_macro.h" 22 #include <petsc/private/pcimpl.h> 24 #include <slepc/private/epsimpl.h> 26 #include "libmesh/linear_solver.h" 27 #include "libmesh/preconditioner.h" 34 namespace SlepcSupport
89 SNES snes, Vec x, std::vector<Mat> & mats,
void *
ctx,
const std::set<TagID> & tags);
125 EPSConvergedReason * reason,
220 #endif // LIBMESH_HAVE_SLEPC int eps(unsigned int i, unsigned int j)
2D version
PetscErrorCode mooseSlepcEigenFormFunctionMFFD(void *ctx, Vec x, Vec r)
Function call for MFFD.
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.
PetscErrorCode mooseMatMult_Eigen(Mat mat, Vec x, Vec y)
Implement MatMult via function evaluation for Bx.
PetscErrorCode mooseSlepcEigenFormJacobianB(SNES snes, Vec x, Mat jac, Mat pc, void *ctx)
Form Jacobian matrix B.
void clearFreeNonlinearPowerIterations(const InputParameters ¶ms)
PetscErrorCode mooseSlepcEigenFormFunctionAB(SNES snes, Vec x, Vec Ax, Vec Bx, void *ctx)
Form function residual Ax-Bx.
PetscErrorCode PCApply_MoosePC(PC pc, Vec x, Vec y)
Preconditioner application.
PetscErrorCode PCDestroy_MoosePC(PC pc)
Destroy preconditioner.
PetscErrorCode mooseSlepcEigenFormFunctionA(SNES snes, Vec x, Vec r, void *ctx)
Form function residual Ax.
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.
void setSlepcEigenSolverTolerances(EigenProblem &eigen_problem, const InputParameters ¶ms)
Control eigen solver tolerances via SLEPc options.
InputParameters getSlepcValidParams(InputParameters ¶ms)
PetscErrorCode PCSetUp_MoosePC(PC pc)
Setup preconditioner.
void attachCallbacksToMat(EigenProblem &eigen_problem, Mat mat, bool eigen)
Attach call backs to mat.
PETSC_EXTERN PetscErrorCode PCCreate_MoosePC(PC pc)
Create a preconditioner from moose side.
PetscErrorCode PCView_MoosePC(PC pc, PetscViewer viewer)
View preconditioner.
void moosePetscSNESFormMatricesTags(SNES snes, Vec x, std::vector< Mat > &mats, void *ctx, const std::set< TagID > &tags)
Form multiple matrices for multiple tags.
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.
PetscErrorCode mooseSlepcEPSGetSNES(EPS eps, SNES *snes)
Retrieve SNES from EPS.
void setFreeNonlinearPowerIterations(unsigned int free_power_iterations)
Set SLEPc/PETSc options to trigger free power iteration.
PetscErrorCode mooseSlepcEPSSNESKSPSetPCSide(FEProblemBase &problem, EPS eps)
Allow users to specify PC side.
PetscErrorCode mooseSlepcEPSSNESSetUpOptionPrefix(EPS eps)
Get rid of prefix "-eps_power" for SNES, KSP, PC, etc.
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.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
Problem for solving eigenvalue problems.
void storeSolveType(FEProblemBase &fe_problem, const InputParameters ¶ms)
Set solve type into eigen problem (solverParams)
PETSC_EXTERN PetscErrorCode registerPCToPETSc()
Let PETSc know there is a preconditioner.
void moosePetscSNESFormMatrixTag(SNES snes, Vec x, Mat mat, void *ctx, TagID tag)
Form matrix according to tag.
void slepcSetOptions(EigenProblem &eigen_problem, const InputParameters ¶ms)
Push all SLEPc/PETSc options into SLEPc/PETSc side.
InputParameters getSlepcEigenProblemValidParams()
Retrieve valid params that allow users to specify eigen problem configuration.