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
GeneralizedPlaneStrainActionPD Class Reference

Action class to setup peridynamic generalized plane strain models. More...

#include <GeneralizedPlaneStrainActionPD.h>

Inheritance diagram for GeneralizedPlaneStrainActionPD:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 GeneralizedPlaneStrainActionPD (const InputParameters &params)
 
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
 
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 * queryParam (const std::string &name) 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
 
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

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

const MooseEnum _formulation
 Option to choose which peridynamic model to use for generalized plane strain formulation: ordinary state based or non-ordinary state based. More...
 
VariableName _scalar_out_of_plane_strain
 Scalar variable for out-of-plane strain variable. More...
 
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
 
std::vector< VariableName > _displacements
 Displacement variables. More...
 
const unsigned int _ndisp
 

Detailed Description

Action class to setup peridynamic generalized plane strain models.

Definition at line 18 of file GeneralizedPlaneStrainActionPD.h.

Constructor & Destructor Documentation

◆ GeneralizedPlaneStrainActionPD()

GeneralizedPlaneStrainActionPD::GeneralizedPlaneStrainActionPD ( const InputParameters params)

Definition at line 57 of file GeneralizedPlaneStrainActionPD.C.

58  : Action(params),
59  _displacements(getParam<std::vector<VariableName>>("displacements")),
60  _ndisp(_displacements.size()),
61  _formulation(getParam<MooseEnum>("formulation")),
62  _scalar_out_of_plane_strain(getParam<VariableName>("scalar_out_of_plane_strain"))
63 {
64  // Generalized plane strain only applies to two dimensional modeling and simulation
65  if (_ndisp != 2)
66  mooseError("GeneralizedPlaneStrainPD only works for two dimensional case!");
67 
68  // Consistency check
69  if (_formulation == "NONORDINARY_STATE" && isParamValid("out_of_plane_stress_variable"))
70  mooseWarning("Variable out_of_plane_stress_variable will not be used in NONORDINARY_STATE "
71  "formulation option!");
72  if (_formulation == "ORDINARY_STATE" && !isParamValid("out_of_plane_stress_variable"))
73  mooseError("Variable out_of_plane_stress_variable must be provided for ORDINARY_STATE "
74  "formulation option!");
75 }
Action(const InputParameters &parameters)
VariableName _scalar_out_of_plane_strain
Scalar variable for out-of-plane strain variable.
std::vector< VariableName > _displacements
Displacement variables.
void mooseWarning(Args &&... args) const
bool isParamValid(const std::string &name) const
const MooseEnum _formulation
Option to choose which peridynamic model to use for generalized plane strain formulation: ordinary st...
const T & getParam(const std::string &name) const
void mooseError(Args &&... args) const

Member Function Documentation

◆ act()

void GeneralizedPlaneStrainActionPD::act ( )
overridevirtual

Implements Action.

Definition at line 78 of file GeneralizedPlaneStrainActionPD.C.

