https://mooseframework.inl.gov
Loading...
Searching...
No Matches
EqualValueEmbeddedConstraint.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
14#include "MooseEnum.h"
15
17class FEProblemBase;
18
23template <bool is_ad>
25{
26public:
28
30
31 virtual void timestepSetup() override {}
32 virtual void jacobianSetup() override {}
33 virtual void residualEnd() override {}
34
35 virtual bool addCouplingEntriesToJacobian() override { return true; }
36
37 bool shouldApply() override final;
38
43 virtual void reinitConstraint();
44
45protected:
46 virtual void prepareSecondaryToPrimaryMap() override;
47 virtual Real computeQpSecondaryValue() override;
48 virtual GenericReal<is_ad> computeQpResidual(Moose::ConstraintType type) override;
49 virtual Real computeQpJacobian(Moose::ConstraintJacobianType type) override;
50 virtual Real computeQpOffDiagJacobian(Moose::ConstraintJacobianType type,
51 unsigned int jvar) override;
52
55
57 CreateMooseEnumClass(Formulation, KINEMATIC, PENALTY) _formulation;
59 const Real _penalty;
61 NumericVector<Number> & _residual_copy;
64
66};
67
Moose::GenericType< Real, is_ad > GenericReal
Definition MooseTypes.h:698
A EqualValueEmbeddedConstraint forces the value of a variable to be the same on overlapping portion o...
virtual Real computeQpOffDiagJacobian(Moose::ConstraintJacobianType type, unsigned int jvar) override
This is the virtual method that derived classes should override for computing the off-diag Jacobian.
GenericReal< is_ad > _constraint_residual
constraint force needed to enforce the constraint
virtual void timestepSetup() override
Gets called at the beginning of the timestep before this object is asked to do its job.
virtual void jacobianSetup() override
Gets called just before the Jacobian is computed and before this object is asked to do its job.
MooseSharedPointer< DisplacedProblem > _displaced_problem
virtual Real computeQpSecondaryValue() override
Compute the value the secondary node should have at the beginning of a timestep.
bool shouldApply() override final
Whether or not this constraint should be applied.
NumericVector< Number > & _residual_copy
copy of the residual before the constraint is applied
CreateMooseEnumClass(Formulation, KINEMATIC, PENALTY) _formulation
Formulations, currently only supports KINEMATIC and PENALTY.
const Real _penalty
Penalty parameter used in constraint enforcement for kinematic and penalty formulations.
virtual void prepareSecondaryToPrimaryMap() override
prepare the _secondary_to_primary_map (see NodeElemConstraintBase)
virtual void reinitConstraint()
Prepare the residual contribution of the current constraint required to enforce it based on the speci...
virtual GenericReal< is_ad > computeQpResidual(Moose::ConstraintType type) override
This is the virtual method that derived classes should override for computing the residual.
virtual Real computeQpJacobian(Moose::ConstraintJacobianType type) override
This is the virtual method that derived classes should override for computing the Jacobian.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Definition FEProblem.h:21
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
const std::string & type() const
Get the type of this class.
Definition MooseBase.h:93
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...