www.mooseframework.org
NodalNormalBC.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 "NodalNormalBC.h"
16 
17 template <>
20 {
22  params.addCoupledVar("nx", "x-component of the normal");
23  params.addCoupledVar("ny", "y-component of the normal");
24  params.addCoupledVar("nz", "z-component of the normal");
25 
26  params.set<std::vector<VariableName>>("nx") = {"nodal_normal_x"};
27  params.set<std::vector<VariableName>>("ny") = {"nodal_normal_y"};
28  params.set<std::vector<VariableName>>("nz") = {"nodal_normal_z"};
29 
30  return params;
31 }
32 
34  : NodalBC(parameters), _nx(coupledValue("nx")), _ny(coupledValue("ny")), _nz(coupledValue("nz"))
35 {
36 }
37 
38 void
39 NodalNormalBC::computeResidual(NumericVector<Number> & residual)
40 {
41  _qp = 0;
42  _normal = Point(_nx[_qp], _ny[_qp], _nz[_qp]);
43  NodalBC::computeResidual(residual);
44 }
Point _normal
Normal at the node (it is pre-computed by user object subsystem)
Definition: NodalNormalBC.h:42
NodalNormalBC(const InputParameters &parameters)
Definition: NodalNormalBC.C:33
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
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
const VariableValue & _nz
Definition: NodalNormalBC.h:40
virtual void computeResidual(NumericVector< Number > &residual) override
Definition: NodalNormalBC.C:39
InputParameters validParams< NodalBC >()
Definition: NodalBC.C:23
const VariableValue & _nx
Definition: NodalNormalBC.h:38
const VariableValue & _ny
Definition: NodalNormalBC.h:39
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
InputParameters validParams< NodalNormalBC >()
Definition: NodalNormalBC.C:19
unsigned int _qp
Quadrature point index.
Definition: NodalBC.h:56
virtual void computeResidual(NumericVector< Number > &residual)
Definition: NodalBC.C:88