www.mooseframework.org
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
GeneralizedPlaneStrainAction Class Reference

#include <GeneralizedPlaneStrainAction.h>

Inheritance diagram for GeneralizedPlaneStrainAction:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 GeneralizedPlaneStrainAction (const InputParameters &params)
 
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
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (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
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
PerfGraphperfGraph ()
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &name, const std::string *param=nullptr) 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 ()
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

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 T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (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
 

Static Protected Member Functions

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

Protected Attributes

std::vector< VariableName > _displacements
 
unsigned int _ndisp
 Number of displacement variables. More...
 
const unsigned int _out_of_plane_direction
 
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
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Detailed Description

Definition at line 14 of file GeneralizedPlaneStrainAction.h.

Constructor & Destructor Documentation

◆ GeneralizedPlaneStrainAction()

GeneralizedPlaneStrainAction::GeneralizedPlaneStrainAction ( const InputParameters params)

Definition at line 73 of file GeneralizedPlaneStrainAction.C.

74  : Action(params),
75  _displacements(getParam<std::vector<VariableName>>("displacements")),
76  _ndisp(_displacements.size()),
77  _out_of_plane_direction(getParam<MooseEnum>("out_of_plane_direction"))
78 {
79 }
Action(const InputParameters &parameters)
unsigned int _ndisp
Number of displacement variables.
const T & getParam(const std::string &name) const
std::vector< VariableName > _displacements

Member Function Documentation

◆ act()

void GeneralizedPlaneStrainAction::act ( )
overridevirtual

Implements Action.

Definition at line 82 of file GeneralizedPlaneStrainAction.C.

83 {
84  // user object name
85  const std::string uo_name = _name + "_GeneralizedPlaneStrainUserObject";
86 
87  //
88  // Add off diagonal Jacobian kernels
89  //
90  if (_current_task == "add_kernel")
91  {
92  std::string k_type = "GeneralizedPlaneStrainOffDiag";
93  InputParameters params = _factory.getValidParams(k_type);
94 
95  params.applyParameters(parameters(), {"scalar_out_of_plane_strain"});
96  params.set<std::vector<VariableName>>("scalar_out_of_plane_strain") = {
97  getParam<VariableName>("scalar_out_of_plane_strain")};
98 
99  // add off-diagonal jacobian kernels for the displacements
100  for (unsigned int i = 0; i < _ndisp; ++i)
101  {
102  if (_out_of_plane_direction == i)
103  continue;
104 
105  std::string k_name = _name + "GeneralizedPlaneStrainOffDiag_disp" + Moose::stringify(i);
106  params.set<NonlinearVariableName>("variable") = _displacements[i];
107 
108  _problem->addKernel(k_type, k_name, params);
109  }
110 
111  // add temperature kernel only if temperature is a nonlinear variable (and not an auxvariable)
112  if (isParamValid("temperature"))
113  {
114  auto temp = getParam<std::vector<VariableName>>("temperature");
115  if (temp.size() > 1)
116  mooseError("Only one variable may be specified in 'temperature'");
117  if (_problem->getNonlinearSystemBase(/*nl_sys_num=*/0).hasVariable(temp[0]))
118  {
119  std::string k_name = _name + "_GeneralizedPlaneStrainOffDiag_temp";
120  params.set<NonlinearVariableName>("variable") = temp[0];
121 
122  _problem->addKernel(k_type, k_name, params);
123  }
124  }
125  }
126 
127  //
128  // Add user object
129  //
130  else if (_current_task == "add_user_object")
131  {
132  std::string uo_type = "GeneralizedPlaneStrainUserObject";
133  InputParameters params = _factory.getValidParams(uo_type);
134 
135  // Skipping selected parameters in applyParameters() and then manually setting them only if they
136  // are set by the user is just to prevent both the current and deprecated variants of these
137  // parameters from both getting passed to the UserObject. Once we get rid of the deprecated
138  // versions, we can just set them all with applyParameters().
139  params.applyParameters(
140  parameters(),
141  {"out_of_plane_pressure", "out_of_plane_pressure_function", "factor", "pressure_factor"});
142  if (parameters().isParamSetByUser("out_of_plane_pressure"))
143  params.set<FunctionName>("out_of_plane_pressure") =
144  getParam<FunctionName>("out_of_plane_pressure");
145  if (parameters().isParamSetByUser("out_of_plane_pressure_function"))
146  params.set<FunctionName>("out_of_plane_pressure_function") =
147  getParam<FunctionName>("out_of_plane_pressure_function");
148  if (parameters().isParamSetByUser("factor"))
149  params.set<Real>("factor") = getParam<Real>("factor");
150  if (parameters().isParamSetByUser("pressure_factor"))
151  params.set<Real>("pressure_factor") = getParam<Real>("pressure_factor");
152 
153  _problem->addUserObject(uo_type, uo_name, params);
154  }
155 
156  //
157  // Add scalar kernel
158  //
159  else if (_current_task == "add_scalar_kernel")
160  {
161  std::string sk_type = "GeneralizedPlaneStrain";
162  InputParameters params = _factory.getValidParams(sk_type);
163 
164  params.set<NonlinearVariableName>("variable") =
165  getParam<VariableName>("scalar_out_of_plane_strain");
166 
167  // set the UserObjectName from previously added UserObject
168  params.set<UserObjectName>("generalized_plane_strain") = uo_name;
169 
170  if (isParamValid("extra_vector_tags"))
171  params.set<std::vector<TagName>>("extra_vector_tags") =
172  getParam<std::vector<TagName>>("extra_vector_tags");
173  if (isParamValid("absolute_value_vector_tags"))
174  params.set<std::vector<TagName>>("absolute_value_vector_tags") =
175  getParam<std::vector<TagName>>("absolute_value_vector_tags");
176 
177  _problem->addScalarKernel(sk_type, _name + "_GeneralizedPlaneStrain", params);
178  }
179 }
unsigned int _ndisp
Number of displacement variables.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
void applyParameters(const InputParameters &common, const std::vector< std::string > &exclude={}, const bool allow_private=false)
bool isParamValid(const std::string &name) const
Factory & _factory
const std::string & _current_task
std::string stringify(const T &t)
const std::string _name
bool isParamSetByUser(const std::string &nm) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
const InputParameters & parameters() const
std::vector< VariableName > _displacements

◆ validParams()

InputParameters GeneralizedPlaneStrainAction::validParams ( )
static

Definition at line 24 of file GeneralizedPlaneStrainAction.C.

25 {
27  params.addClassDescription("Set up the GeneralizedPlaneStrain environment");
28  params.addRequiredParam<std::vector<VariableName>>("displacements", "The displacement variables");
29  params.addRequiredParam<VariableName>("scalar_out_of_plane_strain",
30  "Scalar variable for the out-of-plane strain (in "
31  "y direction for 1D Axisymmetric or in z "
32  "direction for 2D Cartesian problems)");
33  params.addParam<std::vector<VariableName>>("temperature", "The temperature variable");
34  MooseEnum outOfPlaneDirection("x y z", "z");
35  params.addParam<MooseEnum>(
36  "out_of_plane_direction", outOfPlaneDirection, "The direction of the out-of-plane strain.");
37  params.addParam<FunctionName>(
38  "out_of_plane_pressure_function",
39  "Function used to prescribe pressure (applied toward the body) in the out-of-plane direction "
40  "(y for 1D Axisymmetric or z for 2D Cartesian problems)");
41  params.addDeprecatedParam<FunctionName>(
42  "out_of_plane_pressure",
43  "Function used to prescribe pressure (applied toward the body) in the out-of-plane direction "
44  "(y for 1D Axisymmetric or z for 2D Cartesian problems)",
45  "This has been replaced by 'out_of_plane_pressure_function'");
46  params.addParam<MaterialPropertyName>("out_of_plane_pressure_material",
47  "0",
48  "Material used to prescribe pressure (applied toward the "
49  "body) in the out-of-plane direction");
50  params.addDeprecatedParam<Real>(
51  "factor",
52  "Scale factor applied to prescribed out-of-plane pressure (both material and function)",
53  "This has been replaced by 'pressure_factor'");
54  params.addParam<Real>(
55  "pressure_factor",
56  "Scale factor applied to prescribed out-of-plane pressure (both material and function)");
57  params.addParam<bool>("use_displaced_mesh", false, "Whether to use displaced mesh");
58  params.addParam<std::string>("base_name", "Material property base name");
59  params.addParam<std::vector<SubdomainName>>("block",
60  "The list of ids of the blocks (subdomain) "
61  "that the GeneralizedPlaneStrain kernels "
62  "will be applied to");
63  params.addParam<std::vector<TagName>>(
64  "extra_vector_tags",
65  "The tag names for extra vectors that residual data should be saved into");
66  params.addParam<std::vector<TagName>>("absolute_value_vector_tags",
67  "The tag names for extra vectors that the absolute value "
68  "of the residual should be accumulated into");
69 
70  return params;
71 }
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _displacements

std::vector<VariableName> GeneralizedPlaneStrainAction::_displacements
protected

Definition at line 24 of file GeneralizedPlaneStrainAction.h.

Referenced by act().

◆ _ndisp

unsigned int GeneralizedPlaneStrainAction::_ndisp
protected

Number of displacement variables.

Definition at line 27 of file GeneralizedPlaneStrainAction.h.

Referenced by act().

◆ _out_of_plane_direction

const unsigned int GeneralizedPlaneStrainAction::_out_of_plane_direction
protected

Definition at line 28 of file GeneralizedPlaneStrainAction.h.

Referenced by act().


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