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

Simple constant damper. More...

#include <ContactSlipDamper.h>

Inheritance diagram for ContactSlipDamper:
[legend]

Public Member Functions

 ContactSlipDamper (const InputParameters &parameters)
 
virtual void timestepSetup ()
 

Protected Types

typedef std::map< std::pair< unsigned int, unsigned int >, PenetrationLocator * >::iterator pl_iterator
 Convenient typedef for frequently used iterator. More...
 

Protected Member Functions

virtual Real computeDamping (const NumericVector< Number > &solution, const NumericVector< Number > &update)
 Compute the amount of damping. More...
 
bool operateOnThisInteraction (const PenetrationLocator &pen_loc)
 Determine whether the damper should operate on the interaction corresponding to the supplied PenetrationLocator. More...
 

Protected Attributes

AuxiliarySystem & _aux_sys
 
MooseSharedPointer< DisplacedProblem > _displaced_problem
 
std::set< std::pair< int, int > > _interactions
 
int _num_contact_nodes
 
int _num_sticking
 
int _num_slipping
 
int _num_slipping_friction
 
int _num_stick_locked
 
int _num_slip_reversed
 
Real _max_iterative_slip
 
Real _min_damping_factor
 
Real _damping_threshold_factor
 
bool _debug_output
 

Detailed Description

Simple constant damper.

Modifies the non-linear step by applying a constant damping factor

Definition at line 30 of file ContactSlipDamper.h.

Member Typedef Documentation

◆ pl_iterator

typedef std::map<std::pair<unsigned int, unsigned int>, PenetrationLocator *>::iterator ContactSlipDamper::pl_iterator
protected

Convenient typedef for frequently used iterator.

Definition at line 68 of file ContactSlipDamper.h.

Constructor & Destructor Documentation

◆ ContactSlipDamper()

ContactSlipDamper::ContactSlipDamper ( const InputParameters &  parameters)

Definition at line 45 of file ContactSlipDamper.C.

46  : GeneralDamper(parameters),
47  _aux_sys(parameters.get<FEProblemBase *>("_fe_problem_base")->getAuxiliarySystem()),
48  _displaced_problem(parameters.get<FEProblemBase *>("_fe_problem_base")->getDisplacedProblem()),
50  _num_sticking(0),
51  _num_slipping(0),
55  _max_iterative_slip(parameters.get<Real>("max_iterative_slip")),
56  _min_damping_factor(parameters.get<Real>("min_damping_factor")),
57  _damping_threshold_factor(parameters.get<Real>("damping_threshold_factor")),
58  _debug_output(parameters.get<bool>("debug_output"))
59 {
60  if (!_displaced_problem)
61  mooseError("Must have displaced problem to use ContactSlipDamper");
62 
63  std::vector<int> master = parameters.get<std::vector<int>>("master");
64  std::vector<int> slave = parameters.get<std::vector<int>>("slave");
65 
66  unsigned int num_interactions = master.size();
67  if (num_interactions != slave.size())
68  mooseError("Sizes of master surface and slave surface lists must match in ContactSlipDamper");
69  if (num_interactions == 0)
70  mooseError("Must define at least one master/slave pair in ContactSlipDamper");
71 
72  for (unsigned int i = 0; i < master.size(); ++i)
73  {
74  std::pair<int, int> ms_pair(master[i], slave[i]);
75  _interactions.insert(ms_pair);
76  }
77 }
std::set< std::pair< int, int > > _interactions
MooseSharedPointer< DisplacedProblem > _displaced_problem
AuxiliarySystem & _aux_sys

Member Function Documentation

◆ computeDamping()

Real ContactSlipDamper::computeDamping ( const NumericVector< Number > &  solution,
const NumericVector< Number > &  update 
)
protectedvirtual

Compute the amount of damping.

Definition at line 115 of file ContactSlipDamper.C.

