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

Protected Attributes

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

Detailed Description

Definition at line 20 of file GeneralizedPlaneStrainAction.h.

Constructor & Destructor Documentation

◆ GeneralizedPlaneStrainAction()

GeneralizedPlaneStrainAction::GeneralizedPlaneStrainAction ( const InputParameters &  params)

Definition at line 55 of file GeneralizedPlaneStrainAction.C.

56  : Action(params),
57  _displacements(getParam<std::vector<VariableName>>("displacements")),
58  _ndisp(_displacements.size()),
59  _out_of_plane_direction(getParam<MooseEnum>("out_of_plane_direction"))
60 {
61 }
std::vector< VariableName > _displacements

Member Function Documentation

◆ act()

void GeneralizedPlaneStrainAction::act ( )
override

Definition at line 64 of file GeneralizedPlaneStrainAction.C.

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

Member Data Documentation

◆ _displacements

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

Definition at line 28 of file GeneralizedPlaneStrainAction.h.

Referenced by act().

◆ _ndisp

unsigned int GeneralizedPlaneStrainAction::_ndisp
protected

Definition at line 29 of file GeneralizedPlaneStrainAction.h.

Referenced by act().

◆ _out_of_plane_direction

const unsigned int GeneralizedPlaneStrainAction::_out_of_plane_direction
protected

Definition at line 30 of file GeneralizedPlaneStrainAction.h.

Referenced by act().


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