https://mooseframework.inl.gov
NodalConstraint.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 "Constraint.h"
15 
16 class NodalConstraint : public Constraint,
19 {
20 public:
22 
24 
29  std::vector<dof_id_type> & getPrimaryNodeId() { return _primary_node_vector; }
30 
35  std::vector<dof_id_type> & getSecondaryNodeId() { return _connected_nodes; }
36 
40  virtual void updateConnectivity();
41 
45  virtual void computeResidual() override final
46  {
47  mooseError("NodalConstraint do not need computeResidual()");
48  }
49  virtual void computeResidual(NumericVector<Number> & residual);
50 
54  virtual void computeJacobian() override final
55  {
56  mooseError("NodalConstraint do not need computeJacobian()");
57  }
58  virtual void computeJacobian(SparseMatrix<Number> & jacobian);
59 
63  const MooseVariable & variable() const override { return _var; }
64 
65 protected:
71 
77 
79 
81 
85  std::vector<dof_id_type> _connected_nodes;
87  std::vector<dof_id_type> _primary_node_vector;
96  std::vector<Real> _weights;
98  unsigned int _i;
99  unsigned int _j;
100 };
ConstraintFormulationType
Type of constraint formulation.
Definition: MooseTypes.h:917
virtual void updateConnectivity()
Built the connectivity for this constraint.
ConstraintType
Definition: MooseTypes.h:757
Class for stuff related to variables.
Definition: Adaptivity.h:31
Intermediate base class that ties together all the interfaces for getting MooseVariables with the Moo...
const VariableValue & _u_primary
Holds the current solution at the current quadrature point.
unsigned int _j
virtual Real computeQpResidual(Moose::ConstraintType type)=0
This is the virtual that derived classes should override for computing the residual on neighboring el...
Base class for all Constraint types.
Definition: Constraint.h:19
const VariableValue & _u_secondary
Value of the unknown variable this BC is action on.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void computeResidual() override final
Computes the nodal residual.
static InputParameters validParams()
unsigned int _i
Counter for primary and secondary nodes.
std::vector< dof_id_type > _primary_node_vector
node IDs of the primary node
Enhances MooseVariableInterface interface provide values from neighbor elements.
std::vector< dof_id_type > _connected_nodes
node IDs connected to the primary node (secondary nodes)
virtual Real computeQpJacobian(Moose::ConstraintJacobianType type)=0
This is the virtual that derived classes should override for computing the Jacobian on neighboring el...
std::vector< Real > _weights
When the secondary node is constrained to move as a linear combination of the primary nodes...
Moose::ConstraintFormulationType _formulation
Specifies formulation type used to apply constraints.
const MooseVariable & variable() const override
The variable number that this object operates on.
std::vector< dof_id_type > & getPrimaryNodeId()
Get the list of primary nodes.
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51
virtual void computeJacobian() override final
Computes the jacobian for the current element.
forward declarations
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ConstraintJacobianType
Definition: MooseTypes.h:796
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const InputParameters & parameters() const
Get the parameters of the object.
NodalConstraint(const InputParameters &parameters)
MooseVariable & _var_secondary
std::vector< dof_id_type > & getSecondaryNodeId()
Get the list of connected secondary nodes.
MooseVariable & _var