www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
XFEMPressure Class Reference

#include <XFEMPressure.h>

Inheritance diagram for XFEMPressure:
[legend]

Public Member Functions

 XFEMPressure (const InputParameters &parameters)
 
virtual void addPoints ()
 
virtual Real computeQpResidual ()
 

Protected Attributes

const int _component
 
const Real _factor
 
Function *const _function
 
std::map< unsigned int, std::shared_ptr< ElementPairLocator > > * _element_pair_locators
 
std::map< const Elem *, std::map< unsigned int, Point > > _elem_qp_normal
 
std::map< const Elem *, std::map< unsigned int, Real > > _elem_qp_JxW
 

Detailed Description

Definition at line 18 of file XFEMPressure.h.

Constructor & Destructor Documentation

◆ XFEMPressure()

XFEMPressure::XFEMPressure ( const InputParameters &  parameters)

Definition at line 29 of file XFEMPressure.C.

30  : DiracKernel(parameters),
31  _component(getParam<unsigned int>("component")),
32  _factor(getParam<Real>("factor")),
33  _function(isParamValid("function") ? &getFunction("function") : NULL)
34 {
35  GeometricSearchData & geo_search_data = _subproblem.geomSearchData();
36  _element_pair_locators = &geo_search_data._element_pair_locators;
37 }
const int _component
Definition: XFEMPressure.h:27
std::map< unsigned int, std::shared_ptr< ElementPairLocator > > * _element_pair_locators
Definition: XFEMPressure.h:31
const Real _factor
Definition: XFEMPressure.h:28
Function *const _function
Definition: XFEMPressure.h:29

Member Function Documentation

◆ addPoints()

void XFEMPressure::addPoints ( )
virtual

Definition at line 40 of file XFEMPressure.C.

41 {
42  _elem_qp_normal.clear();
43  _elem_qp_JxW.clear();
44 
45  for (std::map<unsigned int, std::shared_ptr<ElementPairLocator>>::iterator it_epl =
46  _element_pair_locators->begin();
47  it_epl != _element_pair_locators->end();
48  ++it_epl)
49  {
50  ElementPairLocator & elem_pair_loc = *it_epl->second;
51  // go over pair elements
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 =
55  elem_pairs.begin();
56  it_ep != elem_pairs.end();
57  ++it_ep)
58  {
59  const Elem * elem1 = it_ep->first;
60  const Elem * elem2 = it_ep->second;
61  const ElementPairInfo & info = elem_pair_loc.getElemPairInfo(*it_ep);
62 
63  for (unsigned int i = 0; i < info._elem1_constraint_q_point.size(); ++i)
64  {
65  _elem_qp_normal[elem1][i] = -info._elem1_normal;
66  _elem_qp_normal[elem2][i] = -info._elem2_normal;
67  _elem_qp_JxW[elem1][i] = info._elem1_constraint_JxW[i];
68  _elem_qp_JxW[elem2][i] = info._elem2_constraint_JxW[i];
69  addPoint(elem1, info._elem1_constraint_q_point[i]);
70  addPoint(elem2, info._elem2_constraint_q_point[i]);
71  }
72  }
73  }
74 }
std::map< const Elem *, std::map< unsigned int, Point > > _elem_qp_normal
Definition: XFEMPressure.h:32
std::map< const Elem *, std::map< unsigned int, Real > > _elem_qp_JxW
Definition: XFEMPressure.h:33
std::map< unsigned int, std::shared_ptr< ElementPairLocator > > * _element_pair_locators
Definition: XFEMPressure.h:31

◆ computeQpResidual()

Real XFEMPressure::computeQpResidual ( )
virtual

Definition at line 77 of file XFEMPressure.C.

78 {
79  Real factor = _factor;
80 
81  if (_function)
82  factor *= _function->value(_t, _current_point);
83 
84  Point normal = _elem_qp_normal[_current_elem][_qp];
85  Real JxW = _elem_qp_JxW[_current_elem][_qp];
86 
87  return -factor * JxW * (normal(_component) * _test[_i][_qp]);
88 }
std::map< const Elem *, std::map< unsigned int, Point > > _elem_qp_normal
Definition: XFEMPressure.h:32
const int _component
Definition: XFEMPressure.h:27
std::map< const Elem *, std::map< unsigned int, Real > > _elem_qp_JxW
Definition: XFEMPressure.h:33
const Real _factor
Definition: XFEMPressure.h:28
Function *const _function
Definition: XFEMPressure.h:29

Member Data Documentation

◆ _component

const int XFEMPressure::_component
protected

Definition at line 27 of file XFEMPressure.h.

Referenced by computeQpResidual().

◆ _elem_qp_JxW

std::map<const Elem *, std::map<unsigned int, Real> > XFEMPressure::_elem_qp_JxW
protected

Definition at line 33 of file XFEMPressure.h.

Referenced by addPoints(), and computeQpResidual().

◆ _elem_qp_normal

std::map<const Elem *, std::map<unsigned int, Point> > XFEMPressure::_elem_qp_normal
protected

Definition at line 32 of file XFEMPressure.h.

Referenced by addPoints(), and computeQpResidual().

◆ _element_pair_locators

std::map<unsigned int, std::shared_ptr<ElementPairLocator> >* XFEMPressure::_element_pair_locators
protected

Definition at line 31 of file XFEMPressure.h.

Referenced by addPoints(), and XFEMPressure().

◆ _factor

const Real XFEMPressure::_factor
protected

Definition at line 28 of file XFEMPressure.h.

Referenced by computeQpResidual().

◆ _function

Function* const XFEMPressure::_function
protected

Definition at line 29 of file XFEMPressure.h.

Referenced by computeQpResidual().


The documentation for this class was generated from the following files: