www.mooseframework.org
MatchedValueBC.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 "MatchedValueBC.h"
16 
17 template <>
20 {
22  params.addRequiredCoupledVar("v", "The variable whose value we are to match.");
23  params.addClassDescription("Implements a NodalBC which equates two different Variables' values "
24  "on a specified boundary.");
25  return params;
26 }
27 
29  : NodalBC(parameters), _v(coupledValue("v")), _v_num(coupled("v"))
30 {
31 }
32 
33 Real
35 {
36  return _u[_qp] - _v[_qp];
37 }
38 
39 Real
41 {
42  if (jvar == _v_num)
43  return -1.0;
44  else
45  return 0.;
46 }
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
This is the virtual that derived classes should override for computing an off-diagonal jacobian compo...
MatchedValueBC(const InputParameters &parameters)
const VariableValue & _v
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Base class for deriving any boundary condition that works at nodes.
Definition: NodalBC.h:38
InputParameters validParams< NodalBC >()
Definition: NodalBC.C:23
unsigned int _v_num
The id of the coupled variable.
InputParameters validParams< MatchedValueBC >()
virtual Real computeQpResidual() override
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
const VariableValue & _u
Value of the unknown variable this BC is acting on.
Definition: NodalBC.h:58
unsigned int _qp
Quadrature point index.
Definition: NodalBC.h:56