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 : #include "EigenProblemSolve.h" 16 : 17 : class InputParameters; 18 : class EigenProblem; 19 : 20 : /** 21 : * Eigenvalue executioner is used to drive the eigenvalue calculations. At the end, 22 : * SLEPc will be involved. 23 : * We derive from Executioner instead of Steady because 1) we want to have a fine-grain 24 : * control such as recovering; 2) Conceptually, Steady is very different from Eigenvalue, 25 : * where the former handles a nonlinear system of equations while the later targets 26 : * at an eigenvalue problem. 27 : */ 28 : class Eigenvalue : public Executioner 29 : { 30 : public: 31 : static InputParameters validParams(); 32 : 33 : /** 34 : * Constructor 35 : * 36 : * @param parameters The parameters object holding data for the class to use. 37 : */ 38 : Eigenvalue(const InputParameters & parameters); 39 : 40 : virtual void execute() override; 41 : 42 1376 : virtual bool lastSolveConverged() const override { return _last_solve_converged; } 43 : 44 : #ifdef LIBMESH_HAVE_SLEPC 45 : virtual void init() override; 46 : 47 : /** 48 : * Eigenvalue executioner does not allow time kernels 49 : */ 50 : virtual void checkIntegrity(); 51 : 52 : /** 53 : * Get the number of grid sequencing steps 54 : */ 55 : unsigned int numGridSteps() const { return _eigen_problem_solve.numGridSteps(); } 56 : #endif 57 : 58 : protected: 59 : EigenProblem & _eigen_problem; 60 : 61 : /// inner-most solve object to perform Newton solve with SLEPc 62 : EigenProblemSolve _eigen_problem_solve; 63 : 64 : Real _system_time; 65 : int & _time_step; 66 : Real & _time; 67 : 68 : PerfID _final_timer; 69 : 70 : private: 71 : bool _last_solve_converged = true; 72 : };