www.mooseframework.org
FunctionDiracSource.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "FunctionDiracSource.h"
16 #include "Function.h"
17 
18 template <>
21 {
23  params.addRequiredParam<FunctionName>(
24  "function", "The function to use for controlling the specified dirac source.");
25  params.addRequiredParam<Point>("point", "The x,y,z coordinates of the point");
26  return params;
27 }
28 
30  : DiracKernel(parameters), _function(getFunction("function")), _p(getParam<Point>("point"))
31 {
32 }
33 
34 void
36 {
37  addPoint(_p);
38 }
39 
40 Real
42 {
43  return -_test[_i][_qp] * _function.value(_t, _p);
44 }
virtual Real value(Real t, const Point &p)
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
Definition: Function.C:43
unsigned int _qp
Quadrature point index.
Definition: DiracKernel.h:188
void addPoint(const Elem *elem, Point p, unsigned id=libMesh::invalid_uint)
Add the physical x,y,z point located in the element "elem" to the list of points this DiracKernel wil...
Definition: DiracKernel.C:188
InputParameters validParams< FunctionDiracSource >()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void addPoints() override
This is where the DiracKernel should call addPoint() for each point it needs to have a value distribu...
FunctionDiracSource(const InputParameters &parameters)
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...
InputParameters validParams< DiracKernel >()
Definition: DiracKernel.C:26
const VariableTestValue & _test
Values of test functions at QPs.
Definition: DiracKernel.h:211
unsigned int _i
i-th, j-th index for enumerating shape and test functions
Definition: DiracKernel.h:199
virtual Real computeQpResidual() override
This is the virtual that derived classes should override for computing the residual.
A DiracKernel is used when you need to add contributions to the residual by means of multiplying some...
Definition: DiracKernel.h:50