LCOV - code coverage report
Current view: top level - src/bcs - FunctorDirichletBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 15 16 93.8 %
Date: 2025-08-08 20:01:16 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          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       14481 : FunctorDirichletBC::validParams()
      16             : {
      17       14481 :   InputParameters params = ADDirichletBCBase::validParams();
      18             : 
      19       14481 :   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       14481 :   params.addRequiredParam<MooseFunctorName>("functor", "The functor to impose");
      24       43443 :   params.addParam<MooseFunctorName>(
      25       28962 :       "coefficient", 1.0, "An optional functor coefficient to multiply the imposed functor");
      26             : 
      27       14481 :   return params;
      28           0 : }
      29             : 
      30          64 : FunctorDirichletBC::FunctorDirichletBC(const InputParameters & parameters)
      31             :   : ADDirichletBCBaseTempl<Real>(parameters),
      32          64 :     _functor(getFunctor<ADReal>("functor")),
      33         128 :     _coef(getFunctor<ADReal>("coefficient"))
      34             : {
      35          64 : }
      36             : 
      37             : ADReal
      38       44784 : FunctorDirichletBC::computeQpValue()
      39             : {
      40       44784 :   const Moose::NodeArg space_arg = {_current_node, &Moose::NodeArg::undefined_subdomain_connection};
      41       44784 :   const Moose::StateArg time_arg = Moose::currentState();
      42       89568 :   return _coef(space_arg, time_arg) * _functor(space_arg, time_arg);
      43             : }

Generated by: LCOV version 1.14