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 
13 
16 {
18  params.addCoupledVar("nx", "x-component of the normal");
19  params.addCoupledVar("ny", "y-component of the normal");
20  params.addCoupledVar("nz", "z-component of the normal");
21 
22  params.set<std::vector<VariableName>>("nx") = {"nodal_normal_x"};
23  params.set<std::vector<VariableName>>("ny") = {"nodal_normal_y"};
24  params.set<std::vector<VariableName>>("nz") = {"nodal_normal_z"};
25 
26  return params;
27 }
28 
30  : NodalBC(parameters), _nx(coupledValue("nx")), _ny(coupledValue("ny")), _nz(coupledValue("nz"))
31 {
32 }
33 
34 void
36 {
37  _normal = Point(_nx[_qp], _ny[_qp], _nz[_qp]);
39 }
NodalNormalBC::_nz
const VariableValue & _nz
Definition: NodalNormalBC.h:36
NodalBC::_qp
const unsigned int _qp
Pseudo-"quadrature point" index (Always zero for the current node)
Definition: NodalBC.h:49
NodalNormalBC::computeResidual
virtual void computeResidual() override
Definition: NodalNormalBC.C:35
NodalNormalBC::validParams
static InputParameters validParams()
Definition: NodalNormalBC.C:15
NodalNormalBC::_ny
const VariableValue & _ny
Definition: NodalNormalBC.h:35
NodalNormalBC::_normal
Point _normal
Normal at the node (it is pre-computed by user object subsystem)
Definition: NodalNormalBC.h:38
NodalNormalBC::_nx
const VariableValue & _nx
Definition: NodalNormalBC.h:34
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Definition: InputParameters.h:53
InputParameters::set
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Definition: InputParameters.h:987
NodalNormalBC
This is a base class to enforce strong boundary condition with a normal defined at a node.
Definition: NodalNormalBC.h:24
NodalNormalBC::NodalNormalBC
NodalNormalBC(const InputParameters &parameters)
Definition: NodalNormalBC.C:29
NodalNormalBC.h
NodalBC
Base class for deriving any boundary condition that works at nodes.
Definition: NodalBC.h:26
defineLegacyParams
defineLegacyParams(NodalNormalBC)
NodalBC::computeQpResidual
virtual Real computeQpResidual()=0
InputParameters::addCoupledVar
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
Definition: InputParameters.C:183
NodalBC::validParams
static InputParameters validParams()
Definition: NodalBC.C:20