https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
29void
34
37{
38 mooseAssert(_current_point == _p, "Current point must be user-provided point");
40 return -_test[_i][_qp] * _functor(space_arg, Moose::currentState());
41}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("MooseApp", FunctorDiracKernel)
AD version of DiracKernel.
static InputParameters validParams()
const ADTemplateVariableTestValue< Real > & _test
Values of test functions at QPs.
unsigned int _i
i-th, j-th index for enumerating shape and test functions
const Elem *const & _current_elem
Current element.
unsigned int _qp
Quadrature point index.
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...
const QBase *const & _qrule
Quadrature rule.
Point _current_point
The current point.
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...
virtual ADReal computeQpResidual() override
Computes the residual contribution at the current quadrature point.
FunctorDiracKernel(const InputParameters &parameters)
const Point & _p
Source point.
static InputParameters validParams()
const Moose::Functor< ADReal > & _functor
Source functor.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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...
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.
StateArg currentState()
Argument for requesting functor evaluation at a quadrature point location in an element.