79 {
80  if (_current_task == "add_kernel")
81  {
82  std::string k_type;
83  if (_formulation == "ORDINARY_STATE")
84  k_type = "GeneralizedPlaneStrainOffDiagOSPD"; // Based on the ordinary state-based model
85  else if (_formulation == "NONORDINARY_STATE")
86  k_type = "GeneralizedPlaneStrainOffDiagNOSPD"; // Based on Form I of horizon-stabilized
87  // correspondence model
88  else
89  paramError("formulation", "Unsupported peridynamic formulation");
90 
91  InputParameters params = _factory.getValidParams(k_type);
92 
93  params.applyParameters(parameters(),
94  {"displacements", "temperature", "scalar_out_of_plane_strain"});
95 
96  params.set<std::vector<VariableName>>("displacements") = _displacements;
97  params.set<std::vector<VariableName>>("scalar_out_of_plane_strain") = {
99 
100  // Coupling between scalar out-of-plane strain and in-plane displacements
101  for (unsigned int i = 0; i < _ndisp; ++i)
102  {
103  std::string k_name = name() + "_GeneralizedPlaneStrainPDOffDiag_disp_" + Moose::stringify(i);
104  params.set<NonlinearVariableName>("variable") = _displacements[i];
105 
106  _problem->addKernel(k_type, k_name, params);
107  }
108 
109  // Coupling between scalar out-of-plane strain and temperature (only when temperature is a
110  // nonlinear variable)
111  if (isParamValid("temperature"))
112  {
113  VariableName temp = getParam<VariableName>("temperature");
114  if (_problem->getNonlinearSystemBase(/*nl_sys_num=*/0).hasVariable(temp))
115  {
116  params.set<std::vector<VariableName>>("temperature") = {temp};
117 
118  std::string k_name = name() + "_GeneralizedPlaneStrainPDOffDiag_temp";
119  params.set<NonlinearVariableName>("variable") = temp;
120 
121  if (_formulation == "NONORDINARY_STATE")
122  params.set<std::vector<MaterialPropertyName>>("eigenstrain_names") =
123  getParam<std::vector<MaterialPropertyName>>("eigenstrain_names");
124 
125  _problem->addKernel(k_type, k_name, params);
126  }
127  }
128  }
129  else if (_current_task == "add_user_object")
130  {
131  std::string uo_type;
132  if (_formulation == "ORDINARY_STATE")
133  uo_type = "GeneralizedPlaneStrainUserObjectOSPD";
134  else if (_formulation == "NONORDINARY_STATE")
135  uo_type = "GeneralizedPlaneStrainUserObjectNOSPD";
136  else
137  paramError("formulation", "Unsupported peridynamic formulation!");
138 
139  InputParameters params = _factory.getValidParams(uo_type);
140 
141  std::string uo_name = name() + "_GeneralizedPlaneStrainPDUserObject";
142 
143  params.applyParameters(parameters(), {"out_of_plane_stress_variable"});
144 
145  if (_formulation == "ORDINARY_STATE")
146  params.set<std::vector<VariableName>>("out_of_plane_stress_variable") = {
147  getParam<VariableName>("out_of_plane_stress_variable")};
148 
149  _problem->addUserObject(uo_type, uo_name, params);
150  }
151  else if (_current_task == "add_scalar_kernel")
152  {
153  std::string sk_type("GeneralizedPlaneStrainPD");
154  InputParameters params = _factory.getValidParams(sk_type);
155 
156  std::string sk_name = name() + "_GeneralizedPlaneStrainPD";
157 
158  params.set<NonlinearVariableName>("variable") = _scalar_out_of_plane_strain;
159 
160  // set the UserObjectName using added UserObject
161  params.set<UserObjectName>("generalized_plane_strain_uo") =
162  name() + "_GeneralizedPlaneStrainPDUserObject";
163 
164  _problem->addScalarKernel(sk_type, sk_name, params);
165  }
166  else
167  mooseError("Task error in GeneralizedPlaneStrainActionPD!");
168 }
VariableName _scalar_out_of_plane_strain
Scalar variable for out-of-plane strain variable.
T & set(const std::string &name, bool quiet_mode=false)
std::vector< VariableName > _displacements
Displacement variables.
InputParameters getValidParams(const std::string &name) const
void applyParameters(const InputParameters &common, const std::vector< std::string > &exclude={}, const bool allow_private=false)
virtual const std::string & name() const
bool isParamValid(const std::string &name) const
Factory & _factory
const MooseEnum _formulation
Option to choose which peridynamic model to use for generalized plane strain formulation: ordinary st...
const T & getParam(const std::string &name) const
const std::string & _current_task
void paramError(const std::string &param, Args... args) const
std::string stringify(const T &t)
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
const InputParameters & parameters() const

◆ validParams()

InputParameters GeneralizedPlaneStrainActionPD::validParams ( )
static

Definition at line 21 of file GeneralizedPlaneStrainActionPD.C.

22 {
24  params.addClassDescription("Class for setting up the Kernel, ScalarKernel, and UserObject for "
25  "peridynamic generalized plane strain model");
26 
27  params.addRequiredParam<std::vector<VariableName>>(
28  "displacements", "Nonlinear variable name for the displacements");
29  params.addRequiredParam<VariableName>("scalar_out_of_plane_strain",
30  "Scalar variable for strain in the out-of-plane direction");
31  params.addParam<VariableName>("temperature", "Nonlinear variable for the temperature");
32  MooseEnum formulation_option("ORDINARY_STATE NONORDINARY_STATE", "NONORDINARY_STATE");
33  params.addParam<MooseEnum>("formulation", formulation_option, "Peridynamic formulation options");
34  MooseEnum strain_type("SMALL FINITE", "SMALL");
35  params.addParam<MooseEnum>("strain", strain_type, "Strain formulation");
36  params.addParam<VariableName>("out_of_plane_stress_variable",
37  "Name of out-of-plane stress auxiliary variable");
38  params.addParam<FunctionName>(
39  "out_of_plane_pressure",
40  "0",
41  "Function used to prescribe pressure in the out-of-plane direction");
42  params.addParam<Real>("factor", 1.0, "Scale factor applied to prescribed out-of-plane pressure");
43  params.addParam<bool>("full_jacobian",
44  false,
45  "Parameter to set whether to use the nonlocal full Jacobian formulation "
46  "for the scalar components");
47  params.addParam<std::vector<SubdomainName>>("block",
48  "List of ids of the blocks (subdomains) that the "
49  "GeneralizedPlaneStrainActionPD will be applied "
50  "to");
51  params.addParam<std::vector<MaterialPropertyName>>(
52  "eigenstrain_names", {}, "List of eigenstrains to be applied in this strain calculation");
53 
54  return params;
55 }
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> GeneralizedPlaneStrainActionPD::_displacements
protected

Displacement variables.

Definition at line 29 of file GeneralizedPlaneStrainActionPD.h.

Referenced by act().

◆ _formulation

const MooseEnum GeneralizedPlaneStrainActionPD::_formulation
protected

Option to choose which peridynamic model to use for generalized plane strain formulation: ordinary state based or non-ordinary state based.

Definition at line 34 of file GeneralizedPlaneStrainActionPD.h.

Referenced by act(), and GeneralizedPlaneStrainActionPD().

◆ _ndisp

const unsigned int GeneralizedPlaneStrainActionPD::_ndisp
protected

Definition at line 30 of file GeneralizedPlaneStrainActionPD.h.

Referenced by act(), and GeneralizedPlaneStrainActionPD().

◆ _scalar_out_of_plane_strain

VariableName GeneralizedPlaneStrainActionPD::_scalar_out_of_plane_strain
protected

Scalar variable for out-of-plane strain variable.

Definition at line 37 of file GeneralizedPlaneStrainActionPD.h.

Referenced by act().


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