www.mooseframework.org
GapHeatPointSourceMaster.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 
9 #include "SystemBase.h"
10 #include "PenetrationInfo.h"
11 #include "MooseMesh.h"
12 
13 #include "libmesh/string_to_enum.h"
14 
15 template <>
16 InputParameters
18 {
19  MooseEnum orders("CONSTANT FIRST SECOND THIRD FOURTH", "FIRST");
20 
21  InputParameters params = validParams<DiracKernel>();
22  params.addRequiredParam<BoundaryName>("boundary", "The master boundary");
23  params.addRequiredParam<BoundaryName>("slave", "The slave boundary");
24  params.addParam<MooseEnum>("order", orders, "The finite element order");
25  params.set<bool>("use_displaced_mesh") = true;
26  params.addParam<Real>("tangential_tolerance",
27  "Tangential distance to extend edges of contact surfaces");
28  params.addParam<Real>(
29  "normal_smoothing_distance",
30  "Distance from edge in parametric coordinates over which to smooth contact normal");
31  params.addParam<std::string>("normal_smoothing_method",
32  "Method to use to smooth normals (edge_based|nodal_normal_based)");
33 
34  return params;
35 }
36 
37 GapHeatPointSourceMaster::GapHeatPointSourceMaster(const InputParameters & parameters)
38  : DiracKernel(parameters),
39  _penetration_locator(
40  getPenetrationLocator(getParam<BoundaryName>("boundary"),
41  getParam<BoundaryName>("slave"),
42  Utility::string_to_enum<Order>(getParam<MooseEnum>("order")))),
43  _slave_flux(_sys.getVector("slave_flux"))
44 {
45  if (parameters.isParamValid("tangential_tolerance"))
46  _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));
47 
48  if (parameters.isParamValid("normal_smoothing_distance"))
49  _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));
50 
51  if (parameters.isParamValid("normal_smoothing_method"))
52  _penetration_locator.setNormalSmoothingMethod(
53  parameters.get<std::string>("normal_smoothing_method"));
54 }
55 
56 void
58 {
59  point_to_info.clear();
60  _slave_flux.close();
61 
62  std::map<dof_id_type, PenetrationInfo *>::iterator
63  it = _penetration_locator._penetration_info.begin(),
64  end = _penetration_locator._penetration_info.end();
65 
66  for (; it != end; ++it)
67  {
68  PenetrationInfo * pinfo = it->second;
69 
70  // Skip this pinfo if there are no DOFs on this node.
71  if (!pinfo || pinfo->_node->n_comp(_sys.number(), _var.number()) < 1)
72  continue;
73 
74  addPoint(pinfo->_elem, pinfo->_closest_point);
75  point_to_info[pinfo->_closest_point] = pinfo;
76  }
77 }
78 
79 Real
81 {
82  PenetrationInfo * pinfo = point_to_info[_current_point];
83  const Node * node = pinfo->_node;
84  long int dof_number = node->dof_number(_sys.number(), _var.number(), 0);
85 
86  return -_test[_i][_qp] * _slave_flux(dof_number);
87 }
88 
89 Real
91 {
92  return 0.0;
93 }
NumericVector< Number > & _slave_flux
PenetrationLocator & _penetration_locator
InputParameters validParams< GapHeatPointSourceMaster >()
std::map< Point, PenetrationInfo * > point_to_info
GapHeatPointSourceMaster(const InputParameters &parameters)