https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
PressureActionBase Class Reference

Pressure boundary condition action template. More...

#include <PressureAction.h>

Inheritance diagram for PressureActionBase:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 PressureActionBase (const InputParameters &params, const std::string &non_ad_pressure_bc_type, const std::string &ad_pressure_bc_type)
 
virtual void act () override
 
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 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 ()
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

template<class T >
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

bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
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
 

Static Protected Member Functions

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

Protected Attributes

const std::string _non_ad_pressure_bc_type
 
const std::string _ad_pressure_bc_type
 
const bool _use_ad
 Flag to use automatic differentiation.
 
const std::vector< std::vector< AuxVariableName > > _save_in_vars
 
const std::vector< bool > _has_save_in_vars
 
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
 

Private Member Functions

bool addRelationshipManager (Moose::RelationshipManagerType input_rm_type, const InputParameters &moose_object_pars, std::string rm_name, Moose::RelationshipManagerType rm_type, Moose::RelationshipManagerInputParameterCallback rm_input_parameter_func, Moose::RMSystemType sys_type=Moose::RMSystemType::NONE)
 
virtual std::string meshPropertyPrefix (const std::string &data_name) const
 
const RestartableDataValuegetMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const
 
void mooseErrorInternal (Args &&... args) const
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

const ParallelParamObject_parent
 
MooseApp_meta_data_app
 
const MooseObject *const _meta_data_object
 
const MooseBase_si_moose_base
 
const FEProblemBase_si_problem
 

Detailed Description

Pressure boundary condition action template.

The type T is used to get the valid parameters through T::actionParams(). The two strings passed into the constructor are the registred type names of teh MOOSE BC objects without and with automatic differentiation.

Definition at line 47 of file PressureAction.h.

Constructor & Destructor Documentation

◆ PressureActionBase()

PressureActionBase::PressureActionBase ( const InputParameters params,
const std::string &  non_ad_pressure_bc_type,
const std::string &  ad_pressure_bc_type 
)

Definition at line 15 of file PressureAction.C.

18 : Action(params),
19 _non_ad_pressure_bc_type(non_ad_pressure_bc_type),
20 _ad_pressure_bc_type(ad_pressure_bc_type),
21 _use_ad(getParam<bool>("use_automatic_differentiation")),
22 _save_in_vars({getParam<std::vector<AuxVariableName>>("save_in_disp_x"),
23 getParam<std::vector<AuxVariableName>>("save_in_disp_y"),
24 getParam<std::vector<AuxVariableName>>("save_in_disp_z")}),
25 _has_save_in_vars({params.isParamValid("save_in_disp_x"),
26 params.isParamValid("save_in_disp_y"),
27 params.isParamValid("save_in_disp_z")})
28{
29}
bool isParamValid(const std::string &name) const
const T & getParam(const std::string &name) const
const bool _use_ad
Flag to use automatic differentiation.
const std::vector< std::vector< AuxVariableName > > _save_in_vars
const std::string _non_ad_pressure_bc_type
const std::string _ad_pressure_bc_type
const std::vector< bool > _has_save_in_vars

Member Function Documentation

◆ act()

void PressureActionBase::act ( )
overridevirtual

Implements Action.

Definition at line 32 of file PressureAction.C.

33{
35
36 std::vector<VariableName> displacements = getParam<std::vector<VariableName>>("displacements");
37 // Create pressure BCs
38 for (unsigned int i = 0; i < displacements.size(); ++i)
39 {
40 // Create unique kernel name for each of the components
41 std::string bc_name = bc_type + "_" + _name + "_" + Moose::stringify(i);
42
43 InputParameters params = _factory.getValidParams(bc_type);
45
46 params.set<NonlinearVariableName>("variable") = displacements[i];
47 if (_has_save_in_vars[i])
48 params.set<std::vector<AuxVariableName>>("save_in") = _save_in_vars[i];
49
50 _problem->addBoundaryCondition(bc_type, bc_name, params);
51
52 // The three BCs can no longer be controlled independently.
53 // We agreed on PR#29603 that this was not a problem
54 if (isParamValid("enable"))
55 connectControllableParams("enable", bc_type, bc_name, "enable");
56 }
57}
std::shared_ptr< FEProblemBase > & _problem
InputParameters getValidParams(const std::string &name) const
T & set(const std::string &name, bool quiet_mode=false)
void applyParameters(const InputParameters &common, const std::vector< std::string > &exclude={}, const bool allow_private=false)
const InputParameters & parameters() const
const std::string & _name
bool isParamValid(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
Factory & _factory
std::string stringify(const T &t)

◆ validParams()

template<class T >
InputParameters PressureActionBase::validParams ( )
static

Definition at line 72 of file PressureAction.h.

73{
75 params += T::actionParams();
76
77 params.addParam<std::vector<BoundaryName>>(
78 "boundary", "The list of boundaries (ids or names) from the mesh where this object applies");
79
80 params.addClassDescription("Set up Pressure boundary conditions");
81 params.addParam<bool>("use_automatic_differentiation",
82 false,
83 "Flag to use automatic differentiation (AD) objects when possible");
84
85 // To make controlling the Pressure BCs easier
86 params.addParam<bool>(
87 "enable",
88 true,
89 "Set the enabled status of the BCs created by the Pressure action (defaults to true).");
90 params.declareControllable("enable");
91
92 // Residual output
93 params.addParam<std::vector<AuxVariableName>>(
94 "save_in_disp_x", {}, "The save_in variables for x displacement");
95 params.addParam<std::vector<AuxVariableName>>(
96 "save_in_disp_y", {}, "The save_in variables for y displacement");
97 params.addParam<std::vector<AuxVariableName>>(
98 "save_in_disp_z", {}, "The save_in variables for z displacement");
99 params.addParam<std::vector<TagName>>("extra_vector_tags",
100 "The extra tags for the vectors this Kernel should fill");
101 params.addParam<std::vector<TagName>>(
102 "absolute_value_vector_tags",
103 "The tags for the vectors this residual object should fill with the "
104 "absolute value of the residual contribution");
105
106 params.addParam<bool>(
107 "use_displaced_mesh",
108 "Whether or not this object should use the displaced mesh for computation. Note that in "
109 "the case this is true but no displacements are provided in the Mesh block the undisplaced "
110 "mesh will still be used. For small strain formulations pressure should be applied to the "
111 "undisplaced mesh to obtain agreement with analytical benchmark solutions.");
112
114 "save_in_disp_x save_in_disp_y save_in_disp_z extra_vector_tags absolute_value_vector_tags",
115 "Residual output");
116 return params;
117}
static InputParameters validParams()
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _ad_pressure_bc_type

const std::string PressureActionBase::_ad_pressure_bc_type
protected

Definition at line 61 of file PressureAction.h.

Referenced by act().

◆ _has_save_in_vars

const std::vector<bool> PressureActionBase::_has_save_in_vars
protected

Definition at line 67 of file PressureAction.h.

Referenced by act().

◆ _non_ad_pressure_bc_type

const std::string PressureActionBase::_non_ad_pressure_bc_type
protected

Definition at line 60 of file PressureAction.h.

Referenced by act().

◆ _save_in_vars

const std::vector<std::vector<AuxVariableName> > PressureActionBase::_save_in_vars
protected

Definition at line 66 of file PressureAction.h.

Referenced by act().

◆ _use_ad

const bool PressureActionBase::_use_ad
protected

Flag to use automatic differentiation.

Definition at line 64 of file PressureAction.h.

Referenced by act().


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