15 #include "libmesh/string_to_enum.h" 24 params.
addParam<
Real>(
"time_start_cut", 0.0,
"Start time of geometric cut propagation");
25 params.
addParam<
Real>(
"time_end_cut", 0.0,
"End time of geometric cut propagation");
34 std::make_pair(getParam<Real>(
"time_start_cut"), getParam<Real>(
"time_end_cut")));
39 std::vector<Xfem::CutEdge> & cut_edges,
40 std::vector<Xfem::CutNode> & cut_nodes)
const 42 bool cut_elem =
false;
50 unsigned int n_sides = elem->n_sides();
52 for (
unsigned int i = 0; i < n_sides; ++i)
56 std::unique_ptr<const Elem> curr_side = elem->side_ptr(i);
57 if (curr_side->type() !=
EDGE2)
58 mooseError(
"In cutElementByGeometry element side must be EDGE2, but type is: ",
60 " base element type is: ",
63 const Node * node1 = curr_side->node_ptr(0);
64 const Node * node2 = curr_side->node_ptr(1);
65 Real seg_int_frac = 0.0;
74 mycut.
_id1 = node1->id();
75 mycut.
_id2 = node2->id();
78 cut_edges.push_back(mycut);
84 mycut.
_id = node1->id();
86 cut_nodes.push_back(mycut);
97 std::vector<Xfem::CutFace> & )
const 99 mooseError(
"Invalid method: must use vector of element edges for 2D mesh cutting");
105 std::vector<Xfem::CutEdge> & cut_edges)
const 107 bool cut_frag =
false;
115 unsigned int n_sides = frag_edges.size();
117 for (
unsigned int i = 0; i < n_sides; ++i)
119 Real seg_int_frac = 0.0;
130 mycut.
_id2 = (i < (n_sides - 1) ? (i + 1) : 0);
133 cut_edges.push_back(mycut);
143 std::vector<Xfem::CutFace> & )
const 145 mooseError(
"Invalid method: must use vector of element edges for 2D mesh cutting");
153 "cut_num is outside the bounds of _cut_time_ranges");
165 mooseError(
"time_start_cut and time_end_cut cannot have the same value");
virtual Real cutFraction(unsigned int cut_num) const
Find the fractional distance along a specified cut line for the current time that is currently active...
Data structure defining a cut through a node.
std::vector< std::pair< Point, Point > > _cut_line_endpoints
static InputParameters validParams()
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
static InputParameters validParams()
unsigned int _host_id
Local ID of this node in the host element.
GeometricCut2DUserObject(const InputParameters ¶meters)
virtual bool cutElementByGeometry(const Elem *elem, std::vector< Xfem::CutEdge > &cut_edges, std::vector< Xfem::CutNode > &cut_nodes) const override
Data structure defining a cut on an element edge.
unsigned int _id1
ID of the first node on the edge.
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...
std::string enum_to_string(const T e)
Real _distance
Fractional distance along the edge (from node 1 to 2) where the cut is located.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned int _id2
ID of the second node on the edge.
void mooseError(Args &&... args) const
unsigned int _host_side_id
Local ID of this side in the host element.
std::vector< std::pair< Real, Real > > _cut_time_ranges
Vector of start/end times for each cut segment.
virtual bool cutFragmentByGeometry(std::vector< std::vector< Point >> &frag_edges, std::vector< Xfem::CutEdge > &cut_edges) const override
unsigned int _id
ID of the cut node.