www.mooseframework.org
ContactPressureAux.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "ContactPressureAux.h"
8 
9 #include "NodalArea.h"
10 #include "PenetrationLocator.h"
11 
12 #include "libmesh/string_to_enum.h"
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<AuxKernel>();
19  params.addRequiredCoupledVar("nodal_area", "The nodal area");
20  params.addRequiredParam<BoundaryName>("paired_boundary", "The boundary to be penetrated");
21  params.set<MultiMooseEnum>("execute_on") = "nonlinear";
22  return params;
23 }
24 
25 ContactPressureAux::ContactPressureAux(const InputParameters & params)
26  : AuxKernel(params),
27  _nodal_area(coupledValue("nodal_area")),
28  _penetration_locator(
29  getPenetrationLocator(getParam<BoundaryName>("paired_boundary"),
30  getParam<std::vector<BoundaryName>>("boundary")[0],
31  Utility::string_to_enum<Order>(getParam<MooseEnum>("order"))))
32 {
33 }
34 
36 
37 Real
39 {
40  Real value(0);
41  const Real area = _nodal_area[_qp];
42  const PenetrationInfo * pinfo(NULL);
43 
44  const auto it = _penetration_locator._penetration_info.find(_current_node->id());
45  if (it != _penetration_locator._penetration_info.end())
46  pinfo = it->second;
47 
48  if (pinfo && area != 0)
49  value = -(pinfo->_contact_force * pinfo->_normal) / area;
50 
51  return value;
52 }
InputParameters validParams< ContactPressureAux >()
ContactPressureAux(const InputParameters &parameters)
const PenetrationLocator & _penetration_locator
const VariableValue & _nodal_area
virtual Real computeValue()