https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
21
27{
28public:
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;
39 virtual Real computeQpResidual(Moose::ConstraintType type) 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
82protected:
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
118 NumericVector<Number> & _residual_copy;
119
122
129
130private:
131 std::unordered_map<dof_id_type, Real> _dof_to_position;
132
137 Real computeFaceMass(const NumericVector<Real> & lumped_mass);
138};
139
140inline const std::unordered_set<unsigned int> &
A ExplicitDynamicsContactConstraint does mechanical contact for explicit dynamics simulations.
virtual void computeJacobian() override
Computes the jacobian for the current element.
virtual void overwriteBoundaryVariables(NumericVector< Number > &, const Node &) const override
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const override
MooseWritableVariable * _gap_rate
Nodal gap rate (output for debugging or analyst perusal)
virtual Real computeQpOffDiagJacobian(Moose::ConstraintJacobianType, unsigned int) override
Compute off-diagonal Jacobian entries.
virtual Real computeQpResidual(Moose::ConstraintType type) override
std::unordered_map< dof_id_type, Real > _dof_to_position
void solveImpactEquations(const Node &node, PenetrationInfo *pinfo, const RealVectorValue &distance_gap)
Determine "Lagrange multipliers" from the iterative solution of the impact problem.
virtual void computeOffDiagJacobian(unsigned int) override
Compute off-diagonal Jacobian entries.
Real computeFaceMass(const NumericVector< Real > &lumped_mass)
virtual bool addCouplingEntriesToJacobian() override
Return false so that the nonlinear system does not try to add Jacobian entries from the contact force...
virtual Real computeQpJacobian(Moose::ConstraintJacobianType) override
virtual void updateContactStatefulData(bool beginning_of_step)
const VariableValue & _neighbor_vel_y
Y component of velocity at the closest point.
void computeContactForce(const Node &node, PenetrationInfo *pinfo, bool update_contact_set)
const VariableValue & _neighbor_vel_z
Z component of velocity at the closest point.
MooseSharedPointer< DisplacedProblem > _displaced_problem
const VariableValue & _neighbor_vel_x
X component of velocity at the closest point.
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const
const InputParameters & parameters() const
const std::string & type() const
VariableValueTempl< false > VariableValue
ConstraintType
ConstraintJacobianType