Line data Source code
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 "FunctorDirichletBC.h" 11 : 12 : registerMooseObject("MooseApp", FunctorDirichletBC); 13 : 14 : InputParameters 15 14467 : FunctorDirichletBC::validParams() 16 : { 17 14467 : InputParameters params = ADDirichletBCBase::validParams(); 18 : 19 14467 : params.addClassDescription("Imposes the Dirichlet boundary condition " 20 : "$u(t,\\vec{x})=h(t,\\vec{x})$, " 21 : "where $h$ is a functor and can have complex dependencies."); 22 : 23 14467 : params.addRequiredParam<MooseFunctorName>("functor", "The functor to impose"); 24 43401 : params.addParam<MooseFunctorName>( 25 28934 : "coefficient", 1.0, "An optional functor coefficient to multiply the imposed functor"); 26 : 27 14467 : return params; 28 0 : } 29 : 30 60 : FunctorDirichletBC::FunctorDirichletBC(const InputParameters & parameters) 31 : : ADDirichletBCBaseTempl<Real>(parameters), 32 60 : _functor(getFunctor<ADReal>("functor")), 33 120 : _coef(getFunctor<ADReal>("coefficient")) 34 : { 35 60 : } 36 : 37 : ADReal 38 40476 : FunctorDirichletBC::computeQpValue() 39 : { 40 40476 : const Moose::NodeArg space_arg = {_current_node, &Moose::NodeArg::undefined_subdomain_connection}; 41 40476 : const Moose::StateArg time_arg = Moose::currentState(); 42 80952 : return _coef(space_arg, time_arg) * _functor(space_arg, time_arg); 43 : }