www.mooseframework.org
NodalConstraint.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef NODALCONSTRAINT_H
16 #define NODALCONSTRAINT_H
17 
18 // MOOSE includes
19 #include "Constraint.h"
21 
22 // Forward Declarations
23 class NodalConstraint;
24 
25 template <>
27 
28 class NodalConstraint : public Constraint,
30 {
31 public:
33 
38  std::vector<dof_id_type> & getMasterNodeId() { return _master_node_vector; }
39 
44  std::vector<dof_id_type> & getSlaveNodeId() { return _connected_nodes; }
45 
49  virtual void updateConnectivity();
50 
54  virtual void computeResidual(NumericVector<Number> & residual);
55 
59  virtual void computeJacobian(SparseMatrix<Number> & jacobian);
60 
61 protected:
67 
72  virtual Real computeQpJacobian(Moose::ConstraintJacobianType type) = 0;
73 
77  std::vector<dof_id_type> _connected_nodes;
79  std::vector<dof_id_type> _master_node_vector;
88  std::vector<Real> _weights;
90  unsigned int _i;
91  unsigned int _j;
92 };
93 
94 #endif
ConstraintFormulationType
Type of constraint formulation.
Definition: MooseTypes.h:318
virtual void updateConnectivity()
Built the connectivity for this constraint.
const VariableValue & _u_master
Holds the current solution at the current quadrature point.
ConstraintType
Definition: MooseTypes.h:198
virtual void computeJacobian(SparseMatrix< Number > &jacobian)
Computes the jacobian for the current element.
Intermediate base class that ties together all the interfaces for getting MooseVariables with the Moo...
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:42
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
unsigned int _i
Counter for master and slave nodes.
const VariableValue & _u_slave
Value of the unknown variable this BC is action on.
InputParameters validParams< NodalConstraint >()
std::vector< dof_id_type > _connected_nodes
node IDs connected to the master node (slave 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 slave node is constrained to move as a linear combination of the master nodes, the coefficients associated with each master node is stored in _weights.
Moose::ConstraintFormulationType _formulation
Specifies formulation type used to apply constraints.
virtual void computeResidual(NumericVector< Number > &residual)
Computes the nodal residual.
MatType type
std::vector< dof_id_type > _master_node_vector
node IDs of the master node
ConstraintJacobianType
Definition: MooseTypes.h:204
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
std::vector< dof_id_type > & getMasterNodeId()
Get the list of master nodes.
NodalConstraint(const InputParameters &parameters)
std::vector< dof_id_type > & getSlaveNodeId()
Get the list of connected slave nodes.