Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : #include "libmesh/libmesh_config.h" 13 : 14 : #include "Executioner.h" 15 : 16 : class InputParameters; 17 : class EigenProblem; 18 : 19 : template <typename T> 20 : InputParameters validParams(); 21 : 22 : /** 23 : * Eigenvalue executioner is used to drive the eigenvalue calculations. At the end, 24 : * SLEPc will be involved. 25 : * We derive from Executioner instead of Steady because 1) we want to have a fine-grain 26 : * control such as recovering; 2) Conceptually, Steady is very different from Eigenvalue, 27 : * where the former handles a nonlinear system of equations while the later targets 28 : * at an eigenvalue problem. 29 : */ 30 : class Eigenvalue : public Executioner 31 : { 32 : public: 33 : /** 34 : * Constructor 35 : * 36 : * @param parameters The parameters object holding data for the class to use. 37 : * @return Whether or not the solve was successful. 38 : */ 39 : static InputParameters validParams(); 40 : 41 : Eigenvalue(const InputParameters & parameters); 42 : 43 : virtual void execute() override; 44 : 45 1276 : virtual bool lastSolveConverged() const override { return _last_solve_converged; } 46 : 47 : #ifdef LIBMESH_HAVE_SLEPC 48 : virtual void init() override; 49 : 50 : /** 51 : * Eigenvalue executioner does not allow time kernels 52 : */ 53 : virtual void checkIntegrity(); 54 : 55 : /** 56 : * Get the number of grid sequencing steps 57 : */ 58 : unsigned int numGridSteps() const { return _feproblem_solve.numGridSteps(); } 59 : 60 : private: 61 : /** 62 : * Prepare right petsc options 63 : */ 64 : void prepareSolverOptions(); 65 : #endif 66 : 67 : protected: 68 : EigenProblem & _eigen_problem; 69 : 70 : /// inner-most solve object to perform Newton solve with SLEPc 71 : FEProblemSolve _feproblem_solve; 72 : 73 : /// Postprocessor value that scales solution when eigensolve is finished 74 : const PostprocessorValue * const _normalization; 75 : 76 : Real _system_time; 77 : int & _time_step; 78 : Real & _time; 79 : 80 : PerfID _final_timer; 81 : 82 : private: 83 : bool _last_solve_converged; 84 : };