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

#include <XFEMElementPairLocator.h>

Inheritance diagram for XFEMElementPairLocator:
[legend]

Public Member Functions

 XFEMElementPairLocator (std::shared_ptr< XFEM > xfem, unsigned int interface_id, bool use_displaced_mesh=false)
 
virtual void reinit ()
 
virtual void update ()
 

Protected Attributes

std::shared_ptr< XFEM_xfem
 
bool _use_displaced_mesh
 

Detailed Description

Definition at line 16 of file XFEMElementPairLocator.h.

Constructor & Destructor Documentation

◆ XFEMElementPairLocator()

XFEMElementPairLocator::XFEMElementPairLocator ( std::shared_ptr< XFEM xfem,
unsigned int  interface_id,
bool  use_displaced_mesh = false 
)

Definition at line 12 of file XFEMElementPairLocator.C.

15  : ElementPairLocator(interface_id), _xfem(xfem), _use_displaced_mesh(use_displaced_mesh)
16 {
18  _elem_pairs = _xfem->getXFEMDisplacedCutElemPairs(interface_id);
19  else
20  _elem_pairs = _xfem->getXFEMCutElemPairs(interface_id);
21 }
std::shared_ptr< XFEM > _xfem

Member Function Documentation

◆ reinit()

void XFEMElementPairLocator::reinit ( )
virtual

Definition at line 24 of file XFEMElementPairLocator.C.

Referenced by update().

25 {
26  // Does not support secondary cut yet.
27  if (_xfem->has_secondary_cut())
28  return;
29 
30  _element_pair_info.clear();
31 
32  for (std::list<std::pair<const Elem *, const Elem *>>::const_iterator it = _elem_pairs->begin();
33  it != _elem_pairs->end();
34  ++it)
35  {
36  const Elem * elem1 = it->first;
37  const Elem * elem2 = it->second;
38 
39  std::vector<Point> intersectionPoints1;
40  Point normal1;
41  std::vector<Point> q_points1;
42  std::vector<Real> weights1;
43 
44  unsigned int plane_id = 0; // Only support one cut plane for the time being
45 
46  _xfem->getXFEMIntersectionInfo(
47  elem1, plane_id, normal1, intersectionPoints1, _use_displaced_mesh);
48 
49  if (intersectionPoints1.size() == 2)
50  _xfem->getXFEMqRuleOnLine(intersectionPoints1, q_points1, weights1);
51  else if (intersectionPoints1.size() > 2)
52  _xfem->getXFEMqRuleOnSurface(intersectionPoints1, q_points1, weights1);
53 
55  {
56  ElementPairInfo new_elem_info(
57  elem1, elem2, q_points1, q_points1, weights1, weights1, normal1, -normal1);
58  _element_pair_info.insert(
59  std::pair<std::pair<const Elem *, const Elem *>, ElementPairInfo>(*it, new_elem_info));
60  }
61  else
62  {
63  std::vector<Point> intersectionPoints2;
64  Point normal2;
65  std::vector<Point> q_points2;
66  std::vector<Real> weights2;
67 
68  _xfem->getXFEMIntersectionInfo(
69  elem2, plane_id, normal2, intersectionPoints2, _use_displaced_mesh);
70 
71  // reverse the order of intersectionPoints2
72  std::reverse(std::begin(intersectionPoints2), std::end(intersectionPoints2));
73 
74  if (intersectionPoints2.size() == 2)
75  _xfem->getXFEMqRuleOnLine(intersectionPoints2, q_points2, weights2);
76  else if (intersectionPoints2.size() > 2)
77  _xfem->getXFEMqRuleOnSurface(intersectionPoints2, q_points2, weights2);
78 
79  ElementPairInfo new_elem_info(
80  elem1, elem2, q_points1, q_points2, weights1, weights2, normal1, normal2);
81  _element_pair_info.insert(
82  std::pair<std::pair<const Elem *, const Elem *>, ElementPairInfo>(*it, new_elem_info));
83  }
84  }
85 }
std::shared_ptr< XFEM > _xfem

◆ update()

void XFEMElementPairLocator::update ( )
virtual

Definition at line 88 of file XFEMElementPairLocator.C.

89 {
90  reinit();
91 }

Member Data Documentation

◆ _use_displaced_mesh

bool XFEMElementPairLocator::_use_displaced_mesh
protected

Definition at line 27 of file XFEMElementPairLocator.h.

Referenced by reinit(), and XFEMElementPairLocator().

◆ _xfem

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

Definition at line 26 of file XFEMElementPairLocator.h.

Referenced by reinit(), and XFEMElementPairLocator().


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