LCOV - code coverage report
Current view: top level - src/dirackernels - ConstantPointSource.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 21 22 95.5 %
Date: 2025-07-17 01:28:37 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 "ConstantPointSource.h"
      11             : 
      12             : registerMooseObject("MooseApp", ConstantPointSource);
      13             : 
      14             : InputParameters
      15       14557 : ConstantPointSource::validParams()
      16             : {
      17       14557 :   InputParameters params = DiracKernel::validParams();
      18       14557 :   params.addClassDescription("Residual contribution of a constant point source term.");
      19       14557 :   params.addRequiredParam<Real>("value", "The value of the point source");
      20       14557 :   params.addRequiredParam<std::vector<Real>>("point", "The x,y,z coordinates of the point");
      21       14557 :   params.declareControllable("value");
      22       14557 :   return params;
      23           0 : }
      24             : 
      25         152 : ConstantPointSource::ConstantPointSource(const InputParameters & parameters)
      26             :   : DiracKernel(parameters),
      27         152 :     _value(getParam<Real>("value")),
      28         304 :     _point_param(getParam<std::vector<Real>>("point"))
      29             : {
      30         152 :   _p(0) = _point_param[0];
      31             : 
      32         152 :   if (_point_param.size() > 1)
      33             :   {
      34         152 :     _p(1) = _point_param[1];
      35             : 
      36         152 :     if (_point_param.size() > 2)
      37             :     {
      38         113 :       _p(2) = _point_param[2];
      39             :     }
      40             :   }
      41         152 : }
      42             : 
      43             : void
      44        5284 : ConstantPointSource::addPoints()
      45             : {
      46        5284 :   addPoint(_p);
      47        5284 : }
      48             : 
      49             : Real
      50       18099 : ConstantPointSource::computeQpResidual()
      51             : {
      52             :   //  This is negative because it's a forcing function that has been brought over to the left side
      53       18099 :   return -_test[_i][_qp] * _value;
      54             : }

Generated by: LCOV version 1.14