https://mooseframework.inl.gov
ADArrayDirichletBC.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 "ADArrayDirichletBC.h"
11 
13 
16 {
18  params.addRequiredParam<RealEigenVector>("values",
19  "The values the components must take on the boundary");
20  params.declareControllable("values");
21  params.addClassDescription(
22  "Imposes the essential boundary condition $\\vec{u}=\\vec{g}$, where $\\vec{g}$ "
23  "are constant, controllable values.");
24  return params;
25 }
26 
28  : ADArrayNodalBC(parameters), _values(getParam<RealEigenVector>("values"))
29 {
30  if (_values.size() != _var.count())
31  paramError("values",
32  "Number of 'values' must equal number of variable components (",
33  _var.count(),
34  ").");
35 }
36 
39 {
40  return _u - _values;
41 }
virtual ADRealEigenVector computeQpResidual() override
Compute this NodalBC&#39;s contribution to the residual at the current quadrature point.
Eigen::Matrix< ADReal, Eigen::Dynamic, 1 > ADRealEigenVector
Definition: MooseTypes.h:148
Base class for deriving any automatic differentiation boundary condition of a integrated type...
Definition: ADNodalBC.h:21
const RealEigenVector & _values
The value for this BC.
unsigned int count() const
Get the number of components Note: For standard and vector variables, the number is one...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const Moose::ADType< T >::type & _u
Value of the unknown variable this BC is acting on.
Definition: ADNodalBC.h:48
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
registerMooseObject("MooseApp", ADArrayDirichletBC)
ADArrayDirichletBC(const InputParameters &parameters)
static InputParameters validParams()
Definition: ADNodalBC.C:26
MooseVariableFE< T > & _var
The variable that this NodalBC operates on.
Definition: ADNodalBC.h:39
static InputParameters validParams()
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...
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:147
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
Boundary condition of a Dirichlet type.