www.mooseframework.org
FunctionPenaltyDirichletBC.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 
11 #include "Function.h"
12 
14 
15 template <>
18 {
20  params.addRequiredParam<Real>("penalty", "Penalty scalar");
21  params.addRequiredParam<FunctionName>("function", "Forcing function");
22 
23  return params;
24 }
25 
27  : IntegratedBC(parameters), _func(getFunction("function")), _p(getParam<Real>("penalty"))
28 {
29 }
30 
31 Real
33 {
34  return _p * _test[_i][_qp] * (-_func.value(_t, _q_point[_qp]) + _u[_qp]);
35 }
36 
37 Real
39 {
40  return _p * _phi[_j][_qp] * _test[_i][_qp];
41 }
const VariableTestValue & _test
test function values (in QPs)
Definition: IntegratedBC.h:68
virtual Real value(Real t, const Point &p)
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
Definition: Function.C:38
InputParameters validParams< IntegratedBC >()
Definition: IntegratedBC.C:23
registerMooseObject("MooseApp", FunctionPenaltyDirichletBC)
InputParameters validParams< FunctionPenaltyDirichletBC >()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
unsigned int _i
i-th, j-th index for enumerating test and shape functions
const VariablePhiValue & _phi
shape function values (in QPs)
Definition: IntegratedBC.h:61
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...
unsigned int _qp
quadrature point index
virtual Real computeQpJacobian() override
const MooseArray< Point > & _q_point
active quadrature points
FunctionPenaltyDirichletBC(const InputParameters &parameters)
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
virtual Real computeQpResidual() override
method for computing the residual at quadrature points
Base class for deriving any boundary condition of a integrated type.
Definition: IntegratedBC.h:24
A different approach to applying Dirichlet BCs.
const VariableValue & _u
the values of the unknown variable this BC is acting on
Definition: IntegratedBC.h:75