https://mooseframework.inl.gov
VectorConstantPointSource.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 
11 
13 
16 {
18  params.addClassDescription("Residual contribution of a constant point source term.");
19  params.addRequiredParam<RealVectorValue>("values", "The value of the point source");
20  params.addRequiredParam<std::vector<Real>>("point", "The x,y,z coordinates of the point");
21  params.declareControllable("values");
22  return params;
23 }
24 
26  : VectorDiracKernel(parameters),
27  _values(getParam<RealVectorValue>("values")),
28  _point_param(getParam<std::vector<Real>>("point"))
29 {
30  _p(0) = _point_param[0];
31  if (_point_param.size() > 1)
32  {
33  _p(1) = _point_param[1];
34  if (_point_param.size() > 2)
35  _p(2) = _point_param[2];
36  }
37 }
38 
39 void
41 {
42  addPoint(_p);
43 }
44 
45 Real
47 {
48  // This is negative because it's a forcing function that has been brought over to the left side
49  return -_test[_i][_qp] * _values;
50 }
const RealVectorValue & _values
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...
const OutputTools< T >::VariableTestValue & _test
Values of test functions at QPs.
Definition: DiracKernel.h:91
VectorConstantPointSource(const InputParameters &parameters)
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...
virtual Real computeQpResidual() override
This is the virtual that derived classes should override for computing the residual.
static InputParameters validParams()
A VectorConstantPointSource DiracKernel is used to add a constant source term at a point...
A DiracKernel is used when you need to add contributions to the residual by means of multiplying some...
Definition: DiracKernel.h:19
registerMooseObject("MooseApp", VectorConstantPointSource)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned int _qp
Quadrature point index.
virtual void addPoints() override
This is where the DiracKernel should call addPoint() for each point it needs to have a value distribu...
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
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
static InputParameters validParams()
Definition: DiracKernel.C:24