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

#include <XFEMSingleVariableConstraint.h>

Inheritance diagram for XFEMSingleVariableConstraint:
[legend]

Public Member Functions

 XFEMSingleVariableConstraint (const InputParameters &parameters)
 
virtual ~XFEMSingleVariableConstraint ()
 

Protected Member Functions

virtual void reinitConstraintQuadrature (const ElementPairInfo &element_pair_info) override
 
virtual Real computeQpResidual (Moose::DGResidualType type) override
 
virtual Real computeQpJacobian (Moose::DGJacobianType type) override
 

Protected Attributes

Point _interface_normal
 Vector normal to the internal interface. More...
 
Real _alpha
 Stabilization parameter in Nitsche's formulation. More...
 
Real _jump
 Vector normal to the internal interface. More...
 
Real _jump_flux
 Vector normal to the internal interface. More...
 
bool _use_penalty
 Use penalty formulation. More...
 
std::shared_ptr< XFEM_xfem
 Pointer to the XFEM controller object. More...
 

Detailed Description

Definition at line 25 of file XFEMSingleVariableConstraint.h.

Constructor & Destructor Documentation

◆ XFEMSingleVariableConstraint()

XFEMSingleVariableConstraint::XFEMSingleVariableConstraint ( const InputParameters &  parameters)

Definition at line 41 of file XFEMSingleVariableConstraint.C.

42  : ElemElemConstraint(parameters),
43  _alpha(getParam<Real>("alpha")),
44  _jump(getParam<Real>("jump")),
45  _jump_flux(getParam<Real>("jump_flux")),
46  _use_penalty(getParam<bool>("use_penalty"))
47 {
48  _xfem = std::dynamic_pointer_cast<XFEM>(_fe_problem.getXFEM());
49  if (_xfem == nullptr)
50  mooseError("Problem casting to XFEM in XFEMSingleVariableConstraint");
51 
52  const UserObject * uo =
53  &(_fe_problem.getUserObjectBase(getParam<UserObjectName>("geometric_cut_userobject")));
54 
55  if (dynamic_cast<const GeometricCutUserObject *>(uo) == nullptr)
56  mooseError("UserObject casting to GeometricCutUserObject in XFEMSingleVariableConstraint");
57 
58  _interface_id = _xfem->getGeometricCutID(dynamic_cast<const GeometricCutUserObject *>(uo));
59 }
std::shared_ptr< XFEM > _xfem
Pointer to the XFEM controller object.
Real _alpha
Stabilization parameter in Nitsche&#39;s formulation.
This is the XFEM class.
Definition: XFEM.h:62
bool _use_penalty
Use penalty formulation.
Real _jump
Vector normal to the internal interface.
Real _jump_flux
Vector normal to the internal interface.

◆ ~XFEMSingleVariableConstraint()

XFEMSingleVariableConstraint::~XFEMSingleVariableConstraint ( )
virtual

Definition at line 61 of file XFEMSingleVariableConstraint.C.

61 {}

Member Function Documentation

◆ computeQpJacobian()

Real XFEMSingleVariableConstraint::computeQpJacobian ( Moose::DGJacobianType  type)
overrideprotectedvirtual

Definition at line 107 of file XFEMSingleVariableConstraint.C.

108 {
109  Real r = 0;
110 
111  switch (type)
112  {
113  case Moose::ElementElement:
114  if (!_use_penalty)
115  r += -0.5 * _grad_phi[_j][_qp] * _interface_normal * _test[_i][_qp] -
116  _phi[_j][_qp] * 0.5 * _grad_test[_i][_qp] * _interface_normal;
117  r += _alpha * _phi[_j][_qp] * _test[_i][_qp];
118  break;
119 
120  case Moose::ElementNeighbor:
121  if (!_use_penalty)
122  r += -0.5 * _grad_phi_neighbor[_j][_qp] * _interface_normal * _test[_i][_qp] +
123  _phi_neighbor[_j][_qp] * 0.5 * _grad_test[_i][_qp] * _interface_normal;
124  r -= _alpha * _phi_neighbor[_j][_qp] * _test[_i][_qp];
125  break;
126 
127  case Moose::NeighborElement:
128  if (!_use_penalty)
129  r += 0.5 * _grad_phi[_j][_qp] * _interface_normal * _test_neighbor[_i][_qp] -
130  _phi[_j][_qp] * 0.5 * _grad_test_neighbor[_i][_qp] * _interface_normal;
131  r -= _alpha * _phi[_j][_qp] * _test_neighbor[_i][_qp];
132  break;
133 
134  case Moose::NeighborNeighbor:
135  if (!_use_penalty)
136  r += 0.5 * _grad_phi_neighbor[_j][_qp] * _interface_normal * _test_neighbor[_i][_qp] +
137  _phi_neighbor[_j][_qp] * 0.5 * _grad_test_neighbor[_i][_qp] * _interface_normal;
138  r += _alpha * _phi_neighbor[_j][_qp] * _test_neighbor[_i][_qp];
139  break;
140  }
141 
142  return r;
143 }
Real _alpha
Stabilization parameter in Nitsche&#39;s formulation.
bool _use_penalty
Use penalty formulation.
Point _interface_normal
Vector normal to the internal interface.

