https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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");
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)
32 "values", "Number of 'values' must equal number of variable components (", _count, ").");
33}
34
35void
36ArrayDirichletBC::computeQpResidual(RealEigenVector & residual)
37{
38 residual = _u - _values;
39}
registerMooseObject("MooseApp", ArrayDirichletBC)
Boundary condition of a Dirichlet type.
virtual void computeQpResidual(RealEigenVector &residual) override
Compute this BC's contribution to the residual at the current quadrature point, to be filled in resid...
static InputParameters validParams()
const RealEigenVector & _values
The value for this BC.
ArrayDirichletBC(const InputParameters &parameters)
Base class for deriving any boundary condition that works at nodes on vector variables.
const unsigned int _count
Number of components of the array variable.
static InputParameters validParams()
const RealEigenVector & _u
Value of the unknown variable this BC is acting on.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
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...
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.
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:457