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 "MultiApp.h" 13 : 14 : class Executioner; 15 : 16 : /** 17 : * This type of MultiApp will do a full solve when it is asked to take a step. 18 : */ 19 : class FullSolveMultiApp : public MultiApp 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : 24 : FullSolveMultiApp(const InputParameters & parameters); 25 : 26 : virtual void initialSetup() override; 27 : 28 : virtual bool solveStep(Real dt, Real target_time, bool auto_advance = true) override; 29 : 30 2377 : virtual void finalize() override 31 : { 32 : // executioner output on final has been called and we do not need to call it again 33 2377 : } 34 2400 : virtual void postExecute() override 35 : { 36 : // executioner postExecute has been called and we do not need to call it again 37 2400 : } 38 : 39 : virtual void restore(bool force = true) override; 40 : 41 : protected: 42 : /** 43 : * FullSolveMultiApp always performs a complete fresh solve on every execution, 44 : * so the parent's recovery state must never be propagated to its sub-apps. 45 : */ 46 8408 : bool propagateRecoverToSubApps() const override { return false; } 47 : 48 : /** 49 : * This function is called after each sub-application solve and is meant to display 50 : * information about the solve. It can be overridden. In this class, it simply 51 : * displays whether or not the sub-application solve was successful. 52 : * 53 : * @param i Sub-application index 54 : */ 55 : virtual void showStatusMessage(unsigned int i) const; 56 : 57 : private: 58 : /// Switch to tell executioner to keep going despite app solve not converging 59 : const bool _ignore_diverge; 60 : /// Switch to tell the systems or not to update the old solution using the unrestored solution (the one we 'kept during restore') 61 : const bool _update_old_state_when_keeping_solution_during_restore; 62 : 63 : std::vector<Executioner *> _executioners; 64 : };