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

Base class for ActionComponents that build THM components. More...

#include <THMActionComponent.h>

Inheritance diagram for THMActionComponent:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 THMActionComponent (const InputParameters &params)
 
virtual void act () override final
 
const std::vector< MeshGeneratorName > & meshGeneratorNames () const
 
MeshGeneratorName getCurrentTopLevelMeshGeneratorName () const
 
void setCurrentTopLevelMeshGeneratorName (const MeshGeneratorName &mg_name)
 
const std::vector< SubdomainName > & blocks () const
 
virtual const std::vector< BoundaryName > & outerSurfaceBoundaries () const
 
virtual Real volume () const
 
virtual Real outerSurfaceArea () const
 
unsigned int dimension () const
 
void addConnectedComponent (ActionComponent &component)
 
const std::set< ActionComponent *> & getConnectedComponents () const
 
void timedAct ()
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type)
 
MooseObjectName uniqueActionName () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
void appendTask (const std::string &task)
 
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 haveParameter (const std::string &name) 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
 
PerfGraphperfGraph ()
 
void assertParamDefined (const std::string &libmesh_dbg_var(param)) 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 unique_action_name_param
 
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
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

virtual void actOnAdditionalTasks () override
 
virtual void addTHMComponents ()
 
virtual void addClosures ()
 
virtual void addControlLogic ()
 
void addTHMComponent (const std::string &class_name, const std::string &obj_name, InputParameters &params)
 Adds a THM component. More...
 
void addClosuresObject (const std::string &class_name, const std::string &obj_name, InputParameters &params)
 Adds a Closures object. More...
 
void addControlLogicObject (const std::string &class_name, const std::string &obj_name, InputParameters &params)
 Adds a ControlLogic object. More...
 
THMProblemgetTHMProblem ()
 Gets the THM problem. More...
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
void assertParamDefined (const std::string &param) const
 
virtual void addMeshGenerators ()
 
virtual void addPositionsObject ()
 
virtual void addUserObjects ()
 
virtual void setupComponent ()
 
virtual void addSolverVariables ()
 
virtual void addPhysics ()
 
virtual void addMaterials ()
 
virtual void checkIntegrity ()
 
void addRequiredTask (const std::string &task)
 
void checkRequiredTasks () const
 
FEProblemBasegetProblem ()
 
FactorygetFactory () const
 
void associateWithParameter (const std::string &param_name, InputParameters &params) const
 
void associateWithParameter (const InputParameters &from_params, const std::string &param_name, InputParameters &params) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) 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
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
void checkParamsBothSetOrNotSet (const std::string &param1, const std::string &param2) const
 
void checkSecondParamSetOnlyIfFirstOneTrue (const std::string &param1, const std::string &param2) const
 
void checkSecondParamSetOnlyIfFirstOneSet (const std::string &param1, const std::string &param2) const
 
void checkSecondParamNotSetIfFirstOneSet (const std::string &param1, const std::string &param2) const
 
void checkVectorParamsSameLength (const std::string &param1, const std::string &param2) const
 
void checkVectorParamAndMultiMooseEnumLength (const std::string &param1, const std::string &param2) const
 
void checkTwoDVectorParamsSameLength (const std::string &param1, const std::string &param2) const
 
void checkVectorParamsNoOverlap (const std::vector< std::string > &param_vecs) const
 
void checkTwoDVectorParamsNoRespectiveOverlap (const std::vector< std::string > &param_vecs) const
 
void checkTwoDVectorParamInnerSameLengthAsOneDVector (const std::string &param1, const std::string &param2) const
 
void checkTwoDVectorParamMultiMooseEnumSameLength (const std::string &param1, const std::string &param2, const bool error_for_param2) const
 
void checkVectorParamNotEmpty (const std::string &param1) const
 
void checkVectorParamsSameLengthIfSet (const std::string &param1, const std::string &param2, const bool ignore_empty_default_param2=false) const
 
void checkVectorParamLengthSameAsCombinedOthers (const std::string &param1, const std::string &param2, const std::string &param3) const
 
void checkBlockwiseConsistency (const std::string &block_param_name, const std::vector< std::string > &parameter_names) const
 
bool parameterConsistent (const InputParameters &other_param, const std::string &param_name) const
 
void warnInconsistent (const InputParameters &parameters, const std::string &param_name) const
 
void errorDependentParameter (const std::string &param1, const std::string &value_not_set, const std::vector< std::string > &dependent_params) const
 
void errorInconsistentDependentParameter (const std::string &param1, const std::string &value_set, const std::vector< std::string > &dependent_params) const
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

unsigned int _dimension
 
std::vector< MeshGeneratorName > _mg_names
 
MeshGeneratorName _top_mg_name
 
std::vector< SubdomainName > _blocks
 
std::vector< BoundaryName > _outer_boundaries
 
const bool _verbose
 
std::set< std::string > _required_tasks
 
std::shared_ptr< std::set< ActionComponent *> > _connected_components
 
std::string _registered_identifier
 
std::string _specific_task_name
 
std::set< std::string > _all_tasks
 
ActionWarehouse_awh
 
const std::string & _current_task
 
std::shared_ptr< MooseMesh > & _mesh
 
std::shared_ptr< MooseMesh > & _displaced_mesh
 
std::shared_ptr< FEProblemBase > & _problem
 
PerfID _act_timer
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Detailed Description

Base class for ActionComponents that build THM components.

