www.mooseframework.org
OneDEqualValueConstraintBC.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 
17 template <>
20 {
22  params.addRequiredCoupledVar("lambda", "Lagrange multiplier");
23  params.addRequiredParam<unsigned int>("component", "Component of the Lagrange multiplier");
24  params.addRequiredParam<Real>(
25  "vg",
26  "Variation of the constraint g wrt this surface (+1 or -1). Note: g = value1 - value2 = 0 ");
27  return params;
28 }
29 
31  : IntegratedBC(parameters),
32  _lambda(coupledScalarValue("lambda")),
33  _lambda_var_number(coupledScalar("lambda")),
34  _component(getParam<unsigned int>("component")),
35  _vg(getParam<Real>("vg"))
36 {
37 }
38 
39 Real
41 {
42  return _lambda[_component] * _vg * _test[_i][_qp];
43 }
44 
45 Real
47 {
48  return 0.;
49 }
50 
51 Real
53 {
54  if (jvar == _lambda_var_number)
55  {
56  if (_j == _component)
57  return _vg * _test[_i][_qp];
58  else
59  return 0.;
60  }
61  else
62  return 0.;
63 }
const VariableTestValue & _test
test function values (in QPs)
Definition: IntegratedBC.h:105
InputParameters validParams< IntegratedBC >()
Definition: IntegratedBC.C:28
InputParameters validParams< OneDEqualValueConstraintBC >()
virtual Real computeQpResidual() override
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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...
virtual Real computeQpJacobian() override
OneDEqualValueConstraintBC(const InputParameters &parameters)
Base class for deriving any boundary condition of a integrated type.
Definition: IntegratedBC.h:33
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
unsigned int _qp
quadrature point index
Definition: IntegratedBC.h:83
unsigned int _j
Definition: IntegratedBC.h:93
virtual Real computeQpOffDiagJacobian(unsigned jvar) override
unsigned int _i
i-th, j-th index for enumerating test and shape functions
Definition: IntegratedBC.h:93