https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ComponentsConvergence Class Reference

Assesses convergence of all Component objects in a simulation. More...

#include <ComponentsConvergence.h>

Inheritance diagram for ComponentsConvergence:
[legend]

Public Types

enum  MooseConvergenceStatus { MooseConvergenceStatus::ITERATING, MooseConvergenceStatus::CONVERGED, MooseConvergenceStatus::DIVERGED }
 
typedef MooseEnumItem IterationType
 
typedef DataFileName DataFileParameterType
 

Public Member Functions

 ComponentsConvergence (const InputParameters &parameters)
 
virtual void initialSetup () override
 
virtual MooseConvergenceStatus checkConvergence (unsigned int n_iter) override final
 
virtual void checkIterationType (IterationType) const
 
virtual void initialize ()
 
virtual void preExecute ()
 
bool verbose () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void subdomainSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
PerfGraphperfGraph ()
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 

Protected Member Functions

virtual MooseConvergenceStatus checkConvergenceInner (unsigned int iter) override
 
void verboseOutput (std::ostringstream &oss)
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 

Protected Attributes

const THMProblem *const _thm_problem
 THM problem. More...
 
std::vector< Convergence * > _convergence_objects
 Convergence objects for all Components that provide one. More...
 
const unsigned int _min_iterations
 
const unsigned int _max_iterations
 
const bool _converge_at_max_iterations
 
PerfID _perfid_check_convergence
 
THREAD_ID _tid
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 
Real_t
 
const Real_t_old
 
int_t_step
 
Real_dt
 
Real_dt_old
 
bool _is_transient
 
const Parallel::Communicator & _communicator
 

Detailed Description

Assesses convergence of all Component objects in a simulation.

Definition at line 19 of file ComponentsConvergence.h.

Constructor & Destructor Documentation

◆ ComponentsConvergence()

ComponentsConvergence::ComponentsConvergence ( const InputParameters parameters)

Definition at line 26 of file ComponentsConvergence.C.

29  dynamic_cast<THMProblem *>(getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")))
30 {
31  if (!_thm_problem)
32  mooseError("ComponentsConvergence only works with THMProblem.");
33 }
const InputParameters & parameters() const
const THMProblem *const _thm_problem
THM problem.
IterationCountConvergence(const InputParameters &parameters)
void mooseError(Args &&... args) const

Member Function Documentation

◆ checkConvergenceInner()

Convergence::MooseConvergenceStatus ComponentsConvergence::checkConvergenceInner ( unsigned int  iter)
overrideprotectedvirtual

Reimplemented from IterationCountConvergence.

Definition at line 49 of file ComponentsConvergence.C.

50 {
51  bool all_converged = true;
52  for (auto & conv : _convergence_objects)
53  {
54  const auto status = conv->checkConvergence(iter);
58  all_converged = false;
59  else
60  {
61  // checking in case additional status added in future
63  "Status not implemented");
64  }
65  }
66 
67  if (all_converged)
69  else
71 }
std::vector< Convergence * > _convergence_objects
Convergence objects for all Components that provide one.
MPI_Status status

◆ initialSetup()

void ComponentsConvergence::initialSetup ( )
overridevirtual

Reimplemented from IterationCountConvergence.

Definition at line 36 of file ComponentsConvergence.C.

37 {
39 
40  for (const auto & comp : _thm_problem->getComponents())
41  {
42  const auto nl_conv = comp->getNonlinearConvergence();
43  if (nl_conv)
44  _convergence_objects.push_back(nl_conv);
45  }
46 }
virtual void initialSetup() override
const std::vector< std::shared_ptr< Component > > & getComponents() const
Return list of components available in the simulation.
Definition: Simulation.h:117
std::vector< Convergence * > _convergence_objects
Convergence objects for all Components that provide one.
const THMProblem *const _thm_problem
THM problem.

◆ validParams()

InputParameters ComponentsConvergence::validParams ( )
static

Definition at line 17 of file ComponentsConvergence.C.

18 {
20 
21  params.addClassDescription("Assesses convergence of all Component objects in a simulation.");
22 
23  return params;
24 }
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _convergence_objects

std::vector<Convergence *> ComponentsConvergence::_convergence_objects
protected

Convergence objects for all Components that provide one.

Definition at line 35 of file ComponentsConvergence.h.

Referenced by checkConvergenceInner(), and initialSetup().

◆ _thm_problem

const THMProblem* const ComponentsConvergence::_thm_problem
protected

THM problem.

Definition at line 32 of file ComponentsConvergence.h.

Referenced by ComponentsConvergence(), and initialSetup().


The documentation for this class was generated from the following files: