www.mooseframework.org
EqualValueConstraint.C
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 #include "EqualValueConstraint.h"
16 #include "SubProblem.h"
17 #include "FEProblem.h"
18 
19 template <>
22 {
24  return params;
25 }
26 
28  : FaceFaceConstraint(parameters)
29 {
30 }
31 
32 Real
34 {
35  return (_u_master[_qp] - _u_slave[_qp]) * _test[_i][_qp];
36 }
37 
38 Real
40 {
41  switch (res_type)
42  {
43  case Moose::Master:
44  return _lambda[_qp] * _test_master[_i][_qp];
45  case Moose::Slave:
46  return -_lambda[_qp] * _test_slave[_i][_qp];
47  default:
48  return 0;
49  }
50 }
51 
52 Real
54 {
55  switch (jac_type)
56  {
58  case Moose::SlaveMaster:
59  return _phi[_j][_qp] * _test_master[_i][_qp];
60 
61  case Moose::MasterSlave:
62  case Moose::SlaveSlave:
63  return -_phi[_j][_qp] * _test_slave[_i][_qp];
64 
65  default:
66  return 0;
67  }
68 }
const VariableTestValue & _test_slave
Values of test functions on the slave side.
ConstraintType
Definition: MooseTypes.h:198
virtual Real computeQpResidualSide(Moose::ConstraintType res_type) override
const VariableValue & _lambda
The values of Lagrange multipliers in quadrature points.
User for mortar methods.
EqualValueConstraint(const InputParameters &parameters)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::vector< std::vector< Real > > _phi
unsigned int _i
Definition: Constraint.h:83
virtual Real computeQpJacobianSide(Moose::ConstraintJacobianType jac_type) override
std::vector< Real > _u_master
Values of the constrained variable on the master side.
unsigned int _j
Definition: Constraint.h:83
virtual Real computeQpResidual() override
std::vector< Real > _u_slave
Values of the constrained variable on the slave side.
InputParameters validParams< FaceFaceConstraint >()
const VariableTestValue & _test_master
Values of test functions on the master side.
ConstraintJacobianType
Definition: MooseTypes.h:204
unsigned int _qp
Definition: Constraint.h:84
std::vector< std::vector< Real > > _test
InputParameters validParams< EqualValueConstraint >()