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 "MultiSystemSolveObject.h" 13 : 14 : class Convergence; 15 : 16 : class FEProblemSolve : public MultiSystemSolveObject 17 : { 18 : public: 19 : FEProblemSolve(Executioner & ex); 20 : 21 : static InputParameters feProblemDefaultConvergenceParams(); 22 : static InputParameters validParams(); 23 : 24 : static const std::set<std::string> & mooseLineSearches(); 25 : 26 : virtual void initialSetup() override; 27 : 28 : /** 29 : * Picard solve the FEProblem. 30 : * @return True if solver is converged. 31 : */ 32 : virtual bool solve() override; 33 : 34 0 : virtual void setInnerSolve(SolveObject &) override 35 : { 36 0 : mooseError("Cannot set inner solve for FEProblemSolve"); 37 : } 38 : 39 : /** 40 : * Return the number of grid sequencing steps 41 : */ 42 : unsigned int numGridSteps() const { return _num_grid_steps; } 43 : 44 : protected: 45 : /// Helper routine to get the nonlinear system parameter at the right index. 46 : /// If a single value is passed for the parameter, then that value is used 47 : /// @tparam T the parameter is of type std::vector<T> 48 : /// @param param_name name of the parameter 49 : /// @param index index of the nonlinear system 50 : /// @return parameter for that nonlinear system 51 : template <typename T> 52 : T getParamFromNonlinearSystemVectorParam(const std::string & param_name, 53 : unsigned int index) const; 54 : 55 : /// Moose provided line searches 56 : static std::set<std::string> const _moose_line_searches; 57 : 58 : /// The number of steps to perform in a grid sequencing algorithm. This is one 59 : /// less than the number of grids requested by the user in their input, 60 : /// e.g. if they requested num_grids = 1, then there won't be any steps 61 : /// because we only need to perform one solve per time-step. Storing this 62 : /// member in this way allows for easy boolean operations, e.g. if (_num_grid_steps) 63 : /// as opposed to if (_num_grids) 64 : const unsigned int _num_grid_steps; 65 : 66 : /// Whether we are using fixed point iterations for multi-system 67 : const bool _using_multi_sys_fp_iterations; 68 : /// Convergence object to assess the convergence of the multi-system fixed point iteration 69 : Convergence * _multi_sys_fp_convergence; 70 : 71 : private: 72 : /// Performs setup related to Convergence objects 73 : void convergenceSetup(); 74 : };