www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
GeneralizedPlaneStrainAction Class Reference

#include <GeneralizedPlaneStrainAction.h>

Inheritance diagram for GeneralizedPlaneStrainAction:
[legend]

Public Member Functions

 GeneralizedPlaneStrainAction (const InputParameters &params)
 
void act () override
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Attributes

std::vector< VariableName > _displacements
 
unsigned int _ndisp
 
const unsigned int _out_of_plane_direction
 

Detailed Description

Definition at line 19 of file GeneralizedPlaneStrainAction.h.

Constructor & Destructor Documentation

◆ GeneralizedPlaneStrainAction()

GeneralizedPlaneStrainAction::GeneralizedPlaneStrainAction ( const InputParameters &  params)

Definition at line 59 of file GeneralizedPlaneStrainAction.C.

60  : Action(params),
61  _displacements(getParam<std::vector<VariableName>>("displacements")),
62  _ndisp(_displacements.size()),
63  _out_of_plane_direction(getParam<MooseEnum>("out_of_plane_direction"))
64 {
65 }

Member Function Documentation

◆ act()

void GeneralizedPlaneStrainAction::act ( )
override

Definition at line 68 of file GeneralizedPlaneStrainAction.C.

69 {
70  // user object name
71  const std::string uo_name = _name + "_GeneralizedPlaneStrainUserObject";
72 
73  //
74  // Add off diagonal Jacobian kernels
75  //
76  if (_current_task == "add_kernel")
77  {
78  std::string k_type = "GeneralizedPlaneStrainOffDiag";
79  InputParameters params = _factory.getValidParams(k_type);
80 
81  params.applyParameters(parameters(), {"scalar_out_of_plane_strain"});
82  params.set<std::vector<VariableName>>("scalar_out_of_plane_strain") = {
83  getParam<VariableName>("scalar_out_of_plane_strain")};
84 
85  // add off-diagonal jacobian kernels for the displacements
86  for (unsigned int i = 0; i < _ndisp; ++i)
87  {
88  if (_out_of_plane_direction == i)
89  continue;
90 
91  std::string k_name = _name + "GeneralizedPlaneStrainOffDiag_disp" + Moose::stringify(i);
92  params.set<NonlinearVariableName>("variable") = _displacements[i];
93 
94  _problem->addKernel(k_type, k_name, params);
95  }
96 
97  // add temperature kernel only if temperature is a nonlinear variable (and not an auxvariable)
98  if (isParamValid("temperature"))
99  {
100  VariableName temp = getParam<VariableName>("temperature");
101  if (_problem->getNonlinearSystemBase().hasVariable(temp))
102  {
103  params.set<VariableName>("temperature") = temp;
104 
105  std::string k_name = _name + "_GeneralizedPlaneStrainOffDiag_temp";
106  params.set<NonlinearVariableName>("variable") = temp;
107 
108  _problem->addKernel(k_type, k_name, params);
109  }
110  }
111  }
112 
113  //
114  // Add user object
115  //
116  else if (_current_task == "add_user_object")
117  {
118  std::string uo_type = "GeneralizedPlaneStrainUserObject";
119  InputParameters params = _factory.getValidParams(uo_type);
120 
121  params.applyParameters(parameters());
122  params.set<ExecFlagEnum>("execute_on") = EXEC_LINEAR;
123 
124  _problem->addUserObject(uo_type, uo_name, params);
125  }
126 
127  //
128  // Add scalar kernel
129  //
130  else if (_current_task == "add_scalar_kernel")
131  {
132  std::string sk_type = "GeneralizedPlaneStrain";
133  InputParameters params = _factory.getValidParams(sk_type);
134 
135  params.set<NonlinearVariableName>("variable") =
136  getParam<VariableName>("scalar_out_of_plane_strain");
137 
138  // set the UserObjectName from previously added UserObject
139  params.set<UserObjectName>("generalized_plane_strain") = uo_name;
140 
141  if (isParamValid("extra_vector_tags"))
142  params.set<std::vector<TagName>>("extra_vector_tags") =
143  getParam<std::vector<TagName>>("extra_vector_tags");
144 
145  _problem->addScalarKernel(sk_type, _name + "_GeneralizedPlaneStrain", params);
146  }
147 }

◆ validParams()

InputParameters GeneralizedPlaneStrainAction::validParams ( )
static

Definition at line 26 of file GeneralizedPlaneStrainAction.C.

27 {
28  InputParameters params = Action::validParams();
29  params.addClassDescription("Set up the GeneralizedPlaneStrain environment");
30  params.addRequiredParam<std::vector<VariableName>>("displacements", "The displacement variables");
31  params.addRequiredParam<VariableName>("scalar_out_of_plane_strain",
32  "Scalar variable for the out-of-plane strain (in "
33  "y direction for 1D Axisymmetric or in z "
34  "direction for 2D Cartesian problems)");
35  params.addParam<VariableName>("temperature", "The temperature variable");
36  MooseEnum outOfPlaneDirection("x y z", "z");
37  params.addParam<MooseEnum>(
38  "out_of_plane_direction", outOfPlaneDirection, "The direction of the out-of-plane strain.");
39  params.addParam<FunctionName>("out_of_plane_pressure",
40  "0",
41  "Function used to prescribe pressure "
42  "in the out-of-plane direction (y "
43  "for 1D Axisymmetric or z for 2D "
44  "Cartesian problems)");
45  params.addParam<Real>("factor", 1.0, "Scale factor applied to prescribed pressure");
46  params.addParam<bool>("use_displaced_mesh", false, "Whether to use displaced mesh");
47  params.addParam<std::string>("base_name", "Material property base name");
48  params.addParam<std::vector<SubdomainName>>("block",
49  "The list of ids of the blocks (subdomain) "
50  "that the GeneralizedPlaneStrain kernels "
51  "will be applied to");
52  params.addParam<std::vector<TagName>>(
53  "extra_vector_tags",
54  "The tag names for extra vectors that residual data should be saved into");
55 
56  return params;
57 }

Member Data Documentation

◆ _displacements

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

Definition at line 29 of file GeneralizedPlaneStrainAction.h.

Referenced by act().

◆ _ndisp

unsigned int GeneralizedPlaneStrainAction::_ndisp
protected

Definition at line 30 of file GeneralizedPlaneStrainAction.h.

Referenced by act().

◆ _out_of_plane_direction

const unsigned int GeneralizedPlaneStrainAction::_out_of_plane_direction
protected

Definition at line 31 of file GeneralizedPlaneStrainAction.h.

Referenced by act().


The documentation for this class was generated from the following files:
GeneralizedPlaneStrainAction::_displacements
std::vector< VariableName > _displacements
Definition: GeneralizedPlaneStrainAction.h:29
validParams
InputParameters validParams()
GeneralizedPlaneStrainAction::_ndisp
unsigned int _ndisp
Definition: GeneralizedPlaneStrainAction.h:30
GeneralizedPlaneStrainAction::_out_of_plane_direction
const unsigned int _out_of_plane_direction
Definition: GeneralizedPlaneStrainAction.h:31