https://mooseframework.inl.gov
ExplicitDynamicsContactConstraint.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 // MOOSE includes
13 #include "NodeFaceConstraint.h"
14 #include "PenetrationLocator.h"
16 #include "Coupleable.h"
17 
18 // Forward Declarations
20 class DisplacedProblem;
21 
27 {
28 public:
30 
32 
33  virtual void timestepSetup() override;
34  virtual void jacobianSetup() override {}
35  virtual void residualEnd() override {}
36 
37  virtual void updateContactStatefulData(bool beginning_of_step);
38  virtual Real computeQpSecondaryValue() override;
40 
44  virtual void computeJacobian() override {}
45 
50  virtual void computeOffDiagJacobian(unsigned int /*jvar*/) override {}
51 
52  virtual Real computeQpJacobian(Moose::ConstraintJacobianType /*type*/) override { return 0.0; }
53 
60  unsigned int /*jvar*/) override
61  {
62  return 0.0;
63  }
64 
65  bool shouldApply() override;
66  void computeContactForce(const Node & node, PenetrationInfo * pinfo, bool update_contact_set);
67  virtual bool isExplicitConstraint() const override { return true; }
73  virtual bool addCouplingEntriesToJacobian() override { return false; }
74 
75  virtual const std::unordered_set<unsigned int> & getMatPropDependencies() const override;
76 
77  virtual void overwriteBoundaryVariables(NumericVector<Number> &, const Node &) const override
78  {
79  return;
80  };
81 
82 protected:
89  void solveImpactEquations(const Node & node,
90  PenetrationInfo * pinfo,
91  const RealVectorValue & distance_gap);
92 
93  MooseSharedPointer<DisplacedProblem> _displaced_problem;
94  Real gapOffset(const Node & node);
95  Real getPenalty(const Node & node);
96 
97  const unsigned int _component;
99 
101 
102  const unsigned int _mesh_dimension;
103 
104  std::vector<unsigned int> _vars;
105  std::vector<MooseVariable *> _var_objects;
106 
111 
112  const Real _penalty;
113 
115 
116  const static unsigned int _no_iterations;
117 
119 
122 
129 
130 private:
131  std::unordered_map<dof_id_type, Real> _dof_to_position;
132 
137  Real computeFaceMass(const NumericVector<Real> & lumped_mass);
138 };
139 
140 inline const std::unordered_set<unsigned int> &
142 {
144 }
MooseSharedPointer< DisplacedProblem > _displaced_problem
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const
ConstraintType
virtual Real computeQpOffDiagJacobian(Moose::ConstraintJacobianType, unsigned int) override
Compute off-diagonal Jacobian entries.
virtual void overwriteBoundaryVariables(NumericVector< Number > &, const Node &) const override
Real computeFaceMass(const NumericVector< Real > &lumped_mass)
void solveImpactEquations(const Node &node, PenetrationInfo *pinfo, const RealVectorValue &distance_gap)
Determine "Lagrange multipliers" from the iterative solution of the impact problem.
virtual void computeJacobian() override
Computes the jacobian for the current element.
virtual bool addCouplingEntriesToJacobian() override
Return false so that the nonlinear system does not try to add Jacobian entries from the contact force...
virtual bool isExplicitConstraint() const override
ExplicitDynamicsContactConstraint(const InputParameters &parameters)
virtual void computeOffDiagJacobian(unsigned int) override
Compute off-diagonal Jacobian entries.
std::unordered_map< dof_id_type, Real > _dof_to_position
virtual void updateContactStatefulData(bool beginning_of_step)
void computeContactForce(const Node &node, PenetrationInfo *pinfo, bool update_contact_set)
const ExplicitDynamicsContactModel _model
const std::string & type() const
A ExplicitDynamicsContactConstraint does mechanical contact for explicit dynamics simulations...
MooseWritableVariable * _gap_rate
Nodal gap rate (output for debugging or analyst perusal)
OutputTools< Real >::VariableValue VariableValue
virtual Real computeQpJacobian(Moose::ConstraintJacobianType) override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableValue & _neighbor_vel_z
Z component of velocity at the closest point.
ConstraintJacobianType
const InputParameters & parameters() const
const VariableValue & _neighbor_vel_y
Y component of velocity at the closest point.
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const override
const VariableValue & _neighbor_vel_x
X component of velocity at the closest point.
virtual Real computeQpResidual(Moose::ConstraintType type) override