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 24 of file OneDContactConstraint.h.

Constructor & Destructor Documentation

OneDContactConstraint::OneDContactConstraint ( const InputParameters &  parameters)

Definition at line 32 of file OneDContactConstraint.C.

33  : NodeFaceConstraint(parameters),
34  _residual_copy(_sys.residualGhosted()),
35  _jacobian_update(getParam<bool>("jacobian_update"))
36 {
37 }
NumericVector< Number > & _residual_copy
virtual OneDContactConstraint::~OneDContactConstraint ( )
inlinevirtual

Definition at line 28 of file OneDContactConstraint.h.

28 {}

Member Function Documentation

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

Definition at line 117 of file OneDContactConstraint.C.

Referenced by ~OneDContactConstraint().

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

Definition at line 100 of file OneDContactConstraint.C.

Referenced by ~OneDContactConstraint().

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

Definition at line 86 of file OneDContactConstraint.C.

Referenced by ~OneDContactConstraint().

87 {
88  PenetrationInfo * pinfo = _penetration_locator._penetration_info[_current_node->id()];
89  Moose::err << std::endl
90  << "Popping out node: " << _current_node->id() << std::endl
91  << "Closest Point x: " << pinfo->_closest_point(0) << std::endl
92  << "Current Node x: " << (*_current_node)(0) << std::endl
93  << "Current Value: " << _u_slave[_qp] << std::endl
94  << std::endl;
95 
96  return pinfo->_closest_point(0) - ((*_current_node)(0) - _u_slave[_qp]);
97 }
void OneDContactConstraint::jacobianSetup ( )
virtual

Definition at line 46 of file OneDContactConstraint.C.

Referenced by ~OneDContactConstraint().

47 {
48  if (_jacobian_update)
50 }
bool OneDContactConstraint::shouldApply ( )

Definition at line 78 of file OneDContactConstraint.C.

Referenced by ~OneDContactConstraint().

79 {
80  std::set<dof_id_type>::iterator hpit =
81  _penetration_locator._has_penetrated.find(_current_node->id());
82  return (hpit != _penetration_locator._has_penetrated.end());
83 }
void OneDContactConstraint::timestepSetup ( )
virtual

Definition at line 40 of file OneDContactConstraint.C.

Referenced by ~OneDContactConstraint().

41 {
43 }
void OneDContactConstraint::updateContactSet ( )
virtual

Definition at line 53 of file OneDContactConstraint.C.

Referenced by jacobianSetup(), timestepSetup(), and ~OneDContactConstraint().

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

Member Data Documentation

bool OneDContactConstraint::_jacobian_update
protected

Definition at line 46 of file OneDContactConstraint.h.

Referenced by jacobianSetup().

NumericVector<Number>& OneDContactConstraint::_residual_copy
protected

Definition at line 44 of file OneDContactConstraint.h.

Referenced by computeQpResidual().


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