www.mooseframework.org
PresetNodalBC.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 "PresetNodalBC.h"
16 
17 // MOOSE includes
18 #include "MooseVariable.h"
19 
20 #include "libmesh/numeric_vector.h"
21 
22 template <>
25 {
27  return p;
28 }
29 
30 PresetNodalBC::PresetNodalBC(const InputParameters & parameters) : NodalBC(parameters) {}
31 
32 void
33 PresetNodalBC::computeValue(NumericVector<Number> & current_solution)
34 {
35  dof_id_type & dof_idx = _var.nodalDofIndex();
36  _qp = 0;
37  current_solution.set(dof_idx, computeQpValue());
38 }
39 
40 Real
42 {
43  return _u[_qp] - computeQpValue();
44 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual Real computeQpResidual() override
Definition: PresetNodalBC.C:41
Base class for deriving any boundary condition that works at nodes.
Definition: NodalBC.h:38
void computeValue(NumericVector< Number > &current_solution)
Definition: PresetNodalBC.C:33
InputParameters validParams< NodalBC >()
Definition: NodalBC.C:23
dof_id_type & nodalDofIndex()
MooseVariable & _var
variable this BC works on
PresetNodalBC(const InputParameters &parameters)
Definition: PresetNodalBC.C:30
virtual Real computeQpValue()=0
InputParameters validParams< PresetNodalBC >()
Definition: PresetNodalBC.C:24
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