www.mooseframework.org
EqualGradientConstraint.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 
16 #include "SubProblem.h"
17 #include "FEProblem.h"
18 
19 template <>
22 {
24  params.addRequiredParam<unsigned int>("component", "Gradient component to constrain");
25  return params;
26 }
27 
29  : FaceFaceConstraint(parameters), _component(getParam<unsigned int>("component"))
30 {
31 }
32 
33 Real
35 {
37 }
38 
39 Real
41 {
42  switch (res_type)
43  {
44  case Moose::Master:
46  case Moose::Slave:
48  default:
49  return 0;
50  }
51 }
52 
53 Real
55 {
56  switch (jac_type)
57  {
59  case Moose::SlaveMaster:
61 
62  case Moose::MasterSlave:
63  case Moose::SlaveSlave:
64  return -_phi[_j][_qp] * _grad_test_slave[_i][_qp](_component);
65 
66  default:
67  return 0;
68  }
69 }
ConstraintType
Definition: MooseTypes.h:198
EqualGradientConstraint(const InputParameters &parameters)
const VariableValue & _lambda
The values of Lagrange multipliers in quadrature points.
User for mortar methods.
std::vector< RealGradient > _grad_u_slave
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::vector< std::vector< Real > > _phi
virtual Real computeQpResidualSide(Moose::ConstraintType res_type) override
unsigned int _i
Definition: Constraint.h:83
InputParameters validParams< EqualGradientConstraint >()
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
unsigned int _j
Definition: Constraint.h:83
virtual Real computeQpJacobianSide(Moose::ConstraintJacobianType jac_type) override
InputParameters validParams< FaceFaceConstraint >()
const VariableTestGradient & _grad_test_slave
const VariableTestGradient & _grad_test_master
std::vector< RealGradient > _grad_u_master
ConstraintJacobianType
Definition: MooseTypes.h:204
virtual Real computeQpResidual() override
unsigned int _qp
Definition: Constraint.h:84
std::vector< std::vector< Real > > _test