117 {
118  // Do new contact search to update positions of slipped nodes
119  _displaced_problem->updateMesh(solution, *_aux_sys.currentSolution());
120 
121  Real damping = 1.0;
122 
123  _num_contact_nodes = 0;
124  _num_sticking = 0;
125  _num_slipping = 0;
127  _num_stick_locked = 0;
128  _num_slip_reversed = 0;
129 
130  GeometricSearchData & displaced_geom_search_data = _displaced_problem->geomSearchData();
131  std::map<std::pair<unsigned int, unsigned int>, PenetrationLocator *> * penetration_locators =
132  &displaced_geom_search_data._penetration_locators;
133 
134  for (pl_iterator plit = penetration_locators->begin(); plit != penetration_locators->end();
135  ++plit)
136  {
137  PenetrationLocator & pen_loc = *plit->second;
138 
139  if (operateOnThisInteraction(pen_loc))
140  {
141  std::vector<dof_id_type> & slave_nodes = pen_loc._nearest_node._slave_nodes;
142 
143  for (unsigned int i = 0; i < slave_nodes.size(); i++)
144  {
145  dof_id_type slave_node_num = slave_nodes[i];
146 
147  if (pen_loc._penetration_info[slave_node_num])
148  {
149  PenetrationInfo & info = *pen_loc._penetration_info[slave_node_num];
150  const Node * node = info._node;
151 
152  if (node->processor_id() == processor_id())
153  {
154  if (info.isCaptured())
155  {
157  if (info._mech_status == PenetrationInfo::MS_STICKING)
158  _num_sticking++;
159  else if (info._mech_status == PenetrationInfo::MS_SLIPPING)
160  _num_slipping++;
161  else if (info._mech_status == PenetrationInfo::MS_SLIPPING_FRICTION)
163  if (info._stick_locked_this_step >= 2) // TODO get from contact interaction
165 
166  RealVectorValue tangential_inc_slip_prev_iter =
167  info._incremental_slip_prev_iter -
168  (info._incremental_slip_prev_iter * info._normal) * info._normal;
169  RealVectorValue tangential_inc_slip =
170  info._incremental_slip - (info._incremental_slip * info._normal) * info._normal;
171 
172  RealVectorValue tangential_it_slip =
173  tangential_inc_slip - tangential_inc_slip_prev_iter;
174  Real node_damping_factor = 1.0;
175  if ((tangential_inc_slip_prev_iter * tangential_inc_slip < 0.0) &&
176  info._mech_status == PenetrationInfo::MS_SLIPPING_FRICTION)
177  {
178  info._slip_reversed = true;
180  Real prev_iter_slip_mag = tangential_inc_slip_prev_iter.norm();
181  RealVectorValue prev_iter_slip_dir =
182  tangential_inc_slip_prev_iter / prev_iter_slip_mag;
183  Real cur_it_slip_in_old_dir = tangential_it_slip * prev_iter_slip_dir;
184 
185  if (prev_iter_slip_mag > info._slip_tol ||
186  cur_it_slip_in_old_dir > -_damping_threshold_factor * prev_iter_slip_mag)
187  node_damping_factor =
188  1.0 - (cur_it_slip_in_old_dir + prev_iter_slip_mag) / cur_it_slip_in_old_dir;
189 
190  if (node_damping_factor < 0.0)
191  mooseError("Damping factor can't be negative");
192 
193  if (node_damping_factor < _min_damping_factor)
194  node_damping_factor = _min_damping_factor;
195  }
196 
197  if (tangential_it_slip.norm() > _max_iterative_slip)
198  node_damping_factor =
199  (tangential_it_slip.norm() - _max_iterative_slip) / tangential_it_slip.norm();
200 
201  if (_debug_output && node_damping_factor < 1.0)
202  _console << "Damping node: " << node->id()
203  << " prev iter slip: " << info._incremental_slip_prev_iter
204  << " curr iter slip: " << info._incremental_slip
205  << " slip_tol: " << info._slip_tol
206  << " damping factor: " << node_damping_factor << "\n";
207 
208  if (node_damping_factor < damping)
209  damping = node_damping_factor;
210  }
211  }
212  }
213  }
214  }
215  }
216  _console << std::flush;
217  _communicator.sum(_num_contact_nodes);
218  _communicator.sum(_num_sticking);
219  _communicator.sum(_num_slipping);
220  _communicator.sum(_num_slipping_friction);
221  _communicator.sum(_num_stick_locked);
222  _communicator.sum(_num_slip_reversed);
223  _communicator.min(damping);
224 
225  _console << " ContactSlipDamper: Damping #Cont #Stick #Slip #SlipFric #StickLock "
226  "#SlipRev\n";
227 
228  _console << std::right << std::setw(29) << damping << std::setw(10) << _num_contact_nodes
229  << std::setw(10) << _num_sticking << std::setw(10) << _num_slipping << std::setw(10)
230  << _num_slipping_friction << std::setw(11) << _num_stick_locked << std::setw(10)
231  << _num_slip_reversed << "\n\n";
232  _console << std::flush;
233 
234  return damping;
235 }
MooseSharedPointer< DisplacedProblem > _displaced_problem
std::map< std::pair< unsigned int, unsigned int >, PenetrationLocator * >::iterator pl_iterator
Convenient typedef for frequently used iterator.
AuxiliarySystem & _aux_sys
bool operateOnThisInteraction(const PenetrationLocator &pen_loc)
Determine whether the damper should operate on the interaction corresponding to the supplied Penetrat...

◆ operateOnThisInteraction()

bool ContactSlipDamper::operateOnThisInteraction ( const PenetrationLocator &  pen_loc)
protected

Determine whether the damper should operate on the interaction corresponding to the supplied PenetrationLocator.