Definition at line 23 of file THMActionComponent.h.

Constructor & Destructor Documentation

◆ THMActionComponent()

THMActionComponent::THMActionComponent ( const InputParameters params)

Definition at line 20 of file THMActionComponent.C.

20 : ActionComponent(params) {}
ActionComponent(const InputParameters &params)

Member Function Documentation

◆ actOnAdditionalTasks()

void THMActionComponent::actOnAdditionalTasks ( )
overrideprotectedvirtual

Reimplemented from ActionComponent.

Definition at line 23 of file THMActionComponent.C.

24 {
25  if (_current_task == "THM:add_component")
27  if (_current_task == "THM:add_closures")
28  addClosures();
29  if (_current_task == "THM:add_control_logic")
31 }
virtual void addControlLogic()
virtual void addTHMComponents()
const std::string & _current_task
virtual void addClosures()

◆ addClosures()

virtual void THMActionComponent::addClosures ( )
inlineprotectedvirtual

Reimplemented in WellBase.

Definition at line 32 of file THMActionComponent.h.

Referenced by actOnAdditionalTasks().

32 {}

◆ addClosuresObject()

void THMActionComponent::addClosuresObject ( const std::string &  class_name,
const std::string &  obj_name,
InputParameters params 
)
protected

Adds a Closures object.

Definition at line 55 of file THMActionComponent.C.

Referenced by WellBase::addClosures().

58 {
59  auto & thm_problem = getTHMProblem();
60  params.set<THMProblem *>("_thm_problem") = &thm_problem;
61  params.set<Logger *>("_logger") = &(thm_problem.log());
62  thm_problem.addClosures(class_name, obj_name, params);
63 }
Keeps the error and warning messages.
Definition: Logger.h:17
Specialization of FEProblem to run with component subsystem.
Definition: THMProblem.h:18
T & set(const std::string &name, bool quiet_mode=false)
THMProblem & getTHMProblem()
Gets the THM problem.

◆ addControlLogic()

virtual void THMActionComponent::addControlLogic ( )
inlineprotectedvirtual

Reimplemented in InjectionWell, and ProductionWell.

Definition at line 33 of file THMActionComponent.h.

Referenced by actOnAdditionalTasks().

33 {}

◆ addControlLogicObject()

void THMActionComponent::addControlLogicObject ( const std::string &  class_name,
const std::string &  obj_name,
InputParameters params 
)
protected

Adds a ControlLogic object.

Definition at line 66 of file THMActionComponent.C.

Referenced by InjectionWell::addControlLogic(), and ProductionWell::addControlLogic().

69 {
70  auto & thm_problem = getTHMProblem();
71  params.set<FEProblemBase *>("_fe_problem_base") = _problem.get();
72  params.set<THMProblem *>("_thm_problem") = &thm_problem;
73  std::shared_ptr<Control> control = _factory.create<Control>(class_name, obj_name, params);
74  thm_problem.getControlWarehouse().addObject(control);
75 }
Specialization of FEProblem to run with component subsystem.
Definition: THMProblem.h:18
Factory & _factory
T & set(const std::string &name, bool quiet_mode=false)
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
THMProblem & getTHMProblem()
Gets the THM problem.
std::shared_ptr< FEProblemBase > & _problem

◆ addTHMComponent()

void THMActionComponent::addTHMComponent ( const std::string &  class_name,
const std::string &  obj_name,
InputParameters params 
)
protected

Adds a THM component.

Definition at line 45 of file THMActionComponent.C.

Referenced by WellBase::addFlowChannel(), InjectionWell::addInlet(), WellBase::addJunction(), WellBase::addJunctionFlux(), ProductionWell::addOutlet(), and WellBase::addWall().

48 {
49  auto & thm_problem = getTHMProblem();
50  params.set<THMProblem *>("_thm_problem") = &thm_problem;
51  thm_problem.addComponent(class_name, obj_name, params);
52 }
Specialization of FEProblem to run with component subsystem.
Definition: THMProblem.h:18
T & set(const std::string &name, bool quiet_mode=false)
THMProblem & getTHMProblem()
Gets the THM problem.
virtual void addComponent(const std::string &type, const std::string &name, InputParameters params)
Add a component into this simulation.
Definition: Simulation.C:991

◆ addTHMComponents()

virtual void THMActionComponent::addTHMComponents ( )
inlineprotectedvirtual

Reimplemented in InjectionWell, and ProductionWell.

Definition at line 31 of file THMActionComponent.h.

Referenced by actOnAdditionalTasks().

31 {}

◆ getTHMProblem()

THMProblem & THMActionComponent::getTHMProblem ( )
protected

Gets the THM problem.

Definition at line 34 of file THMActionComponent.C.

Referenced by addClosuresObject(), addControlLogicObject(), and addTHMComponent().

35 {
36  THMProblem * thm_problem = dynamic_cast<THMProblem *>(_problem.get());
37  if (thm_problem)
38  return *thm_problem;
39  else
40  mooseError("The Problem must derive from THMProblem to use THMActionComponents. Please include "
41  "a [Components] block in your input file, even if empty.");
42 }
Specialization of FEProblem to run with component subsystem.
Definition: THMProblem.h:18
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem

◆ validParams()

InputParameters THMActionComponent::validParams ( )
static

Definition at line 14 of file THMActionComponent.C.

Referenced by WellBase::validParams().

15 {
17  return params;
18 }
static InputParameters validParams()

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