www.mooseframework.org
NodalNormalBC.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "NodalNormalBC.h"
11 
14 {
16  params.addCoupledVar("nx", "x-component of the normal");
17  params.addCoupledVar("ny", "y-component of the normal");
18  params.addCoupledVar("nz", "z-component of the normal");
19 
20  params.set<std::vector<VariableName>>("nx") = {"nodal_normal_x"};
21  params.set<std::vector<VariableName>>("ny") = {"nodal_normal_y"};
22  params.set<std::vector<VariableName>>("nz") = {"nodal_normal_z"};
23 
24  return params;
25 }
26 
28  : NodalBC(parameters), _nx(coupledValue("nx")), _ny(coupledValue("ny")), _nz(coupledValue("nz"))
29 {
30 }
31 
32 void
34 {
35  _normal = Point(_nx[_qp], _ny[_qp], _nz[_qp]);
37 }
Point _normal
Normal at the node (it is pre-computed by user object subsystem)
Definition: NodalNormalBC.h:33
NodalNormalBC(const InputParameters &parameters)
Definition: NodalNormalBC.C:27
virtual Real computeQpResidual()=0
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:20
const unsigned int _qp
Pseudo-"quadrature point" index (Always zero for the current node)
Definition: NodalBC.h:44
const VariableValue & _nz
Definition: NodalNormalBC.h:31
static InputParameters validParams()
Definition: NodalNormalBC.C:13
const VariableValue & _nx
Definition: NodalNormalBC.h:29
const VariableValue & _ny
Definition: NodalNormalBC.h:30
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
static InputParameters validParams()
Definition: NodalBC.C:18
virtual void computeResidual() override
Compute this object&#39;s contribution to the residual.
Definition: NodalNormalBC.C:33