Definition at line 238 of file ContactSlipDamper.C.

Referenced by computeDamping(), and timestepSetup().

239 {
240  bool operate_on_this_interaction = false;
241  std::set<std::pair<int, int>>::iterator ipit;
242  std::pair<int, int> ms_pair(pen_loc._master_boundary, pen_loc._slave_boundary);
243  ipit = _interactions.find(ms_pair);
244  if (ipit != _interactions.end())
245  operate_on_this_interaction = true;
246  return operate_on_this_interaction;
247 }
std::set< std::pair< int, int > > _interactions

◆ timestepSetup()

void ContactSlipDamper::timestepSetup ( )
virtual

Definition at line 80 of file ContactSlipDamper.C.

81 {
82  GeometricSearchData & displaced_geom_search_data = _displaced_problem->geomSearchData();
83  std::map<std::pair<unsigned int, unsigned int>, PenetrationLocator *> * penetration_locators =
84  &displaced_geom_search_data._penetration_locators;
85 
86  for (pl_iterator plit = penetration_locators->begin(); plit != penetration_locators->end();
87  ++plit)
88  {
89  PenetrationLocator & pen_loc = *plit->second;
90 
91  if (operateOnThisInteraction(pen_loc))
92  {
93  std::vector<dof_id_type> & slave_nodes = pen_loc._nearest_node._slave_nodes;
94 
95  for (unsigned int i = 0; i < slave_nodes.size(); i++)
96  {
97  dof_id_type slave_node_num = slave_nodes[i];
98 
99  if (pen_loc._penetration_info[slave_node_num])
100  {
101  PenetrationInfo & info = *pen_loc._penetration_info[slave_node_num];
102  const Node * node = info._node;
103 
104  if (node->processor_id() == processor_id())
105  // && info.isCaptured()) //TODO maybe just set this
106  // everywhere?
107  info._slip_reversed = false;
108  }
109  }
110  }
111  }
112 }
MooseSharedPointer< DisplacedProblem > _displaced_problem
std::map< std::pair< unsigned int, unsigned int >, PenetrationLocator * >::iterator pl_iterator
Convenient typedef for frequently used iterator.
bool operateOnThisInteraction(const PenetrationLocator &pen_loc)
Determine whether the damper should operate on the interaction corresponding to the supplied Penetrat...

Member Data Documentation

◆ _aux_sys

AuxiliarySystem& ContactSlipDamper::_aux_sys
protected

Definition at line 38 of file ContactSlipDamper.h.

Referenced by computeDamping().

◆ _damping_threshold_factor

Real ContactSlipDamper::_damping_threshold_factor
protected

Definition at line 63 of file ContactSlipDamper.h.

Referenced by computeDamping().

◆ _debug_output

bool ContactSlipDamper::_debug_output
protected

Definition at line 64 of file ContactSlipDamper.h.

Referenced by computeDamping().

◆ _displaced_problem

MooseSharedPointer<DisplacedProblem> ContactSlipDamper::_displaced_problem
protected

Definition at line 39 of file ContactSlipDamper.h.

Referenced by computeDamping(), ContactSlipDamper(), and timestepSetup().

◆ _interactions

std::set<std::pair<int, int> > ContactSlipDamper::_interactions
protected

Definition at line 53 of file ContactSlipDamper.h.

Referenced by ContactSlipDamper(), and operateOnThisInteraction().

◆ _max_iterative_slip

Real ContactSlipDamper::_max_iterative_slip
protected

Definition at line 61 of file ContactSlipDamper.h.

Referenced by computeDamping().

◆ _min_damping_factor

Real ContactSlipDamper::_min_damping_factor
protected

Definition at line 62 of file ContactSlipDamper.h.

Referenced by computeDamping().

◆ _num_contact_nodes

int ContactSlipDamper::_num_contact_nodes
protected

Definition at line 55 of file ContactSlipDamper.h.

Referenced by computeDamping().

◆ _num_slip_reversed

int ContactSlipDamper::_num_slip_reversed
protected

Definition at line 60 of file ContactSlipDamper.h.

Referenced by computeDamping().

◆ _num_slipping

int ContactSlipDamper::_num_slipping
protected

Definition at line 57 of file ContactSlipDamper.h.

Referenced by computeDamping().

◆ _num_slipping_friction

int ContactSlipDamper::_num_slipping_friction
protected

Definition at line 58 of file ContactSlipDamper.h.

Referenced by computeDamping().

◆ _num_stick_locked

int ContactSlipDamper::_num_stick_locked
protected

Definition at line 59 of file ContactSlipDamper.h.

Referenced by computeDamping().

◆ _num_sticking

int ContactSlipDamper::_num_sticking
protected

Definition at line 56 of file ContactSlipDamper.h.

Referenced by computeDamping().


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