https://mooseframework.inl.gov
Public Member Functions | Protected Attributes | Private Attributes | List of all members
XFEMCrackGrowthIncrement2DCut Class Reference

#include <XFEMCrackGrowthIncrement2DCut.h>

Public Member Functions

 XFEMCrackGrowthIncrement2DCut (Real x0, Real y0, Real x1, Real y1, Real t0, Real t1)
 
virtual bool cutElementByCrackGrowthIncrement (const Elem *elem, std::vector< CutEdgeForCrackGrowthIncr > &cut_edges, Real time)
 
Real cutCompletionFraction (Real time)
 

Protected Attributes

const std::pair< Real, Real_time_range
 

Private Attributes

const std::pair< Point, Point_cut_line_endpoints
 

Detailed Description

Definition at line 26 of file XFEMCrackGrowthIncrement2DCut.h.

Constructor & Destructor Documentation

◆ XFEMCrackGrowthIncrement2DCut()

XFEMCrackGrowthIncrement2DCut::XFEMCrackGrowthIncrement2DCut ( Real  x0,
Real  y0,
Real  x1,
Real  y1,
Real  t0,
Real  t1 
)

Definition at line 16 of file XFEMCrackGrowthIncrement2DCut.C.

18  : _time_range(std::make_pair(t0, t1)),
19  _cut_line_endpoints(std::make_pair(Point(x0, y0, 0.0), Point(x1, y1, 0.0)))
20 {
21 }
const std::pair< Point, Point > _cut_line_endpoints
const std::pair< Real, Real > _time_range

Member Function Documentation

◆ cutCompletionFraction()

Real XFEMCrackGrowthIncrement2DCut::cutCompletionFraction ( Real  time)

Definition at line 24 of file XFEMCrackGrowthIncrement2DCut.C.

Referenced by cutElementByCrackGrowthIncrement().

25 {
26  Real fraction = 0.0;
27  if (time >= _time_range.first)
28  {
29  if (time >= _time_range.second)
30  fraction = 1.0;
31  else
32  fraction = (time - _time_range.first) / (_time_range.second - _time_range.first);
33  }
34  return fraction;
35 }
const std::pair< Real, Real > _time_range
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ cutElementByCrackGrowthIncrement()

bool XFEMCrackGrowthIncrement2DCut::cutElementByCrackGrowthIncrement ( const Elem *  elem,
std::vector< CutEdgeForCrackGrowthIncr > &  cut_edges,
Real  time 
)
virtual

Definition at line 38 of file XFEMCrackGrowthIncrement2DCut.C.

Referenced by XFEM::markCutEdgesByState().

40 {
41  bool cut_elem = false;
42 
43  Real fraction = cutCompletionFraction(time);
44 
45  if (fraction > 0.0)
46  {
47  unsigned int n_sides = elem->n_sides();
48 
49  for (unsigned int i = 0; i < n_sides; ++i)
50  {
51  // This returns the lowest-order type of side, which should always
52  // be an EDGE2 here because this class is for 2D only.
53  std::unique_ptr<const Elem> curr_side = elem->side_ptr(i);
54  if (curr_side->type() != EDGE2)
55  mooseError("In cutElementByGeometry element side must be EDGE2, but type is: ",
56  libMesh::Utility::enum_to_string(curr_side->type()),
57  " base element type is: ",
58  libMesh::Utility::enum_to_string(elem->type()));
59 
60  const Node * node1 = curr_side->node_ptr(0);
61  const Node * node2 = curr_side->node_ptr(1);
62  Real seg_int_frac = 0.0;
63 
65  *node1, *node2, _cut_line_endpoints, fraction, seg_int_frac))
66  {
67  cut_elem = true;
69  mycut._id1 = node1->id();
70  mycut._id2 = node2->id();
71  mycut._distance = seg_int_frac;
72  mycut._host_side_id = i;
73  cut_edges.push_back(mycut);
74  }
75  }
76  }
77  return cut_elem;
78 }
const std::pair< Point, Point > _cut_line_endpoints
void mooseError(Args &&... args)
bool intersectSegmentWithCutLine(const Point &segment_point1, const Point &segment_point2, const std::pair< Point, Point > &cutting_line_points, const Real &cutting_line_fraction, Real &segment_intersection_fraction)
Determine whether a line segment is intersected by a cutting line, and compute the fraction along tha...
Definition: XFEMFuncs.C:774
std::string enum_to_string(const T e)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
EDGE2

Member Data Documentation

◆ _cut_line_endpoints

const std::pair<Point, Point> XFEMCrackGrowthIncrement2DCut::_cut_line_endpoints
private

Definition at line 41 of file XFEMCrackGrowthIncrement2DCut.h.

Referenced by cutElementByCrackGrowthIncrement().

◆ _time_range

const std::pair<Real, Real> XFEMCrackGrowthIncrement2DCut::_time_range
protected

Definition at line 38 of file XFEMCrackGrowthIncrement2DCut.h.

Referenced by cutCompletionFraction().


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