https://mooseframework.inl.gov
ArrayDirichletBC.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 "ArrayDirichletBC.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  : ArrayNodalBC(parameters), _values(getParam<RealEigenVector>("values"))
29 {
30  if (_values.size() != _count)
31  paramError(
32  "values", "Number of 'values' must equal number of variable components (", _count, ").");
33 }
34 
35 void
37 {
38  residual = _u - _values;
39 }
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition: MooseBase.h:435
Base class for deriving any boundary condition that works at nodes on vector variables.
Definition: ArrayNodalBC.h:18
const unsigned int _count
Number of components of the array variable.
Definition: ArrayNodalBC.h:63
const RealEigenVector & _u
Value of the unknown variable this BC is acting on.
Definition: ArrayNodalBC.h:41
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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...
const RealEigenVector & _values
The value for this BC.
registerMooseObject("MooseApp", ArrayDirichletBC)
virtual void computeQpResidual(RealEigenVector &residual) override
Compute this BC&#39;s contribution to the residual at the current quadrature point, to be filled in resid...
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...
static InputParameters validParams()
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:146
static InputParameters validParams()
Definition: ArrayNodalBC.C:19
Boundary condition of a Dirichlet type.
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
ArrayDirichletBC(const InputParameters &parameters)