https://mooseframework.inl.gov
FunctorDiracKernel.C
Go to the documentation of this file.
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 
13 
16 {
18  params.addRequiredParam<MooseFunctorName>("functor", "Source functor");
19  params.addRequiredParam<Point>("point", "Source point");
20  params.addClassDescription("Computes a dirac source using a functor.");
21  return params;
22 }
23 
25  : ADDiracKernel(parameters), _functor(getFunctor<ADReal>("functor")), _p(getParam<Point>("point"))
26 {
27 }
28 
29 void
31 {
32  addPoint(_p);
33 }
34 
35 ADReal
37 {
38  mooseAssert(_current_point == _p, "Current point must be user-provided point");
40  return -_test[_i][_qp] * _functor(space_arg, Moose::currentState());
41 }
const QBase *const & _qrule
Quadrature rule.
AD version of DiracKernel.
Definition: ADDiracKernel.h:19
const Moose::Functor< ADReal > & _functor
Source functor.
const Point & _p
Source point.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:42
registerMooseObject("MooseApp", FunctorDiracKernel)
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...
FunctorDiracKernel(const InputParameters &parameters)
Computes a dirac source using a functor.
virtual void addPoints() override
This is where the DiracKernel should call addPoint() for each point it needs to have a value distribu...
void addPoint(const Elem *elem, Point p, unsigned id=libMesh::invalid_uint, Real value=1.0)
Add the physical x,y,z point located in the element "elem" to the list of points this DiracKernel wil...
virtual ADReal computeQpResidual() override
Computes the residual contribution at the current quadrature point.
Argument for requesting functor evaluation at a quadrature point location in an element.
const Elem *const & _current_elem
Current element.
static InputParameters validParams()
Definition: ADDiracKernel.C:21
const ADTemplateVariableTestValue< Real > & _test
Values of test functions at QPs.
Definition: ADDiracKernel.h:50
unsigned int _qp
Quadrature point index.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
unsigned int _i
i-th, j-th index for enumerating shape and test functions
static InputParameters validParams()
StateArg currentState()
Point _current_point
The current point.