12 #include "GeometricSearchData.h"
13 #include "ElementPairLocator.h"
14 #include "FEProblem.h"
22 InputParameters params = validParams<DiracKernel>();
23 params.addRequiredParam<
unsigned int>(
"component",
"The component for the pressure");
24 params.addParam<Real>(
"factor", 1.0,
"The magnitude to use in computing the pressure");
25 params.addParam<FunctionName>(
"function",
"The function that describes the pressure");
30 : DiracKernel(parameters),
31 _component(getParam<unsigned int>(
"component")),
32 _factor(getParam<Real>(
"factor")),
33 _function(isParamValid(
"function") ? &getFunction(
"function") : NULL)
35 GeometricSearchData & geo_search_data = _subproblem.geomSearchData();
45 for (std::map<
unsigned int, std::shared_ptr<ElementPairLocator>>::iterator it_epl =
50 ElementPairLocator & elem_pair_loc = *it_epl->second;
52 const std::list<std::pair<const Elem *, const Elem *>> & elem_pairs =
53 elem_pair_loc.getElemPairs();
54 for (std::list<std::pair<const Elem *, const Elem *>>::const_iterator it_ep =
56 it_ep != elem_pairs.end();
59 const Elem * elem1 = it_ep->first;
60 const Elem * elem2 = it_ep->second;
61 const ElementPairInfo & info = elem_pair_loc.getElemPairInfo(*it_ep);
63 for (
unsigned int i = 0; i < info._elem1_constraint_q_point.size(); ++i)
69 addPoint(elem1, info._elem1_constraint_q_point[i]);
70 addPoint(elem2, info._elem2_constraint_q_point[i]);
82 factor *=
_function->value(_t, _current_point);
87 return -factor * JxW * (normal(
_component) * _test[_i][_qp]);