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

A OneDContactConstraint forces the value of a variable to be the same on both sides of an interface. More...

#include <OneDContactConstraint.h>

Inheritance diagram for OneDContactConstraint:
[legend]

Public Member Functions

 OneDContactConstraint (const InputParameters &parameters)
 
virtual ~OneDContactConstraint ()
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void updateContactSet ()
 
virtual Real computeQpSlaveValue ()
 
virtual Real computeQpResidual (Moose::ConstraintType type)
 
virtual Real computeQpJacobian (Moose::ConstraintJacobianType type)
 
bool shouldApply ()
 

Protected Attributes

NumericVector< Number > & _residual_copy
 
bool _jacobian_update
 

Detailed Description

A OneDContactConstraint forces the value of a variable to be the same on both sides of an interface.

Definition at line 26 of file OneDContactConstraint.h.

Constructor & Destructor Documentation

◆ OneDContactConstraint()

OneDContactConstraint::OneDContactConstraint ( const InputParameters &  parameters)

Definition at line 36 of file OneDContactConstraint.C.

37  : NodeFaceConstraint(parameters),
38  _residual_copy(_sys.residualGhosted()),
39  _jacobian_update(getParam<bool>("jacobian_update"))
40 {
41 }
NumericVector< Number > & _residual_copy

◆ ~OneDContactConstraint()

virtual OneDContactConstraint::~OneDContactConstraint ( )
inlinevirtual

Definition at line 30 of file OneDContactConstraint.h.

30 {}

Member Function Documentation

◆ computeQpJacobian()

Real OneDContactConstraint::computeQpJacobian ( Moose::ConstraintJacobianType  type)
virtual

Definition at line 121 of file OneDContactConstraint.C.

122 {
123  double slave_jac = 0;
124  switch (type)
125  {
126  case Moose::SlaveSlave:
127  return _phi_slave[_j][_qp] * _test_slave[_i][_qp];
128  case Moose::SlaveMaster:
129  return -_phi_master[_j][_qp] * _test_slave[_i][_qp];
130  case Moose::MasterSlave:
131  slave_jac =
132  (*_jacobian)(_current_node->dof_number(0, _var.number(), 0), _connected_dof_indices[_j]);
133  return slave_jac * _test_master[_i][_qp];
134  case Moose::MasterMaster:
135  return 0;
136  }
137  return 0;
138 }

◆ computeQpResidual()

Real OneDContactConstraint::computeQpResidual ( Moose::ConstraintType  type)
virtual

Definition at line 104 of file OneDContactConstraint.C.

105 {
106  PenetrationInfo * pinfo = _penetration_locator._penetration_info[_current_node->id()];
107 
108  switch (type)
109  {
110  case Moose::Slave:
111  // return (_u_slave[_qp] - _u_master[_qp])*_test_slave[_i][_qp];
112  return ((*_current_node)(0) - pinfo->_closest_point(0)) * _test_slave[_i][_qp];
113  case Moose::Master:
114  double slave_resid = _residual_copy(_current_node->dof_number(0, _var.number(), 0));
115  return slave_resid * _test_master[_i][_qp];
116  }
117  return 0;
118 }
NumericVector< Number > & _residual_copy

◆ computeQpSlaveValue()

Real OneDContactConstraint::computeQpSlaveValue ( )
virtual

Definition at line 90 of file OneDContactConstraint.C.

91 {
92  PenetrationInfo * pinfo = _penetration_locator._penetration_info[_current_node->id()];
93  Moose::err << std::endl
94  << "Popping out node: " << _current_node->id() << std::endl
95  << "Closest Point x: " << pinfo->_closest_point(0) << std::endl
96  << "Current Node x: " << (*_current_node)(0) << std::endl
97  << "Current Value: " << _u_slave[_qp] << std::endl
98  << std::endl;
99 
100  return pinfo->_closest_point(0) - ((*_current_node)(0) - _u_slave[_qp]);
101 }

◆ jacobianSetup()

void OneDContactConstraint::jacobianSetup ( )
virtual

Definition at line 50 of file OneDContactConstraint.C.

51 {
52  if (_jacobian_update)
54 }

◆ shouldApply()

bool OneDContactConstraint::shouldApply ( )

Definition at line 82 of file OneDContactConstraint.C.

83 {
84  std::set<dof_id_type>::iterator hpit =
85  _penetration_locator._has_penetrated.find(_current_node->id());
86  return (hpit != _penetration_locator._has_penetrated.end());
87 }

◆ timestepSetup()

void OneDContactConstraint::timestepSetup ( )
virtual

Definition at line 44 of file OneDContactConstraint.C.

45 {
47 }

◆ updateContactSet()

void OneDContactConstraint::updateContactSet ( )
virtual

Definition at line 57 of file OneDContactConstraint.C.

Referenced by jacobianSetup(), and timestepSetup().

58 {
59  std::set<dof_id_type> & has_penetrated = _penetration_locator._has_penetrated;
60 
61  std::map<dof_id_type, PenetrationInfo *>::iterator
62  it = _penetration_locator._penetration_info.begin(),
63  end = _penetration_locator._penetration_info.end();
64 
65  for (; it != end; ++it)
66  {
67  PenetrationInfo * pinfo = it->second;
68 
69  // Skip this pinfo if there are no DOFs on this node.
70  if (!pinfo || pinfo->_node->n_comp(_sys.number(), _var.number()) < 1)
71  continue;
72 
73  if (pinfo->_distance > 0)
74  {
75  dof_id_type slave_node_num = it->first;
76  has_penetrated.insert(slave_node_num);
77  }
78  }
79 }

Member Data Documentation

◆ _jacobian_update

bool OneDContactConstraint::_jacobian_update
protected

Definition at line 48 of file OneDContactConstraint.h.

Referenced by jacobianSetup().

◆ _residual_copy

NumericVector<Number>& OneDContactConstraint::_residual_copy
protected

Definition at line 46 of file OneDContactConstraint.h.

Referenced by computeQpResidual().


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