https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CrackMeshCut3DUserObject.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
14
15#include <array>
16
17class Function;
18
26{
27public:
29
31
32 virtual void initialSetup() override;
33 virtual void initialize() override;
34
35 virtual const std::vector<Point>
36 getCrackFrontPoints(unsigned int num_crack_front_points) const override;
37 virtual const std::vector<RealVectorValue>
38 getCrackPlaneNormals(unsigned int num_crack_front_points) const override;
39
40 virtual bool cutElementByGeometry(const Elem * elem,
41 std::vector<Xfem::CutEdge> & cut_edges,
42 std::vector<Xfem::CutNode> & cut_nodes) const override;
43 virtual bool cutElementByGeometry(const Elem * elem,
44 std::vector<Xfem::CutFace> & cut_faces) const override;
45 virtual bool cutFragmentByGeometry(std::vector<std::vector<Point>> & frag_edges,
46 std::vector<Xfem::CutEdge> & cut_edges) const override;
47 virtual bool cutFragmentByGeometry(std::vector<std::vector<Point>> & frag_faces,
48 std::vector<Xfem::CutFace> & cut_faces) const override;
49
55
60 std::vector<int> getFrontPointsIndex() const;
61
67 virtual unsigned int getNumberOfCrackFrontPoints() const override;
68
69protected:
71 const unsigned int _cut_elem_nnode = 3;
72 const unsigned int _cut_elem_dim = 2;
73
76
79
85 std::vector<dof_id_type> _crack_front_points;
86
89 {
92 };
95
97 enum class GrowthRateEnum
98 {
101 };
104
106 const unsigned int _elem_dim = 3;
107
109 const Real _const_intersection = 0.01;
110
113
115 unsigned int _n_step_growth;
116
118 bool _stop;
119 bool _grow;
120
122 std::vector<dof_id_type> _boundary;
123
125 std::vector<std::vector<dof_id_type>> _active_boundary;
126
128 std::vector<unsigned int> _inactive_boundary_pos;
129
132 std::vector<dof_id_type> _tracked_crack_front_points;
133
135 bool _cfd;
136
138 std::set<Xfem::CutEdge> _boundary_edges;
139
141 std::map<dof_id_type, std::vector<dof_id_type>> _boundary_map;
142
144 std::vector<std::vector<Point>> _active_direction;
145
147 std::vector<std::vector<dof_id_type>> _front;
148
151
154
158 virtual bool intersectWithEdge(const Point & p1,
159 const Point & p2,
160 const std::vector<Point> & _vertices,
161 Point & point) const;
162
166 bool findIntersection(const Point & p1,
167 const Point & p2,
168 const std::vector<Point> & vertices,
169 Point & point) const;
170
174 bool isInsideEdge(const Point & p1, const Point & p2, const Point & p) const;
175
179 Real getRelativePosition(const Point & p1, const Point & p2, const Point & p) const;
180
184 bool isInsideCutPlane(const std::vector<Point> & _vertices, const Point & p) const;
185
192 void findBoundaryNodes();
193
197 void findBoundaryEdges();
198
202 void sortBoundaryNodes();
203
207 Real findDistance(dof_id_type node1, dof_id_type node2);
208
212 void refineBoundary();
213
218
222 void growFront();
223
227 void sortFrontNodes();
228
233
237 void refineFront();
238
242 void triangulation();
243
247 void joinBoundary();
248
253
261
263 const std::vector<Real> * const _ki_vpp;
265 const std::vector<Real> * const _kii_vpp;
267 const std::vector<Real> * const _growth_inc_reporter;
268};
const Real p
Class used in fracture integrals to define geometric characteristics of the crack front.
CrackMeshCut3DUserObject: (1) reads in a mesh describing the crack surface, (2) uses the mesh to do i...
std::vector< std::vector< Point > > _active_direction
Growth direction for active boundaries.
const std::vector< Real > *const _growth_inc_reporter
Pointer to reporter with growth increment if available.
void refineFront()
Refine the mesh at the front.
std::vector< dof_id_type > _crack_front_points
updated crack front definition they are in the same order as defined in the input but the number of n...
std::set< Xfem::CutEdge > _boundary_edges
Edges at the boundary.
void initializeCrackFrontNodes()
Determine initial crack front nodes from cutter mesh.
void joinBoundary()
Join active boundaries and inactive boundaries to be the new boundary.
GrowthDirectionEnum
Enum to for crack growth direction.
virtual const std::vector< RealVectorValue > getCrackPlaneNormals(unsigned int num_crack_front_points) const override
get a set of normal vectors along a crack front from a XFEM GeometricCutUserObject
void refineBoundary()
If boundary nodes are too sparse, add nodes in between.
bool _is_mesh_modified
Indicator that shows if the cutting mesh is modified or not in this calculation step.
MooseMesh & _mesh
The structural mesh.
unsigned int _n_step_growth
Number of steps to grow the mesh.
const Real _const_intersection
Used to define intersection points.
void findActiveBoundaryDirection()
Find growth direction at each active node.
Real findDistance(dof_id_type node1, dof_id_type node2)
Find distance between two nodes.
void triangulation()
Create tri3 elements between the new front and the old front.
bool findIntersection(const Point &p1, const Point &p2, const std::vector< Point > &vertices, Point &point) const
Find directional intersection along the positive extension of the vector from p1 to p2.
std::map< dof_id_type, std::vector< dof_id_type > > _boundary_map
A map of boundary nodes and their neighbors.
virtual bool cutFragmentByGeometry(std::vector< std::vector< Point > > &frag_edges, std::vector< Xfem::CutEdge > &cut_edges) const override
bool _stop
Variables to help control the work flow.
std::vector< std::vector< dof_id_type > > _front
New boundary after growth.
CrackFrontDefinition * _crack_front_definition
The crack front definition.
std::vector< int > getFrontPointsIndex() const
Get crack front points in the active segment -1 means inactive; positive is the point's index in the ...
virtual bool intersectWithEdge(const Point &p1, const Point &p2, const std::vector< Point > &_vertices, Point &point) const
Check if a line intersects with an element.
void findFrontIntersection()
Find front-structure intersections.
const GrowthDirectionEnum _growth_dir_method
The direction method for growing mesh at the front.
Real getRelativePosition(const Point &p1, const Point &p2, const Point &p) const
Get the relative position of p from p1.
GrowthRateEnum
Enum to for crack growth rate.
bool _cfd
is it using the crack_front_definition
const Function * _func_x
Parsed functions of front growth.
std::vector< unsigned int > _inactive_boundary_pos
Inactive boundary.
unsigned int _num_crack_front_points
Total number of crack front points in the mesh cutter.
void findActiveBoundaryNodes()
Find all active boundary nodes in the cutter mesh Find boundary nodes that will grow; nodes outside o...
void sortBoundaryNodes()
Sort boundary nodes to be in the right order along the boundary.
virtual unsigned int getNumberOfCrackFrontPoints() const override
Return the total number of crack front points.
bool isInsideEdge(const Point &p1, const Point &p2, const Point &p) const
Check if point p is inside the edge p1-p2.
const GrowthRateEnum _growth_increment_method
The growth increment method for growing mesh at the front.
const std::vector< Real > *const _kii_vpp
Pointer to fracture integral kii if available.
bool isInsideCutPlane(const std::vector< Point > &_vertices, const Point &p) const
Check if point p is inside a plane.
std::vector< dof_id_type > _boundary
Boundary nodes of the cutter mesh.
const std::vector< Real > *const _ki_vpp
Pointer to fracture integral ki if available.
Real _size_control
Used for cutter mesh refinement and front advancement.
virtual const std::vector< Point > getCrackFrontPoints(unsigned int num_crack_front_points) const override
get a set of points along a crack front from a XFEM GeometricCutUserObject
std::vector< dof_id_type > _tracked_crack_front_points
Front nodes that are grown from the crack front definition defined in the input therefore,...
void growFront()
Grow the cutter mesh.
const unsigned int _cut_elem_nnode
The cutter mesh has triangluar elements only.
const unsigned int _elem_dim
The structural mesh must be 3D only.
virtual void initialSetup() override
void findBoundaryEdges()
Find boundary edges of the cutter mesh.
std::vector< std::vector< dof_id_type > > _active_boundary
Active boundary nodes where growth is allowed.
static InputParameters validParams()
void sortFrontNodes()
Sort the front nodes.
virtual void initialize() override
void findBoundaryNodes()
Find boundary nodes of the cutter mesh This is a simple algorithm simply based on the added angle = 3...
virtual bool cutElementByGeometry(const Elem *elem, std::vector< Xfem::CutEdge > &cut_edges, std::vector< Xfem::CutNode > &cut_nodes) const override
Simple base class for XFEM cutting objects that use a mesh to cut.
const InputParameters & parameters() const