◆ computeQpResidual()

Real XFEMSingleVariableConstraint::computeQpResidual ( Moose::DGResidualType  type)
overrideprotectedvirtual

Definition at line 71 of file XFEMSingleVariableConstraint.C.

72 {
73  Real r = 0;
74 
75  switch (type)
76  {
77  case Moose::Element:
78  if (!_use_penalty)
79  {
80  r -= (0.5 * _grad_u[_qp] * _interface_normal +
81  0.5 * _grad_u_neighbor[_qp] * _interface_normal) *
82  _test[_i][_qp];
83  r -= (_u[_qp] - _u_neighbor[_qp]) * 0.5 * _grad_test[_i][_qp] * _interface_normal;
84  r += 0.5 * _grad_test[_i][_qp] * _interface_normal * _jump;
85  }
86  r += 0.5 * _test[_i][_qp] * _jump_flux;
87  r += _alpha * (_u[_qp] - _u_neighbor[_qp] - _jump) * _test[_i][_qp];
88  break;
89 
90  case Moose::Neighbor:
91  if (!_use_penalty)
92  {
93  r += (0.5 * _grad_u[_qp] * _interface_normal +
94  0.5 * _grad_u_neighbor[_qp] * _interface_normal) *
95  _test_neighbor[_i][_qp];
96  r -= (_u[_qp] - _u_neighbor[_qp]) * 0.5 * _grad_test_neighbor[_i][_qp] * _interface_normal;
97  r += 0.5 * _grad_test_neighbor[_i][_qp] * _interface_normal * _jump;
98  }
99  r += 0.5 * _test_neighbor[_i][_qp] * _jump_flux;
100  r -= _alpha * (_u[_qp] - _u_neighbor[_qp] - _jump) * _test_neighbor[_i][_qp];
101  break;
102  }
103  return r;
104 }
Real _alpha
Stabilization parameter in Nitsche&#39;s formulation.
bool _use_penalty
Use penalty formulation.
Real _jump
Vector normal to the internal interface.
Real _jump_flux
Vector normal to the internal interface.
Point _interface_normal
Vector normal to the internal interface.

◆ reinitConstraintQuadrature()

void XFEMSingleVariableConstraint::reinitConstraintQuadrature ( const ElementPairInfo &  element_pair_info)
overrideprotectedvirtual

Definition at line 64 of file XFEMSingleVariableConstraint.C.

65 {
66  _interface_normal = element_pair_info._elem1_normal;
67  ElemElemConstraint::reinitConstraintQuadrature(element_pair_info);
68 }
Point _interface_normal
Vector normal to the internal interface.

Member Data Documentation

◆ _alpha

Real XFEMSingleVariableConstraint::_alpha
protected

Stabilization parameter in Nitsche's formulation.

Definition at line 42 of file XFEMSingleVariableConstraint.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _interface_normal

Point XFEMSingleVariableConstraint::_interface_normal
protected

Vector normal to the internal interface.

Definition at line 39 of file XFEMSingleVariableConstraint.h.

Referenced by computeQpJacobian(), computeQpResidual(), and reinitConstraintQuadrature().

◆ _jump

Real XFEMSingleVariableConstraint::_jump
protected

Vector normal to the internal interface.

Definition at line 45 of file XFEMSingleVariableConstraint.h.

Referenced by computeQpResidual().

◆ _jump_flux

Real XFEMSingleVariableConstraint::_jump_flux
protected

Vector normal to the internal interface.

Definition at line 48 of file XFEMSingleVariableConstraint.h.

Referenced by computeQpResidual().

◆ _use_penalty

bool XFEMSingleVariableConstraint::_use_penalty
protected

Use penalty formulation.

Definition at line 51 of file XFEMSingleVariableConstraint.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _xfem

std::shared_ptr<XFEM> XFEMSingleVariableConstraint::_xfem
protected

Pointer to the XFEM controller object.

Definition at line 54 of file XFEMSingleVariableConstraint.h.

Referenced by XFEMSingleVariableConstraint().


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