LCOV - code coverage report
Current view: top level - src/dirackernels - FunctorDiracKernel.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 15 16 93.8 %
Date: 2026-05-29 20:35:17 Functions: 4 4 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 "FunctorDiracKernel.h"
      11             : 
      12             : registerMooseObject("MooseApp", FunctorDiracKernel);
      13             : 
      14             : InputParameters
      15        3105 : FunctorDiracKernel::validParams()
      16             : {
      17        3105 :   InputParameters params = ADDiracKernel::validParams();
      18       12420 :   params.addRequiredParam<MooseFunctorName>("functor", "Source functor");
      19       12420 :   params.addRequiredParam<Point>("point", "Source point");
      20        3105 :   params.addClassDescription("Computes a dirac source using a functor.");
      21        3105 :   return params;
      22           0 : }
      23             : 
      24          23 : FunctorDiracKernel::FunctorDiracKernel(const InputParameters & parameters)
      25          92 :   : ADDiracKernel(parameters), _functor(getFunctor<ADReal>("functor")), _p(getParam<Point>("point"))
      26             : {
      27          23 : }
      28             : 
      29             : void
      30         411 : FunctorDiracKernel::addPoints()
      31             : {
      32         411 :   addPoint(_p);
      33         411 : }
      34             : 
      35             : ADReal
      36         510 : FunctorDiracKernel::computeQpResidual()
      37             : {
      38             :   mooseAssert(_current_point == _p, "Current point must be user-provided point");
      39         510 :   const Moose::ElemQpArg space_arg = {_current_elem, _qp, _qrule, _current_point};
      40         510 :   return -_test[_i][_qp] * _functor(space_arg, Moose::currentState());
      41             : }

Generated by: LCOV version 1.14