28 params.
addRequiredParam<BoundaryName>(
"secondary",
"The secondary boundary");
30 "Friction coefficient for slippage in the normal direction");
32 "Normal force used together with friction_coefficient to compute "
33 "the normal frictional capacity.");
35 "Stiffness of the spring in the tangential direction.");
41 _primary_boundary_id(getParam<BoundaryName>(
"boundary")),
42 _secondary_boundary_id(getParam<BoundaryName>(
"secondary")),
43 _normal_force(getParam<Real>(
"normal_force")),
44 _tangential_penalty(getParam<Real>(
"tangential_penalty")),
45 _friction_coefficient(getParam<Real>(
"friction_coefficient")),
46 _u_secondary_old(_var.dofValuesOldNeighbor()),
47 _u_primary_old(_var.dofValuesOld())
51 "Primary variable must be identical to secondary "
52 "variable. Different variables are currently not supported.");
56 MooseEnum temp_formulation = getParam<MooseEnum>(
"formulation");
57 if (temp_formulation ==
"penalty")
59 else if (temp_formulation ==
"kinematic")
60 mooseError(
"NodalFrictionalConstraint: Kinematic formulation is currently not supported for "
63 mooseError(
"Formulation must be set to Penalty.");
79 std::vector<dof_id_type> secondary_nodelist =
81 std::vector<dof_id_type> primary_nodelist =
85 for (
auto in : secondary_nodelist)
92 for (
auto in : primary_nodelist)
96 for (
const auto elem_id : elem_ids)
101 const auto displaced_elem_ids =
103 if (displaced_elem_ids != elem_ids)
104 mooseError(
"Reference and displaced meshes selected different primary elements");
110 for (
unsigned int j = 0; j < secondary_nodelist.size(); ++j)
114 Node & secondary_node =
_mesh.
nodeRef(secondary_nodelist[j]);
118 Real
d = (secondary_node - primary_node).norm();
119 if (MooseUtils::absoluteFuzzyEqual(
d, 0.0))
139 std::vector<Number> re(primarydof.size());
140 std::vector<Number> neighbor_re(secondarydof.size());
142 for (
_i = 0;
_i < secondarydof.size(); ++
_i)
158 if (MooseUtils::absoluteFuzzyGreaterThan(std::abs(old_force),
166 if (MooseUtils::absoluteFuzzyGreaterThan(std::abs(current_force),
173 return current_force;
175 return -current_force;
187 DenseMatrix<Number> Kee(primarydof.size(), primarydof.size());
188 DenseMatrix<Number> Ken(primarydof.size(), secondarydof.size());
189 DenseMatrix<Number> Kne(secondarydof.size(), primarydof.size());
190 DenseMatrix<Number> Knn(secondarydof.size(), secondarydof.size());
197 for (
_i = 0;
_i < secondarydof.size(); ++
_i)
218 if (MooseUtils::absoluteFuzzyGreaterThan(std::abs(old_force),
226 if (MooseUtils::absoluteFuzzyGreaterThan(std::abs(current_force),
registerMooseObject("SolidMechanicsApp", NodalFrictionalConstraint)
std::shared_ptr< DisplacedProblem > displaced_problem
const ConsoleStream _console
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const
virtual MooseMesh & mesh() override
const std::string & type() const
void paramError(const std::string ¶m, Args... args) const
void mooseError(Args &&... args) const
virtual const Node & nodeRef(const dof_id_type i) const
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
const std::vector< dof_id_type > & getNodeList(boundary_id_type nodeset_id) const
void scalingFactor(const std::vector< Real > &factor)
unsigned int number() const
const std::vector< dof_id_type > & dofIndicesNeighbor() const final
const std::vector< dof_id_type > & dofIndices() const final
Moose::ConstraintFormulationType _formulation
std::vector< dof_id_type > _primary_node_vector
std::vector< dof_id_type > _connected_nodes
std::vector< dof_id_type > gatherAndRetainConnectedElems(MooseMesh &mesh, const std::vector< dof_id_type > &node_ids)
static InputParameters validParams()
MooseVariable & _var_secondary
const VariableValue & _u_secondary
const VariableValue & _u_primary
const Real & _normal_force
Normal stiffness of spring.
virtual void computeResidual() override final
void updateConstrainedNodes()
Update the sets of nodes with constrained DOFs.
virtual void meshChanged() override
const Real & _tangential_penalty
Tangential stiffness of spring.
virtual Real computeQpJacobian(Moose::ConstraintJacobianType type) override
static InputParameters validParams()
const Real & _friction_coefficient
Coefficient of friction.
const VariableValue & _u_primary_old
Old value of the constrainted variable on the primary nodes.
BoundaryName _primary_boundary_id
Holds the secondary node set or side set.
virtual Real computeQpResidual(Moose::ConstraintType type) override
virtual void computeJacobian() override final
std::vector< dof_id_type > _primary_conn
primary node id connected to each secondary node in _connected_nodes
BoundaryName _secondary_boundary_id
Holds the secondary node set or side set.
NodalFrictionalConstraint(const InputParameters ¶meters)
const VariableValue & _u_secondary_old
Old value of the constrainted variable on the secondary nodes.
FEProblemBase & _fe_problem
virtual void addGhostedElem(dof_id_type elem_id)=0
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
void addResiduals(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
processor_id_type processor_id() const