Functions | |
InputParameters | getSlepcValidParams (InputParameters ¶ms) |
InputParameters | getSlepcEigenProblemValidParams () |
Retrieve valid params that allow users to specify eigen problem configuration. More... | |
void | storeSolveType (FEProblemBase &fe_problem, const InputParameters ¶ms) |
Set solve type into eigen problem (solverParams) More... | |
void | setEigenProblemSolverParams (EigenProblem &eigen_problem, const InputParameters ¶ms) |
Retrieve eigen problem params from 'params', and then set these params into SolverParams. More... | |
void | slepcSetOptions (EigenProblem &eigen_problem, SolverParams &solver_params, const InputParameters ¶ms) |
Push all SLEPc/PETSc options into SLEPc/PETSc side. More... | |
void | setSlepcEigenSolverTolerances (EigenProblem &eigen_problem, const SolverParams &solver_params, const InputParameters ¶ms) |
Control eigen solver tolerances via SLEPc options. More... | |
void | setFreeNonlinearPowerIterations (unsigned int free_power_iterations) |
Set SLEPc/PETSc options to trigger free power iteration. More... | |
void | clearFreeNonlinearPowerIterations (const InputParameters ¶ms) |
void | moosePetscSNESFormMatrixTag (SNES snes, Vec x, Mat eigen_mat, SparseMatrix< Number > &all_dofs_mat, void *ctx, TagID tag) |
Form matrix according to tag. More... | |
void | moosePetscSNESFormMatricesTags (SNES snes, Vec x, std::vector< Mat > &eigen_mats, std::vector< SparseMatrix< Number > *> &all_dofs_mats, void *ctx, const std::set< TagID > &tags) |
Form multiple matrices for multiple tags. More... | |
PetscErrorCode | mooseSlepcEigenFormJacobianA (SNES snes, Vec x, Mat jac, Mat pc, void *ctx) |
Form Jacobian matrix A. More... | |
PetscErrorCode | mooseSlepcEigenFormJacobianB (SNES snes, Vec x, Mat jac, Mat pc, void *ctx) |
Form Jacobian matrix B. More... | |
PetscErrorCode | mooseSlepcEigenFormFunctionA (SNES snes, Vec x, Vec r, void *ctx) |
Form function residual Ax. More... | |
PetscErrorCode | mooseSlepcEigenFormFunctionB (SNES snes, Vec x, Vec r, void *ctx) |
Form function residual Bx. More... | |
PetscErrorCode | mooseSlepcEigenFormFunctionAB (SNES snes, Vec x, Vec Ax, Vec Bx, void *ctx) |
Form function residual Ax-Bx. More... | |
PetscErrorCode | mooseSlepcStoppingTest (EPS eps, PetscInt its, PetscInt max_it, PetscInt nconv, PetscInt nev, EPSConvergedReason *reason, void *ctx) |
A customized convergence checker. More... | |
PetscErrorCode | mooseSlepcEPSGetSNES (EPS eps, SNES *snes) |
Retrieve SNES from EPS. More... | |
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. More... | |
PetscErrorCode | mooseSlepcEPSSNESSetUpOptionPrefix (EPS eps) |
Get rid of prefix "-eps_power" for SNES, KSP, PC, etc. More... | |
PetscErrorCode | mooseSlepcEPSSNESSetCustomizePC (EPS eps) |
Attach a customized PC. More... | |
PetscErrorCode | mooseSlepcEPSSNESKSPSetPCSide (FEProblemBase &problem, EPS eps) |
Allow users to specify PC side. More... | |
void | attachCallbacksToMat (EigenProblem &eigen_problem, Mat mat, bool eigen) |
Attach call backs to mat. More... | |
PetscErrorCode | mooseMatMult_Eigen (Mat mat, Vec x, Vec y) |
Implement MatMult via function evaluation for Bx. More... | |
PetscErrorCode | mooseMatMult_NonEigen (Mat mat, Vec x, Vec y) |
Implement MatMult via function evaluation for Ax. More... | |
void | setOperationsForShellMat (EigenProblem &eigen_problem, Mat mat, bool eigen) |
Set operations to shell mat. More... | |
PETSC_EXTERN PetscErrorCode | PCCreate_MoosePC (PC pc) |
Create a preconditioner from moose side. More... | |
PETSC_EXTERN PetscErrorCode | registerPCToPETSc () |
Let PETSc know there is a preconditioner. More... | |
PetscErrorCode | PCDestroy_MoosePC (PC pc) |
Destroy preconditioner. More... | |
PetscErrorCode | PCView_MoosePC (PC pc, PetscViewer viewer) |
View preconditioner. More... | |
PetscErrorCode | PCApply_MoosePC (PC pc, Vec x, Vec y) |
Preconditioner application. More... | |
PetscErrorCode | PCSetUp_MoosePC (PC pc) |
Setup preconditioner. More... | |
PetscErrorCode | mooseSlepcEigenFormFunctionMFFD (void *ctx, Vec x, Vec r) |
Function call for MFFD. More... | |
void | setEigenProblemOptions (SolverParams &solver_params, const MultiMooseEnum &dont_add_these_options) |
void | setWhichEigenPairsOptions (SolverParams &solver_params, const MultiMooseEnum &dont_add_these_options) |
void | setNewtonPetscOptions (SolverParams &solver_params, const InputParameters ¶ms) |
void | setNonlinearPowerOptions (SolverParams &solver_params) |
void | setEigenSolverOptions (SolverParams &solver_params, const InputParameters ¶ms) |
PetscErrorCode | mooseEPSFormMatrices (EigenProblem &eigen_problem, EPS eps, Vec x, void *ctx) |
void | moosePetscSNESFormMatrixTag (SNES, Vec x, Mat eigen_mat, SparseMatrix< Number > &all_dofs_mat, void *ctx, TagID tag) |
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 | moosePetscSNESFormFunction (SNES, Vec x, Vec r, void *ctx, TagID tag) |
PetscErrorCode | mooseSlepcEigenFormNorm (SNES, Vec, PetscReal *norm, void *ctx) |
Variables | |
const int | subspace_factor = 2 |
void Moose::SlepcSupport::attachCallbacksToMat | ( | EigenProblem & | eigen_problem, |
Mat | mat, | ||
bool | eigen | ||
) |
Attach call backs to mat.
SLEPc solver will retrieve callbacks we attached here
Definition at line 1062 of file SlepcSupport.C.
Referenced by NonlinearEigenSystem::attachSLEPcCallbacks().
void Moose::SlepcSupport::clearFreeNonlinearPowerIterations | ( | const InputParameters & | params | ) |
Definition at line 419 of file SlepcSupport.C.
Referenced by EigenProblem::doFreeNonlinearPowerIterations().
InputParameters Moose::SlepcSupport::getSlepcEigenProblemValidParams | ( | ) |
Retrieve valid params that allow users to specify eigen problem configuration.
Definition at line 67 of file SlepcSupport.C.
Referenced by Eigenvalue::validParams().
InputParameters Moose::SlepcSupport::getSlepcValidParams | ( | InputParameters & | params | ) |
The output of this function should be added to the the parameters object of the overarching class
Definition at line 38 of file SlepcSupport.C.
Referenced by Eigenvalue::validParams().
PetscErrorCode Moose::SlepcSupport::mooseEPSFormMatrices | ( | EigenProblem & | eigen_problem, |
EPS | eps, | ||
Vec | x, | ||
void * | ctx | ||
) |
Definition at line 573 of file SlepcSupport.C.
Referenced by mooseSlepcEigenFormFunctionA(), mooseSlepcEigenFormFunctionAB(), mooseSlepcEigenFormFunctionB(), and mooseSlepcEigenFormJacobianA().
PetscErrorCode Moose::SlepcSupport::mooseMatMult_Eigen | ( | Mat | mat, |
Vec | x, | ||
Vec | y | ||
) |
Implement MatMult via function evaluation for Bx.
Definition at line 1126 of file SlepcSupport.C.
Referenced by setOperationsForShellMat().
PetscErrorCode Moose::SlepcSupport::mooseMatMult_NonEigen | ( | Mat | mat, |
Vec | x, | ||
Vec | y | ||
) |
Implement MatMult via function evaluation for Ax.
Definition at line 1147 of file SlepcSupport.C.
Referenced by setOperationsForShellMat().
Definition at line 904 of file SlepcSupport.C.
Referenced by mooseSlepcEigenFormFunctionA(), and mooseSlepcEigenFormFunctionB().
void Moose::SlepcSupport::moosePetscSNESFormMatricesTags | ( | SNES | snes, |
Vec | x, | ||
std::vector< Mat > & | eigen_mats, | ||
std::vector< SparseMatrix< Number > *> & | all_dofs_mats, | ||
void * | ctx, | ||
const std::set< TagID > & | tags | ||
) |
Form multiple matrices for multiple tags.
This function is conceptually the same as moosePetscSNESForMatrixTag()
but allows passing in multiple matrices to be formed
void Moose::SlepcSupport::moosePetscSNESFormMatricesTags | ( | SNES | , |
Vec | x, | ||
std::vector< Mat > & | eigen_mats, | ||
std::vector< SparseMatrix< Number > *> & | all_dofs_mats, | ||
void * | ctx, | ||
const std::set< TagID > & | tags | ||
) |
Definition at line 712 of file SlepcSupport.C.
Referenced by mooseEPSFormMatrices(), and mooseSlepcEigenFormJacobianA().
void Moose::SlepcSupport::moosePetscSNESFormMatrixTag | ( | SNES | snes, |
Vec | x, | ||
Mat | eigen_mat, | ||
SparseMatrix< Number > & | all_dofs_mat, | ||
void * | ctx, | ||
TagID | tag | ||
) |
Form matrix according to tag.
snes | The PETSc nonlinear solver context associated with the eigensolver |
x | The current eigen solution vector from SLEPc. This vector will have a size corresponding to the number of unconstrained degrees of freedom |
eigen_mat | The matrix we want to form coming from SLEPc. As for x , this will be sized corresponding to the number of unconstrained degrees of freedom |
all_dofs_mat | This matrix corresponds to the "global" matrix, representing both unconstrained and constrained degrees of freedom. We will pass this matrix to MOOSE's assembly framework and then if the problem has constraints we will selectively copy the submatrix representing unconstrained dofs to eigen_mat . (Else this matrix and eigen_mat are the same so no copy is required) |
ctx | The eigensolver context which corresponds to the MOOSE EigenProblem |
tag | The MOOSE TagID for the matrix |
void Moose::SlepcSupport::moosePetscSNESFormMatrixTag | ( | SNES | , |
Vec | x, | ||
Mat | eigen_mat, | ||
SparseMatrix< Number > & | all_dofs_mat, | ||
void * | ctx, | ||
TagID | tag | ||
) |
Definition at line 681 of file SlepcSupport.C.
Referenced by mooseSlepcEigenFormJacobianA(), and mooseSlepcEigenFormJacobianB().
PetscErrorCode Moose::SlepcSupport::mooseSlepcEigenFormFunctionA | ( | SNES | snes, |
Vec | x, | ||
Vec | r, | ||
void * | ctx | ||
) |
Form function residual Ax.
It is a SLEPc callback
Definition at line 911 of file SlepcSupport.C.
Referenced by attachCallbacksToMat().
PetscErrorCode Moose::SlepcSupport::mooseSlepcEigenFormFunctionAB | ( | SNES | snes, |
Vec | x, | ||
Vec | Ax, | ||
Vec | Bx, | ||
void * | ctx | ||
) |
Form function residual Ax-Bx.
It is a SLEPc callback
Definition at line 985 of file SlepcSupport.C.
Referenced by attachCallbacksToMat().
PetscErrorCode Moose::SlepcSupport::mooseSlepcEigenFormFunctionB | ( | SNES | snes, |
Vec | x, | ||
Vec | r, | ||
void * | ctx | ||
) |
Form function residual Bx.
It is a SLEPc callback
Definition at line 943 of file SlepcSupport.C.
Referenced by attachCallbacksToMat().
PetscErrorCode Moose::SlepcSupport::mooseSlepcEigenFormFunctionMFFD | ( | void * | ctx, |
Vec | x, | ||
Vec | r | ||
) |
Function call for MFFD.
Definition at line 749 of file SlepcSupport.C.
Referenced by mooseSlepcEigenFormJacobianA().
PetscErrorCode Moose::SlepcSupport::mooseSlepcEigenFormJacobianA | ( | SNES | snes, |
Vec | x, | ||
Mat | jac, | ||
Mat | pc, | ||
void * | ctx | ||
) |
Form Jacobian matrix A.
It is a SLEPc callback
Definition at line 775 of file SlepcSupport.C.
Referenced by attachCallbacksToMat().
PetscErrorCode Moose::SlepcSupport::mooseSlepcEigenFormJacobianB | ( | SNES | snes, |
Vec | x, | ||
Mat | jac, | ||
Mat | pc, | ||
void * | ctx | ||
) |
Form Jacobian matrix B.
It is a SLEPc callback
Definition at line 861 of file SlepcSupport.C.
Referenced by attachCallbacksToMat().
PetscErrorCode Moose::SlepcSupport::mooseSlepcEigenFormNorm | ( | SNES | , |
Vec | , | ||
PetscReal * | norm, | ||
void * | ctx | ||
) |
Definition at line 1053 of file SlepcSupport.C.
Referenced by attachCallbacksToMat().
PetscErrorCode Moose::SlepcSupport::mooseSlepcEPSGetSNES | ( | EPS | eps, |
SNES * | snes | ||
) |
Retrieve SNES from EPS.
It makes sense only for Newton eigenvalue solvers
Definition at line 1311 of file SlepcSupport.C.
Referenced by NonlinearEigenSystem::getSNES(), mooseSlepcEPSSNESKSPSetPCSide(), mooseSlepcEPSSNESSetCustomizePC(), and mooseSlepcEPSSNESSetUpOptionPrefix().
PetscErrorCode Moose::SlepcSupport::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.
Definition at line 1387 of file SlepcSupport.C.
Referenced by SlepcEigenSolverConfiguration::configure_solver().
PetscErrorCode Moose::SlepcSupport::mooseSlepcEPSSNESKSPSetPCSide | ( | FEProblemBase & | problem, |
EPS | eps | ||
) |
Allow users to specify PC side.
By default, we apply PC from the right side. It is consistent with the nonlinear solver.
Definition at line 1369 of file SlepcSupport.C.
Referenced by SlepcEigenSolverConfiguration::configure_solver().
PetscErrorCode Moose::SlepcSupport::mooseSlepcEPSSNESSetCustomizePC | ( | EPS | eps | ) |
Attach a customized PC.
It is useful when you want to use PBP or other customized preconditioners
Definition at line 1350 of file SlepcSupport.C.
Referenced by SlepcEigenSolverConfiguration::configure_solver().
PetscErrorCode Moose::SlepcSupport::mooseSlepcEPSSNESSetUpOptionPrefix | ( | EPS | eps | ) |
Get rid of prefix "-eps_power" for SNES, KSP, PC, etc.
Definition at line 1332 of file SlepcSupport.C.
Referenced by SlepcEigenSolverConfiguration::configure_solver().
PetscErrorCode Moose::SlepcSupport::mooseSlepcStoppingTest | ( | EPS | eps, |
PetscInt | its, | ||
PetscInt | max_it, | ||
PetscInt | nconv, | ||
PetscInt | nev, | ||
EPSConvergedReason * | reason, | ||
void * | ctx | ||
) |
A customized convergence checker.
We need to make solver as converged when doing free power iteration.
Definition at line 1283 of file SlepcSupport.C.
Referenced by SlepcEigenSolverConfiguration::configure_solver().
PetscErrorCode Moose::SlepcSupport::PCApply_MoosePC | ( | PC | pc, |
Vec | x, | ||
Vec | y | ||
) |
Preconditioner application.
It call libMesh preconditioner to implement this.
Definition at line 1221 of file SlepcSupport.C.
Referenced by PCCreate_MoosePC().
PETSC_EXTERN PetscErrorCode Moose::SlepcSupport::PCCreate_MoosePC | ( | PC | pc | ) |
Create a preconditioner from moose side.
It is used to attach moose preconditioner
Definition at line 1186 of file SlepcSupport.C.
Referenced by registerPCToPETSc().
PetscErrorCode Moose::SlepcSupport::PCDestroy_MoosePC | ( | PC | pc | ) |
Destroy preconditioner.
Definition at line 1199 of file SlepcSupport.C.
Referenced by PCCreate_MoosePC().
PetscErrorCode Moose::SlepcSupport::PCSetUp_MoosePC | ( | PC | pc | ) |
Setup preconditioner.
Definition at line 1252 of file SlepcSupport.C.
Referenced by PCCreate_MoosePC().
PetscErrorCode Moose::SlepcSupport::PCView_MoosePC | ( | PC | pc, |
PetscViewer | viewer | ||
) |
View preconditioner.
Definition at line 1208 of file SlepcSupport.C.
Referenced by PCCreate_MoosePC().
PETSC_EXTERN PetscErrorCode Moose::SlepcSupport::registerPCToPETSc | ( | ) |
Let PETSc know there is a preconditioner.
Definition at line 1176 of file SlepcSupport.C.
Referenced by NonlinearEigenSystem::attachPreconditioner().
void Moose::SlepcSupport::setEigenProblemOptions | ( | SolverParams & | solver_params, |
const MultiMooseEnum & | dont_add_these_options | ||
) |
Definition at line 298 of file SlepcSupport.C.
Referenced by slepcSetOptions().
void Moose::SlepcSupport::setEigenProblemSolverParams | ( | EigenProblem & | eigen_problem, |
const InputParameters & | params | ||
) |
Retrieve eigen problem params from 'params', and then set these params into SolverParams.
Definition at line 212 of file SlepcSupport.C.
Referenced by Eigenvalue::Eigenvalue().
void Moose::SlepcSupport::setEigenSolverOptions | ( | SolverParams & | solver_params, |
const InputParameters & | params | ||
) |
Definition at line 494 of file SlepcSupport.C.
Referenced by slepcSetOptions().
Set SLEPc/PETSc options to trigger free power iteration.
Definition at line 404 of file SlepcSupport.C.
Referenced by EigenProblem::doFreeNonlinearPowerIterations().
void Moose::SlepcSupport::setNewtonPetscOptions | ( | SolverParams & | solver_params, |
const InputParameters & | params | ||
) |
Definition at line 431 of file SlepcSupport.C.
Referenced by setEigenSolverOptions().
void Moose::SlepcSupport::setNonlinearPowerOptions | ( | SolverParams & | solver_params | ) |
Definition at line 474 of file SlepcSupport.C.
Referenced by setEigenSolverOptions().
void Moose::SlepcSupport::setOperationsForShellMat | ( | EigenProblem & | eigen_problem, |
Mat | mat, | ||
bool | eigen | ||
) |
Set operations to shell mat.
Definition at line 1165 of file SlepcSupport.C.
Referenced by NonlinearEigenSystem::attachSLEPcCallbacks().
void Moose::SlepcSupport::setSlepcEigenSolverTolerances | ( | EigenProblem & | eigen_problem, |
const SolverParams & | solver_params, | ||
const InputParameters & | params | ||
) |
Control eigen solver tolerances via SLEPc options.
Definition at line 129 of file SlepcSupport.C.
Referenced by slepcSetOptions().
void Moose::SlepcSupport::setWhichEigenPairsOptions | ( | SolverParams & | solver_params, |
const MultiMooseEnum & | dont_add_these_options | ||
) |
Definition at line 341 of file SlepcSupport.C.
Referenced by slepcSetOptions().
void Moose::SlepcSupport::slepcSetOptions | ( | EigenProblem & | eigen_problem, |
SolverParams & | solver_params, | ||
const InputParameters & | params | ||
) |
Push all SLEPc/PETSc options into SLEPc/PETSc side.
Options could come from commandline, SolverParams, params, etc.
Definition at line 550 of file SlepcSupport.C.
Referenced by Eigenvalue::prepareSolverOptions().
void Moose::SlepcSupport::storeSolveType | ( | FEProblemBase & | fe_problem, |
const InputParameters & | params | ||
) |
Set solve type into eigen problem (solverParams)
Definition at line 286 of file SlepcSupport.C.
Referenced by Eigenvalue::Eigenvalue().
const int Moose::SlepcSupport::subspace_factor = 2 |
Definition at line 35 of file SlepcSupport.C.
Referenced by setEigenProblemSolverParams().